Skip to content

feat(release): extension release --changed with the date version - #456

Merged
vreshch merged 4 commits into
masterfrom
feature/release-changed
Nov 22, 2026
Merged

vreshch merged 4 commits into
masterfrom
feature/release-changed

Conversation

@vreshch

@vreshch vreshch commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Problem

Stage 3 row R4: a merge to master is the release for a repo with one or more extensions. Today extension release only takes a v* tag equal to package.json.

Change

  • New mode agentage extension release --changed (and --dry-run, which needs --changed).
  • Folders: each extensions/<name> with an agentage package, else the root package.
  • Changed: a file in the folder differs from the last <id>@* tag (highest by number, not the push range, so a run the release concurrency group dropped is caught up), or no tag yet, or the last tag has no agentage-extension.json record (a release that failed after its tag). Last tag on this commit (a re-run): that version is resumed.
  • Date version YYYY.MDD.N (UTC; month x 100 + day; N = highest N of that id that day + 1).
  • CI copy only: version and repository (the releasing repo, read by the org.opencontainers.image.source label and npm provenance) in package.json and package-lock.json, plus the contracts check --write writes (openapi info.version, mcpc serverInfo.version, which check compares). Never committed; the build allows only these files to differ.
  • Tag <id>@<version> created on the commit before the build (a tag on another commit is refused), so a failed build uses up its N. Same guard, images, records and npm as v*; the release gets --target <commit>.
  • The shared steps moved from release.ts to release-steps.ts without change; release.test.ts is not edited.
  • Docs: docs/reference.md.

Review round 1

  • History (HIGH): an extension is refused (FAIL history:) when the commit of its last <id>@* tag is not an ancestor of the commit being released (git rev-list --count <sha>..<tagCommit> is not 0; rev-list instead of merge-base --is-ancestor because its exit 1 cannot be told from a git error). A shallow checkout is deepened with --unshallow first, so a depth-1 checkout still works.
  • Tip check: not added. The ancestor check alone keeps the versions of each id in history order: a newer tag on a later commit blocks every older run. A required tip check would only add red runs when two merges land close together, and the next run catches those up anyway (the concurrency rule).
  • Stuck builds (MEDIUM): when the newest 3 tags of an id have no record, that id is refused (FAIL stuck:, naming the tags) until a release of the last tag succeeds or a human removes them. Only where a new N would be made; a resume makes no tag.
  • npm order (MEDIUM): npm is published before the records are attached, so a record means npm has the version. Chosen over "the plan finishes npm" because it adds no npm call to every plan and cannot publish twice (publish still reads "already on npm"). Cost: after an npm failure, a re-run of that commit is refused by the unchanged guard (images pushed, no record); the next commit takes a new N, and the limit of 3 counts it.
  • One failure (MEDIUM): every changed extension is tried; a failed folder no longer counts as dirty for the next build. One table (id, version, result) and exit 1 when any failed or was refused; the error names each <id>: FAIL ... and keeps the first code. A dry run with a refused id also exits 1.
  • Docs (LOW): the help and docs/reference.md: each extension keeps its own package-lock.json; shared root files do not trigger a release.
  • Tests: release-changed-safety.test.ts (real git: a full checkout of an older commit, depth-1 clones). Each test was seen red with its fix removed; removing --unshallow turns 12 tests red. release.test.ts and release-guard.ts are unchanged.

How verified

  • npm run verify and npm run test:coverage green locally.
  • Unit tests: the version maker (January, a day below 10, December, the UTC day, the second release, N=10), the last-tag order, the folder finder, the CI copy.
  • Scratch repos with real git (a bare origin and a depth-1 clone with no tags; gh, docker and npm stubbed): two extensions where only one changed (dry run: clean git status, no new tag on origin, no create, push or publish call), a real run of the same, no tag yet, the root layout, the second release of a day, a tag with no record, a resume, a moved tag, a dirty tree, the template id, an api part (contracts and the one image).
  • Real kit: a clone of extension-probe (api, mcp), built, then writeCiCopy + the kit's writeContracts + check: conforms; git status shows only the four written files.
  • Nothing changed (exit 0, nothing released) and a dropped run caught up by a later README-only commit.
  • The old v* form: all of release.test.ts unchanged and green.

What the reviewer must check

  • The tag is created before the build (with the "no record means changed" rule). Is that the wanted order?
  • X1 needs: fetch-depth any (the command fetches tags), contents: write, packages: write, id-token: write, an npm ci that installs each extension, a package-lock.json in each extensions/<id> (the kit image build needs it), and a build of each extension before the command (writeContracts needs dist/).
  • GHCR packages fixture, market, cloud and platform are linked to their old repos: a release from the host repo is refused by the ownership guard until the owner relinks them (renamed repos keep the link).

https://claude.ai/code/session_01XQkodgygL4W8UcLQDwC212

Each extension of a repo (the root or extensions/*) changed since its
last <id>@* tag gets YYYY.MDD.N, its tag on the commit, images, the
record on a release made with --target, and npm. The v* mode stays.

Claude-Session: https://claude.ai/code/session_01XQkodgygL4W8UcLQDwC212
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 8b0d46731e13bef23b764bc9e3f15277d61996e2
Branch: feature/release-changed

Checks:

  • ✅ Release guard (no version change)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge! ✨


🔗 View workflow run
⏰ Generated at: 2026-11-22T04:53:20.620Z

@vreshch
vreshch marked this pull request as ready for review November 22, 2026 04:42
@vreshch
vreshch merged commit c19b3a9 into master Nov 22, 2026
8 checks passed
@vreshch
vreshch deleted the feature/release-changed branch November 22, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant