Repository navigation
Fail the push check when the extension API changes without a version bump - #3620
Conversation
Pragmatic Code Review: PR #3620 (+ nodespace-docs#105)Review Type: Initial Review Requirements Check (#3414, "Versioning (ADR-082 §8)" only)
What I verified:
Code Review Findings🟡 1.
|
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Address review, round 1 (commit 89ab3ae)Addressed (3 of 4):
Skipped (1 of 4):
Verification:
Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: The 🟡 fix adds a new code path to the release-notes flow, and the 🟢 2 fix changes the signature of 🤖 Generated with Claude Code |
Pragmatic Code Review: PR #3620, re-review of
|
| # | Finding | Status | Notes |
|---|---|---|---|
| 🟡 1 | --notes / --notes-file releases had no "Extension API" section |
✅ Addressed | See below. |
| 🟢 2 | A re-run release compared against its own tag | ✅ Addressed | See below. |
| 🟢 3 | The frontend fixture extension isn't watched | ✅ Reasonably skipped | See below. |
| 🟢 4 | git's stderr was dropped from the fail-closed message | ✅ Addressed | See below. |
🟡 1. --notes / --notes-file releases (scripts/release.ts:194-202, 251-253)
buildReleaseCreateArgs now routes operator notes through withExtensionApiSection, and --generate-notes stays off on that path.
- I checked the heading regex against v0.3.3's real hand-written notes. They use
## Extension API, which matches, so a release cut the way v0.3.3 was would not get a second section. - I probed edge inputs through
buildReleaseCreateArgs:- CRLF line endings and
####headings are detected. ## Extension API changes, an indented heading, a closing-##heading and bold**Extension API**prose don't match, so they get the derived section appended.- Only a heading inside a fenced code block is a false match. That is too unlikely to matter.
- CRLF line endings and
- When detection is unsure it appends, so the section is still present. That's the right default.
🟢 2. Re-run release (scripts/release.ts:217-220, 550-552)
--exclude <releaseTag> is added to git describe, and the caller normalises the tag to its v prefix the same way buildReleaseCreateArgs does.
validateVersion(/^v?\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/) rules out glob metacharacters, so the exclude pattern can only match that one tag.- I probed annotated tags in a throwaway repo:
- excluding the tag on HEAD returns the previous tag;
- excluding a tag that doesn't exist changes nothing.
- The new test kills the "drop
--exclude" mutant: without the flag,previouswould be v0.2.0 andchangeswould be empty.
🟢 3. Frontend fixture (scripts/check-extension-api-version.ts:50-55)
Skipping this is reasonable.
- ADR-082 §8 names exactly the declarations snapshot and the Rust fixtures.
- The new comment explains the omission.
- Leaving slot semantics and hook timing to review is backed by the versioning policy in
src/lib/extension-api/index.ts, which the surface test points to.
🟢 4. git's stderr (scripts/check-extension-api-version.ts:160-179, 212-215)
runGit/git() now carry git's stderr into the thrown error. A missing origin/main now reads "git merge-base origin/main HEAD: fatal: Not a valid object name origin/main", and the test asserts fatal: is present.
- When
merge-baseexits 1 with empty stderr (unrelated histories), the message falls back tofailed. gitOrNullkeeps its null-on-failure behaviour for theshow <rev>:<path>reads.- The new message wording ("If origin/main is missing or stale…") is more accurate than the old unconditional "Run
git fetch origin".
New findings
None. The commit is small, the doc comments match the behaviour, and it follows the project rules:
- no issue numbers or Pro/sync wording in code comments;
- the scripts tests stay DOM-free
bun:test.
What I verified
bun test scripts/check-extension-api-version.test.ts scripts/release.test.ts: 47 pass, 0 fail. That's the 45 from before plus the 2 new tests.bun run scripts/check-extension-api-version.tson89ab3ae3passes.readExtensionApiReleasehas only the call site atrelease.ts:552, plus the updated tests. Nothing else calls the old signature.- Docs PR Add mentions relation management and backlink queries #105 (
development/testing-guide.md) doesn't describe release-notes behaviour, so this commit leaves it unaffected. - The PR head is
89ab3ae3and GitHub reports it MERGEABLE.
Recommendation
APPROVE.
- The 🟡 is fixed correctly and tested both ways: section appended, and existing heading left alone.
- The two 🟢 fixes are correct and covered by tests that kill their mutants.
- The skipped 🟢 is justified by the ADR's wording.
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Address review, round 2 (re-review of 89ab3ae)The re-review returned APPROVE with no new findings.
Nothing to change in this round. One edge case is noted but not acted on: an Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: No code changed in this round. The PR is ready for merge, which is the user's decision. Docs PR NodeSpaceAI/nodespace-docs#105 lands with it. 🤖 Generated with Claude Code |
89ab3ae to
62a1358
Compare
|
Rebased onto main after #3619, which bumped After the rebase:
Release-notes section on today's history: 🤖 Generated with Claude Code |
…bump scripts/check-extension-api-version.ts compares HEAD with its merge-base with origin/main and fails when a file in WATCHED_PATHS changed and EXTENSION_API_VERSION did not (ADR-082 section 8). WATCHED_PATHS is the host API's surface snapshot, the Rust extension-point fixtures and the skill-extension fixture directory. The check also fails when the Rust and TypeScript constants disagree, when the version goes backwards, and when a watched entry matches no file. It reads git alone and runs in the push check and the merge gate's lint section. bun run release writes an "Extension API" section into the generated release notes: the current version, the previous release's, and the subjects of the commits between them that changed it. Part of #3414 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… release's own tag - buildReleaseCreateArgs appends the section to operator-supplied notes unless they already have an "Extension API" heading, so a release cut with --notes/--notes-file carries it too. - readExtensionApiRelease takes the release's tag and excludes it from `git describe`, so a re-run release that finds its own tag on HEAD compares with the release before it. - The check's git failures carry git's own message, which tells a missing origin/main from a broken ref. - WATCHED_PATHS says why the frontend fixture extension is not watched: ADR-082 section 8 enforces the TypeScript surface through the declarations snapshot only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
62a1358 to
f0025de
Compare
Part of #3414 (the Versioning (ADR-082 §8) acceptance items only).
Summary
The push check now fails when the extension API's recorded surface changes without an
EXTENSION_API_VERSIONbump.bun run releasenow writes an "Extension API" section into the release notes.Already enforced on
mainbefore this PRextension-api-version-agreement.test.ts, a Vitest test in the frontend tier.extension-api-surface.test.ts, a Vitest test in the frontend tier. It refuses a re-record without a bump.fixture_tests.rspins the exact version (extension_api_version_is_two_one), so a bump touches it.test:changedand in the merge gate. Nothing ran at push. Nothing failed when a Rust extension fixture or the skill-extension fixture changed without a bump. The release notes had no "Extension API" heading.Added
scripts/check-extension-api-version.tsmerge-base(origin/main, HEAD)..HEADwith--no-renames, and reads both constants withgit show. It uses git only: no build, no tests, under a second.WATCHED_PATHSfile changed and the version did not.WATCHED_PATHSis the one list of watched files:extension-api-surface.json;app-lib/src/extensions/fixture_tests.rs;app-lib/tests/it/extension_hooks_test.rs;app-lib/tests/it/extension_daemon_profile_test.rs;scripts/fixtures/skill-extension/, as asked for the skill-extension fixture.git fetch origin.scripts/test-gate.ts: runs the check in the lint section, so in the push check and before the merge gate takes the machine slot. In the merge gate it judges the whole stack of queued PRs against main.scripts/release.ts: the generated notes gain### Extension API, derived from git rather than written by hand (the stale "What's New" text is the lesson already documented there).git log -G).--notes/--notes-fileget the section appended, unless they already have anExtension APIheading.`EXTENSION_API_VERSION` is 2.1 (v0.3.3 had 2.0). Changed by: - Let an app crate name its daemon and ship core's window capability in the library (#3613).CLAUDE.md: the push-check list and the extension-points paragraph name the check,WATCHED_PATHS, and the rule to add a new fixture in the change that adds it.Coordination
The frontend-contributions PR for #3414 bumps to 2.2 in the same change as its fixtures and re-recorded snapshot. The check accepts that. One test reproduces that shape: a re-recorded snapshot, a changed fixture and a new TS fixture, bumped in the same commit. This PR changes no version constant and no fixture.
The typed-subtype, edge-field and supported-id fixtures (ADR-082 §5, §9) don't exist on
mainyet. They are added toWATCHED_PATHSin the PR that adds them.The frontend fixture extension (
src/tests/fixtures/test-extension/) is deliberately not watched. ADR-082 §8 enforces the TypeScript surface through the declarations snapshot only. The comment aboveWATCHED_PATHSexplains this.Tests
scripts/check-extension-api-version.test.ts(30 tests, DOM-freebun test):origin/mainfails closed.scripts/release.test.ts(+10 tests):readExtensionApiReleaseon a tagged throwaway repo: only commits that changed the constant are listed, and a re-run skips the release's own tag;isWatchedalways falseorigin/maintip instead of the merge-baseorigin/maintest--no-renames)WATCHED_PATHS-Gdropped, no throw on an unreadable constant, changes not listed, previous tag ignoredreadExtensionApiReleasetest###detected,--excludedropped, git stderr droppedorigin/maintestsVerification run:
bun test scripts/: 1395 pass, 0 fail.bun run quality:scripts:fix: clean.bun run scripts/check-pro-boundary.ts: clean.bun run scripts/test-gate.ts --mode=push: passes in about 5.5 s total; the new stage takes under 1 s.fixture_tests.rsfailed the check with the message above. A follow-up commit bumping both constants to 2.2 passed. Both commits were then reset.Documentation
CLAUDE.mdis updated here. The gate docdevelopment/testing-guide.mdis updated in NodeSpaceAI/nodespace-docs#105.🤖 Generated with Claude Code