Skip to content

Refuse a release whose core peer floor lacks an API it uses; fix store release tooling (refs #346) - #355

Merged
jimhoyd merged 2 commits into
mainfrom
fix/store-peer-floor-346
Sep 21, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
fix/store-peer-floor-346

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and change

Refs #346 (does not close it: the release is the maintainer's). Published store 0.4.2 assumes core changes (#342, #343, and the extension authoring contract) that published core 0.4.2 lacks, while its peer range allows core 0.4.2. Nothing in the tooling could notice: unit tests call scaffold() directly and release:peers never drove the core CLI.

This PR does not raise the store peer floor in the manifest. It cannot yet: release:check requires the in-repo core version to satisfy every peer range, and the in-repo core is still 0.4.2, so a floor of >=0.4.3 fails release:check for the current set. The floor is raised during release preparation, by the tooling, once core 0.4.3 is in the checkout (how ui/auth/admin floors have risen: release-prepare sets >=<version> <nextMinor> for selected peers).

Changes:

  • scripts/peer-api.ts (new): records the first core release for each ScaffoldRequest/ScaffoldResult member added after 0.4.2 (acknowledgements, acknowledged, routeNotes, provides, requires, after, conflicts) and for the extension authoring names. It scans a package's src/ with the TypeScript AST (comments and strings ignored) and compares the uses with the package's core peer floor.
  • release-prepare: when a package is selected without core, its core floor is raised to what it uses if the in-repo core already has it (upper bound kept), and refused with the reason if not. Every selected package's resulting floor is asserted.
  • release.ts preflight (runs in the tag workflow before publish): refuses a package whose floor falls short.
  • test/peer-api.test.ts: a completeness test that fails when a new scaffold contract member has no recorded release, plus the scan, violation and raise logic; release-prepare.test.ts covers the refusal.
  • packages/store/test/core-contract.test.ts: drives the installed core's own init --with store --ack store:public-write. release:peers runs it against the published core at the floor, so a floor without the flag fails there.
  • Refusal message: core does not tell an extension whether the flag is supported, and an absent acknowledgement looks the same as an old core (the refusal now prints the exact --ack store:public-write command), so the scaffold cannot detect it without a core change. Documented in the store README and VERSION-ALIGNMENT.md instead.
  • Tooling bugs for a package first published by hand, fixed here (below).

Tooling bugs found (first release of a new package)

  1. release:peers crashed for the store: it unconditionally ran scripts/check-sqlite.mjs, which only auth/admin ship. It now runs it only if the package has it. The store release workflow calls release:peers, so the store's first pipeline release would have failed at that step. With the fix, PACKAGE_DIR=packages/store npm run release:peers fails at the floor's build (acknowledgements, provides and ExtensionAuthoringContract do not exist in core 0.4.2), which is the bug.
  2. packages/store/CHANGELOG.md did not exist and release-prepare reads it unconditionally, so release:run --version X (scope all or store) crashed with ENOENT. Added, with a 0.4.2 entry recording the manual publication.
  3. Not fixed, needs the maintainer: store 0.4.2 is on npm with no tag (tagSha: null), so packageState asserts "Published version has no release tag" and npm run release:run (all scopes, no flags) and --package store abort. Any other scope works. The fix by the script's own instruction is a tag @jimhoyd/[email protected] at 7972185, which needs the maintainer identity. I did not weaken that assertion.
  4. Not fixed: .changeset/clean-release-packages.md names core, ui, auth and admin, so release:prepare --package core refuses ("changeset spans selected and unselected packages"). Core alone cannot be released until that changeset is split or its packages are released together.

Release plan (maintainer; nothing here was executed)

All of this ran without --execute. release:plan reports every package published at 0.4.2 with releaseNeeded: false, tags at 0f9cf07 for core/ui/auth/admin and tagSha: null for the store. release:run with no flags states: core, ui, auth, admin unchanged, then aborts on the store (bug 3).

Recommended path, given bug 4: one coordinated release of all five, which is also the only path that needs no manual floor edit.

  1. Tag @jimhoyd/[email protected] at 7972185 (bug 3), if you want release:run without flags to work.
  2. Merge this PR.
  3. npm run release:run -- --version 0.4.3 (dry run; prints the proposal). Files it would change include packages/store/package.json and CHANGELOG.md, package-lock.json, the version markers, and .changeset/pre/coordinated-0.4.3.md. The store's core peer becomes >=0.4.3 <0.5.0 here.
  4. npm run release:run -- --version 0.4.3 --execute (maintainer): release PR, required checks and merge, exact-SHA CI plus candidate gates, then publishes in order core, ui, auth, admin, store, waits for installability of each, runs verifyPublishedTrain (installs all five, scaffolds ui,auth,admin and store --ack store:public-write with the published set), then the starter PR. The release environment approval and npm trusted publisher settings for the store (per the first-publish runbook) are yours.
  5. Afterwards confirm in an empty directory: npm i @jimhoyd/urlcode @jimhoyd/urlcode-store, init site --with store refuses and --ack store:public-write succeeds.

Alternative that matches the issue text (core first, store next): split or drop clean-release-packages.md, then --package core --version 0.4.3, then --package store --version 0.4.3; with this PR the store step raises its own floor to >=0.4.3, or refuses if core 0.4.3 is not in the checkout. I could not dry-run this path because of bug 4.

Caveats: the recorded 0.4.3 in scripts/peer-api.ts assumes that number; if core ships as another version, update the table in the release PR (the guard then refuses a floor below it). I did not check whether the candidate train for a release that leaves the store at 0.4.2 would compare against the manually published bytes.

Verification

  • npm ci, npm run verify (lint, typecheck, check, build, tests, workspace verify, audit, workspace integration): passes.
  • npm run docs:llms (no change), npm run check:docs, npm run release:check: pass. Prose docs add no version numbers outside the markers.
  • release:peers for the store against published core 0.4.2 fails at the build with the missing APIs, as expected until the floor rises.
  • Package budgets (scripts/package-audit.ts, not raised): core 428 files against the 440 cap, store 12 files, 15889 packed bytes. The new CHANGELOG is not packed.
  • Not run: Windows CI and CodeQL (they run on the PR). docs/FIRST-NPM-PUBLISH.md is on open PR Document the first npm publish runbook; fix stale store publication claims #348, not main; this PR does not touch the lines that PR edits in VERSION-ALIGNMENT.md and agrees with its description of the fix.

Open decisions

  • Coordinated all-package 0.4.3 (recommended) or split core and store?
  • Tag @jimhoyd/[email protected] at 7972185, or relax the "published without a tag" assertion for a manually published first version?
  • Whether ui, auth and admin should also be held to the same floor now: they use the same new APIs, so their next releases are covered by the same guard; their published 0.4.2 predate it.
  • A core change to expose a scaffold API level would let a scaffold detect an old core; not done here.

🤖 Generated with Claude Code

@jimhoyd
jimhoyd force-pushed the fix/store-peer-floor-346 branch from e541d32 to 66b75a4 Compare September 21, 2026 00:37
jimhoyd and others added 2 commits September 20, 2026 19:48
…fix release:peers and preparation for the store (refs #346)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ore contract test and docs (refs #346)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@jimhoyd
jimhoyd force-pushed the fix/store-peer-floor-346 branch from 66b75a4 to ae28159 Compare September 21, 2026 00:50
@jimhoyd
jimhoyd merged commit 06a4d97 into main Sep 21, 2026
20 checks passed
@jimhoyd
jimhoyd deleted the fix/store-peer-floor-346 branch September 21, 2026 01:01
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