Repository navigation
fix(metadata-protocol)!: refuse a write naming no package over the package-less row of a name only disabled packages hold - #37584
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
… row of a name only disabled packages hold WIP: the holder refusal reads past the package-unbound row for the disabled-holders judgment (ADR-0150 D3), with the enable as the remedy; pins for the four write doors on both transports and registration orders. Claude-Session: https://claude.ai/code/session_01L6bhgWSCg5Qjw8A76bTFD6 Co-authored-by: Claude <noreply@anthropic.com>
… active rows where a package-unbound row is stored; the refusal fits the client message cap Claude-Session: https://claude.ai/code/session_01L6bhgWSCg5Qjw8A76bTFD6 Co-authored-by: Claude <noreply@anthropic.com>
…ration entry, changeset and the objectql pin The ADR-0150 D3 note dated 2026-11-26 records the ruling of #37499: while every holder of a name is disabled, the four writes naming no package are refused with the enable remedy, and enabling the holder again serves the package-less row untouched. The semantic migration entry and the changeset carry the same fix; the objectql door pin that read the old 200 now reads the refusal and the round trip. Claude-Session: https://claude.ai/code/session_01L6bhgWSCg5Qjw8A76bTFD6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 29 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 178 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 9bc9b93c51cecb7fad64422348da771359444275 && git checkout 9bc9b93c51cecb7fad64422348da771359444275
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 450813bf0bd2789c250675c48d53db8c20084f66 && git checkout -B drift-repro 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 && git merge --no-ff 450813bf0bd2789c250675c48d53db8c20084f66
node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Isolated review, read at 2026-11-26T14:59Z. Inputs: card #37499 (body, claim 7191684203, dev report 7194444492), this PR's body and file list, the net diff against ① Derived judgmentsEvery answer the diff moves is for a caller naming no package, a type the registry reads by package, and a name whose every holder is disabled.
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. One should-fix, owing a delta review. S1 (should-fix) — the ADR note says every write naming no package is refused; two write doors naming no package are not asked the judgment at this head. The note reads "it hides with its holder, on the reads and on the writes alike", "Every write naming no package is refused … : the publish-mode save, the draft save, the delete and the draft discard", and "Re-enable serves the row untouched". Read in the tree, not run:
Neither door is among the card's four, so the card's Done-when is met by this diff, and this is not graded as a failure of the fix. The finding is on the note: it records a universal the tree does not hold, and it is the text a maintainer approves as the contract. Fix, either way: (a) measure both doors in cell 1 first, then word the note as the four doors it closes, name the per-item publish and the rollback as not judged yet, and cite their card; or (b) close both here through the same judgment and pin them. One clause should also say that the server-stated rewrites ( Per file, against the code and the scenario it is accepted against:
Nits (none moves the head by itself; fix on the next push of the note, or leave as accepted deviations or follow-up cards):
Out of the diff, read and not reviewed:
Implemented-by: VERDICT: PASS |
…wo doors not judged yet The note said every write naming no package is refused. Two doors are not asked the judgment at this head: the per-item publish and the per-item rollback. The note now states the four writes this change closes, names those two as not judged yet with their card, says the server-stated rewrites are not asked by design, names the draft reads, marks which controls are pinned and which are measured, and points at D4's exception for the platform's own record. The migration entry's surface reads "packages that are disabled". Claude-Session: https://claude.ai/code/session_01L6bhgWSCg5Qjw8A76bTFD6 Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #37499
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no page under
skills/**orcontent/docs/**teaches a save, draft save, delete or draft discard naming no package over a name only disabled packages hold; the refusal's own sentence names the fix维护者速读
What changes
A package-less
sys_metadatarow stored at a name a package holds is that package's customization (ADR-0150 D3/D4). Reads naming no package already hid it while every holder was disabled. The four writes naming no package still reached it. Measured onmain5dbcc02bfor adashboard, on both transports and both registration orders, before and after a restart:mainPUT /api/v1/meta/:type/:name200, the hidden row edited409 RESOURCE_CONFLICT, nothing writtenPUT …?mode=draft200, a draft stored that the draft read answers404 NO_DRAFTfor409 RESOURCE_CONFLICT, nothing writtenDELETE …?state=draft200, the draft removed409 RESOURCE_CONFLICT, nothing deletedDELETE /api/v1/meta/:type/:name200, the row removed; the next enable serves the package's item without its customization409 RESOURCE_CONFLICT, nothing deletedThe refusal starts with the fix ("Enable the package that holds TYPE 'NAME' first, then send this save again"), points at
GET /api/v1/packagesandPATCH /api/v1/packages/:id/enable, and names no package. It stays under the 500 characters a door cuts a client message at. Once a holder is enabled again, the read naming no package serves the row byte-identical to what was stored, and the same writes answer as before.Where the change is:
packages/metadata-protocol/src/protocol-save.ts:packagelessHolderRefusal, the one judgment all four doors ask, no longer returns early when a package-less row is stored. The enabled-ambiguity arm keeps that skip, so a package-less row beside two enabled holders is written as before. A newdisabledHoldersCustomizationRefusalcarries the enable remedy. The publish-mode save also asks the judgment when the served address is the package-less row beside a disabled package's own row.packages/metadata-protocol/src/protocol-diff-delete-load.ts: the draft discard judges the holders over the active rows too when a package-less row or draft is stored, so it is refused when the customization is the active row and no draft exists.docs/adr/0150-…md: a dated note under D3 records the ruling, the readings above and the controls.packages/spec/src/migrations/entries/semantic/19.disabled-holder-package-less-row-bare-write-refused.ts: the ADR-0087 entry the narrowed declaration owes.Not moved, each pinned as a control: a name no package holds (
env_only_dash) saves, drafts, discards and deletes with200beside a disabled package; a package-less row at a name an enabled package holds; a name only disabled packages hold with no package-less row or draft stored, which keeps its409and its?package=remedy; every read.Decisions taken in this change, small enough not to need a card:
?package=refusal is kept for a name with no package-less row stored. There the named write has one row to write and nothing hidden beside it.Lane measurements the card asked for first:
mainand on this branch.docandaction(sealed against overlays): the save, the draft save and the delete answer403 NOT_OVERRIDABLEwith the holder enabled or disabled, the draft discard has no draft to remove, and nothing is written. Unchanged here._env: neither transport routes aPUTor aDELETEthere, so there is no write door to close. The dispatcher also mounts noDELETEon a metadata item (405), so the delete and the discard are pinned through the REST route and the in-processdeleteMetaItem.Tests
packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts, in the[#32605]block, each across dispatcher and REST and both registration orders:CONTROL: the environment's own item, of a name no package holds, saves, drafts, discards and deletes as before beside a disabled Dthe package-unbound row of a name only the disabled D ships is hidden with it(four doors refused, every stored row byte-identical, re-enable serves the row, then the same writes succeed)a package-unbound draft of a name only the disabled D ships … is hidden with it(draft beside the row, draft alone)a package-unbound row beside the disabled holder's own row … is hidden with it(a code package and an authored package)packages/objectql/src/disabled-holder-packageless-row-doors.test.ts(review#2 S3): the pin that read the old200now reads the refusal and the round trip.Readings, each under the shared verify lock with the exit code read from its VERDICT line:
Tests 20 failed | 100 passed | 61 skipped (181)with-t 32605(the five refusal pins in each of the four arms; the control passes on both builds).Test Files 1 passed (1),Tests 181 passed (181).Test Files 370 passed | 9 skipped (379),Tests 23440 passed | 45 skipped (23485); objectql638 passed (638),14428 passed (14428); rest429 passed (429),8852 passed | 351 skipped (9203); runtime649 passed (649),12081 passed | 25 skipped (12106); spec899 passed (899),28498 passed | 1 todo (28499).typecheckof metadata-protocol, objectql, runtime and spec: exit 0 each.The metadata-protocol, objectql, rest and runtime suites ran on
f71b5f88aplus the objectql pin edit. The commit after it (7e6689619) adds the ADR note, the spec entry, the changeset and that pin, and no other source. The spec suite, the typechecks, the ablation and the dogfood battery ran on7e6689619.Acceptance notes
env_only_dashstays200,d_unbound_dashflips to409.everyRowBytesin the second and fourth tests above.docs/adr/**is a governed path and the note sits under the ADR's Decision heading, so this pull request needs an authorized approval. Moving the note to its own pull request is possible if the seat prefers.claude/project-thread-iu6ti1, the name the platform assigned to this thread._envfor such a name answers409where the other reads answer404. It lives in other files and has its own card.First read, by risk:
packages/metadata-protocol/src/protocol-save.ts, the tail ofpackagelessHolderRefusal: the removed early return, and the!address.unboundguard that keeps the two-enabled-holders cell unmoved.packages/metadata-protocol/src/protocol-diff-delete-load.ts, theactivelookup for the draft discard: it must stay inside theunboundcondition or the cells without a package-less row would move.packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts, the four tests named above.Two-minute check:
pnpm --filter @objectstack/metadata-protocol build, thenpnpm --filter @objectstack/runtime exec vitest run --project local --maxWorkers=2 src/domains/meta-disabled-holder-served-stack.test.ts. ExpectTests 181 passed.Verification
Summary: the ablation turns 21 tests red and the restore turns them green; all 101 derived gate families answer exit 0, three of them on a rerun once their prerequisite existed; the full dogfood battery on the head is green.
Ablation: re-allow the package-less skip in the judgment
On
7e6689619,scripts/ablation-replace.mjs --holdputif (address.unbound && 'ABLATION_37499_UNBOUND_SKIP'.length > 0) return undefined;back at the head of the judgment inprotocol-save.ts. Then the package was rebuilt andscripts/ablation-dist-preflight.mjsfound the marker indist/index.cjsanddist/index.js.meta-disabled-holder-served-stack.test.tsTests 20 failed | 161 passed (181), lock VERDICTcommand-exit 1;disabled-holder-packageless-row-doors.test.tsTests 1 failed | 4 passed (5), VERDICTcommand-exit 1.--restore,git diff HEADempty, rebuilt, preflight--absentpasses over all 24 built files):Tests 181 passed (181)andTests 5 passed (5), VERDICTcommand-exit 0each.A first attempt was a no-op and is void: the replacement text still contained the anchor, the tool refused it and restored the file, and the preflight reported the marker absent from
dist/. The readings above are from the second attempt.Derived local gates: 101 families
node scripts/pm/dispatch-gates.mjs --commandsderived 101 commands from the seven changed paths. Each ran with its exit code recorded before any pipe, and--ranreconciled the record.node scripts/check-plugin-teardown-shape.mjs --self-test: exit 3 at first (its fixture commit was outside the shallow clone); exit 0 after fetching that commit,48 cases pass.pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts: exit 1 at first (a dependency of the CLI had no build yet); exit 0 after the build,Tests 3 passed (3).pnpm check:dual-build-cjs-loads: exit 3 at first (it reads built output and some packages had nodist/); exit 0 after the dogfood closure build,126 published require entry point(s) across 74 package(s) load.The record with those three reruns reconciles to
101 derived, 101 run, 0 NOT-MEASURED, 0 UNRUN.Among them:
check-adr-0087-registration --base origin/main,check:upgrade-guide,check:spec-changes,check:api-surface,check:error-status-conformance,check:dispatcher-error-vocabulary,check:adr-anchors,check:adr-index,check:issue-citations,check:doc-authoring,check:nul-bytes,check:pm-governed-merges, each exit 0.scripts/pm/overlap-check.mjsansweredVERDICT cleanbefore the first push, andorigin/mainatc385d3bd16merges cleanly and touches none of the changed files.Not run locally, left to CI: the
repovitest project, the workspace type-check lanes and the build job.Dogfood battery on the head
On
7e6689619with a clean tree, as CI spells it:pnpm --filter '@objectstack/dogfood^...' build(lock VERDICTcommand-exit 0), thenpnpm --filter @objectstack/dogfood testwith no shard and no path.Test Files 487 passed | 3 skipped (490)Tests 4129 passed | 68 skipped (4197)command-exit 0, held 1900sHuman Minimum
packages/specholds no runtime logic.packages/spectouched: the migration registry is generated at build and is not tracked;check:generatedreads no stale artifact.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code