Skip to content

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
mainfrom
claude/o5-data-approvals-trunk
Draft

objectstack-fleet[bot] wants to merge 41 commits into
mainfrom
claude/o5-data-approvals-trunk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #37768
Part of #37766
Part of #37767

Trunk moved (seat repo:objectstack#5, area o5-data). This PR replaces #38421, the same closed-state trunk handed back by seat 2 (clock-out brief 7250342397 on #34478). The trunk branch is now claude/o5-data-approvals-trunk, cut from claude/project-thread-yxheps at bfe2df88b and written only by area o5-data. Since the hand-back it carries #37766 slice C (PR #38485, merged into this trunk as 07f0923c5c with --no-ff). Still to land on this trunk before it leaves draft: #37766 slices B and D, #37767 pieces 3–5, #37768 slice C (Release-order lines on those cards). The sections below are #38421's, for slices A and B of #37768 and piece 2 of #37767; the slices added since are described in their own PRs.

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

维护者速读

  • 用户能看到什么变化:对象上写了「哪些状态算已关闭」后,单据一旦进入这些状态(比如发票已付款、已作废),它和它的明细行就不能再被普通用户改、删、挪动明细或加明细,系统返回 409「记录已锁定」;批量操作只要碰到一条已关闭的单据就整批不执行。系统自身的写(汇总重算、审批回写状态)照常落地。没写这个键的对象完全不变。
  • 为什么做:单据关闭态锁定(ADR-0162)的第一、二部分:A 定下这个键和编写规则,B(本次新增)让平台真正按它锁单据,应用不用再手写锁定代码,也第一次能挡住「删一条明细」这种以前挡不住的改动。
  • 出错会怎样:只影响写了这个新键的对象。最坏情况是该锁的没锁(回到今天的样子),或者某个平台内部写被误锁(已逐条列出并测试)。分支在拒绝文案(C 部分)和审批两张卡落地前不合并,所以不会单独发布。
  • 要你做什么:无。有一条覆盖层的发现交座位判断是否要上决策卡(见 Acceptance notes「Overlay」)。

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-order line 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 like fields. 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, the stage-field-kinds.ts precedent), called from the object's superRefine. One located custom issue each, at ['closedStates', FIELD] or ['closedStates', FIELD, i]: a key naming no field of the object; a field that is not a single-value select (another type, radio included, or multiple: true); a select with no inline options (a picklist-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.
  • Studio object form row (Advanced section, JSON row beside uiReadonlyWhen).
  • Liveness row object.closedStates: planned, evidence closed-states.ts#refuseDishonestClosedStates (the refusals, live at parse) — the enable.aiReadable precedent. It turns live, with its runtime proof, in slice B: nothing on this branch reads the key at runtime yet. See Acceptance notes.
  • Regenerated: reference docs (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-core FLS scrub: closedStates classified 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), en regenerated by check-i18n-bundles --write; two derived leaf-count pins moved (+2 leaves in advanced, +1 translated label).
  • Three changesets: @objectstack/spec minor, @objectstack/metadata-core patch, @objectstack/platform-objects patch (the uiReadonlyWhen precedent).

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 direct master_detail lines, 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 is 409 RECORD_LOCKED with reason (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.
  • Wired doors: by-id update and delete (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 composed ReadableIds leaf, else the write's one read of its matched rows under MAX_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).
  • Placement (D10): after the middleware gates, before the before-hooks. A master the write NAMES goes through the caller's own read door first (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)

  • An extension that redeclares a field the served closedStates names, 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.
  • A tenant overlay (the fold's base) may ADD closed values; the served declaration is the package's list with the overlay's added, and a field the package's list names keeps the package's definition where the overlay broke it.

Other

  • Liveness object.closedStates → live, evidence the engine's reads and the dogfood suite; state counts regenerated.
  • Error-code ledger: RECORD_LOCKED registered 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.
  • Changeset @objectstack/objectql minor; the spec changeset gains the ledger line.

After the seat's delta review (7249320091, PASS), head 8e95b36

  • S2: every master check is asked of the store: one existence probe per chunk of ids with the closed predicate in its where and fields: ['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 where lineProbeServes says 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 by a 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']).
  • N2: where the fold restores the package's field over an overlay that broke it, the overlay's added closed values for that field are served only where the package's field declares them.
  • CI on a0d9493: the system-context census row for boundByClosedStates (row 29g on content/docs/permissions/system-context.mdx, register regenerated). The local census had passed before the commit because it walks tracked files only.
  • Carried to slice C by the seat: tests for the assignment-rule and approval-mirror system writes, a plugin-security-level D10 test, and the API names in the developer message.

Engine-derived writes (Done-when list)

Write Context it runs in What the lock does Test
Referential clear of a deleted record's references (set_null) system (reference-cleanup elevates; the clear also carries the referential-clear marker) lands: exactly the cleared field a referential clear lands on a closed record
Recycle-bin relink on restore caller, carrying REFERENTIAL_CLEAR_OPTION lands (a bare reference restore, the clear's inverse) the recycle-bin relink puts a cleared reference back on a closed record, for the caller
Roll-up summary recompute { ...caller, isSystem: true } lands the summary recompute writes the closed invoice in a system context, and lands
Cascade legs of a planned delete caller judged ONCE, at the planned set (D6); legs are not judged again a delete whose cascade reaches a closed record removes no row, with and without transactions
Change Owner (changeRecordsOwner) caller bound: each closed record (and line) is a RECORD_LOCKED failure, the open ones move Change Owner block (4 tests)
Banned-user hand-over (transferUserAssignedWork) caller bound: closed records stay with the user, counted as failures the hand-over of a user's work leaves the closed records …
Assignment rules system lands not added here (system, unbound by D5)
Approval status mirror system, attributed lands measured below

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. ApprovalService finalises the request (engine.update('sys_approval_request', …, { context: SYSTEM_CTX }), approval-service.ts ~6305) and then calls mirrorStatusField (~6312), which issues its own engine.update with 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 / beforeUpdate hook supplies is not judged: the lock runs before the before-hooks (D10), so it judges the master the caller named. Pinned by a 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 declares readableIdsLeaf: 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 a state_machine rule 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-core object-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.
  • Moved pins, each with a history line: compose-stacks-merge-collection-refusal.test.ts and compose-stacks-collection-pipe-arm.test.ts — closedStates is an object-level collection, so composeStacks objectConflict: 'merge' refuses two stacks that declare it differently (new it.each row), 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.ts object 53 → 54 top-level properties; the two platform-objects echo-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.
  • typecheck of spec, metadata-core, platform-objects: exit 0.
  • pnpm --filter @objectstack/spec check:generated: all artifacts up to date (after --fix rebuilt 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) and check:dual-build-cjs-loads (a full build); CI runs both.
  • node scripts/pm/overlap-check.mjs: clean against origin/main, no open PR shares a file.
  • No full dogfood battery: no ! 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.ts 69/69 on a rebuilt dist; fold 13/13; typecheck objectql and dogfood, check:facade-delegation-only, check:system-context-census green.

Head 1f399d9.

  • pnpm --filter @objectstack/objectql exec vitest run: 643/644 files, 14557/14558 tests on the first run; the red file was federated-injected-column-readers.test.ts, which asks every engine use of isFederatedObject() 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.ts against 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.
  • typecheck of objectql (with check:test-typecheck) and dogfood: exit 0.
  • node scripts/pm/dispatch-gates.mjs --ran: 101 derived, 101 run, every one recorded exit 0. First run: 94 green, 7 red, each re-run after its fix: five spec dist-reading gates and check:generated answered exit 3 / 1 on a spec dist older than the ledger edit (green after pnpm --filter @objectstack/spec build); check:facade-delegation-only was red because engine.ts grew 7 lines past its ceiling (the new host members now share existing lines, 6856 ≤ 6857).
  • pnpm check:system-context-census: OK (the lock reads isSystem through boundByClosedStates, inside the census).
  • node scripts/pm/overlap-check.mjs: clean against origin/main, no open PR shares a file.
  • No full dogfood battery: no ! in the title and no (narrowing) arm.

Slice A CI on 5d8b45b: 65 checks passed, 11 skipped, none failed.

Acceptance notes

  • Overlay (card Done-when, for the seat). Verified and pinned: an overlay may ADD 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 is may ADD: an overlay that declares closed values of its own is served with them.
  • The fold "refuses" by keeping the field, not by failing registration. An extension is a separate package that may load in any order; failing its whole registration over one field would take its other objects and fields down with it. The redeclaration of the named field is dropped, the fold logs it once with the package id, and the rest applies.
  • D10 gate placement is proven in the engine by order (the lock runs inside the write after the middleware chain and before the before-hooks, pinned by 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".
  • Liveness (slice A: 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. A live row now would cite a consumer that does not exist. Slice A set the row planned; slice B flips it to live with the engine reads and the dogfood suite as evidence.
  • Narrow readings of D1, decided here (small, listed for the seat): radio is refused (D1 says select); a picklist-backed select is refused because its options are not on the object and this is the one door every save passes (the stageField precedent); an empty map closedStates: {} 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 a formula field, never a select.
  • Publish door. The removal and retype refusals ride the object's whole-document parse, which the save and publish door runs (pinned at getMetadataTypeSchema('object')). A field removed through a tool that rewrites the object document reaches the same parse.
  • Not in this slice (the card's other Done-when lines): the overlay question moved to slice B (claim revision 7248339226) and is answered above. The 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.
  • The Metadata-protocol line is added, the card's own value (the seat's claim revision 7248339226 settles it).
  • Branch is the trunk claude/o5-data-approvals-trunk (cut from seat 2's claude/project-thread-yxheps), not claude/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; after pnpm --filter @objectstack/objectql build, pnpm --filter @objectstack/dogfood exec vitest run test/closed-state-lock.test.ts — expect 69 passed.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (CI).
  • 4. One issue, one branch off an up-to-date main, one pull request (the card's trunk branch).
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2

…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>
…ts status mirror

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
@github-actions github-actions Bot added documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 29, 2026
…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
… 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
… 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
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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr

Seat gate on this trunk → main PR · 2026-11-29T10:12Z

…-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
…ing door, through the first request's one judge (ADR-0162 item 7, slice N45) (#38562)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:data size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants