Skip to content

Units of measure R1: the standard unit table in the spec and the organization unit object sys_unit #35488

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

Units of measure, release R1 (ADR-0158 U7). Parent: #35339. The ADR is the governing text: ADR-0158 (merged PR #35370, 35bd360). Filed on seat 5's word, 2026-11-19.

What to build

  • U1, U2: a closed constant in packages/spec holding the curated Rec 20 subset, each code with its dimension and its ratio to the dimension's base unit, kept apart from ValueDomainSchema the way CURRENCY_FRACTION_DIGITS is. Package codes (X…) carry a package dimension and no ratio. Piece is H87; C62 and EA are refused.
  • U3: the system object sys_unit, organization-owned (organization_id injected, behind the tenant wall like sys_exchange_rate), zero shipped rows, org codes in the reserved namespace (at least 4 characters or containing _). The seat's U3 notes apply: members can read it, and labels say "unit of measure".
  • L1 / L2 as settled: the ratio can be edited and the edit affects only later writes (org admin only, audited); code and dimension are immutable after create; delete is allowed; one org-written label per unit (translation is units of measure: translate organization-added unit labels (deferred by the units ADR, 2A) #35404).

Open items this card carries (settle here, amend the ADR)

Done when

The constant and the object exist with pins (closed set, H87 admitted, C62 / EA refused, the namespace refusal, tenant isolation, member read, admin-only write); OI1, OI2 and OI11 are answered in ADR-0158. No unit key on fields ships here (U8: the reader comes with the membership card).

Grade

p2 · area:data · domain:spec. The first R1 piece; every other R1 card reads these tables.


Generated by Claude Code

Activity

  1. added
    priority:p2
    pm:queue
    domain:spec
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

    Claim: PM loop round 11 · area data-2 (seat 5 2026-11-19T11:41Z: file and build the units R1 cards; this card is the first, ready since OI8 / OI10 were ruled 2026-11-19T12:02Z) · 2026-11-19T13:30Z
    Area: data-2
    Session: session_01Utp6CajiB6BSQKWowy6YLB
    Account: os-bill
    Branch: claude/issue-35488-unit-tables
    Worktree: objectstack-issue-35488
    Domain: domain:spec
    Seat: repo:objectstack#5
    File surface: a new closed constant in packages/spec/src/data/ (the U1 / U2 standard unit table, beside currency-fraction-digits.ts) and its export; packages/spec/src/system/constants/platform-object-names.ts (sys_unit entry); a new packages/platform-objects/src/system/sys-unit.object.ts and its registration, member read grant, Setup navigation entry and the generated translation / source-hash files the generators rewrite; the organization-ownership inventory in packages/cli/src/utils/organization-ownership-inventory.ts if sys_exchange_rate sits there; their tests; root .changeset/; ADR-0158 amendment for Open items 1, 2 and 11 (docs/adr/0158-…md, governed: the PR lands through the seat, Tier H). ⛔ No unitConfig or any field key (U8: ships with #35489), no write-path check, no renderer.
    Container & model: L, mode:subagent, model: default — no path-derived mandate, effort: xhigh (contract + ADR)
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: @objectstack/spec + platform-objects in objectstack: no unit-of-measure tables exist, so no quantity can name a governed unit; no platform path covers it; every R1 card (#35489 #35490 #35491 #35492 #35498) and the suites waiting on units (hotsrm / hotcrm materials)
    Thread-read: 7003532733
    Premise: holds — git grep -n "sys_unit\b" origin/main -- packages/ finds only ADR text; no unit constant in packages/spec/src/data/
    Serial constraints cleared: ADR-0158 merged (PR #35370); no open PR claims these files (the dev runs overlap-check before the first push)
    Pre-claim lane: domain:spec (packages/spec/**, packages/platform-objects/**), area data-2 (units, #35339)
    Pre-claim deps: #35339 ADR (merged); OI8 / OI10 ruled (records on #35339); OI2 #35465 and OI11 #35466 are settled in this PR and close with it
    Prior rulings read: units of measure, sys_unit, Rec 20, org unit → ruling 7001193034 (U1–U8), record 7003532733 with its correction, OI8 / OI10 records on #35339, ADR-0158 L1–L4 and Open items; ADR-0144 D3 (exchange-rate owner left to its card), ADR-0029 D1/D3/D6, ADR-0148 (sys_* has no recycle bin); none conflicts

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB
    os-dev-report

    {
      "issue": 35488,
      "status": "done",
      "branch": "claude/issue-35488-unit-tables",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35581",
      "session": "session_01Utp6CajiB6BSQKWowy6YLB",
      "premise_still_valid": true,
      "summary": "Shipped U1/U2 as a closed spec constant STANDARD_UNITS in @objectstack/spec/data. It holds 41 Rec 20 codes over mass, length, area, volume, time, count and package (base codes KGM, MTR, MTK, MTQ, SEC, H87). Every ratio is an exact decimal string with scale at most 12 and a named source; package X-codes carry no ratio. H87 is a member, C62 and EA are absent, and ORGANIZATION_UNIT_CODE_PATTERN gives org codes their own namespace. Shipped U3 as sys_unit in platform-objects: code, label, dimension, ratio, decimal_places and retired, all field-historied. It is org-owned behind the tenant wall, ships zero rows, has an org-unique code, refuses changes to code and dimension, requires a ratio except on package and refuses one on package, and has a Setup nav entry. member_default reads it and org admins and owners write it through their wildcard. ADR-0158 OI1, OI2 and OI11 are amended. OI11 is settled as 'a deleted code stays retired': L1's delete is spelled as a one-way retired flag, the row keeps the unique key, the data API serves no delete (single or batched) and Setup has no Delete. Deviations: the brief's 'piece' dimension is named count (H87 base, with PR and DZN as multiples; the reasoning is in the ADR). WIP commits were pushed before the first overlap-check, which later came back clean. The commit trailers follow the brief's model-free pair; the harness attribution reminder asked for a model-named trailer and a PR footer, and I did not follow it.",
      "tests": "All on head 298bbb987, under os-verify-lock with set -e (VERDICT batch-last-exit 0; each part reports passed):\n- spec standard-units, api-methods-batch-conformance, platform-object-names, platform-tool-names and value-domain: Test Files 5 passed (5), Tests 67 passed (67).\n- platform-objects full suite: Test Files 125 passed (125), Tests 2092 passed (2092).\n- cli unit layer, organization-ownership-inventory tests: Test Files 1 passed (1), Tests 26 passed (26). The integration layer is left to CI; the diff does not touch it.\n- plugin-security full suite: Test Files 282 passed (282), Tests 7050 passed | 45 skipped (7095). This includes the new default-permission-sets.unit-of-measure.integration.test.ts (14 tests on a real kernel with sqlite), which pins: member read with create and edit refused 403 PERMISSION_DENIED; admin and owner writes with organization_id stamped; KGM, H87, C62, EA and box_12 refused with code:invalid_format; code and dimension changes refused with rule_violation; un-retire refused; re-creating a retired code refused with 409 UNIQUE_VIOLATION.\n- Typecheck: spec, platform-objects and plugin-security gave VERDICT command-exit 0; cli gave VERDICT command-exit 0.\n- No ablation: the diff adds new behaviour and changes no existing tested behaviour.",
      "gates": "Local, on head 298bbb987:\n- node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 110 families; 110 exited 0 (each code captured before any pipe), including check:dual-build-cjs-loads and check:i18n-coverage ('14 config(s), 423 baselined untranslated string(s), none new').\n- --ran printed: 'Run reconciliation — 110 derived, 110 run, 0 NOT-MEASURED, 0 UNRUN.'\n- overlap-check against origin/main cf6bb70e2d, PRs #35510 and #34223: 'VERDICT clean exit 0'.\n- check:dev-prereqs (local-only) exit 1, 'The workspace is not built' (35 of 108 packages, all in the UI tree, have no dist). This is container state, NOT MEASURED.\n- check-platform-checklist n/a: no export was renamed or deleted.\nCI on PR #35581 at report time: 20 check-runs in_progress, 5 skipped (opt-in and queue rows), none concluded. Convergence is the PM's.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — POST /repos/objectstack-ai/objectstack/dispatches (fleet-write pr_create → #35581, draft, assignee os-bill, read back 8238/8238 bytes identical); the os-dev-report comment on #35488 via post-stamped. The git pushes are not REST writes.",
      "open_questions": [
        {
          "question": "L1 says 'delete allowed' and OI2 says 'delete: org admin'. This PR spells that delete as a one-way retire, per the brief's OI11 recommendation and its example mechanism. Does the seat accept retire as L1's delete, including that un-retire is refused?",
          "options": [
            "A — accept: retire is the delete, one way; a mistaken retire is answered with a new code",
            "B — allow un-retire by an org admin (drop the one-way rule, keep the unique key); the code's meaning cannot change because code and dimension are immutable, but a ratio edit after un-retire is still possible",
            "C — require a physical delete as L1 reads; OI11 then needs another mechanism, such as a tombstone table of retired codes"
          ],
          "recommendation": "A, because it is the smallest mechanism that keeps the OI11 hazard impossible and every part is pinned. B is a one-line rule removal if the seat prefers it."
        },
        {
          "question": "apiMethods closes delete at the data API and Setup, but an engine-level delete below the REST door is not refused. Should the membership card (OI9) or a later card add an engine-side refusal (for example a beforeDelete hook on sys_unit)?",
          "options": [
            "A — leave it to the membership card, which already reads sys_unit on every write",
            "B — file a separate small card for a beforeDelete refusal"
          ],
          "recommendation": "A, because no platform path issues an engine delete on sys_unit today and the membership card owns the write path that would care."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — os lint on platform-objects reports translation-target-unknown on Setup nav entries. This class predates this card (nav_exchange_rates shows it too), and no public-door wrong answer was measured."
      ]
    }

    Generated by Claude Code

  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

    Claim amendment · area data-2 · 2026-11-19T16:41Z

    File surface (amended): adds packages/cli/test/connect-agent-both-halves-wire.pin.test.ts. The new Setup entry nav_units_of_measure this card adds moves the Setup tree count that pin states. CI evidence: Test Core 1/10 red on 298bbb987 (job 135699452855, expected … to have a length of 31 but got 32). Fix c890bf191: both counts go 31 → 32, a presence assert for the new entry, and a history line. No other assertion moves and no source changes. Everything else in the claim (7010577714) stands.

  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

    Seat ACCEPT for PR #35581 at head 8037977d2bf6fdcf0cafc43e1f3012d3de64c21d: record 7017937391 on the PR. Contract review PASS 7016785755 + merge-only delta d1 PASS 7017917809. Tier H (ADR-0158): reviewers os-zhuang, hotlong; pm:awaiting-merge. The merge confirms readings 1 and 2.

  7. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

    Close-out: PR #35581 merged as 7411f9b (maintainer merge, Tier H). The merge confirms readings 1 and 2: a unit delete is a one-way retire, and the engine-side delete refusal is deferred to #35489, where it is carried in comment 7016814814. Follow-ups: #35489 (carry), #35490 (N3 display/external members). The ADR nits N1–N3 ride the ADR amendment that records the confirmation. pm:dispatched removed.

  8. removed
    pm:dispatched
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:specpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions