Skip to content

docs(adr): ADR-0158 records the R1 unit key, write check and backfill door as shipped - #35903

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-dr6px1
Nov 20, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-dr6px1

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Fixes #35489
Fixes #35492

Clause-②: no
Metadata-protocol: none

维护者速读

ADR-0158 amendment for the R1 membership card (#35489, PR #35805, merged e1143241de) and the R1 backfill card (#35492, PR #35865, merged f44758b21e). Each card's PR was Part of, so each card closes with this record. This PR changes docs/adr/0158-…md only, one file, +162 / −9. It implements nothing.

What changes

The text was drafted by each card's dev report (adr_amendment: 7035276751 with its fix-round delta for #35489; 7044992828, round 3, for #35492). Each was reviewed with its PR's L1 and L2: #35805 L2 7036451051 / 7037493853, and #35865 L2 7041994401 / 7043808549 / 7045119376.

Not in this PR

  • The Releases table has no status column, so the R1 backfill row is unchanged.
  • No other ADR moves. ADR-0144 is cited, not amended.

Verification

Final head 1f0f9a8b55 (two commits from main at f44758b21e; the second applies both reviews' prose fixes). CI at this head: 25 success, 19 expected skip, 0 failed; mergeable clean.

Reviews: L1 REWORK 7046347694 → delta ACCEPT 7046638729 · L2 PASS 7046431113 (S1, S2) → delta PASS 7046644989 (S1, S2 closed; no must-fix, no should-fix). security label per the L2's Security-touching: yes.

  • node scripts/adr-index.mjs --check: OK.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack docs/adr/0158-…md derives 21 commands, all run, all exit 0 (after pnpm --filter '@objectstack/lint...' build for check:doc-formula-expressions). Among them: check:adr-anchors, check:adr-symbol-anchors, check:adr-index, check-adr-links, check:doc-authoring, check:pm-governed-merges and check:pm-prior-rulings. Reconciliation: dispatch-gates --ran reports "21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED".
  • The edits were made by one script of eight exact anchored replacements, each asserting a single hit.

Governed: docs/adr/** is Tier H (Prime Directive #14). This lands by an authorised approval and the maintainer's merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu

… door as shipped

L3 records `unitConfig` as the three-member union that shipped, with the
type-to-mode rule and the object door's record-pointer refusals. Open items
3, 6, 8, 9, 11 and 12 gain the R1 settlements of the membership card and
the backfill card: the five unit error codes, no required scale, the
standalone `code` marker, the write check's cases and its point 7 remedy
and destructive findings, the engine-level sys_unit delete refusal with
the organization-delete exemption, and the backfill door's rules.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
@objectstack-fleet objectstack-fleet Bot added documentation Improvements or additions to documentation skip-changeset PR has no user-facing published change; bypasses the changeset gate labels Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract-review-claim: session_01L9qibvMi1U7R2kBd3JbTPu · head f69f3d0 · 2026-11-20T17:34Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract review brief — PR #35903 @ f69f3d03a73f51a3f528666666b239d8411bdd54 (cards #35489 and #35492)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· cards #35489 and #35492: each body and EVERY comment (rulings and earlier records included), and the L2 records on PRs #35805 and #35865 that reviewed the amendment text
· PR #35903: its body, its file list, and the net diff against main at f69f3d03a73f51a3f528666666b239d8411bdd54
· the check-runs on f69f3d03a73f51a3f528666666b239d8411bdd54: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — a hits path sits on the low-risk skills arm: when the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/f6f2f87a-1f68-5b6b-ba36-b37fd0636732/scratchpad/d7d/pr-35903/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1: REWORK at f69f3d03a73f51a3f528666666b239d8411bdd54 (2026-11-20T17:37Z). One prose item

This review covers the one file the PR changes, docs/adr/0158-…md (+155 / −7). I diffed it against merge base f44758b21e, which is #35865's merge commit. I checked each amended sentence against the code on that base.

What I checked

Required

  1. Open item 11's exemption is written as if it were built, and it is not.

Nit (not blocking)

  • N1. Open item 3: "when only the case differs, the exact-uppercase spelling is named". The hint in membershipOf is canonicalSpelling = code.trim().toUpperCase(), so a spelling that differs only in surrounding spaces is named too. C62 and EA are pointed to H87. Consider "when only case or surrounding spaces differ, the exact spelling is named (and C62 / EA point to H87)".

Before landing


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f69f3d03a73f51a3f528666666b239d8411bdd54
Local-runs: none
Scope: docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md + none
Security-touching: yes

Inputs read: cards #35489 and #35492 (each body and all 7 comments), the L2 records 7036451051 and 7037493853 on PR #35805 and 7041994401, 7043808549 and 7045119376 on PR #35865, PR #35903 (body, its one-file list, the net diff against main at f44758b21e, +155 / −7), and the check-runs on this head. Code on origin/main was read, not reviewed, for every anchor the amendment names: field.zod.ts (UnitConfigSchema, the type table, the bare-key guidance), object.zod.ts#refuseDishonestRecordUnitField, error-code-ledger.zod.ts, validation/unit-code-membership.ts, the four engine call sites, engine-delete-and-aggregate.ts, default-permission-sets.ts, sys-unit.object.ts, unit-code-backfill.ts, meta-unit-code-backfill-route.ts, commands/migrate/unit-codes.ts and protocol-write-face.ts. The cards the amendment links (#35812, #35885, #35498) were opened to check each link says what the text says.

Check-runs on this head (51 runs, read twice, last at 17:40Z): none failed. success: Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, Check Documentation Links, Lint · PM dispatch-gates, the three Lint · scoped lanes, Type Check · workspace, source gates and debt ledger, Plan Test Core shards, Dogfood Regression Gate, Test UI, filter, Auto Label. In progress when read, not awaited: Lint · docs and code guards, Lint · repo and tooling gates, Lint · CI, release and engine gates, Type Check · consumer gates, Test Core (1/10). The ADR anchor, symbol-anchor and index gates live in the Lint lanes still running, so this record judges the text and does not stand in for them; convergence is the seat's.

Security-touching is yes: the changed hunks state permission and authorization behaviour (organization_admin on sys_unit with no delete bit, the delete refusal under system and automation contexts, the REST door behind metadata.endpoints.maintenance and setup.write, the system-context read and write).

① Derived judgments

  • No accept set and no public surface moves. One file under docs/adr/**, prose only. Right.
  • The L3 code block is replaced, not annotated. The settled four-key block gives way to the three-member union. Right as a record of what is on main (z.discriminatedUnion('unitMode', [Fixed, Record, Code])), and the dated lead line says the block was replaced. The earlier text survives only in git history; acceptable because the lead line says so.
  • Open items 3, 8, 9, 11 and 12 and the first half of 6 change from "not settled" to settled. Right for 3, 8, 9 and 12, each checked against the code below. Wrong in one sentence each for 11 and 6: S1 and S2.
  • The Status line gains an Amended clause. Right; the first Status sentence, which the index reads, is unchanged.

② Semver level

Clause-②: no

skip-changeset is right: the diff publishes nothing, and no package file is touched. Clause-②: no and Metadata-protocol: none on the PR body are right for a prose-only record. Check Changeset on this head is success.

③ Boundary flags

④ Design judgment

docs/adr/0158-…md (hits), against the code on origin/main at f44758b21e and against the R1 cards that read it next.

S1 (should-fix) — Open item 11's note states an exemption that is not built. The sentence reads: "The one exemption, ruled by the maintainer (option B), is the organization delete's own cascade, which removes its units (#35812)." The ruling is real (7035627429 on #35812). The behaviour is not on main: refuseOrganizationUnitDelete(object) takes the object name alone and throws for sys_unit unconditionally (engine-delete-and-aggregate.ts:176), nothing in the cascade planner exempts sys_unit, and #35812 has no PR. Today an organization with units is refused its delete. The same note's first sentence, "in every context", is the true one. Every other note in this amendment records what shipped, and the Status line says so, so a reader takes this sentence as shipped too; it is also a statement about who may delete what. Fix shape: say the exemption is ruled and not built, that #35812 carries it, and that until it lands an organization holding a unit is refused its delete.

S2 (should-fix) — Open item 6's note says "A unit's own decimal places are U6, which R1 does not ship (#35498), so a required scale would serve nothing in R1." The card it cites is titled "Units of measure R1: an organization setting for how many decimal places each standard unit displays" and says "the ruled R1 display needs it"; the Releases table lists "display of the value with its unit" under R1; sys_unit.decimal_places is already on main from #35488; and the note's own last sentence hands the display half to "R1's display card". So the clause contradicts the execution plan it cites, and a dev on #35490 or #35498 could read it as putting unit decimals outside R1. The settlement itself (no scale required, a declared scale stays L4's ceiling) is not disturbed. Fix shape: say that no reader of a unit's decimal places has shipped yet (the display card #35490 and the setting card #35498 add them), so nothing reads a required scale today.

Everything else holds, sentence by sentence:

  • L3, the union and its three bullets. The block matches FixedUnitConfigSchema, RecordUnitConfigSchema and CodeUnitConfigSchema key for key. The type table is number: fixed, record; text: code; every other type refused, with currency, formula and summary worded apart. The four bare keys are answered on FieldSchema. The object door's six pointer refusals and the shared-field dimension conflict are the six branches of refuseDishonestRecordUnitField, in the code's own words.
  • Open item 3. The five codes are in the ledger under @objectstack/objectql; RecordUnitCodeError.status is 400 and UnitDeleteRefusedError.status is 405; sys_unit's apiMethods serves no delete.
  • Open item 8. The marker, the refusal beside valueDomain, the refusal through a quantity's pointer and the backfill's treatment of a standalone blank (skippedBlank, never written, with or without a "" entry) match the tree.
  • Open item 9. The four seams run assertUnitCodes after assertRecordCurrencyCodes on the same image. Cases 1 to 3 and points 5 and 6 match judgedOf and membershipOf. Point 7 (a): the remedy is appended only when the code field was not in the write, on ERR_UNIT_CODE_REQUIRED and ERR_UNIT_CODE_UNKNOWN, with the "" clause for a blank, and never on the retired path. Point 7 (b): unit_code_field_declared iterates newlyDeclaredUnitCodeFieldsOf; unit_mode_to_record fires for a stored quantity whose previous mode was not record unless its unitField is in that map. Tried against the note: a re-point keeps the previous mode record, so neither finding fires onto an existing code field or a new field, as the trailing sentence discloses.
  • Open item 12. Flags, route, gates, INVALID_FIELD for a bad target, VALIDATION_ERROR on mapping before the apply walk, the unscoped multi-organization refusal, engine.update under { isSystem: true }, and unitCodeBackfillComplete gating both the report's and the CLI's check-mark all match. Tried: the report prints no check-mark on a truncated walk either, so "only then" holds.

Nits (no effect on correctness or the contract; fold into the S1 and S2 fix, since this is a prose face):

  • N1 (nit) — L3 says the eight misspellings "are answered with the spelling this record uses". The aliases are split per variant: dimension, field and codeField are not answered under fixed, nor defaultUnit, unitCode, code and uom under record or code (N3 of 7036451051, an accepted deviation). "Each in the variant that holds its target key" would be exact.
  • N2 (nit) — The unamended L3 bullet "Read on type: 'number' only" now stands three bullets below "code on a text", and L3 has two bullets titled "The object door". A dated word on the older two would stop them reading as current. U4's own section carries no pointer to the Open item 8 widening that card Units of measure R1: a number field declares its unit (unitConfig) and the write path checks the unit code #35489 says amends it.
  • N3 (nit) — Open item 9's trailing sentence cites units: a unitField re-pointed at a field new in the same save raises no finding, and two backfill report gaps (follow-up of PR #35865) #35885 after three gaps. That card carries only the re-point onto a field new in the same save; the re-point onto an existing code field and a narrowed unitDimension have no card.
  • N4 (nit) — Open item 3 pairs ERR_HOME_CURRENCY_UNSET with ERR_CURRENCY_CODE_REQUIRED; the ledger comment it describes names ERR_EXCHANGE_RATE_MISSING as the sibling.
  • N5 (nit) — Open item 8 says the picker (Units of measure R1: show a quantity with its unit label #35490) and the backfill "reach it". The backfill does; the picker is not built.
  • N6 (nit) — Open item 12, "Targets", opens with "Each mapping target is judged by U5 before any row is read", and the next sentence gives the exception. An organization's own code on an unscoped run is judged after the read-only preview.

No must-fix. S1 and S2 are open on this head and each earns a delta review of its fix.

Implemented-by: claude/project-thread-dr6px1
Reviewed-by: session_01L9qibvMi1U7R2kBd3JbTPu

VERDICT: PASS

…n as ruled and not yet built

Review fixes on the amendment: Open item 11 says the cascade exemption
(#35812) is ruled but not built in R1, so the refusal still holds for an
organization delete; Open item 6 no longer places unit decimals outside
R1; and the smaller prose corrections of both reviews (the hint's
spelling rule, the alias split per variant, the picker not yet built,
when a backfill target is judged, the two older L3 bullets dated).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract-review-claim: session_01L9qibvMi1U7R2kBd3JbTPu · head 1f0f9a8 · 2026-11-20T17:48Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1 delta: ACCEPT at 1f0f9a8b55b3275f7cffc8c80019d2de982fcf37 (2026-11-20T17:49Z)

Delta reviewed: f69f3d03a7 → 1f0f9a8b55, one fast-forward commit, ADR file only.

The REWORK 7046347694 item is fixed, and so is N1.

What I checked

Before landing


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 1f0f9a8b55b3275f7cffc8c80019d2de982fcf37
Local-runs: none
Scope: docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md + none
Security-touching: yes

Delta record on 7046431113 (PASS at f69f3d03a7, S1 and S2 open, nits N1 to N6). Read this round: the diff f69f3d03a7..1f0f9a8b55 (one commit, a fast-forward, the one ADR file, +28 / −23), the net diff against main (still one file, +162 / −9), and the check-runs on this head. Each changed sentence was read against the same code on origin/main at f44758b21e as the first record. Every judgment of 7046431113 not named below stands.

Check-runs on this head (40 runs when read, 17:49Z): none failed. success: Governed Surface Queue Guard, PR-body guards, Check PR Size, Check Documentation Links, filter. In progress when read, not awaited: every Lint lane (docs and code guards, repo and tooling gates, CI, release and engine gates, ESLint, PM dispatch-gates, the three scoped lanes), the four Type Check lanes, Plan Test Core shards, Dogfood Regression Gate, Test UI, Auto Label. Check Changeset and the Test Core shards had not been created yet. The ADR anchor, symbol-anchor and index gates run in the Lint lanes, so this record judges the text and does not stand in for them; convergence is the seat's.

Security-touching stays yes: Open item 11's rewritten sentence states who may delete a unit and when, and the hunks judged in 7046431113 are unchanged.

S1: closed
S2: closed

① Derived judgments

  • No accept set and no public surface moves. Prose only, in the one file. Right.
  • Open item 11 now records the exemption as ruled and not built. Right: it matches main, where the refusal is unconditional.
  • Open item 6 now says no reader of a unit's decimal places has shipped. Right; the settlement (no scale required) is unchanged.
  • No other settlement changes meaning in this delta; the rest are wording corrections.

② Semver level

Clause-②: no

Unchanged and still right: skip-changeset, Clause-②: no and Metadata-protocol: none for a prose-only record. Check Changeset had not reported on this head when read; the diff still touches no package file and no changeset.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

docs/adr/0158-…md (hits).

Nothing new of substance. One nit, carried: N2's U4 pointer.

Implemented-by: claude/project-thread-dr6px1
Reviewed-by: session_01L9qibvMi1U7R2kBd3JbTPu

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c

维护者速读

席位核对

Seat 7: hand-off for the maintainer's approval · head 1f0f9a8b55b3275f7cffc8c80019d2de982fcf37 · Fixes #35489 #35492 · GOVERNED (docs/adr/**, Tier H: the ADR edit removes 9 lines and the PR carries security) · +162/−9, one file · 2026-11-20T18:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c

Tier H hand-off: pm:awaiting-merge on, after the seat record in this thread (2026-11-20T18:01Z). Waiting for an authorized APPROVED review (os-zhuang).

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/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

3 participants