Repository navigation
feat(objectql): a record in a closed state, and its lines, are closed to change (closedStates, ADR-0162) — trunk - #38497
Draft
objectstack-fleet[bot] wants to merge 41 commits into
Draft
objectstack-fleet[bot] wants to merge 41 commits into
objectstack-fleet[bot] wants to merge 41 commits into
Conversation
…s (ADR-0162 D1) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…nd generated docs (ADR-0162 D1) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…ale, changesets (ADR-0162 D1) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…the closedStates row Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…tes (ADR-0162 D1) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…operty, closedStates (ADR-0162 D1) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…leaves on its status mirror (ADR-0162 item 8, readings 3-6) A node failing after a decision strands the run and the field keeps the first step's outcome; a later step that cannot open (empty slate under `fail`, another approval pending) strands it, or completes the run down a `fault` edge with the step never asked; a parent cancelled above a pending child leaves the decision admitted, the door reporting a clean resume and the parent's next step never asked. The dead-run sweep changes nothing after any of them. Claude-Session: https://claude.ai/code/session_01L6bhgX7z5dcSkTqEAWNMsP Co-authored-by: Claude <noreply@anthropic.com>
…loses on is reported, and refuses an approval's first opening (ADR-0162 item 8) On a field the object closes on at `approved` or `rejected`, the mirror's write that a validation rule, an option's `visibleWhen` or a hook refuses is no longer swallowed at `warn`. At an approval's first request the `pending` is written right after the row; a refusal voids the row as `cancelled`, empties the approver index, notes the timeline and fails the run at that step with the refusal's own message. Every other refused write is reported: an `error` line, a line with no actor on the request's timeline, and a notice to the organization's administrators (`approval.status_mirror_refused`). Objects with no closed state keep the `warn`. Claude-Session: https://claude.ai/code/session_01L6bhgX7z5dcSkTqEAWNMsP Co-authored-by: Claude <noreply@anthropic.com>
…ouble ledger for the refused-mirror writes and the readings pins Claude-Session: https://claude.ai/code/session_01L6bhgX7z5dcSkTqEAWNMsP Co-authored-by: Claude <noreply@anthropic.com>
… to change (ADR-0162 D2-D7, D10) Every write a system context does not make is judged against the stored row: an update or delete of a closed record, and a line create, update, delete or move under a closed master, are refused 409 RECORD_LOCKED. A many-row write is refused whole before any row is written, by one existence probe or the write's one read of its matched rows under the per-row ceiling. A cascade that reaches a closed record removes no row; a restore under a live closed master is refused. The lock runs after the middleware gates and before the before-hooks. Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…st (ADR-0162 D1) An extension's redeclaration that removes, retypes, makes multi-value or narrows a field the served declaration names is refused at the fold (the field stands, the fold logs once, the rest of the extension lands). A tenant overlay may add closed values and may not shorten the package's list or break a field it names. Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…jectql (ADR-0162) The liveness row flips to live with the engine's reads and the dogfood suite as evidence; state counts regenerated. The error-code ledger names objectql as an emitter of RECORD_LOCKED. Changeset for objectql (minor). Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…r (row 29g, ADR-0162 D5) The census reads boundByClosedStates as an elevation read site; the row names it and the site register is regenerated. Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…is closed (ADR-0162 D4) The master check is one existence probe per chunk of ids with the closed predicate in its where, never a read of state columns tested in process. The cascade set is judged the same way: one probe per chunk for its own state, and for its lines the predicate door's semi-join where the store runs it; only a store that cannot keeps the read of the lines' keys, then one probe of their masters. Where the fold restores a package's field over a tenant overlay, the overlay's closed values for that field are served only where the package's field declares them. Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…DR-0162 item 8) Claude-Session: https://claude.ai/code/session_01L6bhgTCFhayR5cBZXM7XPP Co-authored-by: Claude <noreply@anthropic.com>
…ts status mirror Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…s writers Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…n its status mirror Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…o request can hold Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
… trunk (ADR-0162 item 7) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…o-steps stamp (slice B) ADR-0162 Execution item 7 "The check", as revised on 2026-11-27. At an approval's first request the plugin reads the approval whole (the root run's flow and every subflow/map body, to any depth) and: - stamps the between-two-steps set on the request (new engine-written column between_steps_json); later requests of the approval copy it; - refuses the opening, VALIDATION_FAILED with one sentence per gap in the run's locale, where a step mirrors onto a field its object closes on at a request status and a D5 condition fails, where a flow cannot be read, or where the host runs no job service. Not judged: no object declares closedStates; no root run; a later request; a request that cannot be placed. The writing-node condition is withdrawn and pinned as not refused. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
…bjectstack-ai/objectstack into claude/project-thread-fkdrk9
9 tasks done
…e changeset is patch The abandoned-request status-mirror tests (merged from the trunk) now note the plugin's sweeps on their hand-built service, as a host with a job service does, and open the no-pending arm before the object declares closedStates, the case the opening check does not judge. The changeset is graded patch: the metadata protocol is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
Name the optional `locale` member of openNodeRequest's input among the widened surface, and say that an approval one of whose flows cannot be read is refused wherever some object declares closedStates. Prose only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
…DR-0162 item 7) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
… over, and judge it at each door Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pigknx7rC8rXnA3my
… the mark's translations and changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pigknx7rC8rXnA3my
… a subflow body's routed failure; census regenerated Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pigknx7rC8rXnA3my
…e a gap is about that field The host's gap and an unreadable flow are raised on an object that declares closedStates on any field; where they are the only gaps, the opening refusal's lead now says the approval can act on an object that declares closedStates, in all 11 locale packs of the plugin's catalog. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…s and holes Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
… on its approval field only where a gap is about that field The service's warn line at every opening refusal now chooses its wording by the same predicate as the refusal's lead, exported from approval-opening-refusal.ts, so a refusal whose only gaps are the host's or an unreadable flow no longer logs that the object closes on its approval field. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…ve an observation an ablation turns red The two-step case now records every value written to the field: the second step's opening writes `pending` straight after the first decision, so the field read alone could not tell a held-back decision from a written one. The two cannot-tell cases assert the reason the door logs, since a run that is advancing and a status the plugin does not place answer alike. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pigknx7rC8rXnA3my
… refusing end is an end A run that ends on an `end` declaring `outcome: 'refused'` reached an end of the flow, as a completed run did; it logs no step for the `end`, so its last step is the approval just decided and was read as a stop between two steps, abandoning a rejection. A cancelled run, or one failed by a child or settled as unresumable, logs nothing after the node it stood on, so the stop is its last top-level step; an earlier failure the flow routed on is no longer taken for it. The approval's requests are read newest first, so the latest is in the window however many there are, and an auto-rejection the door abandoned no longer also sends the auto-rejected notice. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pigknx7rC8rXnA3my
8 tasks done
What the check at an approval's first request asks of the mirror field and the flow, what a refused opening is for the submitter, what an abandoned approval leaves, and how an approval that does not mirror onto the closing field and an approval per map item behave. Read against the trunk's approvals plugin and ADR-0162 as revised. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…runk (ADR-0162 item 7) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…into claude/project-thread-wug0sh
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
This was referenced Nov 29, 2026
Contributor
Author
…-state trunk (ADR-0162 item 8) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
…te trunk (ADR-0162) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
8 tasks done
…ing door, through the first request's one judge (ADR-0162 item 7, slice N45) (#38562)
This branch has not been deployed
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.
Requested by Leehom · project thread
Part of #37768
Part of #37766
Part of #37767
Clause-②: yes (widening: one new optional authorable key,
ObjectSchema.closedStates, and the engine's enforcement of it)Metadata-protocol: added
Skills-docs: follow-up #38425
维护者速读
What changes
Slice A — the key (ADR-0162 D1)
Slice A of #37768 (ADR-0162 D1, the key), on the card's trunk branch. Slices B (the engine's judgement, D2–D7, D10) and C (the refusal, D8) land on this same branch; it does not merge before the card's
Release-orderline is met, so the key is never published without its enforcement (ADR-0078, ADR-0162 D10).Spec (
packages/spec)ObjectSchema.closedStates: optional map from a field of the object to the list of that field's values that close a record, e.g.{ status: ['paid', 'void'], approval_status: ['approved'] }. The record is guarded against a__proto__key likefields. No default, so no parsed object grows a key. TSDoc and.describe()state the contract D1–D5 give.refuseDishonestClosedStates(src/data/closed-states.ts, outside the barrel, thestage-field-kinds.tsprecedent), called from the object'ssuperRefine. One locatedcustomissue each, at['closedStates', FIELD]or['closedStates', FIELD, i]: a key naming no field of the object; a field that is not a single-valueselect(another type,radioincluded, ormultiple: true); a select with no inlineoptions(apicklist-backed one); an empty list; a value that is not one of the field's options; a repeated value. Because the object document is judged whole, the same refusals cover removing or retyping a named field and removing a listed option: the next version leaves a declaration that names what the edit took away.uiReadonlyWhen).object.closedStates:planned, evidenceclosed-states.ts#refuseDishonestClosedStates(the refusals, live at parse) — theenable.aiReadableprecedent. It turnslive, with its runtime proof, in slice B: nothing on this branch reads the key at runtime yet. See Acceptance notes.content/docs/references/data/object.mdx,packages/spec/docs/references/**), the authorable-surface record (data/Object:closedStates), liveness state counts (object: planned 1 → 2).Other packages
metadata-coreFLS scrub:closedStatesclassified as a map keyed by this object's fields (recordOf(keep, true)): an entry whose field is denied to the caller is left out of the served definition, an emptied map is deleted, and the values (option codes) are literals, never read as references.platform-objects: the form row's label and help text authored in all ten translated metadata-forms locales (ar, de, es-ES, fr, ja-JP, ko, pt-BR, ru, zh-CN, zh-Hant),enregenerated bycheck-i18n-bundles --write; two derived leaf-count pins moved (+2 leaves inadvanced, +1 translated label).@objectstack/specminor,@objectstack/metadata-corepatch,@objectstack/platform-objectspatch (theuiReadonlyWhenprecedent).Slice B — the engine's judgement (ADR-0162 D2–D7, D10)
Engine (
packages/objectql)closed-state-lock.ts(new): the one judgement every write door calls. A record is closed when its STORED row holds a listed value (D2); its unit is the record plus its directmaster_detaillines, and a junction row is a line of both masters (D3). Every write a system context does not make is bound, and a write with no context is bound (D5). The refusal is409 RECORD_LOCKEDwithreason(record_closed·master_closed·cascade_reaches_closed·cannot_judge),object,blockingObject,lockReason: 'closed_state'; the message names no id and no state value. D8's sentences are slice C.engine-update.ts,engine-delete-and-aggregate.ts, judged against the prior row the write already reads); predicate update and delete (refused whole before any row is written: one existence probe on the record, and for lines one semi-join probe where the store compiles the composedReadableIdsleaf, else the write's one read of its matched rows underMAX_BULK_PER_ROW_HOOK_ROWS); insert and insertMany (a line under a closed master; partial-mode insertMany is refused whole); the cascade set where it is planned (engine-cascade-planning.ts, D6); restore (recycle-bin/restore.ts, D7).masterDetailHeadersCallerReads), so an unreadable master answers as before and the lock never confirms that a record the caller cannot read exists; a STORED master is read by the engine.closed-state-values.ts(new):closedValuesOf, split out so the registry does not import the write path.Registry fold (seat review S1,
registry-closed-state-fold.ts, new)closedStatesnames, and removes it, retypes it, makes it multi-value or narrows its options past a listed value (or leaves it with no inline options), has THAT redeclaration refused: the field stands as the fold had it, the fold logs it once naming the package, and the rest of the extension lands. One test per case. The four guarantee sentences of slice A stand as written.Other
object.closedStates→live, evidence the engine's reads and the dogfood suite; state counts regenerated.RECORD_LOCKEDregistered under@objectstack/objectql(third emitter beside plugin-approvals and rest). This is a D8 ledger line pulled forward because B already throws the code; C keeps the sentences.@objectstack/objectqlminor; the spec changeset gains the ledger line.After the seat's delta review (7249320091, PASS), head 8e95b36
whereandfields: ['id'](anyClosedAmong), never a read of state columns tested in process. The cascade set is judged the same way: one probe per chunk for its own state, and for its lines the predicate door's semi-join wherelineProbeServessays the store runs it; only a store that cannot keeps the read of the lines' keys, then one probe of their masters (D4's stated fallback). Pinned per shape bya cascade that reaches a line of a closed record is refused …(probe store: no read of the master; no-probe store: one probe carrying the predicate,fields: ['id']).boundByClosedStates(row 29g oncontent/docs/permissions/system-context.mdx, register regenerated). The local census had passed before the commit because it walks tracked files only.message.Engine-derived writes (Done-when list)
set_null)a referential clear lands on a closed recordREFERENTIAL_CLEAR_OPTIONthe recycle-bin relink puts a cleared reference back on a closed record, for the caller{ ...caller, isSystem: true }the summary recompute writes the closed invoice in a system context, and landsa delete whose cascade reaches a closed record removes no row, with and without transactionschangeRecordsOwner)RECORD_LOCKEDfailure, the open ones movetransferUserAssignedWork)the hand-over of a user's work leaves the closed records …The two writes that run in the CALLER's context (Change Owner and the hand-over) are bound, not exempted, and are reported to the seat as the card asks.
Measured: the approval mirror and the request's finalisation
They do not share one unit of work.
ApprovalServicefinalises the request (engine.update('sys_approval_request', …, { context: SYSTEM_CTX }),approval-service.ts~6305) and then callsmirrorStatusField(~6312), which issues its ownengine.updatewith no transaction handle and swallows a failure into a warning (approval-service.ts~4989–5015). The same order holds at recall, reject, return and the dead-run abandon (~7110, ~7726, ~7768, ~9810). A mirror that fails leaves a finalised request and an unmirrored record. The lock does not change this: the mirror is a system write and lands on a closed record.Hook-supplied master (N14)
A master a
beforeInsert/beforeUpdatehook supplies is not judged: the lock runs before the before-hooks (D10), so it judges the master the caller named. Pinned bya master a beforeInsert hook supplies is not judged by the lock.Why
ADR-0162 (merged as
972114df), Execution item 1, on the maintainer's rulings recorded on #32004 (7073676422) and #36253 (7200732942, 7201405662, 7205949718). Apps that must freeze a decided document hand-code it today and cannot guard the removal of a line at all.Tests
Slice B
packages/qa/dogfood/test/closed-state-lock.test.ts(new, 69): on SQLite in two store shapes, each pinned, a store that runs the line probe and one that declaresreadableIdsLeaf: false(the MongoDB / OData shape). Every row of D4's table, for a record and for a line, single-row and many-row, on both shapes; the read shape of each (probe: one statement on the line table; no probe: the matched rows plus one read of their masters); the three cannot-judge cases (a master named by something that is not one id, a state read that fails, a many-row line write past the per-row ceiling with 10,001 seeded lines, with the probe-store control that lands); the closing write lands whole and the next is refused; no context refused; system writes, deletes and restores; the cascade removes no row with and without transactions; restore; engine-derived writes; a refused write runs no before-hook; an object that declares nothing reads nothing extra; Change Owner and the hand-over.packages/objectql/src/registry-closed-state-fold.test.ts(new, 13): the four extension breaches each refused with the rest of the extension applied, two controls; overlay may add, may add to an object with none, may not shorten (key left out, fewer values), may not break a named field, relabel control, and an overlay's added value for a field the package's version of which is restored is not served (N2). Measured: with the two guards disabled, 7 of the first 12 fail.Slice A
packages/spec/src/data/closed-states.test.ts(new, 22 cases): the ADR example parses and keeps its value; absent stays absent; no tie to astate_machinerule either way;create()keeps it; each refusal above, one located issue each, with its message's subject; one issue per offending entry with a sound entry untouched; removing the field, retyping it, making it multi-value and removing a listed option each refused, with the control that removing an unlisted option lands; the save and publish door (getMetadataTypeSchema('object')) and the stack door refuse at the same path; a line object needs no declaration and may declare its own.metadata-coreobject-schema-fls-references.test.ts: a denied field's entry dropped and the readable one kept; a map left empty deleted; CONTROL: a value spelled like the denied field is served as written.compose-stacks-merge-collection-refusal.test.tsandcompose-stacks-collection-pipe-arm.test.ts—closedStatesis an object-level collection, socomposeStacksobjectConflict: 'merge'refuses two stacks that declare it differently (newit.eachrow), and it is the first collection key on the real shape behind a preprocess stage, which the landed reading carries and the in-only reading does not (the invariance case now pins exactly that);protocol.meta-types-degenerate-derivation.test.tsobject 53 → 54 top-level properties; the twoplatform-objectsecho-decision counts.Slice A local runs (head 5d8b45b)
pnpm --filter @objectstack/spec test: 913/915 files on the first run; the two red files were the composeStacks pins above, re-run green after the move (92/92).pnpm --filter @objectstack/metadata-core --filter @objectstack/platform-objects test: 29/29 files, 1121 tests; 130/130 files, 2218 tests.pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.meta-types-degenerate-derivation.test.ts: 18/18.typecheckof spec, metadata-core, platform-objects: exit 0.pnpm --filter @objectstack/spec check:generated: all artifacts up to date (after--fixrebuilt the dist; it wrote nothing).pnpm check:i18n: OK, all bundles in sync.node scripts/pm/dispatch-gates.mjs --ran: 122 derived, 120 run, every one exit 0; 2 NOT MEASURED (exit 3, prerequisite: other packages' builds) —check:skill-examples(client SDK dist) andcheck:dual-build-cjs-loads(a full build); CI runs both.node scripts/pm/overlap-check.mjs: clean againstorigin/main, no open PR shares a file.!in the title and no(narrowing)arm.Slice B local runs
On 8e95b36: objectql full suite 644/644 files, 14559/14559 tests; dogfood
closed-state-lock.test.ts69/69 on a rebuilt dist; fold 13/13; typecheck objectql and dogfood,check:facade-delegation-only,check:system-context-censusgreen.Head 1f399d9.
pnpm --filter @objectstack/objectql exec vitest run: 643/644 files, 14557/14558 tests on the first run; the red file wasfederated-injected-column-readers.test.ts, which asks every engine use ofisFederatedObject()for a disposition: the line probe's federated-master decline got its row (exempt, reads no row) and the file re-ran green (5/5).pnpm --filter @objectstack/dogfood exec vitest run test/closed-state-lock.test.tsagainst a rebuilt objectql dist: 67/67.pnpm --filter @objectstack/objectql exec vitest run src/registry-closed-state-fold.test.ts: 12/12; with the two fold guards disabled, 7 of 12 fail.typecheckof objectql (withcheck:test-typecheck) and dogfood: exit 0.node scripts/pm/dispatch-gates.mjs --ran: 101 derived, 101 run, every one recordedexit 0. First run: 94 green, 7 red, each re-run after its fix: five spec dist-reading gates andcheck:generatedanswered exit 3 / 1 on a spec dist older than the ledger edit (green afterpnpm --filter @objectstack/spec build);check:facade-delegation-onlywas red becauseengine.tsgrew 7 lines past its ceiling (the new host members now share existing lines, 6856 ≤ 6857).pnpm check:system-context-census: OK (the lock readsisSystemthroughboundByClosedStates, inside the census).node scripts/pm/overlap-check.mjs: clean againstorigin/main, no open PR shares a file.!in the title and no(narrowing)arm.Slice A CI on 5d8b45b: 65 checks passed, 11 skipped, none failed.
Acceptance notes
closedStates, and before this branch it already could (an overlay body is a full object document, and the fold serves it as the base), so a subscriber's admin can freeze records of a packaged object in states the package did not close. Before the guard an overlay could also SHORTEN the package's list (leave the key out or list fewer values), which unlocked what the package locks; it no longer can. Whether "may add" stays is a product question: if it changes what a subscriber may do to a packaged document, it goes back to the seat as a decision card, as the card says. The pin ismay ADD: an overlay that declares closed values of its own is served with them.a refused write runs no before-phase hook); no plugin-security-level test was added for "a caller denied the object gets the same answer on a closed record".planned; slice B:live) (confirmed by the seat, claim revision 7248339226). The claim's file surface names "the liveness ledger row with its runtime proof (ADR-0054)". On this slice there is no runtime reader to prove: the engine's judgement is slice B. Aliverow now would cite a consumer that does not exist. Slice A set the rowplanned; slice B flips it tolivewith the engine reads and the dogfood suite as evidence.radiois refused (D1 saysselect); apicklist-backed select is refused because its options are not on the object and this is the one door every save passes (thestageFieldprecedent); an empty mapclosedStates: {}is accepted and closes nothing (D1 refuses an empty list, not an empty map). "Stored" needs no check of its own: a computed value is aformulafield, never aselect.getMetadataTypeSchema('object')). A field removed through a tool that rewrites the object document reaches the same parse.skills/**follow-up is skills: the data skill teaches the closedStates key (after #37768) #38425; the docs card (item 5) and an eval that exercises a declaration are owed by the card, named here as the card asks.added, the card's own value (the seat's claim revision 7248339226 settles it).claude/o5-data-approvals-trunk(cut from seat 2'sclaude/project-thread-yxheps), notclaude/issue-37768-*.Verification
Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/data/closed-states.test.ts— expect 22 passed;pnpm --filter @objectstack/objectql exec vitest run src/registry-closed-state-fold.test.ts— expect 13 passed; afterpnpm --filter @objectstack/objectql build,pnpm --filter @objectstack/dogfood exec vitest run test/closed-state-lock.test.ts— expect 69 passed.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI).main, one pull request (the card's trunk branch).packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2