Skip to content

Units of measure R1: an organization setting for how many decimal places each standard unit displays #35498

In progress

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

The maintainer ruled ADR-0158 Open item 10 option A, 「组织可改,新开一处设置」 (ruling record on #35339). An organization admin can set the display decimal places of any standard U1 code, for example 3 for grams at a jeweller or 0 for kilograms at a gravel yard. That value lives in a new organization-owned setting place, because sys_unit holds only org-added units (U3) and U1 is a closed spec constant. For an org unit, the value is the existing sys_unit decimal-places field (U6).

Constraints from the ADR

Blocked

Blocked-by: #35488

Needs the unit tables (U1 constant, sys_unit).

Done when

An org admin can set and clear the decimal places of a standard code, and a member can read them. Another organization's value is never read. Display (#35490) reads the setting. ADR-0158 records the answer.

Grade

p2 · area:data · domain:server. The ruled R1 display needs it.


Generated by Claude Code

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server · pm:blocked; rationale: area:data · Feature (a per-organization display-precision setting for standard units, ADR-0158 U7) · the maintainer ruled option A on open item 10 → p2 as set.

  3. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Unlock (daily scan): every Blocked-by: target is closed, so pm:blocked → pm:queue; grade unchanged.

    Target #35488 closed at 2026-11-19T22:28Z. No newer Blocked-by: line in the thread, no Unlock-action: line, no assignee. Same repository, so no installability check is owed.

  4. added
    pm:queue
    and removed
    pm:blocked
    on Nov 23, 2026
  5. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim: area o5-D round 1 · 2026-11-25T23:41Z · area:data p2 (the maintainer, verbatim, 2026-11-25T23:33Z in this seat's project: 「开一个专区 ,接 data 的 p1 p2」)
    Area: o5-D
    Session: session_01Utp6CbdHk3orAeensH6EzS
    Account: os-bill
    Branch: pending — mode:thread: the card thread pushes only the branch the platform assigns it; the area posts a Branch: amendment here when the thread opens
    Worktree: the card thread's own checkout
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: the organization setting's home (packages/platform-objects/src/** or the settings-key registry the precedent uses), its grants and audit wiring, the read path display (#35490) will call (packages/objectql/src/** or packages/services/** as measured), new tests named for the card, generated translations only via their generators, root .changeset/. ⛔ docs/adr/** (the ADR-0158 amendment goes as its own domain:skills card, filed by the area), ⛔ ui/** display (that is #35490). Stop on breach and report.
    Container & model: M, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: yes (a new organization setting surface: object or settings key)
    Metadata-protocol: none (an organization runtime setting, not an authoring key — the thread measures on the diff and corrects)
    Responsibility: n/a — not a defect card (ruled feature, ADR-0158 Open item 10 option A)
    Thread-read: 7107402370
    Premise: holds at origin/main 98bda0a — ADR-0158 L4 still says "For a standard code, a unit's org-editable decimal places have no home: Open item 10"; sys_unit carries decimal_places for org units only. Not yet measured (thread, before code): which precedent the home follows — an org settings key like ADR-0144 D4's localization.currency, or a sys_* object — and its grant/audit path; the thread brings the measured choice to the area before code.
    Pre-claim lane: packages/platform-objects/**, packages/objectql/** → domain:server.
    Pre-claim deps: Blocked-by: #35488 closed (PR #35581 merged). Display #35490 is downstream (pm:blocked), not a dependency.
    Prior rulings read: check-prior-rulings --card 35498 --paths → 111 ADR candidates, 0 ruling comments on the card; binding: ruling record 7001193034 on #35339 (ADR-0158 accepted) and the Open item 10 option A ruling recorded on #35339 (「组织可改,新开一处设置」, quoted by the card); ADR-0158 L4 (scale is the ceiling, nothing rounds at write); ADR-0144 D4 as precedent for an org setting.
    Serial constraints cleared: open-PR file scan of 36 open PRs: none touch sys_unit or unit code paths except release PR #35129 (changesets).
    Scope: the card's "Done when" minus the ADR text (own card). Fixes #35498 only if the ADR card is filed; else Refs.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7177913156 (area o5-D) · 2026-11-25T23:44Z
    Branch: claude/project-thread-yzpuwp (mode:thread: the platform-assigned branch of the card thread; replaces the claim's pending line)
    Thread session: session_01Utp6CXM7nqtiQ3M9JqGAqL
    Worktree: the card thread's own checkout

  8. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7177913156 (area o5-D) · 2026-11-25T23:47Z
    Route: a sys_* object, not a settings key — the same-concept precedent is sys_unit.decimal_places (packages/platform-objects/src/**/sys-unit.object.ts: 0..12, field history, member_default read, organization_admin write); localization.currency (ADR-0144 D4) is an org-wide scalar read through a projection, so it does not fit a per-code value. Readings: the thread's A1–A4 at 98bda0a.
    Shape: sys_standard_unit_setting (code select over STANDARD_UNITS, unique per org, immutable; decimal_places 0..12 optional, trackHistory; clear = null; no delete). Grants: organization_admin create/edit, member_default read; external members no read (as sys_unit).
    Reader: not in this PR. Zero callers today; #35490 adds the reader with its first caller, and the L4 clamp lives there. This card's "a member can read them" is met by the object's read grant over the data API.
    File surface (adds to the claim's line): packages/spec/src/system/constants/platform-object-names.ts, packages/spec/scripts/lib/platform-catalog.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/cli/src/utils/organization-ownership-inventory.ts, packages/platform-objects/src/apps/setup-nav.contributions.ts, generated translations via their generators only. ⛔ packages/objectql/** dropped from this card.

  9. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7178077326 (area o5-D) · 2026-11-25T23:51Z
    Shape correction: clear = the organization admin deletes the row (organization_admin create/edit/delete; member_default read only); decimal_places is required, so a row exists only while an override is set. Reason (thread reading): a non-deletable organization-owned row would block organization delete (plugin-auth refuses while any organization-owned row remains, auth-manager-before-hook.ts ~492 DELETE_RESTRICTED); only sys_unit is exempt through the objectql cascade, which is off this card's surface. Posture follows sys_exchange_rate; create/edit/delete audited through plugin-audit's sys_audit_log, asserted by the card's tests. Supersedes "clear = null; no delete" in 7178077326.

  10. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
      "issue": 35498,
      "status": "done",
      "branch": "claude/project-thread-yzpuwp",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37389",
      "head": "03e453e3d3",
      "session": "session_01Utp6CXM7nqtiQ3M9JqGAqL (card thread; seat signature session_01Utp6CbdHk3orAeensH6EzS)",
      "premise_still_valid": true,
      "summary": "New organization-owned object sys_standard_unit_setting (platform-objects): code (exact-uppercase standard U1 code by format rule, unique per organization, immutable) and decimal_places (0..12, required). member_default reads; organization_admin creates, edits and deletes (clear = delete). Registered beside sys_unit, Setup nav entry, platform-object-names, cli ownership inventory, regenerated bundles and census. Precedent: sys_unit.decimal_places (A1, area go 7178077326; clear-by-delete per 7178144166). No reader (the #35490 display card adds it with the L4 clamp). Diff: 48 files, +1255 -13 (most of it generated translation bundles).",
      "readings": {
        "A1": "localization.currency is one tenant-scope sys_setting scalar (service-settings/src/manifests/localization.manifest.ts:116, readPermission setup.access at :40); members read it only through GET /auth/me/localization (plugin-hono-server/src/current-user-endpoints.ts); its audit stores old_hash/new_hash only (settings-service.ts:3287). The same-concept precedent is sys_unit.decimal_places (platform-objects/src/system/sys-unit.object.ts:178; 0..UNIT_DECIMAL_PLACES_MAX=12 at :27; field history), with member_default read (default-permission-sets.ts:938) and organization_admin write (:471). Chosen: a sys_* object.",
        "A2": "Write: organization_admin explicit line create/edit/delete, no superuser bits. Read: member_default read only. External members: no line (external_default), same as sys_unit.",
        "A3": "No reader ships (area 7178077326). The data API under member_default is the member read face. #35490 adds the reader with its first caller: standard code -> this object's row, org code -> sys_unit.decimal_places, else none.",
        "A4": "0..12 whole number, refused at write of the SETTING (min/max/scale 0 pinned on a real stack); never applied at record write; the display clamp to field scale belongs to the #35490 reader (L4)."
      },
      "tests": "On head 03e453e3, under the verify lock. plugin-security default-permission-sets.standard-unit-setting.integration.test.ts: 12/12. It covers set/change/clear by an admin and by an owner, each with sys_audit_log create/update/delete rows (old_value/new_value); member read; member writes 403 PERMISSION_DENIED; cross-organization isolation for read, update and delete under the isolated tenancy posture; non-standard or lowercase code and out-of-range or fractional decimals 400 VALIDATION_FAILED; duplicate 409 UNIQUE_VIOLATION; code change 400; organization delete 409 DELETE_RESTRICTED (dependentObject = this object) and success after the row is deleted. platform-objects full suite: 127 files / 2176 tests. cli unit: 2 files / 28 tests. spec platform-object-names: 14/14. Typecheck of platform-objects, plugin-security, cli and spec: exit 0. Ablation: member_default allowRead false turned 2 tests red (member read, cross-org read); restored, with blob == HEAD and git diff HEAD empty.",
      "gates": "212 derived commands (106 families), each exit captured before any pipe. 211 exit 0. Five first exited 3 on prerequisites (shallow clone; missing dist) and exited 0 after unshallow and a full build. pnpm check:platform-checklist exits 1 on a base-tree finding outside the diff: areas/automation.json cites FlowItemMoreMenu.tsx#FlowItemMoreMenu, a symbol the ui file no longer declares; same on origin/main. --ran: 106 derived, 106 run, 0 NOT-MEASURED (derived zero). overlap-check: VERDICT clean exit 0 against origin/main 02520ab480, #37371 and #37366. PR check-runs: pending at report time.",
      "dogfood_battery": "n/a — no ! in the PR title and Clause-② is a widening",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + its assignees leg), this os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/35498/comments)",
      "adr_0158_amendment_draft": "project file objectstack-seat5/area-ux/o5-D/card-35498-adr-0158-amendment-draft.md: add-only notes under U3, U6 and L4, and the Open item 10 answer (home, object, clearing, grants, audit, reader).",
      "deviations": [
        "Clear = delete instead of set-to-null with no delete: plugin-auth's organization delete refuses DELETE_RESTRICTED while any organization-owned row remains, and only sys_unit is exempt (objectql cascade, off-surface). Area amendment 7178144166.",
        "code is text plus a format rule, not a select: Field.select lowercases option values (spec field.zod.ts:4233), and a unit code is stored in exact uppercase (U4).",
        "One file beyond the confirmed surface: packages/cli/test/connect-agent-both-halves-wire.pin.test.ts (Setup nav count 36 to 37), the same pin #35581 amended for nav_units_of_measure.",
        "Clause-② written as 'yes (widening)'; the claim's parenthetical is prose, not an arm of the closed pair.",
        "Refs #35498, not Fixes: the ADR amendment card is not filed yet.",
        "Commit trailer is the model-free pair the repo hook requires (check:commit-card-trailers)."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: b · reach: pnpm check:platform-checklist on origin/main exits 1 · docs/qa/platform-checklist/areas/automation.json anchors ui/packages/app-shell/src/views/studio-design/FlowItemMoreMenu.tsx#FlowItemMoreMenu, a symbol the file no longer declares · dedupe words: FlowItemMoreMenu, platform-checklist ABSENT SYMBOL, automation.json anchor"
      ]
    }

    Generated by Claude Code

  11. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Claim amendment to comment 7177913156 (area o5-D) · 2026-11-26T01:11Z
    File surface (adds): packages/cli/test/connect-agent-both-halves-wire.pin.test.ts — the Setup nav count pin (36 → 37) a new Setup entry moves, as PR #35581 amended it.
    Deviation accepted: code is a text field with an exact-uppercase format rule over U1's codes, not a select (Field.select lowercases option values; unit codes are exact uppercase).
    ADR answer: carried as a row on the weekly ADR revisions card #37245 (lands after PR #37389 merges), so PR #37389 closes this card with Fixes #35498.

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

Metadata

Metadata

Assignees

Labels

area:datadomain:serverpm:dispatchedpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions