Skip to content

A summary over a stored home-currency amount is drawn as a bare number, and no summary currencyConfig can say "the home currency" without naming it #33659

Closed

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAjTvcDNgUCBhULRSRe

What happens (@objectstack 18.4.0, HotCRM PSA phase-0 probe, hotcrm#2316, 2026-11-15)

ADR-0144 D6 says consolidated totals read the stored home field, "an ordinary stored currency field", so summary roll-ups total it without any change to the reader. The total is right. Its display is not.

Probe metadata (scratch branch, never merged):

  • crm_probe_expense.amount: currencyMode: 'record', own code field currency_code, homeAmount: { field: 'amount_home', rateDate: 'expense_date', rateField: 'rate_used' }.
  • crm_probe_project.home_expense_total: Field.summary over crm_probe_expense.amount_home, function: 'sum', through the master-detail. No currencyConfig.

Home currency USD, rates EUR 0.9 and CNY 7.2. Three expenses: EUR 90, CNY 720, USD 50.

Why: objectui SummaryField formats money only when summaryDeclaresCurrency(field). For a roll-up of a home field, no declaration is both admitted and honest:

  • record is admitted only for the follow-the-parent roll-up (ADR-0144 D6 as amended).
  • dynamic on a summary is refused (refuseUnadmittedSummaryCurrency).
  • fixed needs a defaultCurrency. That names the home currency in metadata, which the ADR's TL;DR rules out ("Metadata never names the home currency"), and it would be wrong in an organization whose home currency differs.

A dashboard metric over the same home field resolves to the tenant default and shows the symbol (ObjectMetricWidget → resolveFieldCurrency(valueFieldDef, tenantCurrency)). So the same figure is money on a tile and a bare number on the record.

Who reaches it

Every app that rolls a home amount up to a parent, which is the consolidation path D6 prescribes. HotCRM's PSA module (hotcrm#2316 phase 1) rolls expenses and timesheet cost in mixed currencies up to crm_project.actual_cost. Order to Cash will need the same once invoices carry a currency. Screenshots: hotcrm project files issue-2316/probes/probe-project-record.png and probe-expense-record.png.

Ask

A roll-up over a stored home amount (a field some homeAmount.field names) is drawn in the organization's home currency on the record page, list cell and footer, with no currency named in metadata. Whether that is derived from the child field or spelled by a new declaration is the platform's call.

Acceptance

  1. With the probe shape above, the project's home_expense_total draws $250.00 when the home currency is USD, and ¥… after the same rows are written in an organization whose home currency is CNY.
  2. A roll-up over a plain currency field that is not a home field is unchanged.
  3. A test pins the summary face and the metric tile to the same currency for the same home field.

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:spec (lead) · p2 · 2026-11-15T05:47Z

    ⛔ Not a claim.

    A summary over a stored home-currency amount is drawn as a bare number, and no summary currencyConfig can say "the home currency" without naming it (ADR-0144 D6). On its own that is display (p3). HotCRM's PSA probe needs it, so it is raised once to p2. It needs a spec key (or a default that follows the source field), plus the renderer half.

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

    @objectstack-fleet
    ContributorAuthor

    domain:spec#4 · os-project-manager · session_01FEkQ5mecqk8M5q9vjKj6aS

    Claim: PM loop round 5
    Session: session_01FEkQ5mecqk8M5q9vjKj6aS (seat); card thread session_01FEkQ5mF5zkznDPYTZjWWqa
    Account: os-project-manager
    Branch: claude/project-thread-5zm2ol
    Worktree: the card thread's own checkout
    Domain: domain:spec
    Seat: domain:spec#4
    File surface: packages/spec/src/data/object.zod.ts (refuseUnadmittedSummaryCurrency), packages/spec/src/stack.zod.ts (collectRecordCurrencyPathErrors), packages/spec/src/data/field.zod.ts (describe text), their tests, packages/spec/liveness/field.json (the field/currencyConfig note), regenerated spec artefacts, ui/packages/fields/src/** (currency resolution and roll-up faces), packages/services/service-analytics/src/** only if the coherence check needs it, docs pages that state the summary currency rule, root .changeset/ (stop on breach; explain in the report). ⛔ docs/adr/**, ⛔ skills/**.
    Container & model: M, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate; review at CONTRACT_REVIEW_TIER by the seat: published accept set widens), effort: high
    Clause-②: yes (widening: a sum/min/max/avg summary over a stored home amount is admitted with currencyMode: 'dynamic')
    Metadata-protocol: added
    Responsibility: objectstack spec refuses every dynamic summary and objectui draws an undeclared roll-up as a bare number, so a roll-up of a home amount (ADR-0144 D6's consolidation path) shows no currency on the record, list and footer while the metric tile shows it | no platform path covers it today; fixed would name the home currency, which ADR-0144 rules out | every app rolling a home amount up to a parent (HotCRM PSA, hotcrm#2316)
    Thread-read: 6889945413
    Premise: holds
    Serial constraints cleared: open PR #33621 (#33593) edits packages/objectql/src/record-currency-aggregate-door.ts and registry.ts, outside this surface; the dev re-reads open PRs on the surface before its first edit and stops on a same-region overlap. spec#1's in-flight #33642 and #33494 do not name these regions (asked of seat 1 at 05:51Z).

    Route (lane decision, recorded in the order): an explicit dynamic declaration on the summary, admitted only over a home field and judged where the child object is known; no silent derivation and no fixed home code. The PR goes to the maintainer to merge (published accept set widens). Ruling-ref: 「后续只处理 p1 p2」 (Leehom, 2026-11-15T05:05Z).

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

    @objectstack-fleet
    ContributorAuthor

    domain:spec#4 · os-project-manager · session_01FEkQ5mF5zkznDPYTZjWWqa
    os-dev-report
    {
    "issue": 33659,
    "status": "done",
    "branch": "claude/project-thread-5zm2ol",
    "pr": "#33710",
    "session": "session_01FEkQ5mF5zkznDPYTZjWWqa",
    "premise_still_valid": true,
    "summary": "Route A as ordered. Spec: the object door (refuseUnadmittedSummaryCurrency) lets a dynamic summary through only when summaryOperations names a child object and field and no defaultCurrency is set; defineStack's collectRecordCurrencyPathErrors gains case (d), which admits a sum/min/max/avg dynamic roll-up only when some homeAmount.field on the child object names the summarized field, and refuses any other dynamic roll-up naming what the child field supports. count and the other refusals keep refusing exactly the same set; the shared 'admitted' sentence now names the third case. Renderer: summaryDeclaresCurrency (ui/packages/fields/src/currency.ts) answers true for dynamic (and a config with no currencyMode), so SummaryField and FormulaCellRenderer draw the total through resolveFieldCurrency in the tenant currency, the call ObjectMetricWidget makes for the home field. service-analytics and the objectql roll-up admission measured: no change needed. Footer left to #33542 at the seat's word. Liveness WIDENED line, currency guide, field-types gallery, regenerated reference pages, changeset (spec minor, @object-ui/fields patch).",
    "tests": "Head 7abcd20. New packages/spec/src/data/currency-summary-home-rollup.test.ts (11 cases, probe shape admitted; non-home, record-amount, no-home-child, fixed-child dynamic refused by defineStack; object refuses dynamic with no child field and with defaultCurrency; count still refused) and ui/packages/fields/src/tests/summaryFaces.homeRollup-33659.test.tsx (9 cases: $250.00 under USD, CN¥1,800.00 under CNY on cell and record page; {} reads as dynamic; no tenant currency gives 250.00; undeclared stays 250; record page, cell and metric-tile call give one text under USD/CNY/EUR/JPY). Two cases of currency-config-record-mode.test.ts repointed to the narrower refusal. spec test: 842/842 files, 26891 passed | 1 todo; spec typecheck exit 0; fields type-check exit 0, fields vitest 306 passed | 1 skipped files, 4624 passed | 7 skipped. Ablations via scripts/ablation-replace.mjs on committed head (suites import source, no build in between): (1) object-door admission deleted, blob 42c0b107 -> b7aedbd9: 8 failed | 3 passed; (2) stack (d) refusal no-op, 70e8c845 -> ff1e8126: 5 failed | 67 passed; (3) renderer dynamic branch removed, 0748515c mutated: 8 failed | 1 passed. Each restored to the HEAD blob, git diff HEAD empty.",
    "gates": "dispatch-gates --commands derived 118 families; first pass 115 exit 0, 3 exit 3 (prerequisites: teardown pinned commit, missing dist) all exit 0 after fetch + turbo build. --ran then named check:generated: first exit 1 was check:test-typecheck tsc V8 OOM, rerun with --max-old-space-size=8192 exit 0 (52 files / 240 errors / 131 signatures held). dispatch-gates --ran: 119 derived families accounted for, 119 run, 0 NOT-MEASURED. Local Check Changeset simulation on the PR body: exit 0 (yes (widening) + added). CI check-runs: in_progress at report time (PR just opened). Log: /mnt/project-files/pm-orders/spec/33659-gates-ran.txt.",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "8 — GitHub MCP reads only: issue_read x3 (card body, comments x2), list_pull_requests x1, pull_request_read get_files x4 (#33641, #33642, #33357, #33671); no MCP writes",
    "api_writes": "2 — relay pr_create (#33710, via dispatch.mjs) and this os-dev-report comment (post-stamped); plus git push of claude/project-thread-5zm2ol (not a REST write)",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "class: b · reach: a single-object save through the metadata API (ObjectSchema parse) admits a dynamic summary over a non-home child field, which the Console then draws in the home currency; only defineStack (os validate) judges home-ness, and the objectql registry has no dynamic arm (it judges record pairs only) · evidence: packages/objectql/src/record-currency-aggregate-door.ts summaryDeclaresRecord; packages/spec/src/stack.zod.ts case (d) · dedupe: dynamic summary single-object save home amount, registry summary currency dynamic · carrier: none (domain:server; seat to decide whether to file)",
    "carrier: #33542 (ui seat 2) — grid footer draws a dynamic summary through summaryDeclaresCurrency once both land; check after both merge",
    "carrier: spec seat 4 — Skills-docs follow-up owed on skills/objectstack-data/rules/field-types.md"
    ]
    }


    Generated by Claude Code

  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#4 · os-project-manager · session_01FEkQ5mecqk8M5q9vjKj6aS

    Landed · #33659 · PR #33710 · 2026-11-15T08:57Z

    Reading Value
    Merge commit f64c0f90b370035c4da1a3bd7fbd55bd96ec03dd (PR #33710 MERGED)
    Content on origin/main dynamicRollupNotHomeError and case (d) in packages/spec/src/stack.zod.ts; summaryDeclaresCurrency in ui/packages/fields/src/currency.ts answers the dynamic home roll-up

    State: card closed completed by Fixes; pm:dispatched removed in this stroke. Follow-ups unblocked now: #33713 (engine door for a single-object save, suggested domain:server) and #33714 (skills field-types.md). The grid footer rides #33542 (ui seat 2); the after-both-merge check is written there. Nothing else remains on this card.

  7. removed
    pm:dispatched
    on Nov 15, 2026
  8. added 2 commits that reference this issue on Nov 16, 2026
    f64c0f9
    63e47fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

domain:specpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions