Skip to content

feat(units): unitConfig on a number field, and the write path checks the unit code - #35805

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/project-thread-dr6px1
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 9 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

Part of #35489

Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #35808

维护者速读

  • 用户能看到什么变化:搭建应用的人可以给数量字段写明计量单位(整列一个标准单位,或每条记录自己带单位代码),保存记录时系统检查单位代码是不是标准单位或本组织仍在用的单位,不是就拒绝;本组织的单位只能停用,任何人、任何自动化都删不掉。
  • 为什么做:计量单位第一版,替物料、库存、采购这类带数量的业务落地「字段声明单位」和「写入时检查单位」两件事。
  • 出错会怎样:写错或已停用的单位代码,保存会被拒绝并指出是哪个字段;库里已有的旧值不动数量时照常可改其它字段;本次合并可以直接撤回,不涉及数据迁移。
  • 要你做什么:无

ADR-0158 R1, the membership card: the unitConfig key (U4, settled under L3), the standalone unit-code marker (Open item 8, ruled A), the asynchronous write check (U5, Open item 9's settlement 7013996288), the engine-side refusal of a sys_unit delete (Requirement 1 of 7030061316), and the error codes (Open item 3). The ADR-0158 amendment text is handed to the seat; this PR touches no docs/adr/**.

What changes

unitConfig on a field (packages/spec/src/data/field.zod.ts, UnitConfigSchema): a discriminated union on unitMode, three closed shapes.

  • { unitMode: 'fixed', unit: 'KGM' } on a number: one standard unit, checked at parse against STANDARD_UNITS (exact uppercase; C62 and EA are answered with the piece, H87, U2).
  • { unitMode: 'record', unitField: 'uom', unitDimension?: 'mass' } on a number: each record names its unit by code in the sibling text field.
  • { unitMode: 'code', unitDimension?: 'count' } on a text: the Open item 8 marker, a field holding a unit code with no quantity beside it (a material's base unit). A unit marker, not a fourth value domain: ValueDomainSchema stays at three members (U1), and the marker is refused beside a valueDomain.
  • Refused on every other type (currency, formula, summary included, U8: no reader yet). Bare unit / uom / unitCode / dimension keys on a field are refused with guidance naming unitConfig.

The object door (packages/spec/src/data/object.zod.ts, refuseDishonestRecordUnitField, beside the currency one): a record pointer into nothing, into itself, into a non-text field, into a field carrying its own unitConfig (L3: the pointer is the declaration), into a text field that declares a valueDomain (one column, two vocabularies; added in 44bf630 for L2 S2), or through a parent (PARENT.UNIT_FIELD is reserved, L3), and two quantities sharing one unit field with different unitDimension values.

N4: standardUnitOf(code) (packages/spec/src/data/standard-units.ts) is the one own-property lookup on STANDARD_UNITS; the write check asks membership only through it, so toString or __proto__ is never a member, and the fixed enum (built from the table's own keys) is pinned to admit exactly the codes it admits.

The write check (packages/objectql/src/validation/unit-code-membership.ts, new): at every insert, by-id update, predicate update and validate() preview, after the currency-code check. Open item 9, as settled:

  • case 1: a code written must be a standard code or one of the organization's own non-retired sys_unit rows, in exact uppercase (never folded), of the declared unitDimension (point 5);
  • case 2: a non-blank quantity written beside a resting code that is no longer a member is refused, and the message names the field, never the stored value;
  • case 3: a quantity beside a blank code is refused;
  • the row image is judged only when the write touches the quantity or its unit field (point 1, ADR-0113 D1); a standalone marker is judged as a unit field with no quantity (point 6); a write touching neither is never judged, so a row resting on free text stays editable in its other fields (point 7, until the backfill, Units of measure R1: a backfill door that converts existing free-text units to codes #35492).

The organization's units are read once per organization per write (sys_unit, organization_id + code $in, a minimal system context that keeps only the caller's transaction and trace id), and never for a write whose codes are all standard.

A unit is retired, never deleted (Requirement 1): refuseOrganizationUnitDelete in engine-delete-and-aggregate.ts, right after assertWriteAllowed and before any middleware or hook, so it holds for a user, a system writer and an automation run, by id and batched: 405 ERR_UNIT_DELETE_REFUSED. organization_admin names sys_unit explicitly (allowRead/Create/Edit: true, allowDelete: false, no modifyAllRecords), as sys_audit_log does; the effective permissions the client reads now offer no delete.

Error codes (Open item 3), registered in the ledger under @objectstack/objectql, one per remedy (the ERR_HOME_CURRENCY_UNSET precedent): ERR_UNIT_CODE_REQUIRED, ERR_UNIT_CODE_UNKNOWN, ERR_UNIT_CODE_RETIRED, ERR_UNIT_DIMENSION_MISMATCH (400 each), ERR_UNIT_DELETE_REFUSED (405, the data door's status for the same verb; the suffix follows EXTERNAL_WRITE_REFUSED).

Open item 6, first half: a quantity needs no scale, and may keep one. The currency precedent (field-currency-scale-refused.test.ts, ruling 5805782503) is that a currency's decimal places are the currency's, not a field setting, and it never made a scale required. A unit's own decimal places are U6, which R1 does not ship (#35498 owns that setting), so R1 has nothing to require a scale for; a number's optional scale stays what L4 names it, the ceiling. Pinned: a number declaring unitConfig needs no scale (Open item 6, first half), with and without scale: 3.

Where it diverges from currencyConfig, and why

  • unitMode is required with no default: an absent currencyConfig already means the tenant currency, and no tenant unit exists (L3).
  • unit, not defaultUnit: under fixed it is the one unit, never a default (L3; defaultCurrency is the recorded misnomer).
  • unitDimension, not dimension: the bare word is a group-by axis in the analytics schemas (L3).
  • A discriminated union of closed shapes instead of one shape with a cross-key refinement: the discriminator is required, so each mode's keys are its variant's and the rule reaches the published JSON Schema (oneOf). currencyConfig cannot take this form because its discriminator has a default.
  • The membership read is asynchronous and organization-scoped (sys_unit); the currency-code check is pure (ISO 4217).

Ripple (the new key's classification, no behaviour): metadata-core field-level security keeps unitConfig; driver-sql's DDL classes it presentation; the metadata form reconciliation omits it (the picker is #35490); the liveness ledger row; the federated injected-column census row for the sys_unit read; a variant-docs.json entry (generated-reference-only, the gap stated); the sys_unit docblock names its readers.

Read first

  1. packages/objectql/src/validation/unit-code-membership.ts, assertUnitCodes: the three Open item 9 cases and when the row image is judged.
  2. packages/objectql/src/engine-update.ts, the two touchesUnitCodes hunks: the by-id image and the predicate path's prior rows.
  3. packages/objectql/src/engine-delete-and-aggregate.ts, the refuseOrganizationUnitDelete line: before middleware, so no context bypasses it.

Two-minute verification

pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/default-permission-sets.unit-of-measure.integration.test.ts (after building its closure): 23 tests pass, among them the engine refuses to delete a unit in every context for an administrator, an owner, a member, a system writer and an automation run, each by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored.

Tests

New suites, each refusal case asserting the envelope (code and status), never a bare throw:

  • packages/spec/src/data/field-unit-config.test.ts (62): standardUnitOf and N4 (toString, constructor, __proto__ are no member); each mode's shape, aliases and off-mode keys; which type carries which mode; the marker beside a valueDomain; bare unit / uom / unitCode / dimension; the object door's five pointer refusals (six since 44bf630, with the valueDomain target) and the shared-field dimension conflict, each located at its key; Open item 6 first half.
  • packages/objectql/src/validation/unit-code-membership.test.ts: the three Open item 9 cases, by name OI9 case 1: refuses a code that is no member, ERR_UNIT_CODE_UNKNOWN / 400 on the code field, OI9 case 1: refuses %j, never folded, naming the exact spelling, OI9 case 2: refuses the quantity edit beside a retired code, naming the field and never the stored value, OI9 case 3: refuses a quantity beside the code %j, ERR_UNIT_CODE_REQUIRED / 400; Requirement 2 (refuses a new save with a retired code, ERR_UNIT_CODE_RETIRED / 400); point 5 and point 6; the once-per-organization read; the delete refusal.
  • packages/objectql/src/engine-unit-code-membership.test.ts: the engine seams (insert, insertMany culling, by-id and predicate update, validate()), and the delete refusal under a system context, a user and no context, by id and multi: true.
  • packages/plugins/plugin-security/src/default-permission-sets.unit-of-measure.integration.test.ts (23, real stack): the delete refusal for an administrator, an owner, a member, a system writer and an automation run, by id and batched; the administrator's effective permissions; an owner edits the administrator's unit (the explicit line keeps the edit the wildcard gave); the write check over a real sys_unit (a retired unit, a mis-cased code, another dimension, a blank code, EA, and case 2 on a resting row).

Pin sweep (dispatch ①②): the five codes are new, so no pin of them existed; the one pin of the old meaning, the sys_unit test that named "the organization admin wildcard grant", now names the explicit line, and the line's substance is asserted in the real-stack cell (effective allowDelete: false, create and edit kept, every unit still stored after each refused delete).

Ablations (both committed first, mutated and restored with scripts/ablation-replace.mjs, the engine suite importing src/ so no build sits between):

  • the refuseOrganizationUnitDelete(object); line deleted: anchor 1 to 0, blob 0f0fd66a5919 to d1a6c4760fff; engine-unit-code-membership.test.ts 3 failed / 15 passed (the system, user and no-context cells; the other-object control stayed green); restored, blob equals HEAD, git diff HEAD empty.
  • the insert path's assertUnitCodes call short-circuited: blob 58ab1cbe7870 to e037c24b57a0; 7 failed / 11 passed (every insert refusal and the insertMany cull); restored, blob equals HEAD.
Package runs (lock VERDICT lines)
  • @objectstack/spec test: 866 files, 27781 passed, 1 todo, VERDICT command-exit 0
  • @objectstack/objectql test: 620 of 621 files green; the one red, the federated injected-column census, is the new seam's row, added in this PR and green on rerun (5/5); typecheck VERDICT command-exit 0
  • @objectstack/plugin-security test: 284 files, 7068 passed, 45 skipped; typecheck VERDICT command-exit 0
  • @objectstack/metadata-core test + typecheck: 27 files, 1045 passed, VERDICT command-exit 0
  • @objectstack/driver-sql test + typecheck: 266 files (13 skipped), 4438 passed, VERDICT command-exit 0
  • @objectstack/platform-objects test: 125 files, 2092 passed; typecheck VERDICT command-exit 0
  • @objectstack/metadata-protocol degenerate-derivation test: 18 passed
  • final head rerun: objectql unit suites 65/65, spec unit suite 62/62, the real-stack cell 23/23, VERDICT command-exit 0
The real-stack delete cell (verbose)
an organization administrator: refused by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored
an organization owner: refused by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored
a member: refused by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored
a system writer ({ isSystem: true }): refused by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored
a system automation run (svc:flow, runAs system): refused by id and batched, 405 ERR_UNIT_DELETE_REFUSED, every unit still stored
the administrator's effective permissions offer no delete on units, and keep create and edit

Acceptance notes

Verification

Derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, run on the final tree (a37e623808, the tree of 91a4947 and of 168c65a692 before its messages were reworded), each exit code captured before any pipe.

  • Reconciliation: Run reconciliation — 130 derived, 130 run, 0 NOT-MEASURED, 0 UNRUN. and ✓ dispatch-gates --ran: 130 derived famil(ies) accounted for — 130 run, 0 NOT-MEASURED (a DERIVED zero — all 130 recorded an exit code and none of them is 3).
  • The first sweep, over the tree before the last three commits, read check:variant-docs red (the undeclared unitMode:code|fixed|record union, now declared) and three PREREQUISITE NOT MET exits (check:skill-examples, check:dual-build-cjs-loads, check:i18n); all four measured and exited 0 in the final run.
  • Changeset level, offline with this body as the event: node scripts/check-changeset-no-major.mjs --base origin/main --event EVENT_JSON exit 0, ✓ LEVEL AXIS: this PR declares clause-② yes and metadata-protocol added, spec, objectql, plugin-security, metadata-core and driver-sql at minor, platform-objects at patch.
  • Local-only: pnpm check:skill-frame-freshness exit 0 (the frame byte-identical); pnpm check:dev-prereqs exit 1, 35 of 108 workspace packages without a built dist, the named ones under ui/: a reading of this container, not of the diff (check:generated judges the spec dist fresh).
  • Not run locally, by design: test:repo (this diff adds no test to that project) and the CI-only families; CI runs them.
  • The branch carries one merge of origin/main (b0c624a); origin/main has since moved two commits (ef39b2c), neither touching a file here.
Derived gates on the final tree: 130 of 130 exit 0
exit 0  node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0  node scripts/check-adr-0087-registration.mjs --self-test
exit 0  node scripts/check-adr-links.mjs
exit 0  node scripts/check-adr-links.mjs --self-test
exit 0  node scripts/check-changeset-no-major.mjs --base origin/main
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-adoption.mjs
exit 0  node scripts/check-comment-mask-adoption.mjs --self-test
exit 0  node scripts/check-comment-mask-corpus.mjs
exit 0  node scripts/check-dev-prereqs.mjs --self-test
exit 0  node scripts/check-doc-route-spelling.mjs --advisory
exit 0  node scripts/check-doc-route-spelling.mjs --self-test
exit 0  node scripts/check-docs-section-name.mjs
exit 0  node scripts/check-docs-section-name.mjs --self-test
exit 0  node scripts/check-dts-emitted.mjs --self-test
exit 0  node scripts/check-empty-changeset.mjs --base origin/main
exit 0  node scripts/check-empty-changeset.mjs --self-test
exit 0  node scripts/check-engine-split-ratio.mjs --self-test
exit 0  node scripts/check-issue-citations.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs
exit 0  node scripts/check-plugin-teardown-shape.mjs --self-test
exit 0  node scripts/check-section-landing-index.mjs
exit 0  node scripts/check-section-landing-index.mjs --self-test
exit 0  node scripts/check-tenant-audit-census.mjs
exit 0  node scripts/check-tenant-audit-census.mjs --self-test
exit 0  node scripts/ci/assert-turbo-remote-cache.mjs --self-test
exit 0  node scripts/ci/plan-test-core-shards.mjs --self-test
exit 0  node scripts/ci/prune-turbo-cache.mjs --self-test
exit 0  node scripts/ci/snapshot-next.mjs --self-test
exit 0  node scripts/docs-audit/check-affected-docs.mjs
exit 0  node scripts/docs-audit/check-drift-comment.mjs
exit 0  node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0  node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0  node scripts/release-pending-publish.mjs --self-test
exit 0  pnpm --filter @objectstack/lint run check:doc-formula-expressions
exit 0  pnpm --filter @objectstack/lint run check:doc-security-posture
exit 0  pnpm --filter @objectstack/spec run check:api-surface
exit 0  pnpm --filter @objectstack/spec run check:authorable-surface
exit 0  pnpm --filter @objectstack/spec run check:browser-reachable-entries
exit 0  pnpm --filter @objectstack/spec run check:docs
exit 0  pnpm --filter @objectstack/spec run check:dual-source-exports
exit 0  pnpm --filter @objectstack/spec run check:duration-unit-keys
exit 0  pnpm --filter @objectstack/spec run check:empty-state
exit 0  pnpm --filter @objectstack/spec run check:entry-nameability
exit 0  pnpm --filter @objectstack/spec run check:error-code-provenance
exit 0  pnpm --filter @objectstack/spec run check:export-origins
exit 0  pnpm --filter @objectstack/spec run check:exported-any
exit 0  pnpm --filter @objectstack/spec run check:generated
exit 0  pnpm --filter @objectstack/spec run check:liveness
exit 0  pnpm --filter @objectstack/spec run check:llms-txt
exit 0  pnpm --filter @objectstack/spec run check:skill-examples
exit 0  pnpm --filter @objectstack/spec run check:skill-refs
exit 0  pnpm --filter @objectstack/spec run check:skill-served-sections
exit 0  pnpm --filter @objectstack/spec run check:strictness-ledger
exit 0  pnpm --filter @objectstack/spec run check:variant-docs
exit 0  pnpm --filter @objectstack/spec run check:yaml-examples
exit 0  pnpm check:adr-anchors
exit 0  pnpm check:adr-symbol-anchors
exit 0  pnpm check:authz-resolver
exit 0  pnpm check:changeset-gate-self-tests
exit 0  pnpm check:ci-filter-parity
exit 0  pnpm check:cli-command-ids
exit 0  pnpm check:closed-ceremony-text
exit 0  pnpm check:corpus-claim-drift
exit 0  pnpm check:cross-package-test-inputs
exit 0  pnpm check:dispatcher-error-vocabulary
exit 0  pnpm check:doc-anchors
exit 0  pnpm check:doc-authoring
exit 0  pnpm check:doc-frontmatter
exit 0  pnpm check:docs-audit-scope
exit 0  pnpm check:docs-redirects
exit 0  pnpm check:docs-single-h1
exit 0  pnpm check:docs-spec-enumerations
exit 0  pnpm check:docs-transcript-drift
exit 0  pnpm check:driver-conformance
exit 0  pnpm check:driver-memory-census
exit 0  pnpm check:dts-closure
exit 0  pnpm check:dual-build-cjs-loads
exit 0  pnpm check:durability-log-level
exit 0  pnpm check:engine-double-contract
exit 0  pnpm check:error-code-casing
exit 0  pnpm check:error-status-conformance
exit 0  pnpm check:gitlink-declared
exit 0  pnpm check:i18n
exit 0  pnpm check:i18n-stale-fill
exit 0  pnpm check:init-service-contract
exit 0  pnpm check:issue-citations
exit 0  pnpm check:keyed-text-bounds
exit 0  pnpm check:lean-entry-closure
exit 0  pnpm check:logger-receiver-detach
exit 0  pnpm check:merge-driver
exit 0  pnpm check:nul-bytes
exit 0  pnpm check:object-def-param-keys
exit 0  pnpm check:objectql-double-limit
exit 0  pnpm check:optional-error-sink
exit 0  pnpm check:org-identifier
exit 0  pnpm check:page-declaration-shape
exit 0  pnpm check:platform-checklist
exit 0  pnpm check:platform-object-tenancy-census
exit 0  pnpm check:pm-expected-skips
exit 0  pnpm check:pm-prior-rulings
exit 0  pnpm check:published-files
exit 0  pnpm check:published-readme-links
exit 0  pnpm check:query-options-erasure
exit 0  pnpm check:react-page-adapter-contract
exit 0  pnpm check:refd-timer-probe
exit 0  pnpm check:registry-log-declared
exit 0  pnpm check:rest-log-spy-declared
exit 0  pnpm check:role-word
exit 0  pnpm check:route-envelope
exit 0  pnpm check:settings-bind-window
exit 0  pnpm check:skill-identifier-liveness
exit 0  pnpm check:slot-lookup
exit 0  pnpm check:sourcemap-no-sources-content
exit 0  pnpm check:spec-docblock-symbol-anchors
exit 0  pnpm check:spec-parsed-alias
exit 0  pnpm check:startup-registry-verdict
exit 0  pnpm check:swallow-census-controls
exit 0  pnpm check:system-context-census
exit 0  pnpm check:test-source-alias
exit 0  pnpm check:tier-file-adoption
exit 0  pnpm check:type-check-coverage
exit 0  pnpm check:type-check-debt
exit 0  pnpm check:undeclared-dep-imports
exit 0  pnpm check:vendor-version-stamps
exit 0  pnpm check:vouch-for-reference-callers
exit 0  pnpm check:watch-hint-literal
exit 0  pnpm check:where-matcher
exit 0  pnpm check:wildcard-fallthrough

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu

…r (ADR-0158 U4, OI8)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
…te refusal (ADR-0158 U5, OI9, OI11)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
…te refusal; ledger rows for unitConfig

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
…or codes; declare UnitConfigSchema after UniqueScopeSchema

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
…cs entry for the unitConfig union

The federated injected-column census names the sys_unit read's organization_id
predicate as not-a-read of a federated column. The unitConfig union is declared
generated-reference-only with the documentation gap stated plainly.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
…in's explicit line, not the wildcard

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:data protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 6 package(s): @objectstack/driver-sql, @objectstack/metadata-core, @objectstack/objectql, @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/spec, touching 68 documentable anchor(s). ⚠️ 9 changed file(s) yielded no anchor (packages/platform-objects/src/system/sys-unit.object.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

37 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 1d7015aeeaa942c37af86c3c93d000fab7024880.

⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 9 changed file(s) yielded no anchor (packages/platform-objects/src/system/sys-unit.object.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …) — pages documenting those are invisible to this run
  • 18 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 179 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 1d7015aeeaa942c37af86c3c93d000fab7024880 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c3dfdf6c812906832d556e05082a375b721a7723 — the merge of head 44bf630f1e4704727471be06f8f0e3108c964194 into base 1d7015aeeaa942c37af86c3c93d000fab7024880, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c3dfdf6c812906832d556e05082a375b721a7723 && git checkout c3dfdf6c812906832d556e05082a375b721a7723
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1d7015aeeaa942c37af86c3c93d000fab7024880 44bf630f1e4704727471be06f8f0e3108c964194 && git checkout -B drift-repro 1d7015aeeaa942c37af86c3c93d000fab7024880 && git merge --no-ff 44bf630f1e4704727471be06f8f0e3108c964194

node scripts/docs-audit/affected-docs.mjs --json 1d7015aeeaa942c37af86c3c93d000fab7024880

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 1d7015aeeaa942c37af86c3c93d000fab7024880 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract-review-claim: session_01L9qibvMi1U7R2kBd3JbTPu · head 91a4947 · 2026-11-20T09:43Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

Seat check

L1: ACCEPT (L1-a, for area d7-D) at head 91a494735288e000a7259b2009567ef498473d5d, read 2026-11-20T09:46Z.

  • One record is owed before landing, with no new head: a claim amendment (below).
  • One L2 is owed: CONTRACT_REVIEW_TIER. It covers the packages/spec/src/** face (the new unitConfig key, the object door, the ledger rows) and the Clause-②: yes declaration. d7-D runs it on this head (7036271727). This ACCEPT does not replace it, and the depth of the write-path design is left to it.

Owed before landing (a record, not code)

Amend the claim's file surface. Claim 7033168211 names spec, objectql, platform-objects, the organization_admin rows, the generated spec artefacts, the liveness row and .changeset/. The head also edits these ripple files:

  • packages/drivers/driver-sql/src/builtin-column-collision.ts (unitConfig: 'presentation');
  • packages/metadata-core/src/object-schema-fls-references.ts (unitConfig: keep);
  • packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts;
  • docs/audits/2026-07-unknown-key-strictness-ledger.counts/data.md;
  • the plugin-security integration test.

Each is a classification that a new field key forces, and the body's Ripple paragraph explains it. But other seats' overlap checks read the claim, not the body. Post the amendment and re-run overlap-check. No delta L1 is owed.

Declarations

Code (L1 read; design depth is the L2's)

  • unitCodeSources reads only number + record (keyed by unitField) and text + code. A fixed quantity stores no code and is checked at parse.
  • judgedOf.
    • Insert judges every source.
    • Update judges membership only when the code or a non-blank quantity is in the payload (Open item 9 point 1).
    • "Required" is a non-blank quantity beside a blank code when either is written (case 3).
    • So a write touching neither is never judged (point 7).
  • readOrganizationUnits.
    • Standard codes are never looked up.
    • It does one read per organization, adding both the exact and the canonical spelling so the hint can be offered, and keys rows by the exact code.
    • An undefined organization asks nothing, so only standard codes pass.
  • membershipOf.
    • Standard first, then the organization's own (retired gives RETIRED).
    • A near-miss hint is offered only for a non-retired canonical spelling.
    • C62 / EA point to H87.
    • The case-2 message names "a code stored before this write", never the stored value.
  • Engine seams. The same assertUnitCodes runs on insert (after the batch read), by-id update (on the image), predicate update (each prior row with the payload over it) and validate() (same condition, refusal recognised by isUnitCodeRefusal).
  • Delete refusal. refuseOrganizationUnitDelete(object) runs right after assertWriteAllowed, before middleware and hooks, so no context passes.
  • Permissions. organization_admin gets sys_unit with allowDelete: false, without modifyAllRecords, for the reason its comment gives (superuser bits grant delete on their own).

Tests and controls

  • The spec suite: 62 tests.
  • The validation suite covers the three Open item 9 cases by name, with the envelope (code and status).
  • The engine seams suite includes insertMany culling and the delete refusal under system, user and no context, by id and multi: true.
  • The real-stack plugin-security suite: 23 tests.
  • Ablations.
    • Deleting the delete-refusal line reds 3 of 18, and the other-object CONTROL stays green.
    • Short-circuiting the insert assertUnitCodes reds 7.
    • Both restores are blob-equal.

Nits (not owed)

  1. No ablation on the update legs. The two update hunks, which the body tells a reader to read first, have pins but no ablation. One mutation of the predicate path's touchesUnitCodes guard would show those pins are live.
  2. The pending 35488 note goes stale at release. It says "Nothing reads these tables yet: … the write-time membership check … ship with their own cards", and "organization administrators write it through their existing grant". If both land in the same release, one CHANGELOG would say both that nothing reads sys_unit and that the engine now checks codes against it. Correcting that pending note would be a DELIBERATE CORRECTION, which reds Check Changeset, and this diff changes code, so the at-tier L2 PASS would have to confirm it. I leave whether to do it to the seat. The 35489 note on its own is accurate.

Prose, sentence by sentence (changeset)

  • Three modes. Each one's shape, type restriction and object-door refusals match UnitConfigSchema / refuseDishonestRecordUnitField as the body lists them and the spec suite pins them.
  • Write check.
    • "at every insert, by-id update, predicate update and validate() preview" matches the four seams.
    • "exact uppercase and of the declared unitDimension" and "a quantity may not stand beside a blank code" match membershipOf / judgedOf.
    • "judged whenever the write touches the quantity or its unit field" matches judgedOf.
    • The last sentence ("stays editable in its other fields; a quantity edit beside it is refused") matches case 2.
  • Delete. "for every caller, a system writer and an automation run included, by id and batched (405 ERR_UNIT_DELETE_REFUSED)" is pinned in both suites.
  • Ripple sentence. It matches the two classifications.

Gates and routing

  • CI at 91a49473: 62 success, 12 skipped, none red.
  • After the claim amendment and the CONTRACT_REVIEW_TIER L2 PASS on this head, check-governed-merges.mjs --pr 35805 decides the landing route. It reads NOT governed, per d7-D.

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: 91a494735288e000a7259b2009567ef498473d5d
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/standard-units.ts + packages/objectql/src/validation/unit-code-membership.ts, packages/objectql/src/engine-insert.ts, packages/objectql/src/engine-update.ts, packages/objectql/src/engine-validate.ts, packages/objectql/src/engine-delete-and-aggregate.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/platform-objects/src/system/sys-unit.object.ts, packages/metadata-core/src/object-schema-fls-references.ts, packages/drivers/driver-sql/src/builtin-column-collision.ts, packages/spec/liveness/field.json

Inputs read: card #35489 (body and comments 7016814814, 7030061316, 7033168211, 7035276751), PR #35805 (body, 38-file list, net diff from merge-base b0c624af8c to the head), the 74 check-runs on the head, ADR-0158 and the Open item 9 settlement 7013996288 the card cites, and the cited code in the tree at the head. Check-runs: every run is success or skipped, none failed or pending (Test Core 10/10 shards, Type Check, Lint and Repo Gates, Check Changeset, Spec property liveness, Governed Surface Queue Guard, Build Docs all success).

① Derived judgments

  • Field.unitConfig is added to the authorable surface (data/Field:unitConfig, JSON Schema data/UnitConfig). Right: an additive key with a required discriminator, three closed shapes, matching ADR-0158 L3 (fixed needs unit and refuses unitField and unitDimension; record needs unitField and refuses unit) plus Open item 8's code marker.
  • Nothing a metadata author could write before is refused now. FieldSchema was already closed, so the bare unit, uom, unitCode and dimension keys were refused before; only the message changes. Right.
  • Four new public exports from @objectstack/spec: UnitConfigSchema, UnitConfig, UnitConfigParsed, standardUnitOf. Right, and api-surface/data.json lists exactly these.
  • Five new wire codes under @objectstack/objectql in the ledger: four at 400, ERR_UNIT_DELETE_REFUSED at 405. Right: each is emitted by the module the ledger comment names, and the statuses agree with the thrown classes.
  • New write refusals reach only objects that declare unitConfig, a key that did not exist, so no stored declaration changes meaning. Right.
  • The engine now refuses every delete of sys_unit, and organization_admin loses the delete bit on it. A narrowing in form, but sys_unit is unreleased (.changeset/35488-standard-unit-table-sys-unit.md is still pending in this tree), so no published accept-set shrinks. Right.
  • The object door accepts a record pointer into a text field that declares a valueDomain. Wrong: see S2.

② Semver level

.changeset/35489-unit-config.md: spec, objectql, plugin-security, metadata-core and driver-sql at minor, platform-objects at patch. This matches what the diff publishes: a new authorable key and new exports (spec), new refusals and exported error classes (objectql), a changed default permission set on an unreleased object (plugin-security), a docblock (platform-objects). metadata-core and driver-sql each gain one classification row for the new key; minor is not below what they publish. No major, and none is owed.

Clause-②: yes, with Metadata-protocol: added, on the PR body and in the changeset body: correct, the change adds to what an author can write and narrows nothing published. Skills-docs: follow-up #35808 is present. The Check Changeset run on the head is success.

③ Boundary flags

  • Open question 1 (an organization holding any sys_unit row can no longer be deleted): escalated. The claim holds in the tree: the organization delete refuses while a tenant row outside its cascade names it, and the engine now refuses every unit delete. This follows from Requirement 1 of 7030061316 as written ("every context"), so it is not a defect of this head, but it is a product decision about tenant offboarding and it is the seat's or the maintainer's to rule. It needs a follow-up card filed before this PR merges. The dev's option B (the organization delete's own cascade as the one exemption) is consistent with Open item 11, since a deleted organization cannot re-create a code.
  • Open question 2 (the destructive-change finding for unitConfig declared over stored free text): answered A, with a condition. Settlement point 7 says the refusal's guidance names the backfill door, and this head names none because Units of measure R1: a backfill door that converts existing free-text units to codes #35492 has not built it. Shipping the finding and the door's name with Units of measure R1: a backfill door that converts existing free-text units to codes #35492 is acceptable only because point 7 ties both cards to one Version Packages release. Nothing in this diff enforces that tie, so the seat must hold the release until Units of measure R1: a backfill door that converts existing free-text units to codes #35492 lands; escalated to the seat as a release condition.
  • Out-of-scope note, a record pointer declared by an object extension is not judged by the object door: accepted. Same reach as currencyField. The runtime is fail-closed: unitCodeSources answers a pointer as written, so a pointer into nothing reads a blank code and the quantity is refused.
  • Out-of-scope notes on the ADR-0158 amendment and the skills teaching: accepted as the seat's follow-ups (Skills-docs: follow-up #35808; no docs/adr/** in this diff, as the claim fenced).
  • Deviations: accepted. The reworded commits keep the tree (a37e623808); the files outside the landing zone are one classification row each.
  • SQL push-down: no finding. The organization-unit read is one find per organization with organization_id and code $in pushed to the driver, and is skipped when every judged code is standard. The predicate update lays the payload over the matched rows from readPriorRows, the memo the currency twin directly above it already reads for the same purpose; the per-row refusal needs each row's id and image. No new in-app join.
  • Cross-organization read: checked, no finding. The elevated read keeps only the caller's transaction and trace id and names the organization twice; the organization is the row's own, by the same function the home-amount seam uses, and on insert the read runs after the Layer 0 wall's post-hook check.

④ Design judgment

packages/spec/src/data/standard-units.ts. standardUnitOf is an own-property, exact-match lookup, as N4 asks. toString, constructor and __proto__ are no members. Holds.

packages/spec/src/api/error-code-ledger.zod.ts. One code per remedy, each comment agrees with the emitter. Holds.

packages/spec/src/data/field.zod.ts. The union, the type table and the cross-refusals hold against L3 and Open item 8, and the fixed enum is built from the same own keys standardUnitOf reads.

packages/spec/src/data/object.zod.ts. The five pointer refusals and the shared-field dimension conflict hold against L3. One gap:

S2 (should-fix) — refuseDishonestRecordUnitField accepts a record pointer whose target text field declares a valueDomain. L3 says the unit field "carries no marker", and FieldSchema already refuses the same pairing on a code field. Through the pointer it parses: for example weight: { type: 'number', unitConfig: { unitMode: 'record', unitField: 'cur' } } beside cur: { type: 'text', valueDomain: 'iso_4217_currency' }. One column is then judged as a currency and as a unit, and a quantity write passes only for a coincidental code. The runtime is fail-closed, so nothing wrong is stored, but the accept-set is wider than L3, and closing it after release is a narrowing. Fix: refuse at the door when the target declares valueDomain, located at the quantity's unitField, with a pin.

packages/objectql/src/validation/unit-code-membership.ts. The three Open item 9 cases, points 5 and 6, the retired rule (Requirement 2) and the once-per-organization read agree with the settlement. One sentence of its own contract does not hold:

S1 (should-fix) — the module header says "The message prints a code only when the write itself carried it; a resting code is named by its field, never by its value", and the PR body and the proposed ADR note repeat it. Two paths break it for a resting code (case 2, the payload carries the quantity and not the code field):

  • membershipOf computes hint whether or not the code was written, and the ERR_UNIT_CODE_UNKNOWN message prints it. A stored kgm or KGM answers "write 'KGM'", which is the stored value in upper case. A stored ea or c62 answers "The piece is 'H87'".
  • the ERR_UNIT_DIMENSION_MISMATCH message prints verdict.dimension, the dimension of the stored code.
    A caller who may edit the quantity but not read the unit field learns the stored code from the refusal. This is exactly the free-text rows the rollout expects before the backfill. The existing pin covers only the retired path. Fix: when codeWritten is false, drop the hint and the stored code's dimension from the message, and pin both paths with not.toContain.

packages/objectql/src/engine-insert.ts, engine-update.ts, engine-validate.ts. The four call sites sit beside the currency-code check on the same image. The by-id path always has its prior row; the predicate path judges every matched row before the statement; the preview answers the refusal as the row's finding. Holds.

packages/objectql/src/engine-delete-and-aggregate.ts. The refusal runs after resolveObjectName and assertWriteAllowed and before any middleware, hook or driver call. delete() is the only engine door that reaches the driver's delete for a business object, so by-id, multi and system callers are all covered. Holds against Requirement 1.

default-permission-sets.ts, sys-unit.object.ts, object-schema-fls-references.ts, builtin-column-collision.ts, liveness/field.json. Each agrees with the contract it restates; the liveness row names the real reader.

Nits (no effect on correctness or the contract; fold into the S1/S2 fix or leave):

  • N1: the docblock above STANDARD_UNIT_CODE_LIST in field.zod.ts cites unit-config.test.ts; the file is field-unit-config.test.ts.
  • N2: the code beside valueDomain message says "no value could satisfy both". MMK and XDR are both standard units and ISO 4217 codes, and PR is both a unit and an ISO 3166 code. The refusal is right; the sentence overstates.
  • N3: L3 lists the alias rows for unitConfig as one set. Split per variant, some are unanswered: dimension, field and codeField under fixed; defaultUnit, unitCode, code and uom under record. Those get the generic unknown-key answer.
  • N4: a whitespace-only code counts as blank, so a standalone code field, or a unit field beside a blank quantity, stores ' ' unjudged.

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract review brief — PR #35805 @ 91a494735288e000a7259b2009567ef498473d5d (card #35489)

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 packages/spec/src/api/error-code-ledger.zod.ts packages/spec/src/data/field.zod.ts packages/spec/src/data/object.zod.ts packages/spec/src/data/standard-units.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35489: its body and EVERY comment (rulings and earlier records included)
· PR #35805: its body, its file list, and the net diff against main at 91a494735288e000a7259b2009567ef498473d5d
· the check-runs on 91a494735288e000a7259b2009567ef498473d5d: 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: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/standard-units.ts;
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.

⛔ 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-35805/ 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.

…a unit pointer into a value-domain field is refused

S1: on a quantity-only edit beside a resting code, the unknown-code refusal no
longer offers the stored code's corrected spelling (or the piece), and the
dimension refusal no longer prints the stored code's dimension; the field is
named, as the retired path does.

S2: the object door refuses a record quantity's unitField naming a text field
that declares a valueDomain, the pairing FieldSchema refuses beside the code
marker, and no longer offers such a field as a candidate.

N1: the field.zod.ts docblock names field-unit-config.test.ts. N2: the
code-beside-valueDomain message says why the pairing is refused instead of
claiming that no value satisfies both.

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 44bf630 · 2026-11-20T10:40Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 44bf630f1e4704727471be06f8f0e3108c964194
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/standard-units.ts + packages/objectql/src/validation/unit-code-membership.ts

Delta review of the fix for record 7036451051 (PASS at 91a4947352, S1 and S2 open). The head is one commit on top of 91a494735288e000a7259b2009567ef498473d5d, a fast-forward, touching five files: unit-code-membership.ts and its test, field.zod.ts, object.zod.ts, field-unit-config.test.ts. Inputs read: that one-commit diff, the dev's addendum 7037425743 on card #35489, the claim amendment 7036377413, and the check-runs on this head. Everything outside the five files is byte-identical to the head the first record judged, and that record's ①, ② and ③ stand for it.

Check-runs on this head: none failed. success: Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Check Documentation Links, Flag docs affected by code changes, Check PR Size, Auto Label, Dogfood Regression Gate, filter, Plan Test Core shards, Plan Test UI shards, Lint · scoped · tooling self-tests, Lint · PM dispatch-gates. Pending when read (in progress), not awaited: Test Core 1/10 through 10/10, Build Core, Build Docs, Build UI Deps, Live E2E UI, Lint · ESLint, Lint · repo and tooling gates, Lint · docs and code guards, Lint · CI, release and engine gates, Lint · scoped · slot lookup and corpus, Lint · scoped · query-options erasure, Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger. The Test UI shards and the aggregate Test Core, Test UI, TypeScript Type Check and Lint and Repo Gates runs had not been created yet. The new pins in this commit are proven only when Test Core completes green; this record judges the design and does not stand in for those runs.

① Derived judgments

  • The object door now refuses a record pointer whose target text field declares a valueDomain. Right: this is the refusal S2 asked for. It tightens only what this same unreleased PR introduced, so no published accept-set shrinks.
  • Two refusal messages change their text for a resting code; codes, statuses and the field and quantityField members are unchanged. Right.
  • No other accept-set or public-surface change: no new export, no new wire code, no schema key.

② Semver level

Unchanged and still correct. The commit touches no changeset; spec and objectql stay at minor, and the fix adds nothing a different level would owe. Clause-②: yes and Metadata-protocol: added still describe the PR. Check Changeset on this head is success.

③ Boundary flags

  • The addendum raises no new open question and no new out-of-scope finding. Its one deviation, a gate run narrowed to the five changed paths (89 of 130 families), is accepted: CI runs the whole set on this head.
  • The two escalations of the first record stand unchanged and are still owed by the seat: the follow-up card for an organization that holds units and can no longer be deleted, and holding the release until Units of measure R1: a backfill door that converts existing free-text units to codes #35492 lands (settlement point 7).
  • SQL push-down: the commit adds no read, no id materialisation and no in-app join. No finding.

④ Design judgment

S1: closed
S2: closed

S1, against the tree. In assertUnitCodes the spelling hint is now gated on codeWritten, so a quantity-only edit beside a stored kgm, KGM, ea or c62 gets the generic sentence, the same one a code with no near spelling gets; the two cases can no longer be told apart. The dimension-mismatch message prints "a unit of another dimension" for a resting code and names the dimension only for a written one. The module header now states the rule as "never by its value nor by anything derived from it". Six new cases pin both paths with not.toContain, each beside a control showing the written code still gets its correction or its dimension. What a resting code still discloses is the verdict itself (unknown, retired, or another dimension), which the refusal cannot avoid.

S2, against the tree. refuseDishonestRecordUnitField adds the refusal after the own-unitConfig check, located at the quantity's unitConfig.unitField, and the candidate list no longer offers a field that declares a valueDomain. Pinned for all three value domains, each with a control that parses when the quantity points at the plain sibling.

N1: fixed. The docblock in field.zod.ts now cites field-unit-config.test.ts.

N2: fixed. The code beside valueDomain message no longer claims that no value satisfies both; it says the column would carry two vocabularies and names MMK as a shared spelling. The comment names MMK, XDR and PR. The test pins the absence of the old sentence.

N3, N4: unchanged, left as accepted deviations.

Nothing new of substance. One nit:

  • N5: the PR body and the changeset still list the object door's refusals without the valueDomain one. The PR body can be patched without moving the head; the changeset line can wait for the ADR amendment, whose delta text in 7037425743 already names it.

No must-fix, no should-fix.

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_01L9qibyQBB3KuDoNobNq9LH

Seat check (delta)

L1: ACCEPT (L1-a, for area d7-D) at head 44bf630f1e4704727471be06f8f0e3108c964194, read 2026-11-20T10:45Z. This carries ACCEPT 7036343182 forward over the fix for L2 7036451051 (S1, S2, N1, N2), which delta L2 7037493853 PASSes at this head.

  • Condition: CI green at this head. It was still running when I read.
  • Already met: claim amendment 7036377413, the item 7036343182 owed, and the same-head CONTRACT_REVIEW_TIER PASS.

Correction to my ACCEPT 7036343182

I wrote that the case-2 message "names 'a code stored before this write', never the stored value". That was true of the value itself, but not of what is derived from it. The near-miss hint (write 'KGM' beside a stored kgm, 'H87' beside a stored EA) and the mismatch's dimension both disclosed the resting code to a caller who may edit the quantity but not read the code field. The L2's S1 found it.

The delta (5 files, +104 / −14)

  • S1 (unit-code-membership.ts).
    • The hint is printed only when codeWritten.
    • A resting code's dimension mismatch reads "a unit of another dimension".
    • The remedy for a resting code adds "in the same write as ''".
    • Pins were added for the resting kgm / EA cases and the resting mismatch.
  • S2 (object.zod.ts, field.zod.ts). A record pointer into a text field that declares a valueDomain is now refused at the object door, the same pairing FieldSchema refuses beside a code marker. That field is also dropped from the "candidates" prescription.
    • The reason is corrected in both places. The two vocabularies are not disjoint (MMK, XDR, PR are in both), so the pairing is refused for meaning two things at once, not for "no value could satisfy both". The old sentence was false.
    • This tightens only a shape this same unreleased PR introduced, so no published accept set narrows and Clause-②: yes stands.
  • N1 / N2. A docblock path (field-unit-config.test.ts) and the matching pins.

Gates and routing

Tesla chose A for the release pairing. After CI is green at 44bf630f, check-governed-merges.mjs --pr 35805 decides the route (NOT governed).


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu

Landing #35805 at 44bf630f1e4704727471be06f8f0e3108c964194 · 2026-11-20T11:10Z

Probe Reading
CI at 44bf630 pr-state.mjs --pr 35805: 62 success, 12 expected skip, 0 unexpected skip, 0 failed, 0 pending; mergeable_state clean (read twice)
check-governed-merges.mjs --pr 35805 (final list) NOT governed: 0 of 38 paths hit the register. 2,300 changed lines ≤ 3000, so an ordinary queue landing
landing-k.mjs --pr 35805 K = 5 < 15, no locale pack, no shared book moved
Generated-artifact drift, re-measured now 0: main since the merge-base touches no merge=os-regen path
Reviews L1 ACCEPT 7036343182 → delta ACCEPT 7037550656 · L2 PASS 7036451051 → delta PASS 7037493853 (S1 and S2 closed) · claim amendment 7036377413

State change: ready for review, then auto-merge. This lands under the release pairing the maintainer picked (A): he holds the next Version Packages release until #35492 (the backfill door, ADR-0158 Open item 9 point 7) merges. Part of #35489: the card stays open for the ADR-0158 amendment PR. Follow-ups: #35812 (organization delete cascades its units, ruled B) and #35808 (skills, folded into #35769).

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants