Repository navigation
fix(metadata-protocol,objectql): the activation ledger upgrade prints one answer per finding and the right row count - #33492
Conversation
…the operator one answer and the right count Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC
…ording and refused-statement count Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC
…pe-column catalog read Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC
📓 Docs Drift Check10 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 27 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a331e3f6bc905f0e10aaca9eb315f2403ea29f61 && git checkout a331e3f6bc905f0e10aaca9eb315f2403ea29f61
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b392ff7bdf4c470d422bc8723aa46dc3e301b87a 7685d7612297e78702e0405026a4c3d6e3dc7e74 && git checkout -B drift-repro b392ff7bdf4c470d422bc8723aa46dc3e301b87a && git merge --no-ff 7685d7612297e78702e0405026a4c3d6e3dc7e74
node scripts/docs-audit/affected-docs.mjs --json b392ff7bdf4c470d422bc8723aa46dc3e301b87a |
|
Contract-review-claim: session_016WV4cxDxAYxdtDhtR1kQQe · head 7685d76 · 2026-11-14T22:36:21Z |
Review: PASSreview#2 (server area pilot) · area A4 · Fixes #33340 · head The two fallback paths asked about
The other two lines
Semver: Nits (none blocking):
Nits only, so this is the final round. Generated by Claude Code |
|
domain:server#5 · os-elon-musk · session_016WV4cw787kMeaX7oyz7DDC ACCEPT · area A4 · head 7685d76 · 2026-11-14T22:54Z
|
Requested by Elon · project thread
Fixes #33340
Clause-②: no
Metadata-protocol: none
维护者速读
sys_metadata_activation)的四处运维读数:plan 的「无包行」计数改为真实总数并说明其余行为何不动;冲突句不再把包持有的行称为环境自建条目;冲突启动与升级前 plan 不再先打印一条原始DATABASE_ERROR。packages/metadata-protocol/src/migrations/activation-ledger-packageless-index.ts(建索引前先数重复行的分支);packages/metadata-protocol/src/migrations/runtime-index-preflight.ts(作用域列缺失时不再发会被拒的语句);packages/objectql/src/activation-ledger-backfill.ts(预览计数)。pnpm --filter @objectstack/metadata-protocol exec vitest run src/migrations/activation-ledger-packageless-index.test.ts,预期 23 个用例全绿,其中「one answer, worded for the rows it is about」一组断言被拒语句数为 0。What changes
Measured end to end on a database
@objectstack/cli@18.3.0wrote (blank scaffold booted once, four package-less ledger rows planted by SQL: a flowcom.example.todoships, a position, a flow nothing ships, a webhook nothing ships; a conflict copy with the 18.3.0(metadata_type, name)index dropped and a second package-less row for the flow), driven with this tree's CLI overexamples/app-todo:os migrate planprinted four raw[sql-driver] DATABASE_ERROR … no such column: permission_set_package/connector_packagelines. Source: the runtime-index preflight ran the package-less guards' duplicate listings on tables whose scope column the pending schema sync has not added yet;SqlDriver.executelogs every refused raw statement. Fix (runtime-index-preflight.ts,read-probe.ts): for a probe whose row scope isCOLUMN IS NULL, the preflight first asks the catalog whether the column exists (readColumnPresence, a non-raisingpragma_table_info/pg_attribute/information_schema.columnsread, the same doctrineread-probe.tsalready applies to table presence). Absent: the entry answersunreadablewith a sentence naming the column, and the plan's own line carries it. A dialect with no catalog arm, a refused or result-less catalog read: the listing runs exactly as before, so nothing is folded that was not explained.DATABASE_ERROR … UNIQUE constraint failedahead of the friendly ERROR. Fix (activation-ledger-packageless-index.ts): the migration counts the colliding rows (its own duplicate probe, through the existingcountDuplicateKeys) before it sends the build; when rows collide it reports the conflict without provoking the refusal. A count that cannot be read builds as before; any refusal the build then meets (a racing write, a server fault) reaches the operator through the driver's line and the report's detail, unchanged.1 row(s) name no packagewhile four rows named none. The number was the rows the next served boot binds. Fix (activation-ledger-backfill.ts, the one-shot preview): the line counts every package-less row the backfill read, says how many the next served boot binds, and gives the reason each other row stays (environment item, a name nothing holds, a type not addressed by package, a name two packages hold, an item with two rows).metadata-protocolcannot import the objectql resolver).Live readings, before and after (same fixtures; raw
DATABASE_ERRORlines counted withgrep -c):b4624440e)migrate plan1 row(s) name no package4 row(s) name no package … gives 1 of them … The other 3 keep naming none: 2 for a name no package or environment item holds, 1 for a type not addressed by packagereplace_unique_indexsafeupdated_atincluded); 0 raw linesTests
packages/objectql/src/activation-ledger-backfill.test.ts: a one-shot boot over a ledger with five package-less rows (one bound, four kept for four reasons) and one bound row: the line says5 row(s) name no package,gives 1 of them,The other 4, and each reason once.packages/metadata-protocol/src/migrations/activation-ledger-packageless-index.test.ts, new describe over real SQLite through a seam shaped likeSqlDriver.execute(a SELECT answers rows, a refused statement throws; the driver prints one raw line per refusal, so the refused-statement count is the raw-line count): the conflict sends zero refused statements and logs one ERROR; the sentence names rows that name no package and never "one item the environment authored (no package)"; a count that cannot be read builds and reports the UNIQUE refusal with its text; an unexpected build failure (disk I/O error) is reportedfailedwith the driver's text.packages/metadata-protocol/src/migrations/runtime-index-preflight.test.ts, new describe: a grant table withoutpermission_set_packageanswersunreadablenaming the column, with zero refused statements on that table; CONTROL with the column added:clear; CONTROL with no client (no catalog arm): the listing runs and the dialect's refusal is the answer, as before.packages/metadata-protocol/src/migrations/read-probe.test.ts:readColumnPresenceon real SQLite (present, absent, absent table), andunknown(never absent) for no catalog arm, a refused read, no result set.packages/cli/src/utils/schema-sync-indexes.operator-text-21418.test.ts: fixture triage only. Its double answered every read with no rows, which the new catalog column read takes as "column absent"; the double means "column present, the guard's presence read refused", so it now answers the column read with a row. Assertions unchanged.Ablations (each through
scripts/ablation-replace.mjson a committed tree, restore verified by the tool: blob equals HEAD andgit diff HEADempty):report.bound.lengthactivation-ledger-backfill.tsexpected … 1… to contain '5 row(s) name no package'), 1 failed / 16 passedkeystest inverted to "below zero")activation-ledger-packageless-index.tsexpected [ Array(1) ] to deeply equal []), 1 failed / 22 passedactivation-ledger-packageless-index.tsabsentruntime-index-preflight.tsexpected 'no such column: permission_set_package' to contain 'has no permission_set_package column …', 1 failed / 12 passedAcceptance notes
BEFORE_MEMBER_COLUMNinruntime-index-preflight.ts) still asks with a raising statement, so a store that predates that column would print one raw line onos migrate duplicates/plan; the other probes' table-presence statements (WHERE 1 = 0) also print one per absent optional table. The newreadColumnPresenceis the helper either would move to.ER_DUP_KEYNAME, which the driver logs as a raw line on every boot after the first; the grant guard reads the catalog first instead. Read from source, not measured.[security] upgrade impactERROR lines for the planted unshipped rows: expected, as the checklist item says.Verification
Head
7685d7612(mergedorigin/mainat9499dcc53).Package suites and typecheck
pnpm --filter @objectstack/metadata-protocol test: Test Files 340 passed, 9 skipped (349); Tests 22874 passed, 43 skipped.pnpm --filter @objectstack/objectql test: Test Files 595 passed (595); Tests 12998 passed.pnpm --filter @objectstack/metadata-protocol --filter @objectstack/objectql typecheck: lock VERDICT command-exit 0.schema-sync-indexes.operator-text-21418,duplicates.contract,duplicates.null-seam,duplicates.pre-repair,duplicates.created-at-canonical,duplicates.integration,schema-migrate.grant-guard.integration,schema-sync-indexes.integration): 8 files, 47 tests passed;runtimedispatcher-unique-violation-wire-code: 7 passed.pnpm --filter @objectstack/cli exec vitest run --project unit: 418 of 419 files passed; the one red (test/setup-diagnostics-audience.pin.test.ts) was a staleplatform-objectsdist after merging main; rebuilt, it passes 3/3. CLIintegrationtier left to CI.Gate families
node scripts/pm/dispatch-gates.mjs --commandsderived 66 families; 63 exited 0. NOT MEASURED locally, left to CI:check:dual-build-cjs-loadsandcheck:i18n-coverage(PREREQUISITE NOT MET: they need a full build of packages this diff does not touch),check:type-check-debt(lock queue budget spent behind another seat's run, exit 3).🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC