Repository navigation
docs(qa): refresh cli dev-boot DB clause to unified objectstack.db; narrow build exit clause to the #4873 leak - #7712
Merged
Conversation
…arrow build exit clause to the #4873 leak Two checklist reconciliations in docs/qa/platform-checklist/areas/cli.json, both text-only — no packages/cli behaviour changes. cli.dev-boot-contract (rev 1 -> 2), Fixes #7650: the DB-selection clause, its step, variants and sources named the retired `resolveDefaultDevDbUrl` helper and the `.objectstack/data/dev.db` default. Both are superseded by #6469's unified `<state dir>/data/objectstack.db`, resolved through the shared `resolveProjectDatabaseUrl` that dev maps onto via `resolveDevDatabase`. Re-derived from dev.ts and resolve-project-database.ts: the config-datasource and legacy compat-read tiers are now variants, with a step and a negative for the legacy dev.db notice line and the pin test in sources. The load-bearing property is unchanged in substance — nothing chosen still defaults to a PERSISTENT project-anchored sqlite file, never `:memory:`. cli.build-own-contract (rev 1 -> 2), Fixes #7648: clause 4 read "exit codes are exactly 0 or 1", which also forbade oclif's standard ExitError 2 that compile.ts's human-path `this.error()` catches legitimately produce on a config-load-time throw — colliding with cli.flag-command-error-ux, which asserts that same 2 is correct. The clause is narrowed to what #4873 actually was: a computed value reaching the exit slot, detectable as a nonzero on success or a code that moves between identical runs. 0/1 via CliExitCode and oclif's fixed 2 on the human path are named as legitimate. It stays load-bearing — a duration in the exit slot still fails it — and gains a repeat-run step plus a negative to keep it falsifiable.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This was referenced Aug 11, 2026
huangyiirene
marked this pull request as ready for review
August 11, 2026 12:10
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7650
Fixes #7648
Two checklist reconciliations from QA run #7628, both landing in
docs/qa/platform-checklist/areas/cli.jsonand both text-only — nopackages/clibehaviour changes. The product is correct as shipped in both cards; the checklist text was what had drifted.Premise verification (re-derived at this ref, not taken from the issues)
Both premises re-confirmed on
origin/main@21888ab(triage verified at5823d59):resolveDefaultDevDbUrl/dev.db— refresh to unifiedobjectstack.db#7650 —git grep resolveDefaultDevDbUrl -- 'packages/cli/src/**'returns zero hits. Counter-probe: the same grep does hitdocs/qa/platform-checklist/areas/cli.json:45and:88, so the scanner sees the tree and the zero is real, not a broken probe. Repo-wide the name survives only in twoCHANGELOG.mdhistory entries.packages/cli/src/commands/dev.tsuses the unifiedobjectstack.dbat lines 29, 239, 275.packages/cli/src/utils/format.ts:41still readsexport type CliExitCode = 0 | 1;compile.ts'sthis.error()catches are still at:411and:480, and each is on the human branch while the--jsonbranch above it answers throughemitJson(...)+this.exit(1). The collision the issue describes is intact.Line numbers named at filing time (
cli.json:28/:45/:80/:88and:145) all re-derived identical at this ref.Per-card checklist
#7650 —
cli.dev-boot-contract(revision 1 to 2)steps(was:28)file:(cwd)/.objectstack/data/dev.dbfile:(cwd)/.objectstack/data/objectstack.db; notes--freshuses the same unified filename under its ephemeral homesteps(new)dev.dband noobjectstack.dbmust resolve to the legacy file and print the one loud noticeacceptanceclause 2 (was:45)resolveDefaultDevDbUrlmatrix … the PERSISTENT project-anchored sqlite file (.objectstack/data/dev.db) — never the serve default of:memory:"resolveProjectDatabaseUrl, which dev maps its flags onto viaresolveDevDatabase) … the PERSISTENT project-anchored sqlite file — the unifiedobjectstack.db— never the historical serve default of:memory:that wipes work on restart"acceptanceclause 2verifydev.dbdefaultnegative:memory:serve default)":memory:serve default"; new negative for a silent freshobjectstack.dbopened beside an existing legacydev.db, or a compat-read with no noticevariants(was:80)dev.dbobjectstack.db,TURSO_DATABASE_URLadded to the env tier, plus the config-declared default datasource and legacy compat-read tierssource(was:88)dev.ts (resolveDefaultDevDbUrl matrix; …)dev.ts (resolveDevDatabase — dev's ONE resolution seam, carrying no fallback filename of its own; …), pluspackages/runtime/src/resolve-project-database.ts(the #6469 shared matrix, state-dir order, legacy compat-read) andpackages/cli/src/commands/unified-db-resolution.pin.test.tsThe load-bearing property survives verbatim in substance. This is a rename, not a weakening: nothing-chosen still defaults to a PERSISTENT project-anchored sqlite file, and
:memory:is still named as the thing it must never be. The words "PERSISTENT project-anchored sqlite file" and "never …:memory:that wipes work on restart" are carried through unchanged; only the filename and the helper name moved.The current resolution path, read out of
resolve-project-database.tsrather than assumed: explicit URL (flag/config) to env (OS_DATABASE_URL/DATABASE_URL/TURSO_DATABASE_URL) to explicitmemorydriver to config-declared default datasource to the unified(state dir)/data/objectstack.db, with a legacydev.db/standalone.dbcompat-read (probe orderobjectstack.db,dev.db,standalone.db) that emits one loud notice.#7648 —
cli.build-own-contract(revision 1 to 2)acceptanceclause 4 (was:145)CliExitCodeunion) — never a count, never a duration"CliExitCodeunion (everyemitJson/emitTextcaller), plus oclif'sExitError2 when the human path (the run without--json) ends inthis.error(): a config-load-time throw exiting 2 is the framework's error exit and is NOT a violation"verifyecho $?across all runs is only ever 0 or 1"this.error()path, and none varies with the run — with the #4873 shape spelled out concretely (timer.elapsed()inemitJson's positional exit slot made a successful run exit531 & 0xFF= 19, a different nonzero every time)evidence--jsonand human paths labelled separately, plus repeat runs showing each code is stablesteps(new)--jsonexpecting 1 — and a verbatim repeat of one success and one failure, since only a repeat can see a code that movesnegative(new)ExitError2 is explicitly not that leaksourceformat.ts(CliExitCode = 0 or 1— the narrowed exit-code slot)"emitJson/emitTextexit slot, NOT a bound on oclif's own error exit";compile.tsentry now records the human-paththis.error()vs--jsonemitJson+this.exit(1)split; addedformat.exit-code.test.ts(the #4873 pin) and a cross-reference tocli.flag-command-error-uxtitleThe narrowed clause stays load-bearing. A duration or count reaching the exit-code slot still FAILS it, by two independent tests the old wording did not have: a successful run exiting nonzero, and a code that moves between two identical runs. The old "exactly 0 or 1" phrasing could only catch the leak by accident — it would equally have failed the legitimate oclif 2 — so this narrowing makes the clause both correct and strictly more falsifiable. The collision with
cli.flag-command-error-uxdissolves because both items now name the same fact: exit 2 is oclif's error exit, and that item owns it.Verification
Both edited items carry a
revisionbump (1 to 2) and an appendedhistoryentry perdocs/qa/platform-checklist/README.md's change protocol.pnpm check:platform-checklist—checklist-select --self-test: 17 cases pass. The validator reports 1 problem, byte-identical to the pre-edit baseline on this same ref:That red is the known pre-existing #7347
qa: UNCLASSIFIEDcarried by the base branch — recorded, not chased, and out of this card's file surface.diff baseline afteris empty: this change adds no new finding and removes none.Reverse verification (direction predicted before running: RED, since a text-only change has no runtime behaviour to flip — the meaningful question is whether the gate actually reads the items I edited). Setting
cli.dev-boot-contract'srevisionback to 1 while its last history entry says 2:Restored with
git checkout --(nevergit stash), back to the baseline 1 problem. The gate is not blind to these items.JSON validity — parses, 6 items, and every item's
revisionequals its lasthistoryentry's revision (2, 2, 1, 1, 1, 1).pnpm check:nul-bytes— self-test 75 assertions pass;OK (scanned 7104 text file(s) … no raw ASCII control bytes). Self-scan of the edited file beyond the gate (grep -naPover the control-byte ranges) is clean.Diff surface, 1:1 with the mandated scope:
No
coverage.json, no other area file, nopackages/clicode.Changeset
None — docs-only, releases nothing. Needs the
skip-changesetlabel.Generated by Claude Code