Skip to content

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

Draft
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-lotnpd
Draft

objectstack-fleet[bot] wants to merge 2 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

维护者速读

  • 用户无感:这次只落一份设计记录,线上行为不变;记录获批并实现后,业务人员会看到已付款、已审批通过这类已关闭的单据连同它的明细行,在任何入口都不能再手工修改或删除。
  • 为什么做:属于「单据关闭后锁定」这项功能,替需要把已决单据冻结的应用解决问题,今天这些应用只能各自手写代码去拦。
  • 出错会怎样:这份记录本身不影响任何人;其中的选择如果不合适,批准前直接改文字,批准后再出一份修订记录,没有数据需要回滚。
  • 要你做什么:审批这份设计记录;文中标出了四处超出原裁决字面的选择并附另一种读法,其中一处需要你说明同一批里的另一条裁决是否也管这把锁。

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. Referential clears and restore are named case by case.
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 names the reason to a caller who may read the state field. The approvals-family read stays exactly as published.
Where it is enforced D10: in the engine's write path, after the 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.

Four points go past the ruling's words. Each is marked in the text, listed in "Points the ruling does not settle" with the other reading beside it, and can be struck without touching the rest:

  1. D5: a system context is not bound at all, where the card's words require only a sanctioned action that moves the state. A new approval round is named as a way out that the app controls.
  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. This departs from item ③ of the same ruling batch if that item reaches a record-level lock. The record quotes the item as the ruling record words it and asks the maintainer to scope it. Under the other reading a user can neither leave nor enter a closed state by an edit, and only an action or system automation closes a document.
  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.

Read first, by risk:

  1. D4, its last paragraph, with the first entry under "When it is judged" in Alternatives considered: the question put to the maintainer about item ③.
  2. D5 "Who is bound": the test, the breadth of the system exemption, and the three reasons it differs from readonlyWhen.
  3. D6 "A closed record is not deleted by a caller": the one place the two locks deliberately differ.
  4. D9 "One lock read": what the new read answers, who is told the reason, and what stays as published.

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)

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 passed with six points to fix. This head answers them, and each fix owes a delta review. The seat runs it. 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. Three, 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, and whether a customization overlay may add or shorten the declaration.
  • Deviation. One gate needed two packages built first. That build ran without the shared verify lock.

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 revised head fe9a850c. 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

This branch has not been deployed

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

Labels

documentation Improvements or additions to documentation security size/m 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.

2 participants