Skip to content

test(release): run released packages against the new relay and back - #207

Merged
gregpriday merged 7 commits into
developfrom
feature/issue-194-check-released-0-8-0-packages-against-a
Nov 19, 2026
Merged

gregpriday merged 7 commits into
developfrom
feature/issue-194-check-released-0-8-0-packages-against-a

Conversation

@gregpriday

Copy link
Copy Markdown
Contributor

Adds pnpm compat:check, a release-time check that runs the released packages and relay bundle against the new ones in both directions, with real relays under wrangler dev, the installed decisions CLIs, and each library as a host app uses it.

Resolves #194

What it runs

The old side is @daintreehq/decisions-*@0.8.0 from npm plus the relay bundle attached to the v0.8.0 GitHub release, checked against that release's SHA256SUMS and against the npm relay package's manifest. The new side is a packed build of the tree (--new packed, the default) or a published version (--new 0.9.0, the smoke check after publishing). Each side is installed into its own scratch npm project outside the workspace, and its code only runs from there: through its CLI, or as a child process (actor.mjs) whose imports resolve to that install. A simulated phone pairs, reads, answers and declines with signed requests, as the phone app does.

  1. 0.8.0 desktop against the new relay. The 0.8.0 CLI claims the relay as the owner desktop. Its ask --wait gets the person's answer and decline, and it enrolls a 0.9.0 Remote Host. That host asks an advisory question, then an ordinary one, while the 0.8.0 library bridge is connected. The released EventData.created and QuestionDetail refuse the advisory question for its reply_mode and read every other question. The bridge does not adopt either foreign question, its cursor passes them, and it keeps asking and receiving answers and declines in its own pane, with no error, no refused request, and no problem in its audit.
  2. The new desktop against the 0.8.0 relay bundle. The new CLI (ask --wait, get, wait) and library get answers and declines. ask --planned-fallback and the library's advisory ask are both refused as not_supported: relay-unsupported, and neither adds a question to the relay. An agent-stopped push request reports unsupported.
  3. A 0.8.0 host with open questions moves to the new version, then its relay does. The new host reopens the 0.8.0 CLI's identity.json and decisions.db and answers a pre-upgrade question. It also reads a reopen made under 0.8.0 with the reopen's signed deadline (0.8.0 keeps the first round's; the new host's reconcile repairs it). The relay is then swapped for the new bundle on the same storage, as decisions update does. A question asked before both upgrades expires there as a blocking question (nothing due), is reopened by the owner, and is answered in its new round. An agent-stopped push request now reaches the relay (no-subscription).

Where the older release already supports advice or agent-stopped pushes, the refusal checks are skipped and say so, so the same script can serve the next release.

Notable changes

  • tools/compat-check/compat-check.mjs and tools/compat-check/actor.mjs, run as pnpm compat:check [--old 0.8.0] [--new packed|<version>] [--only 1,3] [--no-build] [--port <base>] [--keep]. Relays, actors and CLI runs are stopped on every path, ports something already answers on are refused, and a failed run keeps every relay, CLI and library log.
  • tools/pack-check/pack.mjs: the build, pnpm pack and scratch npm install, now shared by pack-check.mjs (whose behaviour is unchanged) and the compatibility check.
  • docs/operations.md: both runs added to the release procedure, and a section on what the check covers.
  • The release bundle check found one difference between the v0.8.0 GitHub release and the npm relay package: worker/index.js.map names its sources by other relative paths, because the release job bundles the Worker from another directory. Every file that runs is byte for byte the same, so source maps are left out of the comparison.

No product change was needed: the first runs found no incompatibility. A cached 0.8.0 phone app stays with #195.

Testing

  • node tools/compat-check/compat-check.mjs with a fresh build, packed from a clean tree against the released 0.8.0: all three scenarios pass (101 checks, 2.9 minutes), with no processes left behind. After the review fixes, the full run passes again (102 checks, --no-build), and so does scenario 3 on the final commit.
  • node tools/pack-check/pack-check.mjs --no-build passes after the refactor.
  • Impact set: 9 of 144 test files (packages/cli cli and deploy, packages/client entry-points, publish-safety and store, packages/decision-model entry-points, history and review-fixes, tools/release/release.test.mjs), all green.
  • Prettier on the changed files. --only 4 exits 2 with a usage message.
  • Not run: --new 0.9.0, which can run only once 0.9.0 is on npm.

Open

From the last review pass, left for a follow-up:

  • A SIGINT or SIGTERM that arrives while a relay's /health reply is in flight can make the run exit before the signal handler's final process-group kill, which can leave that wrangler dev (or its workerd) running.
  • Scenario 3's final check would also pass a second, identical answer notice labelled revision 1 in the same pane.

- tools/compat-check runs the released CLI, library and relay bundle against a packed build or a newer release
- share pack-check's packing and scratch install with it
- document the check in the release procedure
…ames

- parse a CLI's whole stdout as one object before reading it line by line
- compare the release's runnable files only: its source map names other relative paths
- fail on the audit events that report a problem, allowing the advisory refusal the old reader is meant to make
- match each notice block by question, pane and fields, and count it once after delivery settles
- have the phone confirm each question it reads, and the advisory one's plan and signed deadline
- require the old reader to refuse the advisory question for its reply_mode, each create exactly once
- compare the relay's question sets around refused advisory asks, and add a push control after the upgrade
- adapt scenario 1 and 2 expectations to what the older release supports
- refuse ports something already answers on; stop relays, actors and CLIs on every path; keep CLI logs
- check the release ships no file the npm relay package lacks; reject unknown --only values
…tighten three checks

- a relay, actor or CLI whose spawn failed counts as stopped, so cleanup never waits on it
- a CLI log that cannot be written no longer escapes cleanup
- an expiry notice may not mention a plan; each reopened round's answer is typed once in any pane
- check the release carries the npm package's source maps, and compare full question id lists
… the reopened answer's own notice

- a signal sets a flag that every relay, actor and CLI start checks, so the shutdown sees each process
- the pane and answer checks apply to the one revision-2 notice of each reopened question
@gregpriday
gregpriday merged commit 5f7141e into develop Nov 19, 2026
2 checks passed
@gregpriday
gregpriday deleted the feature/issue-194-check-released-0-8-0-packages-against-a branch November 19, 2026 14:05
@gregpriday gregpriday mentioned this pull request Nov 19, 2026
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.

Check released 0.8.0 packages against a 0.9.0 relay and back

1 participant