Skip to content

docs(adr): ADR-0162 closed states on an object close the record and its lines - #37606

Merged
os-zhuang merged 14 commits into
mainfrom
claude/project-thread-lotnpd
Nov 27, 2026
Merged

os-zhuang merged 14 commits into
mainfrom
claude/project-thread-lotnpd

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #36253. This PR is the card's "ADR first" half. The build half stays on the card and starts only after this record is accepted.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这次只落一份设计记录,线上行为不变;记录获批并实现后,业务人员会看到已付款、已审批通过这类已关闭的单据连同它的明细行,在任何入口都不能再手工修改或删除。
  • 为什么做:属于「单据关闭后锁定」这项功能,替需要把已决单据冻结的应用解决问题,今天这些应用只能各自手写代码去拦。
  • 出错会怎样:这份记录本身不影响任何人;其中的选择如果不合适,批准前直接改文字,批准后再出一份修订记录,没有数据需要回滚。
  • 要你做什么:批准这份设计记录;你 11 月 26 日的三次裁定(「全部按推荐」、「平台堵住:撤回不恢复关闭值」和「平台拒绝这种配置」)已写进正文,正文里有三处你没有逐字说过:「已撤回」被设成关闭状态时撤回也不写它,比「不恢复」的字面更宽;已审批通过的单据被再次送审后撤回,会变回未审批,需要重新审批;「平台拒绝这种配置」在正文里写成发起审批时要满足的六个条件,比选项原话里的「缺少审批中状态或退回路径」更宽:审批的每一步都要写同一个状态字段,两步之间不能夹等待或表单,流程里不能在循环中逐条发起审批(比如逐行明细审批,要另起一个审批),状态字段不能带按条件只读或按条件显示的选项,以提交人身份运行的流程不能在两步之间改单据;拒绝发生在发起审批时,编写时会提前提示,发布时不拦。

What changes

  • Adds docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, status Proposed.
  • Regenerates docs/adr/README.md with scripts/adr-index.mjs (one new row, three counts).
  • No code, no schema key, no route, no changeset. The record declares; it implements nothing.

What the record decides, in the order the card asks:

Card asks Record answers
The key's shape D1, D2: an object-level closedStates map from a state field to the values that close a record. Nothing is stored for it; closed is read off the stored row.
The unit D3: the record and its direct master_detail lines, the unit the pending-approval lock holds.
Exemptions, and delete D4 to D7: every caller is bound at every door, the state field included, and no grant lifts it. A write that names no principal is bound too. A system context is not bound. A caller cannot delete a closed record, and a delete whose cascade would reach one is refused whole before anything is removed. Referential clears, restore and a change of owner are named case by case. A new approval stays a way out of a state closed on the approval's status field, and an abandoned approval never writes a closed value. An approval opens on such a field only where the field can show it in progress, and the platform refuses the configuration otherwise (the third ruling, below).
One lock read D8, D9: one refusal code, RECORD_LOCKED, with its own sentence. One read owned by the data layer answers for both producers, and tells every caller who can read the record whether it is locked and which lock holds. The approvals-family read stays exactly as published.
Where it is enforced D10: in the engine's write path, after the object-permission and row-access gates and before the app's hooks. A many-row write is judged by one existence probe asked of the store. A line write asks the caller's own read door before it consults a master the write names.

Four points go past the ruling's words, and the maintainer has ruled on them. The ruling of 2026-11-26 (record, 「全部按推荐」, all as recommended) adopts each as the record writes it. Each stays marked in the text, with the other reading beside it in "Points the ruling does not settle":

  1. D5: a system context is not bound at all, where the card's words require only a sanctioned action that moves the state. An action button's script is such a context, and works on a closed document as on an open one.
  2. D6: a caller cannot delete a closed record, where a pending one can still be deleted.
  3. D4: the lock is judged on the stored row only, so the write that closes a record lands whole. Item ③ of the 2026-11-22 batch governs readonlyWhen and not this lock.
  4. D9: a new read owned by the data layer answers for both producers and names the reason. The approvals-family read stays as published and answers for approvals only; whether its routes retire or are redirected is a card filed with the build cards.

The same ruling settled three points the second contract review left open:

  • Who is told the lock's reason. Every caller who can read the record. D9 states what that discloses to a reader whom field permissions keep from the state field, and why it is accepted.
  • A delete's cascade. Judged whole, before the first row is removed. The refusal names the record the caller asked to delete and the label of the object in the way, and nothing of the closed record itself. D6 states the exception this makes.
  • A new approval of a closed document. It stays a way out of a closed state. D5 names each outcome and where the author gates it.

A second ruling the same day (record, 「平台堵住:撤回不恢复关闭值」, the platform blocks it: a recall does not restore a closed value) answers the point the third contract review raised. The new approval stays a way out, and D5 gains one platform rule. When a request is abandoned, by its submitter's recall, by an administrator's override or by the sweep of a dead run, the approval status mirror never writes a value the object declares closed, recalled included. The approvals-plugin change is a build card (Execution, item 7), released with the key.

A third ruling the same day (record, 「平台拒绝这种配置」, the platform refuses this configuration) answers the point the seventh contract review raised. That review found that the record accepted, on its own word, a document left reading a decision, and closed, when its approval was abandoned before it finished. The seat put two answers to the maintainer, that the platform refuse the configuration that allows it or that authors be told how to avoid it, and the maintainer chose the first. The option reads 「字段声明了关闭值、却缺少"审批中"状态或退回路径时,发布或开审批时直接报错;作者补上选项才能用,单据不会假装已批准。」: where a field declares closed values and lacks an in-progress status or a way back, publishing or opening an approval fails with an error; the author adds the options before it can be used, and the document does not pretend to be approved. D5 carries the rule as the conditions on which an approval opens, and keeps the point marked ▲. An approval whose step mirrors onto a field the object closes on, at a status the mirror writes, opens only where six things hold: the field declares pending and the object closes on neither pending nor returned; a state_machine rule on the field lets a closed approved or rejected move to pending; the field carries no readonlyWhen, and its options for a request's statuses carry no visibleWhen; every approval step that can act on a record of the object mirrors onto that one field; no flow of the approval that runs as the user can write the record between two steps; and no flow of the approval pauses between two steps, on a node or on an approval of another record under a map. The whole approval is judged at its first request, from its definition. Otherwise that request is refused, with an error that says what is missing. D5 also states, all of it, what the refusal does not reach. The six conditions go further than the option's words. The option names an in-progress status and a way back, and an error at publish or at the opening of an approval. The record refuses when an approval opens and reports at authoring, and does not refuse at publish. Items 6 to 19 below are every choice inside the ruling that is the thread's or the seat's, and the header, D5 and "Points the ruling does not settle" say so.

Small decisions

What earlier heads of this record called a round is called an approval from this head on, because ADR-0044 already numbers the rounds of a request.

The second ruling leaves the thread to say what the mirror writes in place of a closed value. Four choices are the thread's, and one, item 4, is the seat's reading. Each is stated in D5 and listed in "Points the ruling does not settle", with the ones not taken in Alternatives, "What an approval writes on a closing field, and where it may open":

  1. What is written instead. The value a record that was never submitted carries: the field's declared default, or empty where the default is a closed value or there is none. The field does not go on reading pending with no request open.
  2. A closed value the approval did not write is left alone. An approval is one passage of a record through its approval flow as a whole: the flow run started for it and every child run under it. Where the field holds a closed value that no request of the approval on that record had as its status, pending, returned, approved or rejected, the mirror writes nothing: another writer put the record there. Where such a request did have it, the mirror goes down the order. Where the mirror cannot tell, it goes down the order too: that costs a decision, and writing nothing could keep one that was never finished. The test reads what the field holds, and nothing from the value at submit, which a request does not always carry. The seat ruled the unit twice: the whole run after the sixth review, and the whole run tree after the seventh.
  3. Released with the key. The key is not published while an abandoned approval can still write a closed value, or an approval can open on a field that cannot show it.
  4. A recalled the object closes on is not written either (the seat's reading, by the text of the option the maintainer chose, on record). The field is then treated as one that declares no recalled value. The maintainer's own word is 恢复, restore, and the narrower reading, a rule on the put-back only, is in Alternatives.
  5. An empty value at submit on a required field is passed over. The mirror goes on to the default, where today it puts the empty value back on every field. A required field that is not readonly refuses that write, and one that is readonly would be left empty. On a field that is not required the empty value is still put back.

Inside the third ruling, fourteen more choices are the thread's or the seat's, and none of them is in the ruling's words. They are listed in "Points the ruling does not settle", with the ways not taken in Alternatives:

  1. Refused when an approval opens, at its first request, and reported at authoring as early notice. The objects and the flows are published apart, and the first request is the first point at which all of them are certainly in hand.
  2. An approval of one step is judged like one of several. A single step fails too, on a decided document rejected into a status the field does not declare.
  3. returned is refused beside pending. With both open, no failed write of the mirror leaves a lock behind.
  4. Of a state_machine rule one move is asked: from a closed approved or rejected to pending.
  5. The conditions reach only an object that closes on a status the mirror writes (the seat's ruling on the eighth review). An object that closes on its approval field only on values of its own, paid or void, is asked nothing, and its state machine may keep such a value final.
  6. The whole approval is judged at its first request, from its definition (the same ruling): every approval step of the flow and of the flows it calls, each on its own mirror field and its own object, a map's item object included. An approval that cannot be read whole is refused. The automation service hands every run its root run so that the plugin can do this, and Execution item 7 names that change.
  7. A mirror field carries no readonlyWhen at all. The seat's ruling asks that none can hold on a closed value. The platform does not evaluate a predicate ahead, so the record asks that the field carry none. readonly keeps callers off it.
  8. A flow that runs as the user and can write the record between two steps is refused. The seat's ruling left the record to choose between that and letting the approval's own run pass the lock. The record refuses the flow: a pass would exempt a caller's context from this lock, which D5 does for none.
  9. A run that ends between two steps is held to the same bound as a write of the mirror that does not land (the seat's ruling): neither leaves a record closed on a value its own approval wrote and did not finish, and the key waits for the card that delivers both.
  10. Every approval step that can act on a record of the object mirrors onto the one field (the seat's ruling on the ninth review, which asks it of a step that can follow one the conditions concern). Two readings inside it are the thread's. The first step of a new approval of a decided document follows the last decision, so the steps ahead of such a step are asked too. And a step in a map body counts as one that can act on the parent's record, because whether an item is a record is known only as the body runs.
  11. No option of the mirror field for a request's status carries a visibleWhen (the same ruling). The check refuses it as it refuses a readonlyWhen.
  12. A pause between two steps is refused when the approval opens. The seat's ruling left the record to choose between that and holding a run parked there to the bound of the status-mirror card. The record refuses the pause: it is in the flow's definition, and what can be read ahead is refused at the opening. A decision whose run cannot be resumed cannot be read ahead, and joins that card (the same ruling).
  13. A request the plugin cannot place as first or later is not judged (the same ruling), so that no approval is refused between two steps. Only an approval whose run started before the key was released can be in that case.
  14. A map whose body holds an approval step is read both ways (the seat's ruling on the tenth review): as a step of the parent's record, which names the field, and as a pause for it, because an item may be a record and the parent's run then waits on an approval of another record. It is refused unless the node shows that none of its items is a record. One collection can hold items of both kinds, so the refusal holds wherever the map stands among the steps. A node whose type publishes no descriptor counts as one that can pause (the same ruling).

One cost follows from the second ruling and is stated in Consequences: an approval of a decided document that is then abandoned leaves the document open, also when it was started by mistake, and it has to be approved again.

What the refusal does not reach is stated in D5, in "What it costs" and in "Points", and the record accepts none of it as a design. Three things cannot be read ahead: a rule or a hook of the app that refuses a write of the mirror, a run that ends between two steps because a node fails or the run is cancelled, and a decision that is recorded while its run cannot be resumed. For the three the record fixes what must hold: none leaves a record closed on a value its own approval wrote and did not finish, and a refused write of the mirror is no longer swallowed. It leaves the means to the status-mirror card, which Execution now names as item 8, and the key is not released before that card is built. A change to the object or to the flow after the approval opened is not judged again.

Five things follow for authors and are in Consequences. An object that already runs approvals meets the conditions before, or together with, its closed values: from the moment the declaration is published, a new approval is refused until they hold. An approval that keeps one status field for each stage, or leaves a stage without one, brings its steps onto one field, and a delay or a screen between two approval steps moves out from between them. An approval of each line, or of each of some other records, under a map is started as an approval of its own. An approval flow that runs as the user and writes the record between two steps is declared to run as system, or loses the write. And a refused opening reaches the person who submitted as a failed run.

Read first, by risk:

  1. D5, "An approval opens on a closing field only where the field can show it in progress", "The approval is judged whole, once, at its first request", "What the conditions do not reach" and "An abandoned approval never writes a closed value", with their group in Alternatives considered.
  2. D9, "Every reader of the record is told locked" and "What that discloses, and why it is accepted".
  3. D6, "Cascades": what is judged, when, what the refusal names, and the exception.
  4. D10, "A line write reaches a master in one of two ways", with the last group in Alternatives considered.
  5. D5, the other outcomes of an approval, and which actions run elevated.

Revised after the contract review of the first head (review, PASS with six points to fix and six nits). Every point is answered in the record's own text:

Review point Where it is answered
A many-row write should be probed in the store, not listed D4, "Asked of the store, not listed" and "What cannot be judged is refused"
Item ③ was restated with a word the ruling does not carry Header, D4's last paragraph, the third marked point, Alternatives
The showcase changes in more than two outcomes Execution item 3, "What it costs"
lockSource has a published delete reading D9: the delete reading holds only under an approval; the approvals-family read is left as published
Three kinds of writer, not two D5, "The test"
The approval mirror moves a record out of a closed value D5 and "What an author has to know"
The six nits D8 (the upload-link door's own sentence; the refusal names no producer), D9 (two readability anchors), the Context table and D5 (the pending lock's other two passes), "What an author has to know" (create with lines), Readings (the unresolved case)

Revised after the delta review of fe9a850c (review, PASS with two points to fix and three nits) and the ruling:

Review point Where it is answered
D8 and D9 said the reason rule achieves more than the rest of D9 lets it D9: the rule is gone; every reader is told the reason, and the disclosure is stated. D8 loses its sentence about the read. Alternatives keep both readings not taken.
D10's sentence was categorical, and the cascade was a case it did not cover D10: the promise is scoped to the object-permission and row-access gates. D6: the cascade's judgement, its refusal and its exception. D8: the cascade's own sentence.
The per-row ceiling was misdescribed and misanchored D4 and Readings
The upload-link door's sentence for a caller given no reason D8: the door chooses its sentence by the read's reason, which a locked answer always carries
No alternative was recorded for the approval-round path Alternatives, "A request is not opened on a closed record"; D5
A line write and a master its writer cannot read D10's two rules; D4, "One refusal is another gate's"; Alternatives
Where field permissions are asked D10: in the security layer's middleware, ahead of the engine's hooks
What a change of owner does on a closed record D7, "What an author has to know", the left-open list

Revised after the delta review of f79eda94 (review, PASS with one point to fix and six nits) and the second ruling:

Review point Where it is answered
D5 and the author note said the state field always tells what happened D5: each outcome is stated by the values the field declares, and the rule on an abandoned round follows. Consequences and Alternatives match.
The pending lock holds a pending round only where the approval node locks D5, "While the request is pending"
Two writers that abandon a request were not named D5, "Abandoned"; Readings
The cascade's sentence did not fit the second case D6 judges, nor say when it takes the label form D8
What a line's reader is told D9, "What that discloses, and why it is accepted"
The ruling was quoted in English Header: both rulings verbatim, with an English reading beside each
Three nits the review routes to the build cards: the lockSource member under an approval, a master that a hook supplies, an action's registered handler Not changed here. They go to the build cards with the review record.
The ruling record's own wording No change in this PR

Revised after the delta review of eec0a5e1 (review, PASS with one point to fix and seven nits):

Review point Where it is answered
The "left alone" test stranded a record on an in-flight status the object closes on D5 at that head: the mirror writes nothing only where the field still holds its value at submit (replaced in the next revision); a field the round left on a closed pending or returned goes down the order. The author's note, Execution item 7's test list and Alternatives name the case. D5 also states a case in which a record stays closed with no request open, on a required field with no usable default, and has the approvals card run it.
Two sentences on an abandoned round were true only of a round that opened the document Consequences, both entries
A third thing inside the second ruling is the record's own, and "to the letter" was the wrong name for it Header, D5, "Points the ruling does not settle", Alternatives: it is the seat's reading of the chosen option's text
The second ruling's time Header: recorded at 19:16Z
"A stacked pair" in Execution item 1 A trunk branch, as AGENTS.md has it
Three nits the review routes to the approvals card: the validator on a readonly field, the override arm admitting a system context, a log line when a value is withheld Not changed here

Revised after the delta review of 32225e8b (review, PASS with one point to fix and three nits):

Review point Where it is answered
The "left alone" test read a value at submit, which a request does not always carry D5: the test reads what the field holds. At that head a closed value that is neither pending nor returned was left alone, and a field on either went down the order (widened to the run's own requests in the next revision). Execution item 7's test list gains a request that carries no value at submit. Alternatives records the earlier test as not chosen.
The case in which a record stays closed with no request open was stated in D5 only, and the record did not say it accepts it D5 says the record accepts it, why, and what the case takes. The bullet heading above it, the author's note, "What it costs", two entries in Alternatives and the approvals guide of Execution item 7 carry it. D5's order also passes over an empty value at submit on a required field, so each way an author is given avoids the case.
Consequences said "opened" where the test is about the state The author's note and "What it costs" speak of a round that moved the document's state, and say a decided document loses its decision also where it was never open during the round.
Any mirror write that fails is logged and swallowed, on every transition Not changed here. It goes to the status-mirror card with the review record.

Revised after the delta review of 3c67c790 (review, PASS with one point to fix and two nits) and the seat's choice between the two ways it offers:

Review point Where it is answered
The "left alone" test was drawn against one request, and a flow run can hold several D5: a closed value is left alone only where no request of the run had it as its status (the run became the whole round in the next revision). A closed value an earlier step of the same run wrote goes down the order, so a draft abandoned at a later step goes back to its draft value. The sentence on what the mirror has written speaks of the run. D5's accepted case (withdrawn in the next revision), the author's note, "What it costs", Alternatives and Readings carry it, and Execution item 7's test list gains a run abandoned at a later step after an earlier step was approved.
The step for an empty value at submit on a required field was not booked as the record's own choice Header and "Points the ruling does not settle": one reading and three choices. Alternatives: the reading not taken. D5: the order is today's with two departures. D10's table says what changes for the mirror.
The test list lacked the arms that tell the chosen rules from their neighbours, and the step's reason held only for a field that is not readonly Execution item 7's test list. D5 and the fourth reading under "Execution" state both kinds of field.

Revised after the delta review of f7d2eb4c (review, PASS with two points to fix and three nits) and the seat's rulings on them:

Review point Where it is answered
The "left alone" test was drawn against one flow run, and an approval can be spread over several D5: a round is the record's whole approval, the run started for it and every child run under it. Each request records its round as it opens, the mirror asks its own table in one probe, and it goes down the order where it cannot tell. Execution item 7's tests and Readings carry the child run.
The record accepted, on its own word, a document left reading a decision its approval did not finish, and counted five conditions for one route out of several D5 no longer accepts it. The question went to the maintainer, who ruled on it later the same day (the third ruling). On that head D5 was written to the seat's recommendation: the configuration is refused when a round opens. D5 says that the mirror's writes meet the object's validation rules, what an author who puts a state_machine rule on the field owes the mirror, and what the platform cannot read ahead. The paragraph of five conditions is gone. D10, Execution item 7, Points, Consequences and Alternatives follow.
The kinder alternative was turned down for the weaker of two reasons Alternatives: that the two values are equal does not show the document stayed closed.
The test said "a status a request had", and the mirror never writes a closed recalled D5 names the four statuses the mirror may have written.
The author's note said approved where D5 says "outcome", and gave the ways out as one pair Those passages are replaced by the rule above.

Revised after the delta review of 4714072c (review, PASS with three points to fix and four nits) and the seat's rulings on them, in two commits, cbce67a5 and the head:

Review point Where it is answered
The check was made once an approval, while the mirror field is each step's own and the record each request's D5, "The approval is judged whole, once, at its first request": every step of the flow and of the flows it calls, on its own field and its own object. The mirror's probe names the record. Execution item 7 says where the root run comes from, and its tests gain a first step with no mirror field, a map item on another record and a step two levels down.
What the refusal does not reach was wider than the one case stated, and its home was a clause D5, "What the conditions do not reach", states the cases together. Two that the platform can read ahead are now refused when the approval opens: a readonlyWhen on the mirror field, and a write to the record between two steps by a flow that runs as the user. Execution item 8 is the status-mirror card: it takes a write of the mirror that does not land and a run that ends between two steps, and the key waits for it. "What it costs", "Points" and Alternatives follow.
The conditions reached further than their reason D5: they concern an object that closes on a status the mirror writes, and the state_machine move is asked of a closed approved or rejected only. Booked in "Points", with the wider form in Alternatives.
"Round" already names something on a request The record's unit is called an approval, and the word round is left to ADR-0044.
The status line and Provenance counted four marked points, all ruled Five, four of them ruled on that head. The fifth was ruled later the same day.
"In two cases", and the two sides of a request the mirror cannot place D5, "A closed value the approval did not write is left alone".
What a refused opening is for the person who submitted "What an author has to know".

Revised after the delta review of bcc8d889 (review, PASS with two points to fix and four nits) and the seat's rulings on them:

Review point Where it is answered
A later step that mirrors onto another field, or onto none, was asked nothing, and left the record on the earlier step's outcome D5, a new condition: every approval step that can act on a record of the object mirrors onto the one field, the steps ahead of such a step included. The two sentences on what the conditions give are redrawn on it. Booked in "Points" with the two readings that are the record's own. Alternatives keeps the mirror that answers for an earlier step's field, the rule for later steps only, and a map body placed on its item's object. Execution item 7's tests say which way each approval goes.
One sentence gave the abandonment rule the reach of the opening conditions D5: the mirror writes as it does today only where the object closes on no value of the mirror field, and the conditions say that only they are narrowed. D10's table and Execution item 7's mirror tests carry the object that closes on values of its own.
A visibleWhen on an option of the mirror field also meets the mirror's writes D5 counts four things that meet them. On the option of a request's status the check refuses it, in the condition that refuses a readonlyWhen. On an option the mirror puts back it is a refused write, under Execution item 8.
Two neighbours of a run that ends between two steps D5: a pause between two steps is a new condition, refused when the approval opens. A decision whose run cannot be resumed joins what the conditions do not reach and Execution item 8, which names the reader main has as a starting point. The docs card of item 7 is told.
The check's side of requests opened before requests recorded their root run D5 and Execution item 7: a request the plugin cannot place as first or later is not judged.
"Before another step", and the same step opened again D5 defines "between two steps", with the map body, and Execution item 7 has the test.

Revised after the delta review of 0aad3f22 (review, PASS with one point to fix and four nits) and the seat's rulings on them, in commit e7c16faa:

Review point Where it is answered
An approval of another record between two steps held the parent's record on the earlier step's outcome, and the conditions passed it D5: a map whose body holds an approval step is read both ways, as a step of the parent's record and as a pause for it. It is refused unless the node shows that none of its items is a record, wherever it stands, because one collection can hold items of both kinds. The two sentences on the passage between two steps are corrected. Booked in "Points". Alternatives keeps the map taken at the object it names, and the bound of item 8. "What an author has to know" and "What it costs" say where an approval of each item runs. Execution item 7's tests place the map among the parent's steps.
A node type that publishes no descriptor can pause a run D5 and Execution item 7: it counts as one that can pause, with a test.
Two failures of a node between two steps were outside the heading of the case D5 drops the qualifier and names both, and Execution item 8's tests gain both.
"Not judged" rests on every request after the release recording its root run D5 and Execution item 7: the automation service derives the root run of a run started before the change when it resumes it, with a test.
Item 8 counted three things, D5 and "What it costs" two Three in each: a refused write of the mirror, a run that ends between two steps, and a decision whose run cannot be resumed.

Revised after the maintainer's third ruling (record), in a commit of its own, the head. Every passage that called the fifth marked point unruled now cites the ruling: the status line, the header, Provenance, the TL;DR, D5, Points, Alternatives and Refs. The header and D5 quote the option the maintainer chose, and say that the opening conditions spell the rule out further than its words do. No decision changes.

Tests

None. The diff is two Markdown files under docs/adr/.

Acceptance notes

  • Tier H. docs/adr/** is a governed surface. This PR stays a draft: it is not merged, queued, armed or marked ready by its author. It lands by the maintainer's merge or an authorized approval.
  • L2. The contract-tier review of the first head and the delta reviews of fe9a850c, f79eda94, eec0a5e1, 32225e8b, 3c67c790, f7d2eb4c, 4714072c, bcc8d889 and 0aad3f22 passed. Commit e7c16faa answers the tenth review's one point and its four nits, and the head puts the maintainer's third ruling where the text called the fifth point unruled. The eleventh review, of this head, passed (review, PASS): it leaves no point to fix, and its five nits are not fixed on this head. Four go into the text of the build cards for Execution items 7 and 8, and one waits until the file is next changed. The seat ran each review. This thread does not review its own record.
  • Premise. Checked on main at 6c290d3af7 and it holds: the approvals guide still says "the record unlocks", the showcase still carries the three paid-invoice hooks, no key of this meaning exists on the object schema, and the pending line lock is on main. One item was not checked: the card names a hosted app's edit guards as a producer. That app's code is outside this repository; the record relies on it only as the card states it.
  • skip-changeset. docs/adr/** publishes nothing from any released package.
  • Readings the record states but did not run. Four, listed under "Execution" for the build to verify and pin: the order of the approval status mirror and the request's finalisation, which engine-derived writes reach a closed record and in which context, whether a customization overlay may add or shorten the declaration, and what the mirror's put-back does when it comes down to an empty value on a required field.
  • Deviation. In the first round one gate needed two packages built first, and that build ran without the shared verify lock. No build ran in this round.

Verification

Two-minute check: run pnpm check:adr-index. Expected last line: adr-index: OK — docs/adr/README.md is current and every record parsed.

Local gates: 21 derived, 21 run, 0 not measured
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:watch-hint-literal :: exit 0

Run again on the tree of e7c16faa, and again on the tree of head e3283c06. node scripts/pm/dispatch-gates.mjs --ran on that list: 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/overlap-check.mjs before each push: exit 0, clean against origin/main; it found no open PR that shares a file with the branch.


Generated by Claude Code

…ts lines

Proposed record for the card's "ADR first" step. An object declares
closedStates: the values of its state fields in which a record, and its
direct master_detail lines, are closed to change for every caller.

The record settles the four things the card asks for: the key's shape,
the unit (the pending-approval lock's unit), the exemptions and delete,
and one lock read for both producers. Four points go past the ruling's
words and are marked in the text for the maintainer.

It declares and implements nothing. docs/adr/README.md is regenerated by
scripts/adr-index.mjs.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 26, 2026
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9b848ed32beaace721a6370d57476a573e5d9159
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Read for this record: card #36253 with its three comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), and the check-runs on the head (every run is success or skipped by path; none is red). The record cites code and three earlier records; each was read where it is cited, at the head: ruling record 7073676422, seat ruling 6281609466 and the body of PR #36135, to check the quotations only. Security-touching: yes is meant: D5 and D9 teach who a lock binds, that no grant lifts it, that a system context passes it, and what a lock read answers to a caller who cannot read the record. The seat adopting this record adds the security label.

① Derived judgments

  • The diff publishes nothing. No schema, no route, no package source, no changeset. Right.
  • Number 0162. The next free number at the branch point, and docs/adr/ on main has not moved since. Right.
  • Status Proposed. A keyword the index parses; it becomes Accepted by the Tier H merge, as the status line says. Right.
  • docs/adr/README.md. One new row and three counts (163 records, 158 numbers, Proposed 10, total 163), and no other line moved. Right.
  • What the record announces for later, each owed by a build card and not by this PR:
    • a new authorable object key, closedStates, with Metadata-protocol: added on the spec card. Right.
    • the engine package as a new emitter of RECORD_LOCKED in the ADR-0112 ledger. Right.
    • a new sentence family in the Operation Message Catalog. Right, and incomplete: see N1.
    • a new data-family lock read with SDK methods, and a new optional member lockReason. Right as additions.
    • the two approvals-family lock routes "served from the same read". Wrong as written: the record calls lockReason "the only new member" and names no change to a published answer, and there is one. See S4.
  • "No platform default changes; an app is affected only when it declares the key." Right for the write side. For the showcase, the count of changed outcomes is wrong: see S3.

② Semver level

skip-changeset matches what the diff publishes: nothing from a released package. Check Changeset is green on the head. The PR body's Clause-②: no is right for this diff, which changes no accept set, and Metadata-protocol: none is right for it too. For the cards that follow: the key card is an addition; the read card is not a pure addition while S4 stands.

③ Boundary flags

  • open_questions: []. Nothing to answer.
  • Deviation: one gate's prerequisite build ran without the shared verify lock. A process note with no effect on the tree. It is the lane seat's to accept.
  • Deviation: the hosted app the card names was not read. Accepted. The record says so twice and rests nothing on it beyond the card's own sentence.
  • security_findings: withheld in the dev report. Not answerable from this record. Escalated to the seat, off the board.
  • Out-of-scope note: the status mirror is written after the request is finalised, and its failure is logged and swallowed. Confirmed in packages/plugins/plugin-approvals/src/approval-service.ts#mirrorStatusField and its call after the finalising update. The record carries it under Execution as something the engine card measures. Accepted as carried, with one condition for the seat: it is filed as a child card of its own when the build cards are filed, since it decides whether approval_status: ['approved'] closes anything on a bad day.
  • Out-of-scope note: whether an overlay may add or shorten the declaration. Carried under Execution with a route back to a decision card. Accepted.
  • The four ▲ points and the three unrun readings. Each ▲ is marked where it stands and has its other reading beside it. They are the maintainer's to adopt or strike at the merge, not this review's. One of them is not framed correctly: see S2.
  • SQL push-down.

S1 (should-fix) — D4 prescribes list-then-judge for many-row writes, and gives no reason SQL cannot answer.
D4 says a many-row write is refused whole when one row it reaches is closed, and that "a predicate write whose rows cannot be listed within the engine's bounds, is refused". That is the engine listing rows and judging them in the application. On main a predicate update reads its rows only on demand: when the object has per-row hooks, a rule that needs the stored row, or a readonlyWhen strip (packages/objectql/src/engine-update.ts, the one readPriorRows memo). With none of those it goes to the driver as one statement. So for an app that installs no global hook, which D9 names as a supported case, the bullet adds a new id materialisation and a new refusal for a large write that touches no closed row. Closed is a predicate over the row's own stored columns (D2), so "does this predicate reach a closed row" is one existence probe the store can run, and for a line it is a semi-join to the master. AGENTS.md Prime Directive 5 asks for that shape first. D4 should say so, keep listing for the store that cannot run the probe, and say what "unresolved" then still means. N4 is the same bullet's reading.

④ Design judgment

docs/adr/0162-…md against the code it cites. Every row of the Readings table was opened at the head. They hold, with the one imprecision in N4: the pending record lock and its three passes; the line lock, its cascade-leg yield and its two-ended move check; the delete that lands and cancels; the lock read's contract, its null and its bound of 200; the two approvals-family routes; the record page's approvals part; the two console readers; the status mirror's context and its swallowed failure; readonlyWhen and its deliberate refusal to exempt a system context; the referential-clear exemption and the restore re-link; initialStates; the advisory userActions wording; the cascade set collected before any write; summary recompute in a system context; restore through the driver; the elevated action body; runAs defaulting to user on a flow and to inherit on a hook; the two ledger rows; the four sentence forms; the three showcase hooks; the header-first order of the console's save. The quotations of the card, of both rulings and of PR #36135 are exact, except the restatement in S2. No accepted ADR decides the opposite of D1 to D10; ADR-0044's revise window is untouched.

I tried to break it at the doors D5 lists and at a few it does not. Import as a signed-in caller is not a system context, so it is bound, and the import and undo doors refuse a caller's request to take an object's controls off. The upload-link completion writes as the caller. The recycle-bin case in D7 covers re-adding a line through restore. The cascade rule in D6 holds for a junction under one open and one closed master. Those hold.

No must-fix.

S2 (should-fix) — the record restates ruling ③ with a word the ruling does not carry, and ▲3 rests on that word.
The ruling record states item ③ as: "A lock that reads its own field: it holds if its condition is true before or after the write." The record restates it as "a field lock that reads its own field" (Rulings that stand beside it) and as "a readonlyWhen field lock" (D4), and on that basis says it "re-opens none of the other four" and that item ③ "is about a different lock". The closed-state lock freezes the state field it reads (D5: "The state field is frozen with the rest."). By the ruling's own words it is a lock that reads its own field, and ▲3 gives it the opposite rule: a condition that is true only after the write does not hold the lock. That may well be the right product answer, and the record's argument for it is a fair one. But it is a narrowing of a ruling of the same batch, and only the maintainer can make it. The fix is editorial: quote item ③ as the ruling record words it, and present ▲3 as the point where this record departs from, or asks the maintainer to scope, item ③, instead of under "re-opens none".

S3 (should-fix) — the first consumer changes in more than the two outcomes the record counts.
Execution item 3 and Consequences both say two outcomes change when the showcase converts: a caller's edit of a paid invoice's header, and a caller's delete of it. A third changes, by D4's own table. Today a caller's update of a line under a paid invoice lands for description, position, service_start and receipt, which carry no readonlyWhen, and for product, quantity and unit_price the locked keys are stripped and the rest of the write lands (examples/app-showcase/src/data/objects/invoice.object.ts; the move hook is conditioned on the invoice key alone). After the conversion every such update is refused whole. The change is what the ruling asks for ("refuse add, edit, remove and move"). The record's account of its own proof is what is wrong, and the proof card will be accepted against that account. One smaller change belongs in the same list: the three app-worded sentences give way to the platform's. Correct the count in both places and list the line-edit outcome among those the dogfood run records.

S4 (should-fix) — D9 changes what two published members tell an existing client, and says it changes nothing but an added member.
The contract on main gives lockSource a meaning for delete: 'record' is a record held by its own request, which "may still be deleted"; 'master' is "the stricter of the two delete rules" (packages/spec/src/contracts/approval-service.ts#getRecordLock). A shipped reader acts on it: the grid keeps Delete on a 'record' row and drops it on a 'master' row (ui/packages/plugin-grid/src/objectGridActionsColumn.tsx, useRowApprovalLocks.ts). Under D6 a closed record is not deleted by a caller, and under D9 it answers lockSource: 'record'. So a client that does not read lockReason, which is every client today, is told a closed record keeps its delete. The same routes are documented as "held by a locking approval" and would now answer locked: true for a record with no approval at all. Neither is unsafe: the server refuses. Both are a published answer changing, on the read where seat ruling 7152650156 declined to narrow one. D9 should state that lockSource keeps its delete reading only under lockReason: 'approval', say what a closed record answers to a client that reads lockSource alone, and either accept the widening of the approvals-family answer in words or leave those two routes answering for approvals only. The read card then declares it.

S5 (should-fix) — D5 sorts writers into two kinds and the tree has three.
D5 binds "every write made in a caller's context" and passes "a write made in a system context". The engine also carries a write with no principal at all: buildSession answers no session for it (packages/objectql/src/engine-execution-plumbing.ts), a schedule-started runAs: 'user' run is one, and so is a programmatic call from plugin code. The tree treats that third kind in more than one way today, so the build cannot read the answer off precedent. D5 should define "bound" by its test and say on which side a principal-less write falls. D7's "reported back, not exempted on the spot" then has something to be measured against.

S6 (should-fix) — the record's own example has a way out of a closed state that is not an action, and D5 says there is none.
D1's example closes on approval_status: ['approved'], and D5 lists the approval status mirror among the platform services a closed record does not bind. The mirror also writes at the start of a request, not only at its decision: pending when a request opens, and recalled, returned or rejected after, each where the field's options declare the value (approval-service.ts, the six call sites of mirrorStatusField). So where an app's approval flow can be started on an approved record, starting it takes the record out of the closed value, and a rejection, or a recall where the field declares recalled, leaves it open and editable by hand. D5 says "An app that ships no such action has no way for a user to reopen, and that is a legitimate product: closed is closed." For a record closed on the mirror field that sentence is not true as written. Either reading can be defended: a new approval round may be exactly the sanctioned way back, or a request may not be opened on a closed record. The record has to pick one, or at least name the path in D5 and in "What an author has to know" so the author gates the flow's start. The related note in N5 belongs with it.

Nits. None moves the decision. Each is fixed on this prose face or carried to its build card.

  • N1 (nit) — D8 gives the closed-state refusal its own sentence in the Operation Message Catalog only. The upload-link door has a sentence of its own for the same code, in every locale it carries, and it says an approval is in progress (packages/services/service-storage/src/upload-link-copy.ts, record-file-access.ts). D9 moves that door to the one read; Execution should name its copy beside the catalog's.
  • N2 (nit) — "The closing write goes last" has no form for a create. A caller cannot create a document already in a closed state together with its lines: the header insert comes first, and the first line then meets a closed master. One line in "What an author has to know".
  • N3 (nit) — D9 "Same anchor" reads as one anchor. The contract keeps two on purpose, one per door (the getRecordLocks paragraph citing seat ruling 7152650156). The one read has to keep each door's published answer.
  • N4 (nit) — the Readings row for the line lock says "an unresolved master is refused". The code refuses an unresolved write only while some record of that master object is held by a locking request (lifecycle-hooks.ts#bindDetailRowLockHook). D4's "as the pending lock does" inherits it.
  • N5 (nit) — the Context table's "A system context" row leaves out the pending lock's two other passes that the Readings row lists: the run that opened the request, and a write carrying only the mirror field. D5 reads as if neither carries over. Say so, since the nodes after an approval decision in a runAs: 'user' flow are the commonest writer this refuses.
  • N6 (nit) — the read carries which producer holds; the refusal does not. A client that handles RECORD_LOCKED by its code cannot word "closed" without the server's sentence or a second request.

docs/adr/README.md. Generated output of scripts/adr-index.mjs; the row and the counts agree with the record's status line. Nothing to add.

Summary. The four things the card asks are answered, the readings are true, and the design holds at the doors I tried. Nothing found makes a decision wrong. Six points change what the record tells its builder or its maintainer and each owes a delta review of its fix; the record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The review of the first head passed with six points to fix and six nits.
This revision answers each in the record's own text.

- D4: a many-row write is judged by one existence probe asked of the
  store; listing is kept only for a store that cannot run it. What
  "cannot be judged" still means is spelled out.
- Item 3 of the ruling batch is quoted as the ruling record words it,
  and the stored-row rule is presented as the point where this record
  asks the maintainer to scope that item.
- D5 defines "bound" by its test, sorts a principal-less write, says
  which passes of the pending lock do not carry over, and names the
  approval status mirror as a way out the app controls.
- D8: the title is the one served to the writer; the upload-link door
  words its own refusal.
- D9: the reason follows the state field's read permission, lockSource
  keeps its delete reading only under an approval, and the
  approvals-family read stays as published.
- D10: the judgement comes after the permission and row-access gates.
- Execution and Consequences list every outcome the showcase conversion
  changes.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: fe9a850c867dee1f7899d672cd61dae23c0cf0e0
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7196241005, which passed head 9b848ed32b with six graded points open and six nits. Read for this record: card #36253 with its three comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one file, the ADR; docs/adr/README.md did not move), the earlier record, and the check-runs on this head (each is success or skipped; none is red). Every code position the delta adds or rewords was opened on main; the cited files have not moved since the commit the record names. Ruling record 7073676422 was read to check the new quotation of item ③ only. Security-touching: yes is meant: this head adds rules on when a lock is judged relative to the access gates, on who is told a lock's reason, and on the title a refusal may carry.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. The record's title and its Proposed keyword did not move, 0162 is still free on main, and the index gate is green on this head. Right.
  • What the record now announces for later, where this head changed it:
    • The approvals-family lock read is no longer re-served from the new read. Its routes, contract members and published answer stay as they are. No published answer changes, so the read card is an addition and nothing else. Right.
    • lockReason follows the state field's read permission. A rule on a member that does not exist yet. Right as an addition. What the record says the rule achieves is not right: see S7.
    • The upload-link door gains a closed-state sentence in its own copy, in every locale it carries. Owed by the key card. Right.
    • A write that names no principal and carries no system mark is bound. For an object that declares the key this is a new refusal for a programmatic call that passes no context. It is stated in D5 and again under "What an author has to know". Right.
    • What cannot be judged is refused on the declaration alone, which is wider than the pending line lock's condition. Stated as a deliberate difference. Right.
    • The judgement sits behind the permission and row-access gates. No surface of its own. Right in aim; the sentence that states it is wider than the design: see S8.
  • The showcase. Three outcomes change and three refusals change their words. The count now agrees with the line object on main: three fields carry readonlyWhen, four writable fields carry none. Right.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package, and no run on the head is red. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card is an addition, and the read card is now an addition too.

③ Boundary flags

  • open_questions: [], the two deviations, and the two out-of-scope notes. The card carries no new report for this head. The answers of the first record stand, with its one condition: the status-mirror note is filed as a child card of its own when the build cards are filed.
  • security_findings: withheld in the dev report. Still escalated to the seat, off the board.
  • The four ▲ points. Still the maintainer's to adopt or strike. ▲3 is now put as a question about item ③. ▲4 now keeps the approvals-family read as published. ▲1's row now carries the approval-round path.
  • Three rules new on this head carry no ▲: when the judgement runs relative to the gates (D10), who is given the reason (D9), and which title the sentence may carry (D8). The reason rule has its other reading under Alternatives. They are judged in ④ as the record's own text.
  • SQL push-down. S1: closed. D4 now asks the store one existence probe over the write's own scoped predicate, with a semi-join to the master for a line. It keeps a listed fallback only for a store that cannot run the line probe, from the one read of matched rows that already exists, and gives the reason. It also says what is still refused once the probe is in place.

④ Design judgment

The six points of the first record.

  • S1: closed. See ③.
  • S2: closed. Item ③ is quoted as the ruling record words it, and the quotation is exact. The word "field" is gone from the restatement. The header, Provenance, D4, the ▲3 row and Alternatives all present ▲3 as the place where the record meets item ③ and asks the maintainer to scope it. The record no longer says it re-opens none of the batch.
  • S3: closed. Execution item 3 and "What it costs" both list the line-update outcome and the three reworded refusals. The field lists agree with examples/app-showcase/src/data/objects/invoice.object.ts.
  • S4: closed. D9 leaves the two approvals-family routes and getRecordLock / getRecordLocks answering for approvals only, with lockSource and its delete reading as published. On the new read the delete reading holds only under lockReason: 'approval', and an answer with no reason promises nothing about delete. "Leaves unchanged", Execution item 2, the ▲4 row and "What it costs" agree.
  • S5: closed. D5 defines bound by one test, the system mark, and sorts the three kinds of writer the tree has. The statement that the pending lock and the showcase hooks treat a write with no session the same way holds in both (lifecycle-hooks.ts#bindApprovalLockHook, examples/app-showcase/src/data/hooks/index.ts).
  • S6: closed. D5 names the approval status mirror as a way out of a closed value with no app action behind it, keeps the path, and tells the author where to gate it. The sentence that there is no way to reopen is now conditioned on shipping no system automation. The mirror's behaviour as described agrees with approval-service.ts#mirrorStatusField and #mirroredStatusValue. One loose end is N9.

The six nits. N1 to N6 were each taken on this prose face: the upload-link door's own sentence (D8, Execution item 1, Readings), create with lines (Consequences), the two readability anchors (D9), the pending line lock's narrower condition (D4, Readings), the pending lock's other two passes (Context table, D5, Consequences), and the refusal that names no producer (D8, left open by name).

The delta against the code it cites. The new and reworded Readings rows hold: the matched-row memo and the per-row ceiling on a predicate update; the lowering of a related-record condition to a subquery on a read verb and to a bounded id list on a write verb; a context that says nothing about the caller yielding no session; the title of the pending lock's refusal picked from the row as served to the writer; the mirror's values; the grid's delete reading; the upload-link door asking the approvals lock before it issues a link and wording its own refusal; the record page serving locked alone.

I tried to break the three new rules at the doors the record lists. The place D10 names exists in the engine's write path on main, for a by-id write, a predicate write and a line write. The title rule holds for the record's own write. Two things did not hold.

No must-fix.

S7 (should-fix) — D8 and D9 say the reason rule achieves more than the rest of D9 lets it.
D9 withholds lockReason from a caller who may not read the state field "so that a missing reason says nothing". D8 says the read "is held to a tighter line" than the refusal. Read against the rest of D9, neither sentence holds in every app the record supports. This is a disclosure question, so the particulars are with the seat, off the board. The rule is written as it was given. What is wrong is the record's account of what the rule protects, and both the builder and the maintainer read that account. The fix is one of two. Either the record words what the read still tells such a caller and marks it accepted, as D8 already does for the refusal. Or the record changes what the read answers for that caller, which is the maintainer's choice and belongs with ▲4.

S8 (should-fix) — D10's new sentence is categorical, and the record's own cascade rule is a case it does not cover.
D10 says: "A closed record never answers differently from an open one to a caller who could not have written it." D6 judges a delete's cascade at the point the set is planned. For a row the cascade reaches, the record does not say that the caller's gates on that row have been asked by then. D8's naming rule covers the record's own write and a line write. It does not say which document a cascade refusal names, or under which title rule. A second, smaller case sits in D10 itself: it places the judgement after the gates and before the before-phase hooks, and not every gate on main has run by that point. The particulars are with the seat. The fix: scope the sentence to what the design delivers, and decide for the cascade what is judged, when, and what the refusal names. The engine card is accepted against this sentence, so it has to be one the build can meet.

Nits. None moves a decision. Each is fixed on this prose face or carried to its build card.

  • N7 (nit) — D4 says the fallback read is taken "under the bound the engine already sets on it" and anchors #assertBulkPerRowHookBudget in engine-update.ts. The ceiling is on the per-row hook fan-out, it is asked after the rows are read, and the function is declared in engine-hook-dispatch.ts. The Readings row words it correctly; D4 should match it.
  • N8 (nit) — D8 gives the upload-link door a closed-state sentence and D9 moves that door to the one read, which gives some callers no reason. The record does not say which sentence that caller is shown. Execution item 4 gives the console a plain-lock wording for the same case; the door needs the same line.
  • N9 (nit) — keeping the approval-round path is a choice between two readings, as the first record said. It appears in the ▲1 row under "What it means for a user", and Alternatives considered has no entry for the other reading (a request is not opened on a closed record). Provenance promises one for every choice the ruling leaves open.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. The six points of the first record are closed and its six nits are taken. The readings the delta adds are true. Of the three rules new on this head, the title rule holds as written, and the other two are sound in aim but stated more widely than the design delivers. Those are S7 and S8, and each owes a delta review of its fix. Nothing found makes a decision wrong. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The maintainer ruled on the record's four marked points and on the
points the second contract review left open: all as recommended
(ruling record 7200732942 on the card).

- Item 3 of the 2026-11-22 batch is scoped to readonlyWhen; this lock
  is judged on the stored row (D4, the header, the points table).
- The lock read tells every reader of the record `locked` and the
  reason. D9 states the one bit that discloses and why it is accepted;
  the earlier rule that withheld the reason is gone, with D8's
  sentence about the read.
- A delete's cascade is judged whole before the first row is removed;
  its refusal names the record at the root and the label of the object
  in the way, and D6 states the exception in so many words.
- D10 scopes its promise to the object-permission and row-access
  gates, places field permissions ahead of the engine's hooks, and
  gives a line write two rules: the caller's read door first for a
  master the write names, the stored state for a master the line
  already hangs under.
- D5 names the approval round's outcomes, the submitter's own recall
  among them, and says which actions run elevated.
- D7 says what Change Owner and the banned-user hand-over do on a
  closed record.
- Alternatives gain the readings not taken; the per-row ceiling is
  re-anchored; Execution gains the card for the approvals-family read.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f79eda94104ceceb10af703b712b766283d11fe3
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7197474873, which passed head fe9a850c86 with S7 and S8 open and nits N7 to N9. Read for this record: card #36253 with its four comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one file, the ADR, 98 lines added and 46 removed; docs/adr/README.md did not move), both earlier records, and the check-runs on this head. Every code position the delta adds or rewords was opened on main at ddd5941898. Four files the record cites have moved on main since the commit it names; the positions it cites read the same there. Security-touching: yes is meant: this head rewrites who is told a lock's reason, what a refused cascade names, and what a line's writer learns of a master.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. The record's title and its Proposed keyword did not move, main has added no record since the branch point, and 0162 is still free there. Right.
  • What the record now announces for later, where this head changed it:
    • lockReason goes to every reader of the record, and a locked answer always carries it. An addition on a read that does not exist yet. Right. One line of the answer's shape is stricter than the code it leans on: see N12.
    • A delete whose cascade would reach a closed record is refused before the first row is removed, under the existing code, in a sentence of its own in every locale. A new refusal for a declaring app only. Right.
    • Change Owner, its cascade and the hand-over of a banned user's work are refused row by row on a closed record, inside the report shape those doors already answer. No new member. Right.
    • An action that updates declaratively is refused on a closed record like an edit. It follows from D5 and adds no surface. Right.
    • Execution item 6: one more card, which decides whether the approvals-family lock routes retire or are redirected. It publishes nothing until it is ruled. Right.
  • The showcase. Not touched by the delta. The count of the second record stands.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card is an addition, and so is the read card.

Check-runs on the head, read just before this record was written: 48 runs, all completed: 26 success, 22 skipped, none red. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped on this head; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head. The answers of the first record stand, with its one condition: the status-mirror note is filed as a child card of its own when the build cards are filed.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The ruling. Ruling record 7200732942 is a comment on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253, as the record cites it in each of its five places. Its words are "all as recommended", and it names what it covers: the four marked points and the three points the second review left open. The quotation in the record is exact. The record text does not carry what was recommended: see N13.
  • The other cited records. 7073676422 on [PM seat] security · seat 2 — 🟢 os-justin · high only #32004, 6281609466 on showcase: a new line can be inserted on a paid invoice, so its total moves — readonlyWhen is insert-exempt by design, and nothing else locks a paid header against new lines #24684 and seat ruling 7152650156 sit where the record says, unchanged by the delta. The ruling on console: a non-participant reader is offered inline edit on a record whose pending approval locks it (lockRecord: true), and the save answers 409 RECORD_LOCKED #25934 is cited by its card, option A, as the approvals contract records it; the contract says so at packages/spec/src/contracts/approval-service.ts#getRecordLock, and the card carries that ruling with the same date.
  • The four ▲ points. Each is now marked as ruled, with the other reading kept beside it. ▲1, ▲2 and ▲4 read as they did; ▲3 is closed as a question and item ③ is scoped to readonlyWhen.
  • Two rules new on this head carry no ▲ and are not in the list the record gives of what the ruling settled: the two rules for a line write and a master its writer cannot read (D10, with an alternative recorded), and the change of owner (D7, with an entry under "Left open"). They are the record's own text, judged in ④, and the maintainer adopts them with the rest at the merge. The PR body lists the first under "Read first".
  • One spelling for the seat to confirm. The card's ruling record and the ADR quote the maintainer in English. The PR body quotes the same ruling in Chinese. AGENTS.md keeps a ruling in the words it was given in; whichever is the original is the one both carry.
  • SQL push-down. The delta adds no id materialisation. The cascade judgement is made on the set the engine already collects before it writes (packages/objectql/src/engine-cascade-planning.ts#cascadeDeleteRelations), and the record gives that as the reason. The probe over that set takes D4's shape on the engine card: one existence probe per object in the set, with the semi-join to the master for a line. S1 stays closed.

④ Design judgment

The points of the second record.

  • S7: closed. The rule that withheld the reason is gone. D9 gives the reason to every reader of the record, states the one bit this lets out and why it is accepted, and D8's sentence about a tighter line on the read is gone. Alternatives keep both readings not taken. Execution item 2, "What an author has to know" and "What it costs" agree.
  • S8: closed. D10's promise is scoped to the object-permission and row-access gates and says where it stops. D6 says what a cascade is judged on, when, and what its refusal names, and states the exception in so many words. D8 gives the cascade its own sentence. D10 names the gates that have not run by the point of judgement and says the judgement does not wait for them.
  • N7: closed. D4 words the ceiling as the Readings row does and anchors it in engine-hook-dispatch.ts, where it is declared; it is asked after the rows are read (engine-update.ts, the call beside readPriorRows).
  • N8: closed. A locked answer always carries a reason, the upload-link door chooses its sentence by it, and Execution item 4 no longer has a plain-lock wording.
  • N9: closed. Alternatives has the entry "A request is not opened on a closed record", and D5 points at it.

The delta against the code it cites. The new and reworded Readings rows hold: the cascade set collected and its in-cascade restrict judged before any write, with the legs deleted one at a time as the caller, and as one unit of work only where the engine can open one over every participant; the restrict refusal naming both objects by label and giving a count only where the caller's own read returns the same rows; the reference gate asking the caller's read door first, answering reference_not_found, not asking again about a stored value, and running after the before-phase hooks; readonlyWhen reading a header in two reads and holding as locked when the door does not return it; write-side field permissions refused in the security layer's middleware, which a system context passes whole; the written-image check after the hooks; Change Owner and the hand-over writing row by row as the caller and reporting each refused row; the pending line lock judging an update or delete on the stored row's masters, read in a system context, and wording its refusal with no title; the status mirror's values, and its put-back of the value held at submit when a request is abandoned.

The two places where the author departed from the decision text. Both hold against the code.

  • An action's visible and disabled. No dispatch door reads them. The runtime says so in its own words where the activation switch is written (packages/runtime/src/domains/actions.ts), the declarative update leaves visible unread on purpose (packages/runtime/src/action-execution.ts#executeDeclarativeUpdateAction), and the guide says that in a UI gate they decide only what is shown (content/docs/ui/actions.mdx). A script body runs elevated whoever invokes it (#buildActionExecutionContext), behind requiredPermissions where the action declares them. A declarative update is written under the caller's own context, and that function forbids the elevated one by name. So the record is right to name the body's own state check as the ▲1 risk, and right that a declarative "reopen" is refused. One imprecision is N15.
  • readonlyWhen and field permissions. readonlyWhen strips a system context's value too (packages/objectql/src/validation/rule-validator.ts), so a state field locked by it could not be set by an action body either. Field permissions are asked in the security layer's middleware, and a system context leaves that middleware before the field check is reached. So field permissions are the tool that reserves the closing write to an action, and the record names the right one.

I tried to break the three rewritten rules. D6 holds for a root the caller may delete over a closed row the caller could not have deleted: the refusal comes before the first write, which is what "refused whole" needs on a store with no unit of work, and the record accepts what it tells. D10's two rules hold at each end of a move, for a named master the read door fails on, and for a value the row already stores. D9 holds against the approvals contract's own promise to readers. One thing did not hold.

No must-fix.

S9 (should-fix) — D5 says the mirror field always tells what happened, and for a field that declares no recalled value it does not.
D5 says: "In each case the field says what happened. A document edited after a recall or a rejection reads recalled or rejected, and it reads approved again only through a new approval." "What an author has to know" repeats it: "The field then reads rejected or recalled, not approved." D5's own bullets, read together, say otherwise. A returned round leaves the record open, and a caller edits it by hand. A recall on a field that declares no recalled value puts back the value held at submit, which is approved, and the record is closed again. D5's recall bullet covers only a round recalled while it is pending. ADR-0044 also lets the submitter recall a returned request, and the mirror puts back the same submit value there (packages/plugins/plugin-approvals/src/approval-service.ts#mirroredStatusValue). So after such a round the field can read approved again over hand edits, with no new approval. A second bullet is narrower than it reads: "While the round is pending, the pending lock holds the record" is true of a node that locks, which is the default, and an approval node may declare lockRecord: false (packages/spec/src/automation/approval.zod.ts). Two more writers leave the recall outcome and are not named: an administrator's override recall of a pending request, and the sweep that releases a record held by a dead run. The particulars are with the seat.

The decision to keep the path is the maintainer's and is not reopened here, and the gate the record gives the author still works. What is wrong is the account of the outcome. The maintainer kept the path on that account, and Execution item 5 sends it to the docs by name. The fix is prose: state these outcomes in D5 and in the author's note, say that an author who closes on the mirror field declares recalled among its options or gates the flow's start, and drop the sentence that the field reads approved again only through a new approval. Whether the mirror should ever put a closed value back is the approvals plugin's question and goes to the seat as a card of its own. The seat tells the maintainer that the account of this ruled point changed.

Nits. None moves a decision. Each is fixed on this prose face or carried to its build card.

  • N10 (nit) — D8's cascade sentence says "a closed record of the named object would be removed with it". D6 judges two cases, and in the second the closed record is not removed: a row in the set is a line of a closed record that stays. The sentence needs a wording for that case, and a line saying it takes D8's label form when the root has no title the caller is served or the delete names many records.
  • N11 (nit) — D9's paragraph on what the read discloses speaks of a reader whom field permissions keep from the state field. D10 states the matching case for a line's writer who may not read the master. D9 does not state it for a line's reader, and "What an author has to know" follows D9. The particulars are with the seat.
  • N12 (nit) — D9's answer shape says lockSource and lockReason are "present exactly when locked is true". The approvals contract lets an implementation omit lockSource on a locked answer (packages/spec/src/contracts/approval-service.ts#getRecordLock). The read card either requires the source at the internal seam or leaves lockSource optional under approval.
  • N13 (nit) — the record attributes to ruling record 7200732942 the particulars of each point, and Execution item 5 says the ruling "asks for three by name". The ruling record holds the maintainer's three words and the list of points they cover, not the text that was recommended. The seat adds that text to the card under the ruling record, so the citation can be read at the place it points to. No change to the PR.
  • N14 (nit) — D10 judges a line write before the before-phase hooks, on the master the write names. It does not say whether a master that a before-phase hook supplies is judged. The reference gate treats only a caller-supplied value as the caller's. The engine card says which it is and pins it.
  • N15 (nit) — D5 and "What an author has to know" say an action's "script body" runs elevated, and that the way out needs "a script body, or a flow that runs as system". A handler registered for a script action runs elevated through the same context builder, so the docs card names it beside the body.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S7, S8 and N7 to N9 are closed. The ruling is carried into the text as its record states it, every cited record sits where the ADR says, and both departures from the decision text are right against the code. One account in D5 is false for a field that declares no recalled value, which is S9, and it owes a delta review of its fix. Nothing found makes a decision wrong. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…d value back

The maintainer ruled a second time on 2026-11-26 (ruling record
7201405662 on the card): a new approval round stays a way out of a
state closed on the approval's status field, and a recall never
restores a closed value. The third contract review of this record
raised the question.

- D5 states the rule for the three writers that abandon a request: the
  submitter's recall, an administrator's override, and the sweep of a
  dead run. A field that declares `recalled` is written `recalled`, as
  today. Otherwise the mirror never puts back a value the object
  declares closed, and it leaves alone a record that is closed on the
  field at that moment.
- D5 no longer says the pending lock holds every pending round: it
  holds where the approval node locks, which is a node's default.
- Execution gains the approvals card for the put-back, released with
  the key, and one more reading for the build to run and pin.
- Alternatives record the other values the put-back could have
  written. Consequences tell the author what an abandoned round
  leaves, and what it costs.
- D8 words the cascade's refusal for both cases D6 judges, and says
  when it takes the label form. D9 states what a line's reader is
  told.
- Both rulings are quoted as given, with an English reading beside
  each.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
The ruling record words the rule as a recall that never writes the
state field back to a value in the closed set. D5 now reads it that
way: where the object closes on `recalled`, the mirror does not write
`recalled` either, and the field is treated as one that declares no
`recalled` value.

The narrower reading, a rule on the put-back only, moves to
Alternatives. Execution, Consequences, the header and the TL;DR follow
the wording.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: eec0a5e150a59403b0583f68e17e206668bbf007
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7201298747, which passed head f79eda9410 with S9 open and nits N10 to N15. Read for this record: card #36253 with its five comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (two commits, one file, the ADR, 57 lines added and 22 removed; docs/adr/README.md did not move; f79eda9410 is an ancestor of this head, so no history was rewritten), the three earlier records, and the check-runs on this head. Every code position the delta adds or rewords was opened on main at 1dbf19a162. approval-service.ts has moved on main since the commit the record names, in places away from the status mirror; the positions the record cites read the same there. Security-touching: yes is meant: this head says what a line's reader is told about a master it may not read, and adds a rule on what a platform service writing in a system context may write.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. The record's title and its Proposed keyword did not move. main has amended five records since the branch point and added none, its index is byte-identical to the branch point's, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • The approvals plugin changes one behaviour: on a transition that abandons a request, the status mirror no longer writes a value the object declares closed on the mirror field. It is new only for an object that declares a closed value on a field an approval mirrors onto. No contract member, route or answer shape changes. Right.
    • Execution item 7: one more build card, for the approvals plugin, released with item 1. The coupling runs the right way: the key is what gives "closed value" a meaning, and it is not published while an abandoned round can still write one. Right.
    • A fourth reading for the build to run and pin. Right as a hand-off. Its premise is narrower in the tree than as written: N17.
    • The D10 table gains a row for the mirror, changed in one respect. The header's "Leaves unchanged" list never named the mirror, and the Alternatives entry that said this record leaves the approvals plugin as it is was reworded. The record is consistent with itself on this. Right.
  • The showcase. Not touched by the delta. Its invoice closes on a business status, and no approval node in the showcase uses the status mirror at all (examples/app-showcase/src/automation/flows/index.ts says why), so the proof of Execution item 3 does not exercise the new rule. The approvals card's own tests are the rule's only proof. Right, and the seat should know it when it files item 7.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card and the read card are additions, and the approvals card changes behaviour only for an object that declares the key, so it rides the key's release.

Check-runs on the head, read just before this record was written: 48 runs, all completed: 25 success, 22 skipped, 1 cancelled, none failed. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. The cancelled run is the first of two PR-body guards runs on this head; the second run of the same check started as the first was cancelled, and it is success. Both Check Changeset runs are skipped on this head; the PR carries the skip-changeset label.

③ Boundary flags

④ Design judgment

The points of the third record.

  • S9: closed. D5 no longer says the field always tells what happened. Each outcome of a round is stated by the values the field declares, the sentence that the field reads approved again only through a new approval is gone from D5 and from the author's note, and the rule the maintainer added makes the remaining claim true of the mirror. The pending bullet is conditioned on the node's lockRecord, which defaults to locking (packages/spec/src/automation/approval.zod.ts). The three writers that abandon a request are named with their positions.
  • N10: closed. D8's cascade sentence now fits both cases D6 judges, and says when it takes the label form.
  • N11: closed. D9 states the case for a line's reader, and it agrees with what the approvals contract answers a line's reader today (packages/spec/src/contracts/approval-service.ts#getRecordLock).
  • N12, N14 and N15 are not touched by the delta. They stand as accepted deviations, routed to the build cards.
  • N13 is the card's. On the ADR side the header and Execution item 5 now attribute the particulars to the recommendations the maintainer adopted, which is accurate. The card still does not carry the recommended text.

The rule, against the ruling. The head states it the same way in each place it appears: the header, the TL;DR, D5, the D10 table, Execution item 7, the author's note and Alternatives. No value the mirror writes for an abandoned request is a closed value of the mirror field, recalled included, and a field whose recalled is a closed value is treated as one that declares none. The three writers are the ones the tree has: the submitter's recall of a pending or a returned request, the override on a pending request only, and the sweep of a dead run, which scans pending requests only (approval-service.ts#recall, #abandonForDeadRun). Those are the only two call sites that hand the mirror the submit snapshot. No other transition finalises a request as recalled; a record's delete cancels its request and leaves no record to mirror onto.

The fallback order, against mirroredStatusValue on main. D1 admits only a select with declared options, so the branch of the mirror that writes any status onto a field with no value set cannot arise for a declared state field. For such a field main writes a status the options declare; otherwise nothing, unless the request is abandoned; then the value in the submit snapshot where the field declares it, else the default where the field declares it, else empty. The record's reading of that is right, and D5's order follows it step for step. Case by case:

  • recalled declared and not closed. Written, whatever the field holds, as today. This includes a record the round never opened, on a field that declares neither pending nor returned: the recall opens it. D5 says the record this value leaves is open, and the Consequences entry on a mistaken round covers it. It holds.
  • No recalled the mirror may write, and the round opened the record. The field holds pending or returned, an open value. The submit value approved is passed over, then a closed default, and the record ends on the default or empty. Under lockRecord: false, and in the revise window of a returned request, the record could be edited, and nothing closes it again. It holds.
  • No recalled the mirror may write, on a field that declares neither pending nor returned. The mirror never moved the field. The record stayed closed for the whole round under this lock, whatever the node's lockRecord says, since the closed-state lock does not ask it. Nothing is written and the decision stands. It holds.
  • Empty on a required field. The rule holds whether or not the write lands, as D5 argues. The reading under it is narrower than written: N17.
  • A field that holds a closed in-flight status. This one does not hold: S10.

No must-fix.

S10 (should-fix) — the "left alone" test strands a record on an in-flight status the object closes on.
D5 says: "where the field holds a closed value when the request is abandoned, the mirror writes nothing". The reason it gives covers one case, the field the round never moved. The test is wider than that case. D1 lets an author list any declared option as a closed value, and D5's own sentence on a new round allows for a closed pending ("the first status the mirror writes that is not a closed value"). Take an object that closes on pending and approved, on a field with no recalled the mirror may write. A draft is submitted and the mirror writes pending. The request is then abandoned by any of the three writers. The field holds pending, a closed value, so the mirror writes nothing. The request is finished, the pending lock is gone, and the record still reads pending and is closed to every caller. On main the same recall puts the draft value back. Three things are wrong with that outcome, by the record's own text:

  • It is the outcome Alternatives rejects under "Write nothing, and leave the field at the value it holds": the field says an approval is in progress when none is, and an app that gates its flow's start on the field may never admit the document again.
  • Two of the three writers exist to release a record. Alternatives says so of the sweep, and the override is there to free a stuck record (approval-service.ts#isOverrideActor). Here they release the pending lock and leave the record closed.
  • No decided document and no unseen edit is involved, so the ruling's purpose is not what keeps the record closed.

The same holds for a field closed on returned and a request recalled from its revise window. "Points the ruling does not settle" words the choice as leaving alone "a record the round never opened", which is narrower than the test D5 gives the builder, and Execution item 7 has the build pin the wider one ("the value the field holds closed and not").

The ruling is not in question: writing nothing never writes a closed value. What is incomplete is the record's own choice inside it. The fix is prose, and which way is the author's: scope the test to a record the round never moved (the field still holds the value it held at submit), so that a field left on a closed in-flight status goes down the order like any other; or keep the test, state this case in D5 and in the author's note, and say what an author who closes on pending or returned gets when a request is abandoned. Either way Execution item 7's test list names the case.

Nits. None moves a decision. Each is fixed on this prose face or carried to its build card.

  • N16 (nit) — The "What it costs" entry says a round opened on a decided document and then abandoned "leaves the document open", and the author's note says an abandoned round "stays open" on recalled, the default or empty. D5 has a case where neither is so: on a field that declares neither pending nor returned, with no recalled the mirror may write, the round never opens the document and it keeps its decision. Both sentences are true of a round that opened the document and should say so. Execution item 5 sends every author's note to the docs.
  • N17 (nit) — D5 and the new Readings row say an update that empties a required field is refused. The validator makes that refusal for a field that is not readonly; for a readonly field it judges shape only and does not ask required (packages/objectql/src/validation/record-validator.ts#validateRecordInScope). The approval node's own schema advises that the mirror field be readonly (approval.zod.ts#approvalStatusField), so on the advised configuration the validator does not refuse the write of empty. The rule holds either way. The approvals card runs both configurations. The same Readings row leaves out that an empty value at submit is put back as empty without asking the default.
  • N18 (nit) — "Points the ruling does not settle" says two things inside the second ruling are the record's own choice. A third is there: that a recalled the object closes on is not written either. D5 and the header call it reading the rule "to the letter", while the Alternatives entry beside it says the ruling's own word is 恢复, restore. It is a reading that goes past the maintainer's words, with the other reading recorded, and it belongs in that list so that the maintainer adopts it as one.
  • N19 (nit) — The header dates the second ruling "at 19:15Z". The ruling record on the card reads 19:16Z and gives no separate time for the answer.
  • N20 (nit) — The override arm of recall admits a system context as well as an administrator, on a pending request (approval-service.ts#isOverrideActor). D5 and the Readings row name three writers by who acts. Execution item 7 applies the rule "on every transition that abandons a request", which covers it; its tests should be counted by transition.
  • N21 (nit) — The mirror warns today when it leaves a status unwritten because the field does not declare it. D5 does not say whether it logs when it withholds a declared recalled or passes over a closed value. An author who closed on recalled has no other trace of why the field reads the default. For the approvals card.
  • N22 (nit) — Outside the delta, in Execution item 1 since the first head: "One PR or a stacked pair". AGENTS.md does not support a stacked series; a change that spans cards uses a trunk branch. For the seat when it files the cards.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S9, N10 and N11 are closed. The second ruling is carried into the text in the maintainer's own words, the rule is stated the same way everywhere it appears, the three writers are the ones the tree has, and the fallback order follows the mirror's code on main. One case of the record's own choice does not hold: a record left on an in-flight status that the object closes on, which is S10, and it owes a delta review of its fix. Nothing found makes a decision wrong or departs from a ruling. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The fourth contract review found one case the record's own choice did
not hold: an object that closes on `pending` or `returned` was left on
that status, closed, when its request was abandoned.

- D5 scopes "the mirror writes nothing" to a field that still holds
  its value at submit. A field the round left on a closed in-flight
  status goes down the order like any other.
- D5 and the points list say whose reading it is that a closed
  `recalled` is not written, and count three things as this record's
  own inside the second ruling.
- Consequences say which abandoned rounds leave a document open.
- The header gives the second ruling's recorded time and links the
  record of the first ruling's original words.
- Execution item 1 names a trunk branch in place of a stacked pair.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 32225e8b14351112a4ea8a2ac1c2ee76e3a1a675
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7202211190, which passed head eec0a5e150 with S10 open and nits N16 to N22. Read for this record: card #36253 with its six comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one commit, one file, the ADR, 16 lines added and 13 removed; docs/adr/README.md did not move; eec0a5e150 is an ancestor of this head, so no history was rewritten), the four earlier records, the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at 6d106a1a45. approval-service.ts has moved on main since the commit the record names, in places away from the status mirror; #mirrorStatusField, #mirroredStatusValue, #recall and #abandonForDeadRun read the same there. Security-touching: yes is meant: this head changes what a platform service writing in a system context may write, and states a case in which a record stays closed to every caller.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. The record's title and its Proposed keyword did not move. main has amended five records since the branch point and added none, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • The mirror's "write nothing" case is narrower. It now holds only where the field still holds its value at submit and that value is closed. The approvals card therefore reads two things before it chooses a value: what the field holds, and what the request's snapshot holds for it. Against the previous head this changes the outcome only for an object that closes on pending or returned. Right as a change. One arm of the new test has no answer: S11.
    • Execution item 7's test list gains two cases, and the fourth reading gains the case where the value the field keeps is a closed pending or returned. Right.
    • Execution item 1 names a trunk branch for work that spans cards. Right.
  • The showcase. Not touched by the delta, and its proof still does not exercise the mirror's rule. The approvals card's own tests remain that rule's only proof.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card and the read card are additions, and the approvals card changes behaviour only for an object that declares the key, so it rides the key's release.

Check-runs on the head, read just before this record was written: 48 runs, all completed: 25 success, 22 skipped, 1 cancelled, none failed. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. The cancelled run is the first of two PR-body guards runs on this head; the second run of the same check is success. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head. The answers of the first record stand, with its one condition: the status-mirror note is filed as a child card of its own when the build cards are filed. N24 adds one line to that card.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The record of the ruling text. Comment 7202242844 on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 carries the first ruling's original words, the recommendations it adopted, and the text of the option chosen in the second. The ADR cites it in four places and quotes the option, 「ADR 加一条:撤回永远不把状态写回关闭值」, character for character, with the English reading that record gives. That closes N13 on the card's side.
  • The seat's reading. The header, D5, "Points the ruling does not settle" and Alternatives now say that not writing a recalled the object closes on is the seat's reading of the option's text. The maintainer's own word, 恢复, restore, is kept beside it in "Points" and in Alternatives, with the narrower reading recorded as not taken. The PR body's "Small decisions" says the same at item 4. The option's verb is 写回, write back, so the option text does not settle between the two readings by itself; the record no longer says it does, and gives the rule's purpose as its ground. That is what the fourth record asked for.
  • Two things for the seat to put to the maintainer before the approval, in the maintainer's language. The quick-read block of the PR body says both rulings are written into the text and asks for the approval. It does not say that the merge also adopts one reading that is wider than the maintainer's word, or that D5 now states a case in which an abandoned round leaves a record closed with no request open. Both are in the record. Neither is in that block. No change to the tree.
  • Choices new on this head that carry no ▲. None. The list in "Points the ruling does not settle" now has three entries inside the second ruling, one reading and two choices, and the second choice is worded as this head decides it.
  • The other cited records. 7073676422 on [PM seat] security · seat 2 — 🟢 os-justin · high only #32004, 6281609466 on showcase: a new line can be inserted on a paid invoice, so its total moves — readonlyWhen is insert-exempt by design, and nothing else locks a paid header against new lines #24684, seat ruling 7152650156 and the console: a non-participant reader is offered inline edit on a record whose pending approval locks it (lockRecord: true), and the save answers 409 RECORD_LOCKED #25934 ruling sit where the record says, untouched by the delta.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The delta adds no id materialisation and no in-app join. The narrowed test has the mirror read one field of the one record it is about to write, by id. No finding. S1 stays closed.

④ Design judgment

The points of the fourth record.

  • S10: closed. D5 leaves a record alone only where the field still holds the value it held at submit and that value is closed. A field the round left on a closed pending or returned goes down the order, in a bullet of its own. The author's note, Execution item 7's test list, the fourth reading and Alternatives name the case, and Alternatives records the earlier test as not chosen, with the reason. The fix took the first of the two ways the fourth record offered, as that record worded it. That wording leaves one arm without an answer, which is S11.
  • N16: closed. Both Consequences entries speak of a round that opened the document, and the author's note says when a document keeps its decision. One word of the fix is N25.
  • N18: closed. See ③.
  • N19: closed. The header reads "recorded at 19:16Z", which is what the ruling record carries.
  • N22: closed. Execution item 1 says one PR, or a trunk branch where the work spans cards, with the sentence AGENTS.md has on a stacked series.
  • N17, N20 and N21 are not touched, by the author's stated choice, and go to the approvals card as accepted deviations. N17 now carries more than it did: see the corner below. N12, N14 and N15 stand as before.

The narrowed test, against mirroredStatusValue on main. The cases of the fourth record, run again on the new text:

  • recalled declared and not closed. Written, whatever the field holds. Unchanged, and it holds.
  • No recalled the mirror may write, and the field holds an open pending or returned. Down the order, with a closed value at submit and a closed default passed over. Unchanged, and it holds.
  • No recalled the mirror may write, on a field that declares neither pending nor returned. The field holds its value at submit. Where that is closed, nothing is written and the decision stands. Where it is open, the same value is put back, as on main. It holds.
  • A field the round left on a closed pending or returned. The field no longer holds its value at submit, so the mirror goes down the order. A draft submitted on an object that closes on pending goes back to its draft value when the request is abandoned. This is the case of S10 and it holds now. A request can be abandoned only while it is pending or returned (approval-service.ts#recall, #abandonForDeadRun), so these two statuses are the whole set.
  • A decided document on an object that closes on pending beside approved. The round moves it from one closed value to another. It is never open, and an abandoned round leaves it on the default or empty, with its decision gone. That follows from the ruling: the value at submit is closed and may not be written. Alternatives has the other way, "Put the closed value back where the round gave no window to edit", not chosen for a stated reason. It holds. How Consequences words it is N25.
  • A request that carries no value at submit for the field. No answer: S11.

The corner D5 states. Where the order comes down to empty on a required field, the write is refused, the field keeps the value it holds, and where the object closes on that value the record stays closed with no request open. The fourth record's S10 was about this outcome, and here it remains for one configuration. Three questions.

  • Are the stated conditions exact? Against mirroredStatusValue, yes. The mirror reaches empty where there is no recalled it may write, the value at submit is closed, not declared or not carried, and the default is absent, not declared or closed. "No default the mirror can use" covers the last, and the order covers the rest. Against the validator, they are exact for a required field that is not readonly. The refusal is made for a system context as for a caller, but on a readonly field the validator judges shape only and does not ask required (packages/objectql/src/validation/record-validator.ts#validateRecordInScope), and readonly is what the approval node's schema advises for this field (packages/spec/src/automation/approval.zod.ts, approvalStatusField). On the advised configuration the write of empty lands: the record is left open with an empty required field, and no record is held. That is N17. It is no longer only the premise of a reading. It decides which of two outcomes an author gets, and the approvals card pins both.
  • Is the guidance adequate? In substance, yes. Each of the two ways D5 gives is sufficient against the code: a declared recalled the object does not close on is written before any order is consulted, and a declared default that is not closed ends the order one step before empty. In placement, no. The guidance is in D5 only: N23.
  • Is the approvals card's pinned test enough, or should the ADR rule it? The test is enough, and no further rule is asked of this record. The outcome is not left open; D5 states it. At that step nothing is left that the mirror may write: every candidate is closed, not declared, or refused by the validator. The ways around it are a value the field does not declare and a refusal at publish, both in Alternatives and not chosen for reasons that still stand, or a write the validator does not judge, which nothing in this record proposes. So the outcome follows from rules the record already decides, and what the card verifies is a reading the record did not run. What the record still owes is to say that it accepts the outcome, because Alternatives turns down the earlier test for this same outcome: N23.

No must-fix.

S11 (should-fix) — the "left alone" test reads a value the request does not always carry.
D5 says: "where the field still holds the value it held at submit and that value is a closed one, the mirror writes nothing". The value at submit is read from the request's snapshot, which is the record the flow was started with. That record does not always carry the field, and mirroredStatusValue on main has an arm for exactly that: it asks whether the snapshot has the field before it reads it, and goes to the default where it has not. D5's order covers that arm ("or failing that"). The test does not. Where the request carries no value at submit for the field, neither way of completing the test keeps both of D5's bullets:

  • Read as "not shown to be unmoved", the mirror goes down the order and writes the default or empty onto a record that stayed closed for the whole round. That is the outcome Alternatives turns down under "Open every record whose value at submit was closed, including one the round never moved", and the one the bullet's own reason excludes ("anything else would open a record the round never opened").
  • Read as "left alone wherever the field is closed", it is the earlier test again, and a record on a closed pending or returned is left there. That is S10.

The ruling is not in question: neither completion writes a closed value. What is incomplete is the record's own choice inside it, as with S10, and as the text stands the builder of item 7 makes that choice. The fix is prose, and which way is the author's: say what the mirror does where the request carries no value at submit for the field, for example by judging what the field holds (a closed value that is one of the request's own statuses goes down the order, any other closed value is left alone), and add the case to Execution item 7's test list. How such a request comes about is with the seat.

Nits. None moves a decision. Each is fixed with S11's prose or carried to its build card.

  • N23 (nit) — D5 states the corner, and four other places read as if there were none. The bullet just above it is headed "A record is not left on the request's own status". The author's note says closing on pending or returned "does not leave an abandoned document there either", and Execution item 5 sends every author's note to the docs, so the docs would carry the sentence without its exception and without the guidance that avoids it. "What it costs" has no entry for it. In Alternatives, "Leave alone every record that is closed" is turned down for this same outcome, and "Refuse, at publish" says the rule already makes the declaration safe. One clause in each, and one sentence that the record accepts the outcome and why. The approvals guide of item 7 takes the exception and the guidance from D5.
  • N24 (nit) — The corner is one case of a wider one. Any mirror write that fails is logged and swallowed, and on an object that closes on pending or returned a failed write leaves the same record whichever transition it was: closed, with the request finished. Execution's first reading names the other direction only ("stays open if the mirror fails"). For the status-mirror child card.
  • N25 (nit) — Consequences says "opened" where D5's test is "moved". The two part on an object that closes on pending beside approved: a decided document there is never open during the round, and an abandoned round still leaves it on the default or empty. "What it costs" counts only a round that opened a decided document, and the author's note says a document the round never opened keeps its decision. The sentence on closing on pending or returned gives the mechanics; it does not say the decision is lost.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S10 is closed, and so are N16, N18, N19 and N22. The second ruling's widest point now reads as the seat's reading, with the maintainer's own word kept beside it. The narrowed test follows the mirror's code on main in every case but one: a request that carries no value at submit for the field, which is S11, and it owes a delta review of its fix. The corner D5 states is real, its conditions are exact for a field that is not readonly, and leaving its verification to the approvals card is acceptable for this record. Nothing found makes a decision wrong or departs from a ruling. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The fifth contract review found that the "left alone" test read a
value a request does not always carry.

- D5 leaves alone a closed value the round did not write, judged by
  what the field holds. A field on the request's own status goes down
  the order.
- D5's order passes over an empty value at submit on a required field.
- D5 says this record accepts the case in which a record stays closed
  with no request open, and names what the case takes. The bullet
  heading, the author's note, "What it costs" and two alternatives
  say it too.
- Consequences speak of a round that moved a document's state.
- Execution item 7's tests gain a request that carries no value at
  submit, and the approvals guide takes the exception.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3c67c7904fb6d4248594b3a645490bad6e91dad2
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7202670625, which passed head 32225e8b14 with S11 open and nits N23 to N25. Read for this record: card #36253 with its six comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one commit, one file, the ADR, 13 lines added and 11 removed; docs/adr/README.md did not move; 32225e8b14 is an ancestor of this head, so no history was rewritten), the five earlier records, the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at c2bfa3ef7c. approval-service.ts has moved on main since the commit the record names, in places away from the status mirror; #mirrorStatusField, #mirroredStatusValue, #recall, #abandonForDeadRun and #openNodeRequest read the same there. Security-touching: yes is meant: this head changes the test by which a platform service writing in a system context decides whether to move a closed record, and states as accepted a case in which a record stays closed to every caller.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. The record's title and its Proposed keyword did not move. main has added no record since the branch point, its index is byte-identical to the branch point's, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • The mirror's "write nothing" case is decided by one reading: what the field holds. A closed value that is neither pending nor returned is left alone; anything else goes down the order. The approvals card needs the request's snapshot only to choose what to write, no longer to decide whether to write. Right as the answer to S11. The premise the test rests on does not hold for one shape of flow: S12.
    • On an object that declares a closed value on the mirror field, the mirror's order gains a step main does not have: an empty value at submit on a required field is passed over and the default is asked. No object can declare the key before it is released, so no shipped outcome moves. Right as a change. It is not booked as the record's own choice: N26.
    • Execution item 7's test list gains the request that carries no value at submit and the empty value at submit on a required field, and the approvals guide gains the accepted case with the way round it. Right. Two arms are missing from the list: N27.
    • D5, the author's note and "What it costs" now say that the record accepts one outcome, and under which conditions. Right.
  • The showcase. Not touched by the delta, and its proof still does not exercise the mirror's rule. The approvals card's own tests remain that rule's only proof.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card and the read card are additions, and the approvals card changes behaviour only for an object that declares the key, so it rides the key's release.

Check-runs on the head, read at 2026-11-26T21:02Z: 48 runs, all completed: 26 success, 22 skipped, none failed and none cancelled. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

④ Design judgment

The points of the fifth record.

  • S11: closed. D5 no longer reads a value at submit to decide whether the mirror writes. It reads what the field holds, which every request has an answer for. A request that carries no value at submit now has both of its cases decided: on a closed value that is neither pending nor returned the mirror writes nothing, and on a closed pending or returned it goes to the default, then to empty. Execution item 7's test list names the request, and Alternatives records the earlier test as not chosen, with the reason. The author took one test where the fifth record suggested two. That is the author's to choose. Of the two differences the PR body names, the first is a gain. The second is a gain where the other writer is outside the flow run, and inside the run it opens a gap of its own, which is S12.
  • N23: closed. The bullet's heading is scoped ("wherever the mirror has a value to write") and points at the case stated next. D5 says the record accepts the outcome and why, and lists what it takes. The author's note, "What it costs", the two Alternatives entries and the approvals guide of item 7 carry it.
  • N25: closed. The author's note and "What it costs" speak of a round that moved the document's state, and both say that a decided document loses its decision also where it was never open during the round.
  • N24 is not touched, by the author's stated choice. See ③.
  • N17 is half closed: the Readings row now says that on main an empty value at submit is put back as empty. Its other half, the validator on a readonly field, stays with the approvals card, and N27 adds one line to it. N12, N14, N15, N20 and N21 stand as before.

The one test, against mirroredStatusValue on main. main does not read the field at all on this path: it answers from the request's snapshot and the field's declaration. The record's test adds one reading, of the field. Case by case:

  • recalled declared and not closed. Written, whatever the field holds. Unchanged, and it holds.
  • The field holds pending or returned, open or closed. Down the order: the value at submit where it is declared and not closed, then the default, then empty. For an open value this is what main does, with closed values passed over. For a closed one it is the answer to S10. It holds.
  • The value at submit is itself pending or returned. The first difference the PR body names. Under the previous head's test a record submitted on a closed pending would have been left on it. Here the field is on the request's status, so the mirror goes down the order and passes over the closed value. It holds, and it is better than the test the fifth record suggested.
  • An open value and no value at submit. The order goes to the default, then to empty, as main does where the snapshot does not carry the field. It holds.
  • A closed value that another writer set while the request was open. The second difference the PR body names. The mirror leaves it. Where that writer is no part of the same flow run, this is right: the mirror undoes its own statuses and nothing else, D2 already says that whatever sets the state closes the record, and the previous head's test would have had the mirror write over, for example, the outcome of another flow's approval decided while this request sat in its revise window. Where the writer is an earlier step of the same run, it does not hold: S12.
  • The accepted case. Its five conditions are exact against the order as now written, for a field that is not readonly: the order reaches empty only where the value at submit is closed, undeclared, empty or not carried and the default is closed, undeclared or absent, and the write of empty is refused only on a required field. Each of the two ways the author is given is sufficient against the code. The first always was. The second, a default that is not a closed value, is sufficient only because of the new step: without it an empty value at submit ends the order on main before the default is asked.

The step for an empty value at submit on a required field. Three questions.

  • Does it agree with main? With the validator, yes. On an update the validator refuses a supplied empty value on a required field that is not readonly, whoever writes (packages/objectql/src/validation/record-validator.ts#validateRecordInScope). The write main makes on its held == null arm is that write, so on such a field it never lands, and passing it over loses nothing that would have landed. With mirroredStatusValue itself, no, and by intent: on that arm main answers empty for every field and does not ask the default. The Readings row now says so. D5 still introduces the order as "the order it uses today".
  • Is it inside the rulings? Yes. It writes no closed value, and neither ruling says anything about an empty one. It is a choice of the record's own, inside "what the mirror writes instead".
  • Does it change shipped behaviour? No. D5 scopes the whole rule to an object that declares a closed value on the mirror field, and none can before the key is released. What it does change, on a declaring object, is an outcome in which no closed value is in play: a required field with a usable default and an empty value at submit ends on the default, where main attempts empty. D10's table says the mirror has one change and that every other write is unchanged. With this step, and with the left-alone test, that is no longer exact. This is N26.

The step is sound, and the record is right to take it: it is what makes the guidance true. It is under-recorded, not wrong.

No must-fix.

S12 (should-fix) — the test's premise is true of a request, and a flow run can hold more than one.
D5 says: "A request can be abandoned only while its status is pending or returned, so those are the only values the mirror has written in the round", and concludes that a closed value which is neither of them is one "the round did not put the record on". That holds for a run with one approval node. A run with successive approval nodes, which is how the platform models a multi-step approval, opens one request per node, and the mirror writes each request's outcome when that request is decided, whether or not a later step follows (approval-service.ts, the mirror call after the finalising update). So by the time a later step's request is abandoned, the mirror has also written the earlier step's approved in the same run. Every request of the run is opened with the run's own trigger record, which the engine seeds once when the flow starts, so each carries the same value at submit (packages/plugins/plugin-approvals/src/approval-node.ts, packages/services/service-automation/src/dag-traversal.ts#seedRunVariables).

Take an object that closes on approved, on a field that declares neither pending nor returned and has no recalled the mirror may write: the configuration D5 calls the usual case of this bullet. A draft is submitted to a two-step flow. Step one approves and the mirror writes approved. Step two opens and the field does not move. Step two's request is then abandoned by any of the three writers. The field holds a closed value that is neither pending nor returned, so the mirror writes nothing. The document reads approved and is closed to every caller, and its approval was abandoned before its last step. On main the same abandonment puts back the value at submit, and the previous head's test went down the order to that same open value. Three things are wrong with the outcome, by the record's own text:

  • The bullet's reason does not cover it. The round did put the record on that value.
  • The ruling does not ask for it. The value at submit is open and declared, and writing it writes no closed value.
  • Nothing in the record states it. D5's outcomes are written for a round that ends with one decision, the author's note says a document "whose state the round never moved keeps its decision", and Execution item 7's test list has no run with more than one step.

The same holds for an earlier step's rejected on an object that closes on it, where the reject edge leads to another approval node. A field that declares pending is not affected, as long as the write of pending lands when the next step opens.

The ruling is not in question, and neither is the choice of one test over two. What is incomplete is the set the test is drawn against. The fix is prose, and which way is the author's: draw the left-alone case against the statuses the run's own requests have had, not against pending and returned alone, so that a closed value an earlier step of the same run wrote goes down the order; or keep the test, state this outcome in D5 and in the author's note with what an author does about it, and say that the record accepts it. Either way the sentence on what the mirror has written in the round is corrected, and Execution item 7's test list gains a run abandoned in a later step. The particulars are with the seat.

Nits. None moves a decision. Each is fixed with S12's prose or carried to its build card.

  • N26 (nit) — The step for an empty value at submit on a required field is a choice of the record's own and is not booked as one. The header and "Points the ruling does not settle" count one reading and two choices inside the second ruling; this is a third choice. Alternatives has no entry for the reading not taken, which is to put the empty value back as main does on every field. D5 calls the order "the order it uses today" one sentence before it departs from it. D10's table says "One change" and "Every other write of the mirror is unchanged", while this step and the left-alone test both change what is written on a declaring object where no closed value would have been written. One clause in each.
  • N27 (nit) — Execution item 7's test list names the empty value at submit "on a required field" and the field on its two closed positions. It does not name the arms that tell the chosen rules from their neighbours: an empty value at submit on a field that is not required, which is still put back as on main; and the field on an open value, the request's own status or another, with and without a value at submit. The step's stated reason, "which the field would refuse", is also true only of a field that is not readonly: on the configuration the approval node's schema advises, the write of empty lands on main, and the step puts the default in its place. That joins N17 on the approvals card, which pins both configurations.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S11 is closed, and so are N23 and N25. The quick-read block now tells the maintainer, in Chinese, the two things the merge adopts beyond the rulings' words. The single test is right in every case of a run with one approval node. It is better than the test the fifth record suggested where the value at submit is itself the request's status, and where a writer outside the run closed the record meanwhile. The new step for an empty value at submit agrees with the validator, stays inside the rulings and changes nothing shipped; it wants booking as a choice. One shape of flow is outside the test's premise: a run with successive approval nodes, where an earlier step's outcome is a closed value the same run wrote. That is S12, and it owes a delta review of its fix. Nothing found departs from a ruling. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The sixth contract review found that the "left alone" test was drawn
against one request, while a flow run can hold several.

- D5 leaves alone a closed value that no request of the run had as
  its status. A closed value an earlier step of the same run wrote
  goes down the order, so a run abandoned at a later step does not
  leave the document on an earlier step's outcome.
- D5 states the case in which a record stays on such a value, and
  what it takes. Consequences and "What it costs" carry it.
- The step for an empty value at submit on a required field is
  counted as this record's own choice, with its alternative, and D10
  says what changes for the mirror.
- Execution item 7's tests gain a run abandoned at a later step and
  the arms that tell the chosen rules from their neighbours.
- Readings name where a run opens its requests.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f7d2eb4cb61aa1f5659e513fcd84984b992e9785
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7203327629, which passed head 3c67c7904f with S12 open and nits N26 and N27. Read for this record: card #36253 with its six comments, the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one commit, one file, the ADR, 19 lines added and 15 removed; docs/adr/README.md did not move; 3c67c7904f is an ancestor of this head, so no history was rewritten), the six earlier records (the fourth, fifth and sixth in full, since they judge the mirror's rule; the first three for their findings and what closed them), the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at c2bfa3ef7c; main has since moved to 9476092c7e with no change under the approvals plugin, the engine's validators, approval.zod.ts or the automation service. Security-touching: yes is meant: this head changes the test by which a platform service writing in a system context decides whether to move a closed record, and widens the case in which the record accepts that a document stays closed.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. main has added no record since the branch point and has not touched its index, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • The mirror's "write nothing" case is drawn against the statuses the requests of the flow run have had, no longer against pending and returned alone. The approvals card gains one read of its own table beside the read of the field. Right as the answer to S12. The unit it is drawn against, one flow run, is not always the whole of one record's approval: S13.
    • A draft abandoned at a later step of a run goes back to its value at submit, as on main. Right.
    • A decided document sent round a flow with more than one approval step loses its decision once a step of the new run is decided and a later step is abandoned. Stated in D5, the author's note and "What it costs", and stated exactly. Right, and judged under ④.
    • The outcome the record accepts now covers a record left on an earlier step's outcome. The five conditions are exact for the route D5 walks and are not the only route, and the outcome is of another kind than the one accepted before: S14.
    • Execution item 7's test list gains the arms N27 asked for and a run abandoned at a later step. D10's row for the mirror says what changes. The header and "Points the ruling does not settle" count one reading and three choices. Right.
  • The showcase. Not touched by the delta, and its proof still does not exercise the mirror's rule. The approvals card's own tests remain that rule's only proof.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the key card and the read card are additions, and the approvals card changes behaviour only for an object that declares the key, so it rides the key's release.

Check-runs on the head, read at 2026-11-26T21:31Z: 48 runs, all completed: 26 success, 22 skipped, none failed and none cancelled. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head. The answers of the first record stand, with its one condition: the status-mirror note is filed as a child card of its own when the build cards are filed. N24 was routed to that card as a nit. On this head it weighs more than a nit, and S14 takes it up.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • Escalated: one question for the maintainer. Ruling 7201405662 chose that the platform, and not a note to authors, keeps an abandoned approval from leaving a closed value behind. This head accepts, with a note to authors, a case in which an abandoned approval leaves a document reading approved and closed although its approval was not finished. Whether that case may be left to a note, or the platform must refuse the configuration that allows it, is the same kind of question the maintainer answered once, and neither the record nor the seat can answer it for the maintainer. S14 says what the answer has to cover. It goes to the maintainer as a question of its own, with its options, and not as a clause of the quick-read block.
  • The quick-read block, fourth line. It tells the maintainer in Chinese the two things an approval adopts beyond the rulings' words, and on this head the second of them names both forms of the accepted outcome: 「显示「审批中」却没有进行中的审批,或停在多步审批里前一步的「已批准」上」. That is true to the tree. Two things about it follow from S13 and S14. 「正文写了怎么避开」 holds only for the one route D5 counts. And the second form is offered for adoption by the approval itself, where it wants the maintainer's own answer first. The line also does not carry the cost this head adds, that a decided document sent round a flow with more than one step loses its decision once a step is decided and a later one abandoned; that cost is of the kind ruling 7201405662 already accepts, so one clause is enough.
  • The rulings. The delta does not touch either quotation. Records 7200732942, 7201405662 and 7202242844 sit on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 where the record cites them, and the option text, 「ADR 加一条:撤回永远不把状态写回关闭值」, is quoted as 7202242844 carries it.
  • Choices new on this head. The run-wide test is booked: the PR body says the seat chose it from the two ways the sixth record offers, and "Points" lists it among the three choices. The acceptance of an outcome on an earlier step's approved is not booked. It stands in D5, the author's note and "What it costs", it is not among the four things the header and "Points" count as the record's own, and it carries no mark. See S14.
  • The other cited records. 7073676422 on [PM seat] security · seat 2 — 🟢 os-justin · high only #32004, 6281609466 on showcase: a new line can be inserted on a paid invoice, so its total moves — readonlyWhen is insert-exempt by design, and nothing else locks a paid header against new lines #24684, seat ruling 7152650156 and the console: a non-participant reader is offered inline edit on a record whose pending approval locks it (lockRecord: true), and the save answers 409 RECORD_LOCKED #25934 ruling sit where the record says, untouched by the delta.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The delta adds one read: the statuses the run's requests have had, from the plugin's own table. It can be asked as one probe, on the run's id and the value the field holds, and it needs no history: every request opens on pending, and a request's row keeps the last status it reached. No id list and no in-app join is prescribed. No finding. One thing for S13's fix: the request row carries the object, the record and the id of the run that opened it, and the link from a child run to its parent is kept in the automation engine's run context, not on the row. A unit the plugin can ask its own table for in one probe is to be preferred to one that needs a walk of run links. S1 stays closed.

④ Design judgment

The points of the sixth record.

  • S12: closed. D5 draws the left-alone case against the statuses the requests of the run have had before the abandonment, the first of the two ways the sixth record offers, by the seat's choice. A closed value that an earlier step of the same run wrote goes down the order, so a draft abandoned at a later step goes back to its value at submit, as on main. The sentence on what the mirror has written now speaks of the run and names the outcome of an earlier request. Execution item 7's test list has the run abandoned at a later step after an earlier step was approved, Alternatives records the previous head's test as not chosen with the reason, and Readings has a row for the facts the test rests on (approval-service.ts#openNodeRequest, #decideNode, and the resubmission of ADR-0044, each read on main: a resubmission opens a new request under the same run and node, and the returned row keeps its status). One sentence is added that the rule assumes a mirror field callers do not write, with the schema's own advice as its anchor (approval.zod.ts#approvalStatusField, "make it read-only"). What the fix leaves is not S12: it is the same outcome where the steps are not all in one run, which is S13.
  • N26: closed. The header and "Points" count four things, one reading and three choices, and the third choice is the step for an empty value at submit. Alternatives has the reading not taken, with both kinds of field. D5 says the order is today's with two departures. D10's row says where the mirror changes and what changes there.
  • N27: closed. The test list names an empty value at submit on a field that is not required, and a field on an open value, the request's own status or another, with and without a value at submit. D5, the fourth reading under "Execution" and the Readings row state the step's reason for both a field that is readonly and one that is not.
  • N17 is closed in the record's text by the same edits. What stays with the approvals card is the run that pins both kinds of field, and one line more: the validator's refusal is also not made for a system column, nor for a field that is required only when shown where the rule validator runs (record-validator.ts#validateRecordInScope). N12, N14, N15, N20 and N21 stand as before.

The run-wide test, against main. For a flow whose approval nodes all sit in its own body, it holds in every case.

  • One request. Every request opens on pending, so the set is pending and, after a send-back, returned. This is the previous head's test, with one gain: a closed returned on a record whose requests were never returned is no longer taken for the mirror's own.
  • Several requests, one run. An earlier step's approved or rejected, where the object closes on it and the next step had no pending to write, is a value the run wrote. The mirror goes down the order. With an open value at submit the result is what main does today.
  • A closed value from outside the run. Left alone, as on the previous head.
  • A closed value that is both. Where a writer outside the run and a request of the run arrive at the same value, the mirror cannot tell them apart and goes down the order. That costs a decision and keeps no unfinished one. It is the right way to err.

The cost the author flags: a decided document, a flow with more than one step. On a field that declares no pending, a decided document sent round again stays on approved and closed while the new run's first step is open. If the run is abandoned there, it keeps its decision. Once a step of the new run is approved, approved is a status a request of the run had, and an abandonment at a later step takes the document down the order: its value at submit is closed and is not put back, so it ends on the default or empty and has to be approved again. D5 says so in the bullet on a closed value the run wrote, the author's note says so in two sentences, and "What it costs" names both ways a document that was never open loses its decision. The statement is exact against the test as written. The same test gives one more case, and gives it consistently: where the earlier step's outcome is a status the field does not declare, no request of the run had the value the field holds, and the document keeps its decision.

Turning down the kinder alternative, to leave the earlier step's outcome alone where it equals the value at submit, is sound. The record's reason is that it brings back a reading of the value at submit for one case. There is a stronger one, and the record should give it: the two values being equal does not show that the document stayed closed during the run. On a field that declares returned as an open value, a first step can send the document back, the document is open to revision in the revise window of ADR-0044, and the step can approve it when it is resubmitted. The kinder rule would then leave a closed approved over changes the later steps never saw, which is what ruling 7201405662 exists to prevent. The rule the record chose, that the mirror undoes what its own run wrote, has no such case. This is N28.

No must-fix.

S13 (should-fix) — the test is drawn against one flow run, and one record's approval can be spread over several.
D5 says "A round, in this record, is one flow run", and draws the left-alone case against "the run's own requests". That is the whole of a record's approval only where every approval node sits in the flow's own body. A subflow node starts its body as a child run with a run id of its own, and so does each item of a map. An approval node inside one opens its request under the child's id, on the same record and from the same trigger record, because the child run inherits its parent's context (packages/services/service-automation/src/builtin/subflow-node.ts, packages/plugins/plugin-approvals/src/approval-node.ts#hasParentRun). ADR-0019, which this record builds on, carries the shape as its linked-runs model. The approvals service already states it as the limit of any read keyed on a run's id: a child run's end "is not the end of the record's approval", and a request a child run opened "is filed under the child's run id and is not among the rows read here" (approval-service.ts, the note above #attachFlowRoute).

So where one step of an approval sits in a child run and the next in its parent, or in a second child, the earlier step's outcome is a closed value that no request of the later step's run had as its status. On the configuration D5 calls the usual case of the bullet, a field that declares neither pending nor returned with no recalled the mirror may write, a request abandoned at the later step has the mirror write nothing, and the record stays on the earlier step's outcome, closed. That is the outcome S12 named. It takes none of the five conditions of the accepted case, and it holds on a readonly mirror field as on any other. On main the same abandonment puts back the value at submit. Two sentences are then true only of a flow that starts no child run: D5's definition of a round, and the Readings row that begins "A run opens one request for each approval node it reaches".

The fix is prose, and the unit is the author's to choose: the record's approval as a whole, which is the root run with the child runs linked to it, or another unit that covers it. Two things the choice should keep. First, the note under ③: a unit the plugin can ask its own table for. Second, D5 should say which way the mirror goes where it cannot tell whether the approval wrote the value; to go down the order costs a decision, and to write nothing keeps one that was not finished. Execution item 7's test list gains a later step abandoned where the earlier step ran in a child run, and the reverse.

S14 (should-fix) — the accepted case now holds an outcome of another kind, its five conditions are those of one route, and the record accepts it on its own word.

The five conditions, against main. For the route D5 walks they are exact. mirroredStatusValue comes down to empty only where there is no recalled to write, the value at submit is closed, undeclared, empty or not carried, and the default is closed, undeclared or absent; with the new step, an empty value at submit on a required field is one more way to the default and not past it. The record validator refuses the write of empty only on a required field that is not readonly (record-validator.ts#validateRecordInScope, with the two small exceptions noted above for the approvals card). On that route each of the two ways out the author is given is enough, and so are two the record does not list: a readonly mirror field, which is the schema's own advice, and, for the earlier-step form, a pending the field declares and the object does not close on.

It is not the only route. mirrorStatusField logs and swallows every refused write, not that one alone. The object's validation rules bind a write made in a system context: the state_machine rule is set aside only for a seed replay and a historical import (packages/objectql/src/engine-top-level.ts#shouldSkipStateMachine), and it judges the clearing of the field as a move to the empty value (packages/objectql/src/validation/rule-validator.ts#checkStateMachine). An object whose rule on the mirror field lists the closed value and gives it no move back, which is how an author who means a decision to be final writes it, refuses the put-back of the value at submit, the default, recalled and empty alike. The field then stays where the run left it with only the first of the five conditions present, on a field that is readonly or not, required or not, and neither way out avoids it. This is N24. The fifth record judged the five conditions exact against mirroredStatusValue and the record validator, which they are; it did not read the rule validator, which the same write also meets, and it graded N24 a nit when the value kept could only be pending or returned. On this head the value kept can be an earlier step's outcome, and "The outcome takes five things at once" is then a statement about the document's decision that is not true of the tree. S13 is a second route.

The kind of outcome. A record left on pending or returned with no request open reads as waiting. Nothing takes it for decided, and the fifth and sixth records passed its acceptance. A record left on an earlier step's approved reads as decided and is closed to every caller, when its approval was abandoned before its last step. The record's own Alternatives entry gives the ground of ruling 7201405662: "a lock that holds only where a note was read is not the platform's". The same holds of a decision. The sixth record's S12 was this outcome, and the seat did not take the way that accepts it. This head accepts it again for the configurations in which the mirror has nothing to write, in D5, the author's note and "What it costs", outside the four things the header and "Points" count as the record's own. A record may state a residual. Whether the platform may leave a document reading decided when its approval was abandoned, with a note to authors, is the question the maintainer answered for the general case, and it is escalated under ③.

What closes it. The maintainer's answer on the card, and D5 following it. If the answer is to accept, the acceptance is marked as ruled, counted in "Points", and stated with its true extent: every write of the mirror that an abandoned request needs and the object refuses, not five conditions. If the answer is that the platform prevents it, the record chooses the way with the ruling in hand. The ways are few and each meets something already decided: a refusal where the object or the flow is authored, of which Alternatives turns down a wider form; a refusal when a request opens on a configuration that leaves the mirror nothing to write; or an order whose last write lands. The record's reasons against a value outside the field's options and against refusing the abandonment stand. Either way D5 or the author's note should say that the mirror's writes meet the object's validation rules, and what an author who puts a state_machine rule on the mirror field owes the mirror.

Nits. None moves a decision. Each is fixed with the prose of S13 and S14 or carried to its build card.

  • N28 (nit) — The Alternatives entry "Leave alone an earlier step's outcome where it is also the value held at submit" gives the weaker of its two reasons. The stronger is above: equality with the value at submit does not show the document stayed closed during the run. One sentence.
  • N29 (nit) — The test says a value no request of the run "had as its status", and its reason says a value the run "did not put the record on". They part for a closed recalled: an earlier request of a run can end recalled and the run go on down its reject edge to another approval node, and the mirror never writes a closed recalled. The set meant is the statuses the mirror may have written: pending, returned, approved, rejected. One clause.
  • N30 (nit) — The author's note and "What it costs" name the earlier step's approved. D5 says "outcome", and an object may close on rejected where the reject edge leads to another approval node. And the ways out are given for both forms as one pair, where the earlier-step form has two more (S14). One clause in each.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S12 is closed, and so are N26 and N27. The run-wide test is right for a flow whose approval steps all sit in its own body, and the cost it adds for a decided document sent round a flow with more than one step is stated exactly; turning down the kinder alternative is sound, for a reason stronger than the one the record gives. Two points are open. S13: the unit of the test is one flow run, and an approval built with subflow or map is spread over several, so the outcome S12 named stands there unchanged. S14: the accepted case now includes a document left reading decided, its five conditions are those of one route out of at least three, and the acceptance is a question for the maintainer, not a choice of the record's. Both owe a delta review of their fix. Nothing found departs from a ruling's words. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

The seventh contract review found two things: the "left alone" test
was drawn against one flow run while an approval can be spread over
several, and the record accepted on its own word a document left
reading a decision its approval did not finish.

- D5 draws a round as the record's whole approval: the run started
  for it and every child run under it. Where the mirror cannot tell
  whether the round wrote a value, it goes down the order.
- D5 no longer accepts that outcome. On an object that declares a
  closed value on the mirror field, a round opens only where the
  field declares `pending`, the object closes on neither `pending`
  nor `returned`, and a `state_machine` rule lets a closed value move
  to `pending`. The point is marked as before the maintainer and not
  yet ruled.
- D5 says the mirror's writes meet the object's validation rules, and
  what the platform cannot read ahead.
- D10, Execution item 7, Points, Consequences, Alternatives and
  Readings follow.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4714072cecb0da6e7ccda211aa7d79472a7df5f7
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7203817706, which passed head f7d2eb4cb6 with S13 and S14 open and nits N28 to N30. Read for this record: card #36253 with its six comments (none added since 7202242844), the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one commit, one file, the ADR, 50 lines added and 24 removed; docs/adr/README.md did not move; f7d2eb4cb6 is an ancestor of this head, so no history was rewritten), the seven earlier records, the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at e491fce2c7. Since the commit the record names, approval-service.ts has moved on main in places away from the status mirror and #openNodeRequest; the approval node's executor, the subflow and map nodes, the validators and approval.zod.ts read the same there. Security-touching: yes is meant: this head adds a refusal the platform makes when an approval opens, and redraws what the record says the platform does and does not prevent on a closed document.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. main has not touched its index since the branch point, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • A refusal that does not exist today: on an object that declares a closed value on an approval's mirror field, the approval node refuses the first request of an approval unless the field declares pending, the object closes on neither pending nor returned, and a state_machine rule on the field lets a closed value move to pending. It reaches only an object that declares the key, so no shipped outcome moves. Right as the shape of the seat's recommendation, and marked as not ruled wherever it stands. What it is judged per: S15. How far it reaches: S17.
    • An object that closes on pending or on returned runs no approval onto that field. Right, and it retires the case N24 named.
    • The left-alone case is drawn against the whole approval of the record, child runs included, and where the mirror cannot tell it goes down the order. Each request records its approval as it opens, which is one more stored fact on a request. Right as the answer to S13.
    • The same conditions are reported where a flow or an object is authored, as early notice. Right.
    • Execution item 7 now carries the check, the mirror and the docs, released with the key. The case the record says the platform does not prevent has no item: S16.
  • The showcase. Not touched by the delta. Its flows do not use the status mirror (examples/app-showcase/src/automation/flows/index.ts says why), so the conversion meets none of the new rule, and the approvals card's own tests remain the only proof of it.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff. For the cards that follow: the approvals card changes behaviour only for an object that declares the key, and stores one more fact with each request; it rides the key's release.

Check-runs on the head, read at 2026-11-26T22:11Z: 48 runs, all completed: 26 success, 22 skipped, none failed and none cancelled. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head. The answers of the first record stand, with its one condition: the status-mirror note is filed as a child card of its own when the build cards are filed. On this head that card becomes the home of the one case the record says the platform does not prevent. S16 says what that asks of it.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The question before the maintainer. The header says the seat put it to the maintainer with the recommendation that the platform refuse, and that the record is not accepted before the answer. That is the right state for the record to be in. The card carries no record of the question yet. When the answer comes, its ruling record should carry the option text, as 7202242844 does for the earlier two. Two things belong in front of the maintainer with the question, because the recommended answer adopts them: what it leaves unprevented, in its true extent (S16), and what it asks of an object that already runs approvals (S17).
  • The quick-read block, fourth line. True to the tree. It asks for the separate question to be answered before the approval, words the question as the header does, and says the text is written to the refusal and is not ruled. The two things it lists as beyond the rulings' words both still hold: a recalled the object closes on is not written, and a decided document sent round again and then recalled has to be approved again. On this head the second holds for every such round, since every round now opens the document. The line does not carry the two things named in the bullet above; they go with the question.
  • The rulings. The delta does not touch either quotation. Records 7200732942, 7201405662 and 7202242844 sit on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 where the record cites them.
  • Choices new on this head. Four, and they are booked: "Points the ruling does not settle" lists them under the point that is before the maintainer, and Alternatives has the way not taken beside each. One more is in the text and is not booked: how far the conditions reach (S17). The status line and Provenance still count four marked points, all ruled: N32.
  • The other cited records. 7073676422 on [PM seat] security · seat 2 — 🟢 os-justin · high only #32004, 6281609466 on showcase: a new line can be inserted on a paid invoice, so its total moves — readonlyWhen is insert-exempt by design, and nothing else locks a paid header against new lines #24684, seat ruling 7152650156 and the console: a non-participant reader is offered inline edit on a record whose pending approval locks it (lockRecord: true), and the save answers 409 RECORD_LOCKED #25934 ruling sit where the record says, untouched by the delta.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The delta adds two reads, both of the plugin's own table: when a request opens, whether its approval already has one; when a request is abandoned, whether a request of the approval had the value the field holds. D5 prescribes one probe and no walk of run links. No id list and no in-app join. No finding. One note for the approvals card: the probe can be asked of the store only if what a request records is a column. The two precedents, __runRoot and __round, live in the config snapshot, which the store cannot filter on. S1 stays closed.

④ Design judgment

The points of the seventh record.

  • S13: closed. D5 defines a round as the approval of the record as a whole: the run started for it and every child run under it, a subflow body or a map item. That agrees with main: both nodes start the child under an id of its own with the parent's id on its context, and an approval node in it files its request under the child's id (subflow-node.ts, map-node.ts, approval-node.ts#hasParentRun). The test is drawn against the requests of that whole approval, D5 says which way the mirror goes where it cannot tell, and gives the reason. Execution item 7's tests have the earlier step in the same run, in a child run and in the parent. The Readings row that was true only of a flow with no child run is corrected and a row for child runs is added. "Points" books the choice, and Alternatives turns down the one-run test with the reason. An approval that an author chains across two flows started apart is two rounds. That is the widest unit the platform can know, and under the drafted rule each of them opens on pending. What the definition still needs in order to be built as written is S15.
  • S14 (should-fix) — still open, and this record cannot close it. S14: open — awaiting maintainer. D5 no longer accepts the outcome on its own word, the paragraph of five conditions is gone, D5 says that the mirror's writes meet the object's validation rules and what an author who puts a state_machine rule on the field owes the mirror, and the header, the TL;DR, D5 and "Points" all mark the point as not ruled. That is what the seventh record asked the text to do while the question is open. Judged as if the maintainer picks the recommended answer, the drafted rule holds in its main line (below), and S14 would close on it with a delta read of the edit that turns "before the maintainer" into "ruled", on one condition: that the answer is given on the true extent of what stays unprevented, which is S16. If the answer is to accept with a note, the marked rule goes and the acceptance is written as the seventh record said. S15 to S17 are findings on the drafted rule itself. They are prose, they do not wait for the answer, and S15 and S17 fall away if the rule does.
  • N28: closed. The Alternatives entry gives the stronger reason: that the two values are equal does not show the document stayed closed.
  • N29: closed. D5 names the four statuses the mirror may have written.
  • N30: closed. The passages are replaced by the rule. If the answer is to accept, they return and N30 with them.
  • N24: the case it named, a failed write that leaves a lock on pending or returned, cannot arise for an approval opened under the rule. N12, N14, N15, N17, N20 and N21 stand as before.

The drafted rule, against main. With nothing else of the object's in the way, the two conditions do what D5 says.

  • Every request opens on pending (approval-service.ts#openNodeRequest). With pending declared, and the move to it legal from a closed value, the field is on an open value from each request's opening until that request is decided.
  • checkStateMachine judges a move only from a state whose moves the rule declares, and lets a prior state with none pass (rule-validator.ts#checkStateMachine). So "where the rule declares the moves out of a closed value" is the exact condition, and an empty list is a declaration.
  • Every other move a state_machine rule can refuse the mirror, into an outcome, to returned, or the put-back, leaves the field on the open value it held: a stale status and no lock, which is what main gives today. So the one move asked is the one the lock depends on. D5's sentence "every request that opens moves the field to pending" says more than that, and the paragraph after it corrects it.
  • With pending and returned both open, a put-back that does not land leaves no lock behind.

A closed value then stands on the field only from the moment a request is decided until the next request opens. That interval is where S16 sits.

The four choices the record books.

  • Refused when the approval opens, reported at authoring, not refused at publish. Right. The object and the flow are published apart, and the opening is the first point at which both are in hand. #openNodeRequest already refuses a step before any row is written (the step that names the platform administrators), so the refusal has a place and a precedent. Two things follow: what the check is made per (S15), and what a refused opening is for the person who submitted (N34).
  • One step judged like several. Right. The node cannot see a later step, and the single-step case is real: on a field with no pending, a decided document sent round again and rejected into a status the field does not declare keeps its old decision.
  • Neither pending nor returned closed where an approval mirrors onto the field. Right. The pending lock already holds a record under approval, passes the run that opened the request and lets go in the revise window; a closed returned would refuse the very revision ADR-0044 opens the window for. D1 still lets an author list either value on a field no approval mirrors onto, which is why the refusal belongs at the opening and not on the key.
  • Which move of a state_machine rule is asked. Right, by the trace above. Of which closed values it is asked is S17.

The bookkeeping. Recording the approval on the request as it opens is the right way: the request row carries its own run's id, the child's context names only its immediate parent, and nothing at the time of an abandonment could rebuild the tree from the plugin's own table. The executor already tells a child run from a root one and stamps it (__runRoot). The fallback errs the right way. Where the mirror goes down the order wrongly, a document another writer closed is opened and has to be decided again. Where it wrote nothing wrongly, a decision nobody finished would stand. What the paragraph leaves is in S15 and N33.

Existing apps. No shipped app is touched: the rule reaches only an object that declares the key. The showcase does not mirror, and nothing else in the tree can declare a key that does not exist yet. For an object that adopts the key on a field its approvals already mirror onto, three things happen. A round in flight runs on unjudged, which D5 and the tests state. Every new approval is refused until the conditions hold, which "What an author has to know" states ("before, or together with"). And the conditions reach further than their reason, which is S17.

No must-fix.

S15 (should-fix) — the check is made once an approval, and what it judges is set per request.
D5 says the check is made "when the round opens, at its first request", and that "a later request of the same round is not judged again, because refusing it would stop the run on the earlier step's outcome". The text reads as if an approval had one mirror field and one record. On main it has neither for certain.

  • The mirror field is each node's own. approvalStatusField is an optional key of one approval node's config (approval.zod.ts#approvalStatusField), and #openNodeRequest mirrors onto the field of the node that opens the request. A first step that names no mirror field, or another field, opens the round without the closing field being judged. A later step that mirrors onto it is then "a later request" and is never judged, and every outcome the check exists to keep out is back on that field. The reason for not judging a later request holds only where the round has already written the field.
  • The record is each request's own. A map item that is a record runs its child with the item as the record and itemObject as the object (map-node.ts). Its request is under the same run tree and on another record, possibly of another object. Judged per round, such a record is never judged where the parent opened a request first. And the mirror's probe has to be asked on the record as well as on the round: asked on the round alone, a closed value on one item's record is taken for the round's own because another item's request had that status.
  • What a request can know when it opens. D5 has each request record its round. A child's context carries $parentRunId, the immediate parent, and subflow nests (subflow-node.ts). The plugin's reader of a run answers its status, flow name and start, not its context. So a request two levels down cannot name the root from what the plugin is handed, and recorded from what is in hand, the S13 outcome returns one level further down. The id has to be handed down by the automation service, which Execution item 7 does not name, and the tests have no step two levels down and no two sibling children.

The fix is prose. The check is made at the first request of the approval that mirrors onto that field of that record; "not judged again" is said of a field the round has already written; the probe names the record; item 7 says where the root's id comes from and its tests gain a first step with no mirror field, a map item on another record, and a step two levels down.

S16 (should-fix) — what the refusal does not reach is wider than the one case D5 states, and its home is a clause.
D5 says what the conditions keep out is "a record that reads a decision, and is closed, with no finished approval behind it", states one case the platform does not prevent, a rule of another kind that refuses a write of the mirror, and sends it to "a card of its own". "Points" and "What it costs" repeat that one case. The statement is honest as far as it goes. Three more ways lead to the same record.

  • readonlyWhen on the mirror field. It binds a write made in a system context, as the record's own Context table says of who passes it (engine-update.ts, the conditional strip), and it does not refuse: it drops the value and lets the write land, so the mirror logs no failed write. D10's table recommends it "for a field that must hold against system writes". A predicate that holds on a closed value takes away the pending of the next request and every value the mirror would put back. D5's sentence on what the mirror's writes meet names validation rules only. Unlike a script rule, its presence on the mirror field can be read ahead, at the opening and at authoring.
  • A hook of the app that refuses the write. The same class as the stated case; one phrase covers it.
  • A run that ends between two steps. The mirror writes a step's outcome when it is decided, and the next request writes pending only when the run reaches it. If the run ends in between, because a node fails or the run is cancelled, no request is open, none of the three writers that abandon a request acts, and the sweep reads pending requests only (approval-service.ts#releaseDeadRunRequests). The record stays on the first step's outcome, closed. The lock this record adds is itself a way there: D5 says a write to the record by a node that follows an approval decision, in a flow that runs as the user, is refused once the outcome is a closed state, and that this is a flow's default. Where that node stands between two approval steps, the refusal ends the run there unless the flow catches it. The author's note that covers it today ("declares that flow to run as system") is a note, and the record's own Alternatives entry says what a decision that holds only where a note was read is.

So D5's sentence "A record is then on a closed value of its approval field only where the last approval to open on it ended there, or where another writer put it there" reads as complete and is not, and the maintainer would adopt the recommended answer on a narrower account of what it leaves than the tree gives.

The home. The ruling text gives the mirror's failed write-back a child card (7202242844), so the card exists by ruling. In Execution it is a clause of the first reading ("changing the approvals plugin's behaviour is a card of its own"), not one of the seven items. Nothing says that this case is in its scope, or how it stands to the key's release, where item 7 ties the key to the check and the mirror. It is an adequate home once Execution names it as a card filed with the build cards, with its question worded for this case (a write of the mirror that does not land on a closing field, refused or dropped, and whether it stays silent), says whether the key waits for it, and has the approvals card pin the case with the value the field keeps. The Alternatives entry turns down setting the object's rules aside for every write of the mirror on every object. The narrower form, only the write that takes a record off a closed value its own round wrote, is not weighed, and is that card's first candidate.

What closes it: D5 states the cases together and corrects the sentence; "What it costs" and "Points" follow; Execution carries the card; and the question before the maintainer carries the same extent.

S17 (should-fix) — the conditions reach further than their reason, and the reach is not booked.
The reason D5 gives is a record that reads a decision, closed, with no finished approval behind it. That can arise only where the object closes on a status the mirror writes. As written, the rule applies to "an object that declares a closed value on the mirror field", whatever the value, and Execution item 7 asks the move to pending of "every closed value" a state_machine rule declares moves for.

Take an object with one status field that carries its business states and the mirror, closed on paid and void only. Traced against #mirroredStatusValue and #checkStateMachine, no approval leaves it closed on a decision it did not finish: approved and rejected are open there, and a round on a paid document either leaves it on paid or moves it to an open outcome. Under the rule every approval on that object is refused until the field declares pending, and until its rule lets paid and void move to pending, a move the reason does not call for, and one the rule then allows every system writer. An author can no longer keep a closed value final in the state machine on a field an approval mirrors onto.

Either narrow the rule to its reason (the conditions apply where the object closes on a status the mirror writes, and the move is asked of a closed approved or rejected), or keep the simpler rule and book it: a fifth choice in "Points", the cost in "What an author has to know" and "What it costs", and the narrower form in Alternatives. It decides which objects are refused when they adopt the key, so it belongs with the question. The sentence in item 7 ("lets every closed value it declares moves for move to pending") wants rewording either way.

Nits. None moves a decision. Each is fixed with the prose of S15 to S17 or carried to its build card.

  • N31 (nit) — "Round" already names something on a request. ADR-0044 D4 numbers the rounds of a revise loop, the contract publishes that number as round on the request row (packages/spec/src/contracts/approval-service.ts), the snapshot carries it as __round, and the approvals guide uses the word that way. This record's round is the whole approval, and on this head it tells the approvals card to record "the round" on each request. "In this record" is enough for a reader of D5. The card and the guide need another name for what is recorded.
  • N32 (nit) — The status line says four points go past the ruling's words, each marked, and that the maintainer ruled on all four. Provenance says the maintainer ruled on the marked points and adopted each as written. The tree now carries a fifth marked point, not ruled, in the TL;DR and D5. The header bullet says so; the status line and Provenance need the exception until the answer.
  • N33 (nit) — D5 says an earlier step's outcome can still be on the field "in two cases". A third is of the same kind as the second: the object or the flow changed after the round opened (D1 refuses the removal of an option a declaration names, and pending is not one). And "a request the mirror cannot place" has two sides: the abandoned request, and an earlier request of the same approval opened before requests recorded it. For the second the probe finds nothing, which reads as "another writer", unless D5 says it counts as not being able to tell. One clause, and one test arm.
  • N34 (nit) — D5 says of a refused opening that "nothing is written". That is true of the node. The refusal reaches the person who submitted as a failed run: what the flow did before the node stays done, and where a record change started the flow, the save has landed. One sentence in "What an author has to know", for the docs card.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S13 is closed, and so are N28 to N30. S14 stays open until the maintainer answers; the record is in the right state for that, and on the recommended answer S14 would close. The drafted rule is sound in its main line: the two conditions keep a document on an open value from each request's opening to its decision, the one move asked of a state_machine rule is the one the lock depends on, each of the four booked choices is right, and the fallback errs the right way. Three points are open on the rule as drafted. S15: the check is made per approval, and the mirror field is per node and the record per request, so a later step can reach the closing field unjudged. S16: what the rule does not reach is wider than the one case stated, it includes a run that ends between two steps, and its home is not yet an Execution item. S17: the rule refuses more objects than its reason covers, and asks of a state machine a move its reason does not call for. Each is prose and owes a delta review of its fix. Nothing found departs from a ruling's words. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

Answers the contract review of 4714072 and the seat's rulings on it.

- The check reads the whole approval at its first request: every
  approval step of the flow and of the flows it calls, each on its own
  mirror field and its own object. An approval that cannot be read
  whole is refused. Execution item 7 names the automation-service
  change that hands the plugin the root run.
- The conditions concern an object that closes on a status the mirror
  writes, and the state_machine move is asked of a closed approved or
  rejected only.
- Two more configurations are refused when an approval opens: a
  readonlyWhen on the mirror field, and a write to the record between
  two steps by a flow that runs as the user.
- D5 states together what the conditions do not reach. Execution item 8
  is the status-mirror card, and the key waits for its first answer.
- The record's unit is called an approval; the word round is left to
  ADR-0044.
- The status line and Provenance count five marked points, four of
  them ruled.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
…rror card

The seat's follow-up on the answer to the contract review of 4714072.

- A run that ends between two approval steps, by a failed node or a
  cancellation, is held to the same bound as a write of the mirror
  that does not land: neither leaves a record closed on a value its
  own approval wrote and did not finish.
- Execution item 8 carries both, and the key waits for it.
- D5, D10, Points and "What it costs" follow.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bcc8d889c2d8ec732776d04232103c3b05ca29bc
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7204452910, which passed head 4714072cec with S14 open and awaiting the maintainer, S15 to S17 open, and nits N31 to N34. Read for this record: card #36253 with its six comments (none added since 7202242844), the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (two commits, one file, the ADR, 86 lines added and 54 removed; docs/adr/README.md did not move; 4714072cec is an ancestor of this head, so no history was rewritten), the eight earlier records, the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at 5d37374f8e. The files this record cites read the same there as at the commit the last record read them at. Security-touching: yes is meant: this head redraws which approvals the platform refuses to open and what it says it does not prevent on a closed document.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. 0162 is still free on main and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • The approval is judged whole, once, at its first request, from its definition: every approval step of the root run's flow and of each flow a subflow or a map in it names, each on its own mirror field and on each object it can act on. An approval that cannot be read whole is refused. Right, and it is the answer to S15. What it does not ask of the steps that follow one another is S18.
    • Two more conditions: the mirror field carries no readonlyWhen, and no flow of the approval that runs as the user can write the record between two steps. Right. Both reach only an object that closes on its approval's outcome, so no shipped outcome moves.
    • The conditions concern only an object that closes on a status the mirror writes, and the one move asked of a state_machine rule is asked of a closed approved or rejected. Right as the answer to S17. One sentence carries the narrowing over to the abandonment rule, where it does not belong: S19.
    • The automation service hands every run of a tree its root run, and each request records it in a column of its own. Right, and Execution item 7 now says that this changes a second package. The card that changes what the automation service hands a node owes its own semver judgement.
    • A card the key waits for (Execution, item 8): on a field the object closes on, a write of the mirror that a rule or a hook refuses is no longer swallowed, and neither that nor a run that ends between two steps leaves a record closed on a value its own approval wrote and did not finish. Right, and the change to the swallowed write is limited to a closing field.
  • The showcase. Not touched by the delta. Its flows do not use the status mirror, so the conversion meets none of the new rule, and the approvals card's own tests remain the only proof of it.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff.

Check-runs on the head, read at 2026-11-26T23:05Z: 48 runs, all completed: 26 success, 22 skipped, none failed and none cancelled. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head. The first record's one condition, that the status-mirror note is filed as a child card of its own, is now Execution item 8, with its scope stated and the key tied to it.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The question before the maintainer. The header, the status line, Provenance, the TL;DR, D5 and "Points" all mark the point as not ruled, and say the record is not accepted before the answer. That is the right state. The card carries no record of the question yet. When the answer comes, its ruling record should carry the option text, as 7202242844 does for the earlier two, and with it what the answer adopts: the three things D5 says the refusal does not reach, and the configuration of S18, which is not among them.
  • The quick-read block, fourth line. True to the tree. It asks for the separate question to be answered before the approval, words the question as the header does, and says the text is written to the refusal and is not ruled. The two things it lists as beyond the rulings' words both still hold: a recalled the object closes on is not written, and a decided document sent for approval again and then recalled has to be approved again. The line does not carry what the refusal leaves unprevented, or that the key waits for a second card; the PR body below it does, and both go with the question.
  • The stated residuals. Three, and they are stated the same way in D5, in D10's table, in "What it costs", in "Points" and in the PR body. A rule or a hook of the app that refuses a write of the mirror, and a run that ends between two steps because a node fails or the run is cancelled: both go to the card of item 8, D5 fixes what must hold for each, and item 1 waits for that card. A change to the object or to the flow after the approval opened: not judged again, and stated as accepted. Checked against main: the sweep of dead runs reads pending requests only (approval-service.ts#releaseDeadRunRequests), so nothing acts on a run that ends with no request open, as D5 says. What the list leaves out is S18 and nits N35 and N36.
  • The rulings. The delta does not touch either quotation. Records 7200732942, 7201405662 and 7202242844 sit on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 where the record cites them.
  • Choices new on this head. "Points" lists nine things under the point that is before the maintainer, and marks which are the seat's rulings and which the record's own. Three are the record's own beyond the seat's words, and each has its way not taken in Alternatives: no readonlyWhen at all on the mirror field; a user-run flow that writes between two steps is refused, where an exception for the approval's own run was the other way; and the concept is renamed. The count agrees with the PR body.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The check reads definitions, not rows. The two reads of the plugin's own table stay one probe each, with no walk of run links, and the root run is now a column of its own so that the store can be asked for it, which answers the note the last record left here. No id list and no in-app join. No finding.

④ Design judgment

The points of the eighth record.

  • S14 (should-fix) — still open, and this record cannot close it. S14: open — awaiting maintainer. The text is in the state the question needs. Judged as if the maintainer picks the recommended answer, the drafted rule now holds along the lines the last record traced, with one configuration it does not refuse (S18). On that answer S14 closes with a delta read of the edit that turns "before the maintainer" into "ruled", once S18 and S19 are fixed.
  • S15: closed. The approval is read whole at its first request, from its definition, so a later step that mirrors onto a closing field has been judged before anything is written, and a first step that names no field does not open the approval unjudged. Each step is judged on its own field and on each object it can act on, a map's item object included. "Not judged again" keeps its reason. The mirror's probe names the record, so another item's request does not answer for this one. Execution item 7 names the change to the automation service and the column, and its tests have the first step with no field, two fields, a map on another object, a step two levels down, two child runs side by side and a flow the node cannot read. Against main: a child's context carries its immediate parent's id and the rest of the parent's context (subflow-node.ts, map-node.ts), a map item that is a record becomes the child's record on itemObject or else on the parent's object, both nodes name their flow as a literal, and no binding door lets a flow rebind $record (flow-bound-variable-name.ts), so "the record its run carries" is what the approval node reads (approval-node.ts).
  • S16: closed. D5 states together what the conditions do not reach and what must hold for each, and the sentence the last record quoted is redrawn. The two routes that can be read ahead are in the conditions. The card is an Execution item with its scope, its first candidate and the release tie, and "What it costs", "Points" and D10's table follow. Against main: readonlyWhen has no exemption for a system context and drops the value without failing the write (rule-validator.ts#stripReadonlyWhenFields); the static readonly strip does pass one, so "readonly is what keeps callers off a mirror field, and the mirror passes it" is true; a flow's nodes after a human decision run as the decider, and each flow, a child included, takes its own runAs (run-resume.ts#resolveRunContext). The redrawn sentence is still short of one case, which is S18 and not S16.
  • S17: closed. The conditions concern a step whose field the object closes on at pending, returned, approved or rejected; an object that closes on that field only on values of its own is asked nothing; the move is asked of a closed approved or rejected. Booked in "Points" as the seat's ruling, with the wider rule in Alternatives and a test for the object whose rule keeps its own value final. What the narrowing took with it is S19.
  • N31: closed. The concept is "an approval", ADR-0044 keeps "round", and item 7 tells the docs card so.
  • N32: closed. The status line and Provenance count five marked points, four ruled.
  • N33: closed. D5 names the cases by reference to what the conditions do not reach, and says in which two cases the mirror cannot tell; item 7 has the test arm.
  • N34: closed. "What an author has to know" says a refused opening reaches the submitter as a failed run, and what stays done.

The record's own choices on this head.

  • No readonlyWhen at all on the mirror field. Right. The seat's ruling asks only that none can hold on a closed value. The platform does not evaluate a predicate ahead, a predicate can read any field of the record, and a rule that held for some predicates and not for others is not one an author can state. It reaches only the mirror field of a step the conditions concern. The cost is small: readonly does what such a field needs.
  • Refused at the opening, and no pass for the approval's own run. Right. A pass would be the first caller's context this lock lets through, and the reason in Alternatives holds against main: nothing in a run tells a node between two steps from one after the last. The refusal has its cost booked. What the static read has to count as "between two steps" is N38.
  • The card gates the key. Right, and it is what makes the two residuals a bound and not a note. Item 8 fixes the outcome and leaves the means, which is the right split for a record that implements nothing.

The drafted rule, tried against main. With the conditions met and one field for the whole approval, a closed value stands on the field only from a decision to the next request's opening, as D5 says. Three things were tried and hold. Two steps cannot be open on one record at once: the service refuses a second pending request on a record (#openNodeRequest), and parallel, loop and try_catch regions refuse a pause, so subflow and map are the only composition. A step that opens no request, because its slate is empty and it approves by policy, writes nothing and is not a first request, so the check still meets the first real one. And a recall resumes the run down the step's reject edge with the record already on an open value. What does not hold is below.

No must-fix.

S18 (should-fix) — a later step that mirrors onto another field, or onto none, is asked nothing, and it leaves the record on the earlier step's outcome.
D5 judges each step on its own mirror field. That closes S15: no step reaches a closing field unjudged. The conditions say nothing of the steps that follow one. Take an approval of two steps on one record, where the first mirrors onto a field the object closes on at approved, and the second names another field or none. approvalStatusField is optional on every node, and on main every transition of a request writes the field of that request's own node and no other (approval-service.ts#openNodeRequest, #decideNode, #recall, #abandonForDeadRun). All four conditions hold for the first step, the second is not a step the conditions concern, and the approval opens. Once the first step is approved the field holds approved, and nothing the second step does moves it.

  • The record reads the first step's decision, closed, while the second step is open, and for good unless that step approves: after a rejection, a send-back, or its being abandoned. This is the record D5 says the conditions keep out, and it is none of the three stated residuals. No write of the mirror fails, no run ends between two steps, and nothing changed after the opening.
  • The left-alone test is never asked of that field: an abandoned request's mirror reads its own node's field.
  • Where the second step sends the request back, the revise window opens on a record this lock still holds. D5's first condition exists for that window and does not reach this case.
  • Two sentences of D5 are then not true as written: that with the conditions met "the field is then on an open value from the request's opening until the request is decided", and that a record is on a closed value of its approval field "in four situations only".

On main the same approval leaves the same status on the field. What this record adds is the lock, which is the measure D5 itself applies to a run that ends between two steps. Unlike that case, this one is in the definition, and the check already reads every step with its field and its record. Execution item 7's test "two steps that name different fields" passes such an approval as the rule stands.

What closes it is prose. Either the conditions ask it: on one record, a step that can follow a step the conditions concern mirrors onto the same field, and a step the check cannot place counts as following. Or the mirror answers for an earlier step's field as well as its own, which is the larger change. "Points" books the choice, Alternatives keeps the way not taken, "What an author has to know" tells the author, the two sentences are corrected, and item 7's tests say which way the approval of two fields and the later step with no field go. It belongs with the question before the maintainer: the recommended answer is that the platform refuses the configuration, and this is one it does not yet refuse.

S19 (should-fix) — one sentence gives the abandonment rule the reach of the opening conditions.
D5's paragraph on how the rule is kept ends: "An approval that is read whole and reaches no step the conditions concern is refused nothing, and its mirror writes as it does today." Before this head the sentence was said of an object that declares no closed value on the mirror field, and there it was true. S17 narrowed what the conditions concern, and the sentence went with it. An object that closes on its approval field only at paid, or only at recalled, now reaches no step the conditions concern. By this sentence its mirror writes as today: recalled wherever the field declares it, else the value held at submit (approval-service.ts#mirroredStatusValue). For such an object that is a closed value written for an abandoned request, which the ruling in record 7201405662 rules out for every object, and it is a write over a record another writer closed, which the left-alone rule rules out. The rule's own section, D10's table ("both only where an object closes on the mirror field") and item 7 ("on every transition that abandons a request") say the opposite, and they are right. One sentence: the second half holds only for an object that closes on no value of the mirror field. An arm in item 7's mirror tests for an object that closes on the field only on values of its own would pin it.

Nits. None moves a decision. Each is fixed with the prose of S18 and S19 or carried to its build card.

  • N35 (nit) — D5 counts "three things of the object's own" that meet the mirror's writes. A fourth is a visibleWhen on an option of the mirror field. The rule validator refuses a write of that value where the predicate is false, for a system context as for a caller (rule-validator.ts#evaluateOptionVisibility; field.zod.ts calls it the one visibility predicate the server also enforces). On the pending option it stops the write the lock depends on. It refuses, so it comes under item 8 as a refused write; it also sits on the field's own definition, where the check already reads readonlyWhen. Name it, and say which of the two answers for it.
  • N36 (nit) — D5 and item 8 name two ends between two steps: a node that fails and a run that is cancelled. Two neighbours leave the same record. A decision that lands while its run cannot be resumed: main already has a reader of exactly those requests (approval-service.ts#inspectStrandedRequests), which is a starting point for the card's "how the plugin learns that an approval's run has ended". And a run that parks between two steps, on a wait or a screen: the passage D5 lists as the second of its situations then lasts as long as the pause. An object-form screen leaves the save to the client (screen-nodes.ts), which is a caller's write, so between two steps it is a node that can write the record, and a refused save leaves the run parked and does not end it. One clause in item 8's scope, and one sentence for the docs card.
  • N37 (nit) — The mirror's side says what it does with requests opened before requests recorded their root run. The check's side does not. A later request of an approval whose earlier requests record none finds no earlier request and reads as a first one, and refusing it is the outcome the check exists to keep out. One clause, that such a request is not judged, and one test arm.
  • N38 (nit) — "Before another step" has to include the same step opened again. A map over items that are not records runs its body once for each item on the parent's record (map-node.ts), so a writing node after the body's step stands between two steps, and under S18 the body's step follows itself. Read alone, the body flow shows that node after its last step. One clause and one test arm.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S15, S16 and S17 are closed, and so are N31 to N34. S14 stays open until the maintainer answers, and the record is in the right state for that. The record's own three choices on this head are right and booked. Two points are open on the rule as drafted. S18: the conditions judge each step on its own field and ask nothing of a later step that mirrors elsewhere or nowhere, so an approval can still leave a record on an earlier step's outcome, closed, by its definition alone. S19: one sentence lets the mirror of an object that closes only on values of its own write as it does today, against the ruled rule the same section states. Both are prose and each owes a delta review of its fix. Nothing found departs from a ruling's words in the rule's own section. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…a pause between two steps

Answers the contract review of bcc8d88, on the seat's rulings.

- D5 gains two conditions for an approval on a closing field: every
  approval step that can act on a record of the object mirrors onto
  the one field, and no flow of the approval pauses between two steps.
- The mirror field's options for a request's status carry no
  visibleWhen, in the condition that refuses a readonlyWhen.
- The rule for an abandoned request holds for every closed value; only
  the opening conditions are narrowed to the statuses the mirror
  writes.
- A decision whose run cannot be resumed joins the card the key waits
  for (Execution, item 8).
- A request the plugin cannot place as first or later is not judged.
- "Between two steps" is defined, and includes the same step opened
  again under a map.
- D10, Execution items 7 and 8, Points, Consequences, Alternatives and
  Readings follow.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0aad3f22b6de5539fd610d59552b4fd5b2263a71
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7205252464, which passed head bcc8d889c2 with S14 open and awaiting the maintainer, S18 and S19 open, and nits N35 to N38. Read for this record: card #36253 with its six comments (none added since 7202242844), the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads (one commit, one file, the ADR, 47 lines added and 28 removed; docs/adr/README.md did not move; bcc8d889c2 is an ancestor of this head, so no history was rewritten), the nine earlier records, the two ruling records and the record of the ruling text (7202242844), and the check-runs on this head. Every code position the delta leans on was opened on main at f722411edd. Since the commit the last record read them at, nothing this record cites has changed there. Security-touching: yes is meant: this head widens which approvals the platform refuses to open, and restates what it does not prevent on a closed document.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. main has not touched its index since the branch point, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • Six conditions where there were four. The two new ones: every approval step that can act on a record of the object mirrors onto the one field, and no flow of the approval pauses between two steps. The third gains the options: none of the field's options for a request's status carries a visibleWhen. Right in direction, and each reaches only an object that closes on its approval's outcome, so no shipped outcome moves. What the two new conditions leave between them is S20.
    • The rule for an abandoned request holds wherever the object closes on the mirror field, on a value of its own as on a status of the approval. Only the opening conditions are narrowed. Right, and it is the answer to S19.
    • The root run that the automation service hands every run now carries when it started, and a request the plugin cannot place as first or later is not judged. Right. The card that changes what the automation service hands a node still owes its own semver judgement.
    • The card the key waits for (Execution, item 8) takes two more things: a visibleWhen on an option the mirror puts back, as a refused write, and a decision recorded while its run cannot be resumed. Right.
  • The showcase. Not touched by the delta. Its flows do not use the status mirror, so the conversion meets none of the new rule.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff.

Check-runs on the head, read at 2026-11-26T23:43Z: 48 runs, all completed: 25 success, 22 skipped, one cancelled, none failed. The cancelled run is a superseded PR-body guards run, and the run of the same name that replaced it succeeded. The successes include Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard and Check Documentation Links. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head, and nothing in the delta changes how they stand.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The question before the maintainer. The header, the status line, Provenance, the TL;DR, D5 and "Points" all mark the point as not ruled, and say the record is not accepted before the answer. That is the right state. The card carries no record of the question yet. The refusal is wider on this head than when the question was put: an approval that keeps one status field for each stage, or leaves a stage without one, a step in a map body that does not name the field, and a delay or a screen between two steps are all refused on an object that closes on its approval's outcome. The answer should be given on the six conditions as they stand, and its ruling record should carry the option text, as 7202242844 does for the earlier two.
  • The quick-read block, fourth line. True to the tree. It asks for the separate question to be answered before the approval and says the text is written to the refusal and is not ruled. The PR body below it counts six conditions and thirteen choices, and both counts agree with D5 and with "Points".
  • The stated residuals. Stated the same way in D5, in D10's table, in "What it costs", in "Points" and in the PR body: a rule or a hook of the app that refuses a write of the mirror, a run that stops between two steps, and a change made after the approval opened. What the list leaves out is S20, with nits N39 and N40.
  • The rulings. The delta does not touch either quotation. Records 7200732942, 7201405662 and 7202242844 sit on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 where the record cites them.
  • Choices new on this head. "Points" lists thirteen things under the point that is before the maintainer, marks which are the seat's rulings, and names the two readings inside the one-field condition that are the record's own. Each way not taken is in Alternatives.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The one new read is an existence probe of the plugin's own table: whether a request that records no root run was opened since a given time. No id list, no in-app join, no walk of run links. No finding.

④ Design judgment

The points of the ninth record.

  • S14 (should-fix) — still open, and this record cannot close it. S14: open — awaiting maintainer. The text is in the state the question needs. Judged as if the maintainer picks the recommended answer, the drafted rule holds along the lines the last record traced and along the two it found open, with one configuration it does not refuse (S20). On that answer S14 closes with a delta read of the edit that turns "before the maintainer" into "ruled".
  • S18: closed. The fourth condition asks every approval step that can act on a record of the object to mirror onto the one field, so a later step with another field, or with none, is refused when the approval opens. The two sentences the last record quoted are redrawn on it. "Points" books the choice with the two readings that are the record's own, Alternatives keeps the three ways not taken, "What an author has to know" and "What it costs" tell the author, and item 7's tests say which way each approval goes. Against main: every transition of a request writes the field of that request's own node and no other (approval-service.ts#openNodeRequest, #decideNode, #recall, #sendBack), which is the reading the condition rests on.
  • S19: closed. D5 says the mirror writes as it does today only where the object closes on no value of the mirror field, and that only the opening conditions are narrowed. D10's table says "on whichever values the object closes", and item 7's mirror tests gain the object that closes on the field only on values of its own.
  • N35: closed. D5 counts four things that meet the mirror's writes. On the option of a request's status the check refuses a visibleWhen, in the condition that refuses a readonlyWhen; on an option the mirror puts back it is a refused write under item 8. Against main the reading is exact, the one admitted fault included (rule-validator.ts#evaluateOptionVisibility).
  • N36: closed. A pause between two steps is a condition, refused when the approval opens, and a decision whose run cannot be resumed joins what the conditions do not reach and item 8, with the reader main has named as a starting point (approval-service.ts#inspectStrandedRequests, which reports and rewrites nothing, as the record says). What is left of it is S20 and N39.
  • N37: closed. A request the plugin cannot place as first or later is not judged, D5 says why, and item 7 has the test arm. One thing it rests on is N41.
  • N38: closed. D5 defines "between two steps", says the next step can be the same step opened again, and item 7 tests a writing node after the only step of a map body.

The record's own choices on this head.

  • Every step, the steps ahead included. Right. The seat's ruling asks the one field of a step that can follow a step the conditions concern. The record asks it of every step that can act on the object, on the ground that the first step of a new approval of a decided document follows the last decision. That holds: such a step lands no pending on the field, and the old decision stands, closed, through its rejection and its revise window. The wider rule is also the one an author can state. Its cost is booked. An approval none of whose steps names a closing field is asked nothing, and the record says what that approval then is: not a way out of the closed state.
  • A step in a map body counts as one that can act on the parent's record. Right as far as it goes. Against main the node decides item by item, as the body runs, whether an item is a record, also where it names an object for its items (map-node.ts), so the check cannot place the body's step on the item alone. But the reading is applied one way only. Counted as a step of the parent's record, the body's step is asked for the field. It is not also counted as what it is for the parent's record when the item is a record: an approval of something else, on which the parent's approval waits. That half is S20.
  • A pause between two steps is refused when the approval opens. Right, by the record's own measure that what can be read ahead is refused at the opening. Holding a parked run to the bound of item 8 would have the platform write an open value with no request open. The revise window is correctly not such a pause: it follows returned, which the first condition keeps open, and "between two steps" is defined from a closed outcome. Against main the six node types the Readings name are the ones that declare a pause. The cost is real and booked: a delay or a screen between two approval steps has no place left on an object that closes on its approval's outcome, and such an author closes on a later state instead. Two things it does not yet read are S20 and N39.
  • A request the plugin cannot place is not judged. Right. The other direction refuses an approval between two steps, which is the outcome the check exists to keep out. The probe is wide: any request that records no root run, opened since the approval's root run started, on any record. It has to be, since an approval's earlier requests can sit on other records. Its reach is what the record says it is, an approval whose run started before requests recorded their root run, on one condition the text leaves unsaid (N41).

The drafted rule, tried against main. With the six conditions met and one field for the whole approval, the passages the last record traced hold, and three more were tried on this head and hold. A step that approves by policy on an empty slate opens no request and writes nothing, and the outcome it leaves on the field is one that policy itself gives. A revise node placed after a closed outcome declares a pause, so the definition refuses it without a rule of its own. And an object that closes on two approval fields cannot spread one approval over both. What does not hold is below.

No must-fix.

S20 (should-fix) — an approval of another record between two steps holds the parent's record on the earlier step's outcome, closed, and the conditions pass it.
Take an approval whose flow has a step on the record, then a map whose items are records and whose body holds an approval step, then a second step on the record. A document whose lines are approved one by one between two approvals of the document is the plain case. The body's step names the parent's field, as the fourth condition asks, and the sixth condition reads the map by its body and finds a step there, not a wait or a screen. Item 7's test of such a map turns only on whether the body's step names the parent's field. The approval opens. Once the first step is approved the parent's field holds approved. Each item's request is filed on the item, its statuses are written onto the item's record, and nothing lands on the parent's.

  • The parent's record reads the first step's decision, closed, for as long as the items' requests are open, with its own next step not yet asked. That is the state the sixth condition gives as its reason, and an approval of an item waits on a person as a screen does.
  • Where the items are the record's own master_detail lines, they are held with it. An item that is sent back opens a revise window on a line this lock still holds, which is the case the first condition exists for.
  • Where an item's run fails, the map fails and the parent's run stops between two of its steps. That case is item 8's. The wait before it is no one's: item 8 names a run that ends and a run that cannot be resumed, and not a run that is parked.
  • Two sentences of D5 are then not true as written: that a record is on a closed value of its approval field while an approval passes from one step to the next only through "a passage in which no caller's write and no pause stands", and that there are four such situations only.

On main the same approval leaves the same status on the parent. What this record adds is the lock, which is the measure D5 applies to a pause. Unlike the cases item 8 takes, this one is in the definition, and the check already reads the map, its body and its place among the steps.

What closes it is prose. The reading of a map body's step is drawn both ways: it counts as a step of the parent's record, so it names the field, and because its item may be a record it also counts, for the parent's record, as a pause, so a map whose body holds an approval step does not stand between two steps that can act on the parent's record. Or item 8's bound takes a run parked there, which the record turned down for wait and screen for a reason that holds here too. Either way the record says what the check does with a collection in which some items are records and some are not, "Points" books the choice, Alternatives keeps the way not taken, the two sentences are corrected, the author's note says where a per-item approval may stand, and item 7's test of a map whose items are records of another object says where the map stands among the parent's steps. A map after the parent's last step is another matter: the parent's steps are finished and its decision stands, and what an author has to know there is that an item sent back cannot be revised, as the record already says of an approval that names no closing field. The fix can ride in the push that answers S14, and one delta read covers both.

Nits. None moves a decision. Each is fixed in the push that closes S14 and S20, or carried to its build card.

  • N39 (nit) — The check reads a pause "off the node type's own declaration". A node type that publishes no descriptor declares nothing, and main lets such a node pause a run (engine.ts#refuseUndeclaredSuspension refuses a pause only for a type whose descriptor does not declare one). Item 7 says that a node whose writes the check cannot read counts as one that writes. One clause gives the pause the same rule: a node whose type declares nothing counts as one that can pause. One test arm.
  • N40 (nit) — D5 heads the second residual "for another reason than this lock", and lists a node that fails. Two failures of a node between two steps are not on that list as worded. The next step itself can fail to open, by a policy its own configuration declares for an empty slate, or because another request is pending on the record. And a node can fail on this lock through a write the check cannot read: a hook of the app that writes back to the record, or a delete on another object whose cascade reaches it. Item 8's own words, "a node fails", cover both. Drop the qualifier in D5, and add both arms to item 8's tests.
  • N41 (nit) — The reach of "not judged" rests on every request opened after the release recording its root run, also one opened in a child run that was started before it. The automation service can derive that root at resume, and the record should say that it does, with one test arm. Without it, one such request leaves unjudged every approval whose run started before it and whose first request opens after it.
  • N42 (nit) — Item 8 now counts three things and still ends "the key is not released before both are built", while D5 and "What it costs" count two. One wording.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S18 and S19 are closed, and so are N35 to N38. S14 stays open until the maintainer answers, and the record is in the right state for that. Of the record's four own choices on this head, three are right and booked, and the fourth, the reading of a map body's step, is right and drawn one way only. One point is open on the rule as drafted. S20: an approval of another record that stands between two steps of the parent's record holds the parent on the earlier step's outcome, closed, by its definition alone, and neither the conditions nor item 8 take it. It is prose, it owes a delta review of its fix, and it can share the push and the read that S14's answer needs. Nothing found departs from a ruling's words. The record is Tier H and lands only by the maintainer's merge or an authorized approval.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…parent's record

Answers the contract review of 0aad3f2, on the seat's rulings.

- A map whose body holds an approval step is read both ways: as a
  step of the parent's record, and as a pause for it, since an item
  may be a record. It is refused when the approval opens unless the
  node shows that none of its items is a record.
- A node type that publishes no descriptor counts as one that can
  pause.
- What the conditions do not reach is counted one way: a refused
  write of the mirror, a run that ends between two steps and a
  decision whose run cannot be resumed go to the card the key waits
  for. The failures of a node between two steps are named.
- The automation service derives the root run of a run started before
  the change when it resumes it, so every later request records one.
- Execution items 7 and 8, Points, Consequences, Alternatives and
  Readings follow.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
…d configuration

The maintainer ruled on 2026-11-26 at 23:51Z that the platform refuses
the configuration which would leave a document reading a decision its
approval did not finish (ruling record 7205949718).

- Every passage that called the fifth marked point unruled now cites
  the ruling: the status line, the header, Provenance, the TL;DR, D5,
  Points, Alternatives and Refs.
- The header and D5 quote the option the maintainer chose, and say
  that the opening conditions spell the rule out further than the
  option's words do. Points lists what inside the ruling is this
  record's own or the seat's.
- No decision changes.

Claude-Session: https://claude.ai/code/session_01L6bhgWPwjheYqchuPwxH8t
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e3283c063ba29517f810076f35ea977c273f7505
Local-runs: none
Scope: docs/adr/0162-an-object-declares-its-closed-states-the-record-and-its-lines-are-closed-to-change.md, docs/adr/README.md + none
Security-touching: yes

Delta round on the record in comment 7205803522, which passed head 0aad3f22b6 with S14 open and awaiting the maintainer, S20 open, and nits N39 to N42. Read for this record: card #36253 with its seven comments (one added since the last round, the ruling record 7205949718), the PR body and file list, the net diff against main (two files, both under docs/adr/), the delta between the two heads in full (two commits, one file, the ADR, 40 lines added and 29 removed; docs/adr/README.md did not move; 0aad3f22b6 is an ancestor of this head), the latest record and the rulings it rests on, and the check-runs on this head. Every code position the delta leans on was opened on main at 80519b5991. The files the new Readings rows cite are unchanged there since the commit the record read them at, but for approval-service.ts, where the refusal of a second pending request on one record still stands. Security-touching: yes is meant: this head widens which approvals the platform refuses to open and restates what it does not prevent on a closed document.

① Derived judgments

  • The delta publishes nothing. One Markdown file moved. No schema, no route, no package source, no changeset. Right.
  • docs/adr/README.md. Unchanged since the first head. main has not touched its index since the branch point, 0162 is still free there, and the branch merges clean. Right.
  • What the record now announces for later, where this head changed it:
    • A map whose body holds an approval step is refused when the approval opens, wherever it stands among the steps, unless its items are written out in the node and none is a record. It reaches only an approval that concerns a step on the parent's object, so no shipped outcome moves. Right.
    • A node whose type publishes no descriptor counts as one that can pause. Right in direction; its wording is N43.
    • The automation service derives a root run, at resume, for a run that was started before the change. Right. The card that changes what the automation service hands a node still owes its own semver judgement.
    • The card the key waits for (Execution, item 8) gains the test arms for a next step that fails to open and for a node that fails on this lock through a write the check cannot read. Right.
    • The fifth marked point is ruled. No decision moved with that edit: the second commit changes who decided, and nothing of what is decided.
  • The showcase. Not touched by the delta. Its flows do not use the status mirror. Its one approval of each item under a map (the batch sign-off) names no closing field and runs under a parent that carries no record, so the conversion meets none of the new rule.

② Semver level

Unchanged by the delta. skip-changeset matches a diff that publishes nothing from a released package. The PR body's Clause-②: no and Metadata-protocol: none are right for this diff.

Check-runs on the head, read at 2026-11-27T00:23Z: 48 runs, all completed: 26 success, 22 skipped, none failed, none still running. The successes include Lint & Repo Gates with each of its families, TypeScript Type Check with each of its families, Test Core, Test UI, Dogfood Regression Gate, Governed Surface Queue Guard, Check Documentation Links and both PR-body guards runs. Both Check Changeset runs are skipped; the PR carries the skip-changeset label.

③ Boundary flags

  • open_questions: [], the two deviations and the two out-of-scope notes. The card carries no new report for this head, and nothing in the delta changes how they stand.
  • security_findings: withheld in the dev report. Still with the seat, off the board.
  • The question that was before the maintainer. Answered. Record 7205949718 on 专题:单据锁定(对象声明审批、付款、关账等状态后,单据和主从明细不能再增删改)(ADR 先行) #36253 carries the question, the option chosen and its text, and the option not chosen. The answer was given after the six conditions stood, as the last record asked.
  • The quick-read block, fourth line. True to the tree. It names the three rulings, says which three things the maintainer did not say in so many words, lists what the six conditions add to the option's words, and says where the refusal happens: when an approval is started, with notice at authoring, and not at publish. That last clause is the one an approver should read twice (④, the moment of the refusal).
  • Choices new on this head. "Points" lists fourteen things inside the third ruling, says of each whose it is, and says that none is in the ruling's words. The count agrees with the PR body's items 6 to 19. Each way not taken is in Alternatives.
  • The PR's author is the fleet account. There is no second login to name.
  • SQL push-down. The delta adds one read: the walk from a run that was started before the change up its parent links, once, when that run is resumed. It is a chain of point reads by id over a run's own ancestors, which the automation service already makes on main for another purpose, and no id list or in-app join. No finding.

④ Design judgment

The points of the tenth record.

  • S14: closed. The maintainer ruled, and the text carries the record faithfully everywhere the point stood. The id 7205949718 is cited in the status line, the header, D5, "Points", Alternatives and Refs. The time is the one the record carries, 2026-11-26 at 23:51Z, in the header and in D5. The words are the record's own, byte for byte: 「平台拒绝这种配置」 three times, and the option's text once, in the header, with an English reading beside it as the earlier two rulings have. No passage still calls the point unruled, before the maintainer or written to a recommendation; Provenance counts three rulings, and the two sentences on which rulings kept the new approval as a way out now say the first two. The mark stays on D5 and the TL;DR as the mark of a point that goes past the 2026-11-22 ruling's words, now ruled, as on the other four. The ruling record's own effect line says the opening conditions are the platform's rule and not guidance, and D5 says the same: the report at authoring is early notice, and the refusal at the first request is the rule.
  • S20: closed. A map whose body holds an approval step is read both ways for the parent's record: as a step of it, which names the field, and as a pause for it, because an item may be a record. It is refused unless the node shows that none of its items is a record. The record says what the check does with a collection of both kinds, and draws the consequence the last record did not: with one item of each kind a wait on another record's approval can fall between two steps of the parent's record wherever the map stands, so the refusal holds after the parent's last step too. That is right, and it is what the seat's ruling asks. The two sentences of D5 are corrected, "Points" books the choice, Alternatives keeps both ways not taken, "What an author has to know" and "What it costs" say where an approval of each item runs, D10's table and item 7's check carry the condition, and item 7's tests place the map ahead of the parent's steps, between two of them and after the last. Against main the reading is exact: the node tests each item as the body runs, also where it names an object for its items, and takes its collection from an expression or from a list written in the node (map-node.ts).
  • N39: closed. D5, item 7's check, its tests, "Points" and Readings say that a node whose type publishes no descriptor counts as one that can pause, and the engine's reading is exact (run-resume.ts#refuseUndeclaredSuspension). How far the words reach is N43.
  • N40: closed. D5 drops the qualifier and names both failures, and item 8's tests gain a next step that fails to open, on an empty slate and on a request already pending, and a node that fails on this lock through a hook's write-back or another object's cascade.
  • N41: closed. D5 and item 7 state the invariant: the automation service derives the root run of a run started before the change when it resumes it, so every request opened after the release records one, and item 7 has the test. Against main the links exist and the runs above a parked child are themselves parked, so the walk has what it needs (run-resume.ts#failAncestors).
  • N42: closed. Three things in D5, in "Points", in "What it costs" and in item 8's text, and the key waits for "this card".

The author's four readings.

  1. S20 taken to the letter. Right, as above. Its cost is real and booked: an approval of each line cannot run inside the approval of a document that closes on its approval's outcome, and such an author starts the per-item approval apart or closes on a later state. Alternatives names the one change that would bring it back, a map that refuses an item of the other kind, and leaves it a later decision. That is the right place for it.
  2. A node type with no descriptor counts as able to pause. Right in direction (N43).
  3. Item 8's two failure arms, and the root run derived at resume. Right, both.
  4. The moment of the refusal, and "further than the option's words". The option's words are 「发布或开审批时直接报错」. The record refuses when an approval opens, reports at authoring, and does not refuse at publish. That is one of the two moments the words name, so the words are kept. The purpose the option states is kept too: until the author has met the conditions no approval opens on the field, no request is written and nothing is mirrored, so no document reads a decision its approval did not finish, for every approval that opens after the declaration is published. The reason the record gives for not making publish the rule holds against main: that a field is an approval's mirror field is said by a flow's node, the object and the flow are published apart, and a field that closes only on paid with no pending is no error on its own. Two things follow from taking the later moment. An approval already in flight when a declaration is published is not judged, and where an author passes over the notice the refusal reaches the person who submitted, as a failed run. The record states both, the first as the fourth thing the conditions do not reach and the second in "What an author has to know", though not beside the choice. The sentences that say the conditions go further than the option's words are accurate. In two of the fourteen the record takes less than the letter and not more: it does not refuse at publish, and it asks nothing of an object that closes on the field only on values of its own. Both are inside the option's stated purpose, and "Points" books both, the first and the fifth entries. This reading honours the ruling. It is also the record's own choice inside it, and the approval of this PR is what adopts it; what is left of it for the build is N45.

The drafted rule, tried against main on this head. A run of the approval comes to carry another record only under a map: a subflow hands its parent's context on whole, and a binding may not take a name the engine owns, so no node can point a step at another record from inside the parent's run (subflow-node.ts, flow.zod.ts). A region body, a loop, a parallel branch or a try, may not hold an approval step, so a subflow and a map are the only bodies a step sits in. A map under a map, or under a subflow, is reached by "at any depth". An item written out in the node is judged by the node's own test of a record. The passages the earlier records traced hold on this head.

No must-fix, no should-fix.

Nits. None moves a decision, and none is to be fixed on this head: a change to this file moves the head and owes another round. Each is carried to the build card named, or stands.

  • N43 (nit) — "A node whose type publishes no descriptor counts as one that can pause" takes in, by its words, the two structural types, start and end, which publish no descriptor and have no executor either (flow.zod.ts#FLOW_STRUCTURAL_NODE_TYPES), so they cannot pause. Read to the letter, the end of a map body or of a subflow body stands between two steps and would refuse approvals that item 7's own test list passes. The clause means a type that has an executor and publishes no descriptor. Item 7's card says so, pins it with the arm of a map whose items are written out, and its docs tell the author that a node type without a descriptor between two approval steps is refused.
  • N44 (nit) — The map rule applies "where the conditions concern a step that can act on a record of the parent's object". The body's step counts as able to act on the parent's record, and the conditions can concern it through the item's object alone. D5 judges each step on each object it can act on, and "What it costs" speaks of a document that closes on its approval's outcome, so the rule is meant of the parent's object: a map is refused where the parent's object closes on the field of a step that can act on its record. Item 7's card pins two arms that are not refused: an item's object that closes on the body step's field under a parent whose object does not, and a parent run that carries no record, which is the batch sign-off shape the showcase ships.
  • N45 (nit) — The record says the conditions are "reported" at authoring and no more. The option's word is 报错, an error. Whether that report is an error or a notice where the object and the flow are in view together is item 7's card to state. Alternatives turns down a refusal only at publish; a refusal at publish as well, where the pair is in view, is the reading nearest the option's words and is not listed with its reason.
  • N46 (nit) — Item 8 names a run that ends between two steps because a node fails. A flow can route a node's failure and go on, and a run can then complete without the next step having been asked. The card says on which side of its bound that falls, and pins it: whether it is the author's own routing, as a branch that skips a step is, or an end between two steps.
  • N47 (nit) — In "Points" the last entry's "(the same ruling)" now follows two entries that cite the seat's ruling on the tenth review. The entry is the seat's ruling on the ninth, with the invariant added on the tenth. It stands, or is put right when the file is next touched for another reason.

docs/adr/README.md. Not in the delta, and still the generated output for the record's unchanged title and status. Nothing to add.

Summary. S14 and S20 are closed, and so are N39 to N42. Nothing of the first two grades is open on this head, and the five nits go to the build cards or stand. The record carries the maintainer's third ruling faithfully, and the one place where it takes the narrower of the two moments the option names is stated in the text and in the quick-read block. Nothing is left for a contract review on this head. What is left is not this record's: the PR is Tier H and lands only by the maintainer's merge or an authorized approval, and the build cards are filed after that, items 7 and 8 with N43 to N46 in their text.

Implemented-by: claude/project-thread-lotnpd
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head e3283c0 · card #36253 · area s2-data · 2026-11-27T00:25Z

L1 checklist

  • Shape and relation. l1-face.mjs --pr 37606 read 13 items and flagged none. On this head 26 check-runs succeeded and 22 were expected skips; none failed or is pending. mergeable_state is clean. Two files: the new ADR-0162 and the regenerated docs/adr/README.md index. skip-changeset (no published package).
  • Part of #36253 is right. This PR is the card's "ADR first" half. The build cards the ADR's execution plan names start only after it is Accepted, and the card stays open for them.
  • Maintainer rulings carried. 7200732942 (「全部按推荐」, text of record 7202242844), 7201405662 (「平台堵住:撤回不恢复关闭值」) and 7205949718 (「平台拒绝这种配置」, S14). The last one replaces every ▲ wording: the review checked the id, time and words byte for byte.
  • Contract review. Eleven rounds at CONTRACT_REVIEW_TIER. The last two are 7205803522 (PASS, S20 open) and, on this head, 7206423099: PASS, S14, S20 and N39–N42 closed, no must-fix, no should-fix. The seat adopts it. Nits N43–N46 go into the text of the build cards for execution items 7 and 8. N47 stays until the file is next touched. Neither is fixed on this head, because any change to the ADR moves it.
  • Governance. check-governed-merges.mjs: governed (docs/adr/** added file, index lines removed, security label). 587 changed lines. Tier H.

Tier: H. Landing: hand-off to the approver by the next stroke; ⛔ the seat does not merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Tier H hand-off · 2026-11-27T00:25Z · head e3283c0 · approver os-zhuang

维护者速读

  • 定了什么: 新的 ADR-0162 允许对象声明「哪些状态值算已关闭」,比如已批准、已付款。单据进入这些状态后,记录本身和它的一层明细行都不能再被用户或管理员修改、删除;系统身份(含动作体)不受限。这只是设计记录,代码由后续建设卡按它实现,合并后才开工。
  • 用户会看到什么: 已关闭的单据编辑、删除会被拒,并说明「已关闭」;连带删除碰到已关闭单据时整笔拒绝,一条都不删;给已关闭单据换负责人也会被拒。声明一发布,已经处在这些状态的旧记录立刻关闭,没有宽限期;把值从声明里拿掉,就重新放开。
  • 请你留意,三处你没有逐字说过:
    1. 你选了「平台拒绝这种配置」。ADR 把拒绝放在开审批时,编写时只做提示,发布时不拦。你的选项写的是「发布或开审批时」,二选一,审核判为合规。代价是:发布那一刻已经在途的多步审批不受检查;作者不理会提示的话,拒绝会落在提交人身上,表现为一次失败的流程运行。
    2. 拒绝的条件比选项原话宽:不只「缺少审批中状态或退回路径」,ADR 一共列了六个开审批条件。例如每一步都写同一个状态字段,两步之间不能有用户运行的写入或可暂停的节点。
    3. 由此推出:单据审批流程里不能再放逐行明细审批(审批步骤放在 map 循环里的那种),要逐行审批得另起一个独立审批。
  • 审核: 契约审核共 11 轮,最后一轮 7206423099 PASS,没有必须改或建议改的项。席位 L1 已 ACCEPT(本评论前一条)。剩下几个小问题和边界情况写进建设卡,不改这份 ADR。
  • 要你做什么: ADR 是受管面,需要你批准后才能合并。合并即视为 Accepted,建设卡随后立。撤回这一次合并即可恢复原样。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 27, 2026 01:00
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 972114d Nov 27, 2026
58 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-lotnpd branch November 27, 2026 01:33
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security size/l skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants