Repository navigation
fix(service-analytics): a consolidated measure over the home field works unchanged (proof), and the record-currency refusal names the home field (multi-currency M3-1) - #30176
Conversation
… remedy Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r
…field, on the preview, SQLite and Postgres Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r
…cord-currency refusal Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 53e861a2fe4d1b217a45e471d089c9ede1c7f55a && git checkout 53e861a2fe4d1b217a45e471d089c9ede1c7f55a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 59e64635f4a6bf03ecbe17afb63b8af5908eb2f9 d4e33ba109630f0fff336b35892cf7af71e108ed && git checkout -B drift-repro 59e64635f4a6bf03ecbe17afb63b8af5908eb2f9 && git merge --no-ff d4e33ba109630f0fff336b35892cf7af71e108ed
node scripts/docs-audit/affected-docs.mjs --json 59e64635f4a6bf03ecbe17afb63b8af5908eb2f9
|
|
epic:#8345#1 · os-bill · session_01Utp6CZWjnSeed8H4dMjt9d Served-tier: TIER_DEFAULT (the seat's own review of record for the Seat review · PR #30176 @ e430075 · TIER_DEFAULT Head-sha: e430075 (PR head.sha read via gh api; matches the reviewed tree) The verdict is FAIL on one mechanical must-fix. Everything else checks out. Must-fix
Should-fix (non-blocking)
Seat actions (not dev must-fix)
Checks against the brief
Checks run (fresh worktree at e430075; install with npm_config_nodedir=/opt/node22)
Local-runs: probe — the proof file ×3 ablations, package suite, typecheck and eslint, all on a throwaway worktree. |
… and host-neutral words for the unnamed home field Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r
|
epic:#8345#1 · os-bill · session_01Utp6CZWjnSeed8H4dMjt9d Served-tier: TIER_DEFAULT · delta e430075..d4e33ba · PASS. The claim's Seat review (delta) · PR #30176 · e430075..d4e33ba · TIER_DEFAULT Head-sha: d4e33ba (equals PR head.sha via gh api at review time) Prior items
New itemsShould-fix (nit, non-blocking):
No must-fix. Checks run (fresh worktree at d4e33ba, npm_config_nodedir=/opt/node22, local PostgreSQL 16)
CI at d4e33ba (gh api, read only): Check Changeset success. Most jobs were still in_progress when read, including Seat actions carried over (not dev items)
Local-runs: probe — proof file with and without PG plus 2 ablations, typecheck and eslint, on a throwaway worktree |
|
epic:#8345#1 · os-bill · session_01Utp6CZWjnSeed8H4dMjt9d Seat ACCEPT · PR #30176 · Head-sha: 维护者速读
席位意见:证明与文案都做到了卡上要求,放宽是纯增量,可落地。 席位核对
|
Requested by Bill · project thread
epic:#8345#1 · os-bill · session_01Utp6CZWjnSeed8H4dMjt9d
Fixes #27195
Ruling-ref: 6465431966
Clause-②: yes (widening) —
AnalyticsServiceConfig.sourceFieldMeta(an exported config type) may answer one more optional key,homeAmountField, whichAnalyticsServicePluginrelays; nothing an author writes changesMetadata-protocol: none
维护者速读
sum影子列在内存预览、SQLite、Postgres 上都直接得出本位币合计,代码路径零改动;未分组汇总原始金额的拒绝文案现在同时给出两个药方:指向影子列(宿主透传时点名),或按币种码分组。sourceFieldMeta多一个可选键(Clause-② widening),宿主不答时文案不点名字段。回滚即撤 PR。packages/services/service-analytics/src/cube-record-currency-door.ts的文案,再看home-amount-consolidated-measure.test.ts。OS_TEST_POSTGRES_URL=… npx vitest run src/__tests__/home-amount-consolidated-measure.test.ts(36 条);在 main 上跑同一文件,证明部分全绿、文案断言红。What changes
The proof (no product code).
src/__tests__/home-amount-consolidated-measure.test.tswrites four invoices in three record currencies (USD, EUR and the home CNY) through the engine, whose write-time projection (ADR-0144 D5,home-amount-projection.ts) stores each amount converted into the home currency in the declaredhomeAmount.field. A dataset measuresumover that home field answers the home-currency total throughqueryDataset(dataset compile + query), on:NativeSQLStrategy;ObjectQLStrategy, narrowed to the engine aggregate);driver-memory.Pinned per cell: the projection fixture (home amounts and rates as stored); the ungrouped KPI (2010 CNY); per-currency subtotals grouped by the code field and a
totalsgrand total equal to the KPI; the column labelled with the home currency and no per-rowcurrencyField(the home field isdynamic); the inferred cube'samount_home_sum; a relationship path (a line cube joined to the invoice:invoice.amountrefused naminginvoice.amount_homeandinvoice.currency_code,invoice.amount_homeserved on the native strategy);INVALID_FIELDand status 400 on every refusal path (dataset, inferred cube, joined cube, draft preview). Control: the raw amount grouped by code is served per currency and adds to a different number (270). Onmainthe proof assertions already pass, so the consolidated path is the unchanged code path.The door message (text only).
assertRecordCurrencyAggregatesGrouped(#27187, PR #27338) refused an ungroupedsum/avg/min/maxover a record-mode amount with one prescription: group by the code field. It now names both:homeAmount.field) when the host relays it, or else as "the field itscurrencyConfig.homeAmount.fieldnames", with the declaration to add if it has none (true whether or not the object declares one);Code
INVALID_FIELD, status 400,member/param/cube/field/objectare unchanged; no new refusal code. The home field reaches the door throughsourceFieldMeta, which now answershomeAmountFieldbesidecurrencyField(record mode only), relayed byAnalyticsServicePluginfromcurrencyConfig.homeAmount.field.Not in this diff. The engine's own
aggregate()door (packages/objectql/src/record-currency-aggregate-door.ts) already names a stored home-currency amount field generically; it is outside this card's file surface. ⛔ Noui/**/plugin-dashboardchange (ui lane off). #27193 untouched.Why
ADR-0144 D6: a consolidated total aggregates the stored home field. The proof shows that needs nothing new; the message makes the refusal prescribe it.
Verification
home-amount-consolidated-measure.test.ts: 36/36 at the current head (30/30 ate430075a) withOS_TEST_POSTGRES_URLset (PostgreSQL 16, local). Ablation ate430075a: the same file onmain's three source files: 14 failed, every one a message assertion; every proof assertion passed.pnpm --filter @objectstack/service-analytics typecheck: exit 0.eslinton the changed files: exit 0.OS_TEST_POSTGRES_URL(ate430075a): 5267 passed, 1 failed:read-scope-temporal-coercion.test.ts"the server is not on UTC (the premise of the PostgreSQL cells)", a premise check on the local server's zone (local PostgreSQL runs onEtc/UTC; CI provisions a skewed zone). Not touched by this diff.dispatch-gates --commands(ate430075a): 62 commands, exit codes captured before any pipe: 61 exit 0;pnpm check:dual-build-cjs-loadsexit 3, NOT MEASURED (it reads every package'sdist/, and this worktree built only this package's closure), left to CI.check-plugin-teardown-shape --self-testfirst exited 3 on the shallow clone and passed (exit 0) after fetching its pinned fixture commit.One changeset,
@objectstack/service-analyticspatch.Human Minimum
packages/specholds no runtime logic. (spec not touched)pnpm lintleft to CI).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CbmDUh2Sx7fvaGgu7r