Repository navigation
Description
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Filing gate: ③ maintainer-directed · Source: ADR-0162 Execution item 1 (accepted by merge 972114d)
维护者速读
- 做什么:让应用在对象上写一行,声明哪些状态算「已关闭」(比如已付款、已审批通过),平台从此在每个入口拒绝对这类单据及其明细行的手工修改和删除。
- 用户会看到什么:已关闭的单据不能再改、不能删,明细行不能增、改、删、挪;提示语说明单据已关闭;系统自己的动作按钮和以系统身份运行的自动化不受限。
- 不做会怎样:需要冻结已决单据的应用只能继续各自写代码去拦,而且删除明细行这一种情况用代码也拦不住。
- 顺序:这张卡和审批相关的两张卡必须同一次发布,声明不能早于平台对它的执行上线。
What happens
On main there is no way to declare that a document is closed. The platform unlocks a record when its approval is decided (git grep -n "the record unlocks" origin/main -- content/docs/automation/approvals.mdx, two hits), and an app that needs a decided document frozen hand-codes it: the showcase carries three paid-invoice line guards in examples/app-showcase/src/data/hooks/index.ts. Removing a line cannot be guarded without code. git grep -n closedStates origin/main -- packages ui examples content returns nothing.
ADR-0162 (merged as 972114df) decides the key and where it is enforced. The maintainer ruled the rule on 2026-11-22 (option C, ruling record 7073676422 on #32004) and the record's open points on 2026-11-26: 「全部按推荐」 (7200732942), 「平台堵住:撤回不恢复关闭值」 (7201405662) and 「平台拒绝这种配置」 (7205949718), all on #36253.
Expected
The card has three slices. They ship in one release: the key is never published without its enforcement (ADR-0078, ADR-0162 D10).
A. The key (D1).
closedStatesat object level: a map from a field of the object to the list of that field's values that close a record.- The field is a stored, single-value
selectfield of the object. Each listed value is one of its declared options. A list is not empty and repeats nothing. - A declaration that breaks one of those rules is a named refusal at parse and at publish. So is removing or retyping a field, or removing an option, that a declaration still names.
- Optional. An object without the key behaves as today. A line object declares nothing to be closed with its master, and may declare its own.
- No tie to a
state_machinerule in either direction. - The form row, the reference docs and the liveness ledger row with its runtime proof (ADR-0054).
B. The engine's judgement (D2 to D7, D10).
- Closed is read off the stored row: a record is closed when one named field holds one of its listed values. Nothing is stored for it, and there is no backfill.
- The unit is the record and every row that points at it through a
master_detailfield, one level deep. Lookups and satellite objects are not in it. - A bound writer's update, delete, line create, line update, line delete and line move are refused as D4's table says. An update is judged by the keys it carries. A many-row write is refused whole before any row is written.
- A many-row write is judged by one existence probe asked of the store. A store that cannot run the line probe is answered from the one read of the matched rows that exists, under the engine's per-row ceiling. What cannot be judged is refused (D4 names the three cases).
- The lock is judged on the row as stored when the write reaches it, inside the write's unit of work. The write that closes a record lands whole.
- Who is bound (D5): every write not made in a system context, a write with no principal included. No grant opens a closed record. The state field is frozen with the rest. The pending lock's two passes do not carry over.
- Delete (D6): a bound writer's delete of a closed record is refused. A delete whose cascade would reach a closed record or a line of one is refused whole, where the cascade is planned and before the first row is removed. A system context deletes.
- Writes that are not a caller's change (D7): a referential clear lands, exactly the cleared field at the value the engine wrote. Restore puts an entry back as it stood, and refuses to put a row back under a live closed master that is not part of the entry. Change Owner and the hand-over of a banned user's work are bound and report each closed record among their failures.
- Placement (D10): after the object-permission and row-access gates, before the before-phase hooks. A master a write names is consulted only when the caller's own read door returns it. A master the stored row already hangs under is judged on its stored state, whoever the writer is. An object that neither declares the key nor is a line of one that does reads nothing extra.
C. The refusal (D8).
- One code,
409 RECORD_LOCKED. The engine package becomes an emitter of it in the error-code ledger. - Its own sentence family in the Operation Message Catalog, in every locale the catalog carries, with the four forms the pending lock's sentence has. The title is the one the writer would be served under its own field permissions, never the title as stored. The sentence carries no record id, API name or state value.
- The cascade's own sentence, in every locale: it names the record the caller asked to delete and the label of the object in the way, and nothing else.
- The upload-link door gains a closed-state sentence in every locale that door carries. Choosing between its two sentences by the lock read's reason lands with the lock-read card (item 2).
Done when
- Slice A: the schema accepts the key, each authoring refusal has a test, and the form row, reference docs and liveness row with its runtime proof are in the diff.
- Slice B: every row of D4's table has a test for a record and for a line, for a single-row and a many-row write, on a store that runs the probe and on one that does not.
- The three "cannot be judged" cases of D4 are each refused, with a test.
- A write that closes a record and carries other fields lands whole. The next write is refused.
- A write with no principal is refused. A system context writes, deletes and restores.
- A delete whose cascade reaches a closed record removes no row, on a store with transactions and on one without.
- The engine-derived writes that reach a closed record are listed in the PR, each with the context it runs in and a test. One that turns out to run in the caller's context is reported to the seat and not exempted on the spot (D7).
- Whether a master that a before-phase hook supplies is judged is stated in the PR and pinned by a test. The reference gate treats only a caller-supplied value as the caller's (review note N14).
- Measured and reported: whether the approval status mirror's write and the request's finalisation share one unit of work (the first of the four readings under ADR-0162 "Execution").
- Verified and pinned: whether a customization overlay may add
closedStatesto an installed package's object, and that it may not shorten a package's own list. If the answer changes what a subscriber can do to a packaged document, it goes back to the seat as a decision card. - Slice C: the ledger row, both sentence families and the upload-link sentence exist in every locale, and no refusal carries a title the writer may not be served.
- The key is authorable, so three things are named in the PR: the
skills/**follow-up card, the docs (item 5), and an eval that exercises a declaration. - The release carries items 7 and 8 with it (see Blocked-by).
Category ③: maintainer-directed. A build card of ADR-0162, child of #36253.
Grade: area:data · Feature · n/a (not a defect) · reach: every app that declares the key, none before · evidence: read (ADR-0162 Readings at 6c290d3af7, premise re-read on main at 972114df)
Suggested-grade: p2 · the grade of #36253, which the maintainer ruled; this card is the feature itself
Size: L (three packages: spec, the engine, the message catalog and its locales). Split along slices A, B and C before dispatch, on one trunk branch.
Business reason: carried from #36253. Apps that must freeze a decided document hand-code it today and cannot guard a line's removal at all.
Reader: seat 2 (repo:objectstack#2), one card thread per slice, effort high.
Release-order: #37766 (item 7) and #37767 (item 8) (release order: the key is not published before an approval is refused on a field that cannot show it, and before an abandoned or stranded approval can no longer leave a closed value behind). On a trunk branch this card's slices land first and the trunk merges last.
Clause-②: yes (widening). A new key on a published schema, a new emitter of a published code, new catalog entries. Nothing an existing app wrote is refused.
Metadata-protocol: added
Dedupe: searched closedStates (all issues): 1 hit, #36253 itself. Searched "closed state" lock (open issues): no other card on this mechanism.
Related: #36253, PR #37606 (ADR-0162), #24731 (the showcase guards), #35755 (the pending line lock).
Activity
objectstack-fleet commentedon Nov 27, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in area:data · domain:spec · Feature · priority:p2 ·
pm:queue· size M; rationale: closedStates item 1. The object key and the engine's enforcement of it are released together (ADR-0162), and the other children of #36253 build on it. p2.objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Claim: PM loop round 10 · 2026-11-28T23:51Z · slice A of three
Picked from
pm:queueon the maintainer's order in this seat's project, verbatim: 「开一个专区,接手 area:data 并发3」 (area declaration 7247668950).Session:
session_01L6bhgV6i8jfWwSXjpWJrjAThread session:
session_01L6bhgTCFhayR5cBZXM7XPPAccount:
os-salesBranch:
claude/project-thread-yxheps(frommain; the card's trunk branch: B and C land on it, and its draft PR does not merge before the Release-order line is met)Domain:
domain:specSeat:
repo:objectstack#2Area:
s2-dataFile surface (slice A, D1): the object schema in
packages/spec/src/**(closedStates), its authoring refusals at parse and at publish (including removing or retyping a named field or option), the generated baselines, the object form row, the reference docs, the liveness ledger row with its runtime proof (ADR-0054), their tests; one changeset.Container & model:
M,mode:thread,model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate",effort: high(reason: the thread session serves claude-opus-5-5 at effort high)Clause-②: yes (widening: a new authorable object-level key is published; one contract-review-tier review owed)
Metadata-protocol: widened (
closedStatesis new authorable metadata; changeset minor)Responsibility: slice A's Done-when line on the card; the key is not released before B and C share the release (ADR-0078, ADR-0162 D10).
Thread-read: 7208033749
Serial constraints cleared: no open PR of this seat edits these files (seat read); the thread runs
scripts/pm/overlap-check.mjsbefore its first push.The PR says
Part of #37768until slice C.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#2 · os-sales · session_01L6bhgTCFhayR5cBZXM7XPP
os-dev-report
{ "issue": 37768, "status": "done", "branch": "claude/project-thread-yxheps", "pr": "https://github.com/objectstack-ai/objectstack/pull/38421", "session": "session_01L6bhgTCFhayR5cBZXM7XPP", "premise_still_valid": true, "summary": "Slice A only, as claimed (7247708428), head 5d8b45b76, draft PR 38421 says Part of 37768 and does not merge before the card's Release-order line. ObjectSchema.closedStates (a map from a field to its closing values, __proto__-guarded, no default) with refuseDishonestClosedStates in packages/spec/src/data/closed-states.ts, called from the object's superRefine: one located issue each for a key naming no field, a field that is not a single-value select (radio and multiple: true included), a select with no inline options, an empty list, a value that is not an option, a repeated value; the same refusals cover removing or retyping a named field and removing a listed option, since the next version is judged whole. Studio form row (Advanced, JSON) translated in the ten translated locales; FLS scrub classifies the key as field-keyed (denied entry dropped, empty map deleted); liveness row planned (the refuser as evidence, flips to live with the runtime proof in slice B); generated docs, authorable-surface and state counts; three changesets (spec minor, metadata-core and platform-objects patch).", "tests": "On 5d8b45b76 (locked runs): spec closed-states.test.ts 22/22 (new); spec full suite 913/915 files first run, the two red files were composeStacks collection pins that closedStates moves, updated with history lines and re-run 92/92; metadata-core 29/29 files 1121 tests (3 new FLS cases); platform-objects 130/130 files 2218 tests (two echo counts moved); metadata-protocol protocol.meta-types-degenerate-derivation.test.ts 18/18 (object 53 to 54 properties); typecheck spec, metadata-core, platform-objects exit 0. No ablation: the refusals are new behaviour pinned by their own cases with controls, nothing existing was retuned.", "gates": "dispatch-gates --ran on the final change set: 122 derived, 120 run, all exit 0; 2 NOT MEASURED (exit 3, prerequisite): spec check:skill-examples (client SDK dist absent) and check:dual-build-cjs-loads (needs a full build), CI runs both. check:generated up to date after --fix rebuilt the dist (wrote nothing); check:i18n OK; overlap-check clean (origin/main c610020e, no open PR shares a file). CI check-runs on the PR: not read yet, the PR was just opened.", "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm", "mcp_calls": "1 — get_session (claude-code-remote, read). Zero MCP GitHub calls.", "api_writes": "1 — pr_create through the fleet-write relay (request fw-20261129T004234Z-b18d55, run 46207694089), plus this report through post-stamped. git push is not a REST write.", "open_questions": [ { "question": "Metadata-protocol line: the claim reads widened, which is not in the closed vocabulary (added, narrowed, semantic, none). The PR and the changesets carry added, the card's own value. Keep added?", "options": [ "A keep added", "B another value" ], "recommendation": "A, because added is the card's value and the only spelling the gate reads for a new key" }, { "question": "The overlay Done-when line (may a customization overlay add closedStates to an installed package's object, and not shorten a package's list) is not in slice A's claimed surface and was not read. Which slice carries it?", "options": [ "A slice B", "B a slice of its own on the trunk", "C slice A, as a delta" ], "recommendation": "A, because the overlay merge is runtime and slice B already reads the stored declaration" } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: seat · the skills/** follow-up card, the docs card (ADR-0162 item 5) and an eval that exercises a declaration are owed by the card; Skills-docs line reads follow-up owed until the seat files the skills card" ] }objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Claim amendment · 2026-11-29T00:46Z · amends claim 7247708428
Writes:
Metadata-protocol: added(the closed vocabulary's word; the claim's "widened" was not in it). The liveness row lands asplannedin slice A, with the authoring refusal as its evidence: slice A has no runtime reader, and slice B turns itlivewith its runtime proof on this same trunk before the key is released. The card's overlay Done-when (whether a customization overlay may addclosedStatesor shorten a package's list) moves to slice B. Theskills/**follow-up is carded by the seat and named in the PR'sSkills-docs:line.Clause-②: yes (widening)and every other line of the claim stand.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Claim amendment · 2026-11-29T00:59Z · amends claim 7247708428 · seat call on contract review 7248480527, S1
Writes: S1 closes on this trunk, in slice B, not in slice A. Slice A refuses a declaration whose field or option is gone wherever the object document is parsed; the registry fold that lays another package's extension over an owner's object does not re-run that refusal. Slice B gains its own line: the fold refuses an extension that removes, retypes or narrows the options of a field a
closedStatesentry names, with a test for each, and the four sentences that state the guarantee (the key's TSDoc,.describe(), the form help text, the refuser's docblock) stay as written because the key is not released before B lands. If slice B cannot refuse it at the fold, it comes back to the seat before the sentences are narrowed. A delta review on the trunk's final head writesS1: closed — …. N1 is an accepted deviation. Every other line of the claim stands.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Claim amendment · 2026-11-29T00:59Z · amends claim 7247708428 · slice B follows on the same thread and trunk
Writes: Responsibility widens to slice B (the engine's judgement, D2–D7 and D10) once slice A's checks are green, on
claude/project-thread-yxheps, same thread session, same tier (claude-opus-5-5, effort high). Its file surface is the write path of the data engine and its tests, the fold refusal named in 7248485744, the liveness row turnedlivewith its runtime proof, and the card's overlay Done-when. Each Done-when line of slice B on the card is the measure. The trunk's draft PR staysPart of #37768and does not merge before slice C shares it. Every other line of the claim stands.21 remaining items
objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu
2026-11-30T08:26Z · Release to seat
repo:objectstack#3(os-steve) · handover, not abandonment.Provenance: who = the maintainer (Warren,
os-warren); words, verbatim: 「审批专题第 5 块 以及后续让 3号座位接手」; where = os-warren's fleet project timeline, 2026-11-30T08:23Z.pm:queueon,pm:dispatchedoff, assignee off, for seat 3 to claim. This card's slices are on the approvals trunk; it waits only on the trunk →mainPR #38497. Full state of the approvals topic: release comment on #37767.objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z
Claim: PM loop round (seat, delivery only) · handover from
repo:objectstack#2(release 7272923598)Provenance: the maintainer (Warren,
os-warren), verbatim 「审批专题第 5 块 以及后续让 3号座位接手」, os-warren's fleet project timeline, 2026-11-30T08:23Z; released to this seat in 7272923598 (full state in 7272899889 on #37767).Session:
session_01ADHkmSAjFEZHRpRq3WCj6zAccount:
os-steveBranch:
claude/o5-data-approvals-trunk(this card's slices are on it; it reachesmainby PR #38497)Domain:
domain:specSeat:
repo:objectstack#3Area:
o3-DFile surface: delivery only, no edit in this round: the card's own files on the trunk,
packages/spec/src/data/closed-states.ts,packages/objectql/src/closed-state-lock.ts,packages/objectql/src/closed-state-values.tsand their tests, reachmainby the trunk →mainPR #38497. Shared files that PR also touches are resolved there, under #37767's claim (7273042270) by amendment, after piece 5 and #38601.Container & model: XS, mode:none (no dev in this round), model: default, effort: medium
Clause-②: yes (widening), as the slices on the trunk declared; nothing new in this claim
Metadata-protocol: as the trunk slices declared (
addedon slice A)Responsibility:
n/a — not a defect cardThread-read: 7272923598
Premise: holds as handed over; nothing is built on this card until #38497 is taken up.
Prior rulings read: as recorded on the card's earlier claims (7264936984 / 7264915982) and on #37767's release 7272899889. No conflict.
objectstack-fleet commentedon Dec 1, 2026
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z
2026-12-01T02:37Z · Seat
repo:objectstack#3closes this card as completed. The key and its enforcement are onmain, released together with items 7 and 8 in PR #38810 (merged,440574f62c):The three follow-ups this Done-when asks to be named:
feat(objectql)!: a record in a closed state, and its lines, are close…