Skip to content

metadata save: a dynamic roll-up over a child field that is not a stored home amount is admitted by a single-object save on a running server (stack door refuses it) #33713

Closed

Description

@objectstack-fleet

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

Filing gate: ① (should-fix S1 of the contract review of PR #33710 / card #33659, record 6890873219 section ③; the dev's report 6890800748 flagged it with carrier: none).

Blocked-by: #33710

What is wrong (once #33710 lands). #33659 admits currencyConfig: { currencyMode: 'dynamic' } on a sum / min / max / avg summary that rolls up a stored home amount (a child field some currencyConfig.homeAmount.field on the child object names). Whether the child field is a home field needs the child object, so the spec judges it in defineStack's cross-reference pass (collectRecordCurrencyPathErrors, case (d)); the object door (refuseUnadmittedSummaryCurrency) lets any dynamic summary with a named child field through. A single-object save or publish through the metadata API on a running server parses ObjectSchema and then asks packages/objectql/src/record-currency-aggregate-door.ts#recordCurrencyFollowRefusal, which judges only record roll-ups and record-mode child amounts. So a dynamic summary over a fixed EUR amount, a plain number or a formula is stored there, and the record page and list cell draw its total with the home currency's symbol. Before #33710 that door refused every dynamic summary.

Fix shape. A dynamic arm in recordCurrencyFollowRefusal beside its record case, refusing a dynamic summary whose child field is not a stored home amount on the child as served, with the same wording as the spec's case (d) (shared the way the record case shares record-currency-path.ts). Fold in two neighbours the review graded as nits:

  • N6: a summary on a parent, or over a child, that the stack knows only through an object_extension is judged by neither door; dynamic now has a reader there.
  • N7: homeAmountSourceOf takes any field's homeAmount.field at its word, which the object door guarantees only for authored objects.
  • N1 (prose, with this fix): the FieldSchema.currencyConfig .describe() in packages/spec/src/data/field.zod.ts says "any other dynamic summary ... are refused" without naming a door; once the engine refuses it, that sentence is true at every door.

Reach. A hand-written metadata body on a running server (the Studio field form offers currencyConfig only on currency fields and currency formulas, so it is not reached by a click). Display only: the stored total is right, its symbol can be wrong.

Dedupe. repo:objectstack-ai/objectstack is:issue is:open recordCurrencyFollowRefusal dynamic summary: no open card.

Suggested lane: domain:server (objectql door), spec-lane wording shared. Suggested-grade: p2 (a refusal #33710 loosens at a door users reach; parent #33659 is p2). Triage routes and may re-grade.

Activity

  1. added
    finding
    pm:blocked
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:spec · p2 (pm:blocked kept) · 2026-11-15T07:45Z

    ⛔ Not a claim.

    A single-object save on a running server admits a dynamic roll-up over a child field that is not a stored home amount, while the stack door refuses it. Two doors disagree, so p2. It stays blocked on PR #33710 as filed.

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

    @objectstack-fleet
    ContributorAuthor

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

    Unblocked · 2026-11-15T08:58Z

    Blocked-by: #33710 is cleared: PR #33710 merged as f64c0f90, so the dynamic home roll-up this card follows up is on main. pm:blocked → pm:queue under the lane and grade triage set. ⛔ Not a claim.

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

    @objectstack-fleet
    ContributorAuthor

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

    Serial hold · 2026-11-15T09:01Z

    Blocked-by: #33621

    ⛔ Not a claim. Read before any seat picks this card: open draft PR #33621 (card #33593, domain:server, lease E2b) rewrites packages/objectql/src/record-currency-aggregate-door.ts#recordCurrencyFollowRefusal (+79/−42), the very function this card adds a dynamic arm to, and it judges an extension's record-mode amount against its object as served, which is this card's N6 neighbour. A second PR in the same function now would collide in one region. pm:queue → pm:blocked until #33621 merges or is closed; then this card returns to pm:queue (P2) and the dev reads #33621's landed shape first, so the dynamic arm and N6 follow it.

  7. added
    pm:blocked
    and removed
    pm:queue
    on Nov 15, 2026
  8. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: unblocked · pm:blocked → pm:queue · 2026-11-15T09:50Z

    ⛔ Not a claim.

    Its Blocked-by: #33710 (PR) has merged, so the single-object save door fix can start. p2, spec.

  9. added
    pm:queue
    and removed
    pm:blocked
    on Nov 15, 2026
  10. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 7
    Session: session_01FEkQ5mecqk8M5q9vjKj6aS (seat); card thread session_01FEkQ5nU2dZbC2HWMg47r4D
    Account: os-project-manager
    Branch: claude/project-thread-7j5opi
    Worktree: the card thread's own checkout
    Domain: domain:spec
    Seat: domain:spec#4
    File surface: packages/objectql/src/record-currency-aggregate-door.ts and its tests, packages/objectql/src/registry.ts (only the N6 call site, if #33621's registration-run hook needs one), packages/spec/src/stack.zod.ts (homeAmountSourceOf, case (d) wording) and its tests, packages/spec/src/data/record-currency-path.ts or a sibling packages/spec/src/data/*currency*.ts (the shared spelling), packages/spec/src/data/field.zod.ts (describe text only), packages/spec/liveness/field.json (a dated line on the field/currencyConfig note), regenerated spec artefacts, packages/spec/src/migrations/entries/** only if a published release carried #33710's widening, root .changeset/ (stop on breach; explain in the report). ⛔ docs/adr/**, ⛔ skills/**, ⛔ ui/**.
    Container & model: M, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate; review at CONTRACT_REVIEW_TIER by the seat: a metadata door's accept set narrows), effort: default
    Clause-②: no (narrowing: the single-object save door refuses the dynamic roll-ups defineStack already refuses)
    Metadata-protocol: narrowed
    Responsibility: objectstack's engine door (recordCurrencyFollowRefusal) judges only record roll-ups, so since #33710 a metadata-API save stores a dynamic summary over a fixed amount, a plain number or a formula that the stack door refuses, and the record page and list draw its total with the home currency's symbol | no platform path covers it; the two doors disagree | any author or AI saving a hand-written object body on a running server
    Thread-read: 6892583884
    Premise: holds (the dev re-reads at current origin/main before the first edit)
    Serial constraints cleared: the serial hold 6892043044 is cleared, since PR #33621 (#33593) merged as 06e53a7a at 10:23Z. At 10:52Z none of the 43 open PRs edited the surface. Spec seat 1's in-flight work (PR #33725, #33733, #33757) touches none of these files (asked at 10:52Z, answered at 10:53Z). The dev re-reads open PRs on the surface before its first edit and stops on a same-region overlap.

    Route (seat's lane decision, recorded in the order; it is the filing's fix shape):

    Ruling-ref: 「后续只处理 p1 p2」 (Leehom, 2026-11-15T05:05Z).

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

    @objectstack-fleet
    ContributorAuthor

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

    Claim amendment to 6893268160 (same session, same branch claude/project-thread-7j5opi): one docs page, two passages.

    File surface (added): content/docs/data-modeling/currency.mdx, only the two passages #33710 added that this fix makes false:

    Both are rewritten to say that the metadata API on a running server refuses it with defineStack's words, mirroring the record bullet above it. Nothing else on the page changes. The currency-mode-family-closure pin reads this page, so the dev keeps its terms.

    Recorded from the dev's measurement:

  13. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

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

    os-dev-report
    {
    "issue": 33713,
    "status": "done",
    "branch": "claude/project-thread-7j5opi",
    "pr": "#33855",
    "session": "session_01FEkQ5nU2dZbC2HWMg47r4D",
    "premise_still_valid": true,
    "summary": "S1: recordCurrencyFollowRefusal gains case (d). A sum/min/max/avg summary declaring dynamic (or a mode-less currencyConfig) over a child field that is not a stored home amount on the child as served is refused at both ends with RecordCurrencyFollowRefusedError (INVALID_METADATA / 422, the record refusal's code and status). The message is recordCurrencyDynamicRollupNotHomeError, moved from stack.zod.ts into data/record-currency-path.ts, and both doors print it. N7: storedHomeAmountSourceOf, at both doors, counts a homeAmount only where it is valid as declared (a record-mode currency amount naming another dynamic, readonly, expression-free currency field claimed by it alone). N6 needed no registry.ts change, because #33621's served fold already hands extension layers and served children to the door. N1: the describe and the two stale currency.mdx passages were rewritten under surface amendment 6893463231. Migration: the next snapshot 0.0.0-next-20261115100430 carries #33710 (18.4.0 does not), so one semantic entry was registered. Branch is 19 commits behind origin/main, none touching the diff's files.",
    "tests": "head c6d372d: spec test 842 files / 26948 tests passed; objectql test 596 files / 13151 passed; spec + objectql typecheck exit 0. New pins: protocol-batch-object-registration.test.ts [#33713] (5), record-currency-guards.test.ts case (d) describe (10), currency-summary-home-rollup.test.ts N7 + wording describes (6). Ablation 1 (declaresDynamicCurrency forced false, src read directly): 9 red (2 metadata-API, 7 registry), controls green, restored blob == HEAD a193269e. Ablation 2 (storedHomeAmountSourceOf back to any-homeAmount): spec rebuilt, dist-preflight marker in 2 files; 3 spec + 2 objectql red; restored blob == HEAD 45ae471e, rebuilt, preflight --absent clean.",
    "gates": "dispatch-gates --commands: 121; all run with exit captured before any pipe; 119 green first pass, check:dual-build-cjs-loads and check:published-readme-exports exit 3 (prerequisite: 6 unbuilt packages outside the diff), both exit 0 after building them; --ran: 121 run, 0 NOT-MEASURED. check:generated exit 0. Log: pm-orders/spec/33713-gates-ran.txt. CI check-runs: in_progress at report time.",
    "dogfood_battery": "c6d372dc · os-verify-lock: VERDICT command-exit 0 · Test Files 467 passed, 3 skipped (470) · Tests 3958 passed, 42 skipped (4000) · no failures",
    "mcp_calls": "0 — no GitHub MCP calls; reads through anonymous public REST",
    "api_writes": "2 — fleet-write pr_create (#33855, relay run 43713550709), os-dev-report comment on #33713 via post-stamped; plus git pushes (not REST)",
    "open_questions": [
    {
    "question": "Is a 0.0.0-next snapshot a published release for the order's migration-entry measurement?",
    "options": [
    "A keep the registered semantic entry (the snapshot is a published @objectstack/spec version carrying #33710; check:adr-0087-registration refuses not-required(no-migration-prescription) on a narrowed changeset anyway)",
    "B drop the entry, reading ADR-0087's stable-x.y.z rule; then the changeset needs another disposition the gate accepts"
    ],
    "recommendation": "A, because the ruling's literal test is 'any @objectstack/spec version with it published', and the gate leaves no other disposition for Metadata-protocol: narrowed"
    }
    ],
    "security_findings": "none",
    "out_of_scope_findings": [
    "class: none (prose) · packages/objectql/src/registry.ts docblock above the single-save follow question names only the following amount and the record roll-up, not (d) · carrier: none — noted in the PR's Acceptance notes, not filed",
    "class: none (observation) · a single save judges against an empty slot (before: null), so a bad dynamic roll-up already stored before this release blocks an unchanged /meta re-save of its child (same as (a)/(c) today); runs apply R7 · carrier: none — noted in Acceptance notes"
    ]
    }

  14. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

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

    ACCEPT · PR #33855 (#33713) · head c6d372dcbee640d17b49375e50ea8951ea54c678 · 2026-11-15T13:12Z

    席位核对

    • 形态: 16 files, +699/−86, read from the PR's file list.
      • A dynamic arm in recordCurrencyFollowRefusal: a sum/min/max/avg summary declaring dynamic over a child field that is not a stored home amount on the child as served is refused, 422 INVALID_METADATA, with defineStack case (d)'s sentence. That sentence now has one spelling in record-currency-path.ts, used by both doors.
      • N6: extension layers reach the arm through feat(objectql)!: judge an extension's record-mode amount against its object as served, refusing a bad follow pair at the run that completes it #33621's served fold, and registry.ts is untouched.
      • N7: storedHomeAmountSourceOf accepts only a homeAmount that is valid where declared.
      • N1: the describe prose.
      • Also in the diff: two currency.mdx passages (amendment 6893463231), a dated liveness line, regenerated api-surface / export-origins, one ADR-0087 semantic entry, and a changeset with Clause-②: no (narrowing), Metadata-protocol: narrowed, minor on @objectstack/spec and @objectstack/objectql.
      • Not governed (check-governed-merges --pr 33855: 0 of 16 paths): Tier S.
    • 前提实测: the dev report 6894270946 measures that the next snapshot 0.0.0-next-20261115100430 carries feat(spec, fields): a roll-up of a stored home amount declares currencyMode dynamic and is drawn in the home currency #33710's widening and 18.4.0 does not, so the semantic entry is owed. Ablations: the dynamic arm off gives 9 red, the N7 check off gives 5 red, both restored. Locally, spec 26948 and objectql 13151 green, 121/121 gates, dogfood VERDICT exit 0.
    • 门禁 check-runs: on this head (latest attempt) 68 runs: 58 success, 10 skipped, 0 failed. mergeable_state: clean.
      • Attempt 1 had Test Core (4/8) red on one timeout in protocol-unmanaged-import-rename-battery.test.ts:430 (5000 ms; 13150/13151 passed), a file outside the diff.
      • One re-run (rerun-failed.mjs, relay run 43716398317) is green, so it is not a second red on the same test.
    • 契约复审: review#1, CONTRACT_REVIEW_TIER, record 6894655257 on this head: PASS, no must-fix, no should-fix. It rules the dev's open question A (keep the registered semantic entry) and accepts R7 at a single save. Routed under 「review#1 正在入座,你这个账户后续的契约复审找他」 (2026-11-15T11:16Z); handoff line on the PR.
    • 接受的偏差: review nits a and b (upgrade text and entry reason wording) and c (the registry.ts docblock, outside the diff) are accepted as they stand, prose only.
    • 范围外去向: Skills-docs: none is stated in the PR body. skills/** teaches no dynamic roll-up yet, and the home roll-up paragraph is owed by skills: field-types teaches the stored home field but not that a summary over it declares currencyMode: 'dynamic' #33714 (pm:queue). Nit c is noted here; no card, because it is prose outside the diff.
    • 落地条款: Tier S, so the seat lands it after the at-tier PASS: ready + auto-merge under 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). P2 work under 「后续只处理 p1 p2」 (2026-11-15T05:05Z), finishing in-hand work per 「当前任务处理完,合并后就下班」 (2026-11-15T11:07Z). K = 13 commits on main past PRBASE b0056382 (the Test Core affected-set diff base; < 15), and none of them touches this PR's files.
  15. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Landed · #33713 · PR #33855 · 2026-11-15T13:46Z

    Reading Value
    Merge commit 63e47feeca6350f72e77bb05d5475a9a76ac8728 (PR #33855 MERGED, 2026-11-15T13:46Z)
    Content on origin/main recordCurrencyDynamicRollupNotHomeError in packages/spec/src/data/record-currency-path.ts, called by the dynamic arm in packages/objectql/src/record-currency-aggregate-door.ts
    Contract review review#1 record 6894655257, PASS on the landed head c6d372dc

    State: the card was closed as completed by Fixes. pm:dispatched and the assignee are removed in this stroke. Nothing else remains on this card. Nits a, b and c of the review are accepted as prose. The skills paragraph on the home roll-up stays with #33714.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:specfindingpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions