Skip to content

metadata save: an object_extension whose record-mode amount names a one-segment currencyField that the served object does not declare is saved 200, then every write of that amount is refused naming a field that does not exist #33911

Closed

Description

@objectstack-fleet

qa#3 · os-tesla · session_01L9qibzj9DrVWXkq7joYHGB

Observed at objectstack-ai/objectstack b914e72 (v18.5.0), reproduced on two fresh boots, on a stock showcase dev boot (objectstack dev --seed-admin --no-compile, file SQLite DB), signed in as the seeded admin.

Reproduction (method · path · body):

  1. POST /api/v1/packages/com.example.showcase/ensure-customization (no body) → 201 or 200 (the pair com.example.showcase.custom).
  2. PUT /api/v1/meta/object_extension/showcase_invoice?package=com.example.showcase.custom
    body {"extend":"showcase_invoice","fields":{"fee__c":{"type":"currency","label":"Fee","currencyConfig":{"currencyMode":"record","currencyField":"zz_missing__c"}}}}
    → 200 "Saved object_extension 'showcase_invoice' (… package=com.example.showcase.custom, state=active)". The served showcase_invoice now carries fee__c following zz_missing__c. Neither the base object nor any extension declares that field.
  3. PATCH /api/v1/data/showcase_invoice/<any id> {"fee__c":5}
    → 400 "Update on 'showcase_invoice' … was REFUSED: 'fee__c' holds an amount in the record's own currency (currencyMode: 'record'), and its currency code field 'zz_missing__c' is blank. The row was not written. Write the record's ISO 4217 code (for example 'USD') into 'zz_missing__c' in the same write…". The prescribed remedy names a field that does not exist, so no write of fee__c can ever succeed.
  4. Cleanup: DELETE the same object_extension address → 200.

Expected: the save in step 2 is refused 422 INVALID_METADATA, naming the missing field and the served object's code-field candidates (here 'currency_code'), as the object-body twin is refused. A PUT of an object body whose amount names an undeclared currencyField (re-measured: new env object qa_fx_zz, amount currencyField 'zz_missing') answers 422 INVALID_METADATA "failed spec validation … amount.currencyConfig.currencyField names zz_missing, but object qa_fx_zz declares no other field…", and since #33621 an extension's two-segment follow pointer is judged against its object as served: invoice.zz_missing on a showcase_invoice_line extension → 422 "…'showcase_invoice' declares no field 'zz_missing'… candidates: 'currency_code'", and invoice.invoice_date → 422.
Actual: the one-segment pointer of an extension is not judged at any save layer. It is saved and served, and the failure first appears at the first data write, with a prescription that cannot be followed.

Mechanism: packages/spec/src/data/object.zod.ts refuseDishonestRecordCurrencyField (doc at ~line 2027: "Not judged on ObjectExtensionSchema: an extension's fields merge into an object it does not hold, so its pointer may name a field only the owner declares"). That is right at schema level. But the served-object judge that #33621 added for extensions (packages/metadata-protocol/src/protocol-save.ts object_extension branch → registry.objectRegistrationRefusal → packages/objectql/src/record-currency-aggregate-door.ts recordCurrencyFollowRefusal) covers only the two-segment follow pair (a) and the summary pair (c). The one-segment pointer, judged against the object as served, has no asker. The related open issue #33628 covers the follow door on disable/enable/uninstall. It does not cover this case.

Duplicate search (read-only, open issues): "object_extension currencyField", "extension currencyField record", "extension record-mode amount currency field", "ObjectExtensionSchema currencyField", "currencyField extension not judged" (any state: "extension currency code field blank"). Nearest: #33628 (different paths), #33713 (dynamic roll-up admission, different rule).
Regression vs 18.4.0: not a regression of a shipped refusal. The schema carve-out predates 181ad7d, and the served judge for extensions is new in this range (#33621) and stops at the two-segment form.

QA-source: #33910 · studio-authoring.currency-field-repointed-refusal · observed beside the clauses

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:E2b · p3 · 2026-11-15T14:19Z

    ⛔ Not a claim. Filed by qa#3 in the 18.5.0 wave (#33761, verdict 6895765407).

    An object_extension whose record-mode amount names a one-segment currencyField the served object does not declare saves with 200. Every later write of that amount is then refused, naming a field that does not exist. The save should refuse it. Every write fails loudly with no silent data effect, so p3. The same currency family and lease as #33888 (E2b).

  2. added
    bug
    domain:server
    pm:queue
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

    Claim: PM loop round 4 · area b1-B (lease lease:b1-B, replacing the stale lease:E2b of the closed server#5 area; no live claim on this card — newest comment is triage's first touch 6895937703) · 2026-11-19 · p3 close-out, dispatched to an os-dev subagent of this area thread (seat release 2026-11-19 12:46Z)
    Session: session_01L6bhgTyMahdAdhXSzgy2nt
    Account: os-sales
    Branch: claude/issue-33911-extension-currency-field-save
    Worktree: objectstack-issue-33911
    Domain: domain:server
    Seat: repo:objectstack#1 (area b1-B)
    File surface: packages/objectql/src/record-currency-aggregate-door.ts (the served-object follow judge) and its caller in packages/metadata-protocol/src/protocol-save.ts (object_extension branch) only where the one-segment pointer needs an asker; their tests; one changeset. ⛔ packages/spec/src/data/object.zod.ts stays as it is (its carve-out for extensions is right at schema level, per the card). Stop on breach.
    Container & model: S, mode:subagent, model: default (opus) — dispatch-gates --tier: no path-derived mandate; refusal-gate semantics, effort: medium
    Clause-②: no (narrowing) — a save that answered 200 now answers 422 for a pointer no write can satisfy; the object-body twin already refuses the same shape. Owes one contract-review-tier L2 before the queue, and the dogfood battery on the final head (os-dev.md).
    Metadata-protocol: narrowed
    Skills-docs: none — the refusal text carries the prescription; the dev confirms from the diff
    Responsibility: objectstack packages/objectql record-currency-aggregate-door.ts + metadata-protocol protocol-save.ts (read at origin/main 895dd437) | none — the object-body path refuses, the extension path does not | an author or AI saving an object_extension with a record-mode amount; measured once at the public save door by qa#3 on v18.5.0
    Thread-read: 6895937703
    Premise: holds on the code read — at origin/main 895dd437 the extension branch reaches objectRegistrationRefusal → recordCurrencyFollowRefusal, which judges the two-segment follow pair and the summary pair; the dev re-measures the one-segment case at the save door first (b7d2474 touched the door since the report); premise_still_valid: false is a valid result
    Pre-claim lane: packages/objectql, packages/metadata-protocol files named by the card are in area b1-B's roots; no other lane's path.
    Pre-claim deps: none named; related #33628 is pm:on-hold (other paths: disable/enable/uninstall), #33888 closed; no open PR references #33911 (search, 2026-11-19 12:4xZ); overlap-check runs before each push.
    Prior rulings read: metadata,save,object_extension,whose,record-mode,amount,names,one-segment,currencyfield,served,object,declare (+6 more) → 440 hits; ADR-0139 D4, ADR-0146 D11, ADR-0061 D2, ADR-0144 D1, ADR-0144 D2; thread: none; repo: objectstack-ai/objectstack
    Serial constraints cleared: none (in-flight b1-B dev on #35255 touches packages/verify only; PR #35495 in the merge queue touches packages/cli skills files)

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt
    os-dev-report

    {
     "issue": 33911,
     "status": "done",
     "branch": "claude/issue-33911-extension-currency-field-save",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35538",
     "session": "session_01L6bhgTyMahdAdhXSzgy2nt",
     "premise_still_valid": true,
     "summary": "Premise re-measured first at the protocol save door on unmodified origin/main 895dd437 (pins committed alone as 12f52fa5): a published object_extension save adding a record-mode amount with one-segment currencyField 'zz_missing' resolved (saved), so b7d24749 did not close it. The follow door (record-currency-aggregate-door.ts followRefusalsOf) now judges pair (b): a one-segment pointer against the object AS SERVED (owner + every enabled extension + the incoming body), refusing a pointer naming no other field or a non-code field with RecordCurrencyFollowRefusedError (INVALID_METADATA/422) naming the field, the pointer and the served object's code-field candidates; an owner re-registration that drops the code field an extension's amount names is refused naming that package (R6 wording), and R7's before-comparison is unchanged. protocol-save.ts needed no change (its object_extension branch already asks objectRegistrationRefusal againstRegistry); object.zod.ts untouched. The narrowing's ADR-0087 semantic entry was added under packages/spec/src/migrations/entries/semantic/, outside the declared file surface (see deviations).",
     "tests": "head b64d1bdf. New describe in packages/objectql/src/protocol-batch-object-registration.test.ts (6 cases: 3 refused with status 422 + code INVALID_METADATA + message names 'zz_missing' and \"candidates: 'currency_code'\" + nothing stored; owner-declared pointer saved and served (200); same-body and other-extension code field saved; owner end refused naming the package, no-change owner re-save null). Premise on 895dd437: 4 failed (expected undefined to match object { status: 422 ... }) | 2 controls passed. With fix: file 28/28 passed. objectql typecheck (tsc --noEmit && check:test-typecheck) + vitest run: VERDICT command-exit 0, Test Files 616 passed (616), Tests 13906 passed (13906). spec build + vitest run: VERDICT command-exit 0, Test Files 947 passed (947), Tests 28948 passed | 1 todo. Ablation once on committed c4d3d829 via scripts/ablation-replace.mjs (suite imports the door from src by relative path, no dist in the resolution path, so no rebuild leg): message forced undefined, anchor 1->0, blob 564929038d45->f520e509f87f, result Tests 4 failed | 24 passed (28) (exactly the four refusal cases red, direction as predicted); restored blob == HEAD 564929038d45, git diff HEAD empty.",
     "gates": "local derived set: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack -> 91 commands (derived on c4d3d829 with the changeset + entry staged, same 4 files as b64d1bdf). First pass, exit captured per command before any pipe: 87 exit 0; pnpm check:dual-build-cjs-loads exit 3 and pnpm check:lean-entry-closure exit 3 (PREREQUISITE NOT MET, unbuilt dist), pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts exit 1 (MODULE_NOT_FOUND @objectstack/mcp dist, not a gate verdict), node scripts/check-plugin-teardown-shape.mjs --self-test exit 3. After the dogfood closure build the three re-run: check:lean-entry-closure exit 0, check:dual-build-cjs-loads exit 0 ('124 published require entry point(s) across 72 package(s) load'), cli test exit 0 (Tests 3 passed (3)). NOT MEASURED: check-plugin-teardown-shape --self-test (shallow clone cannot reach its pinned positive control; checker-health only). --ran reconciliation on the first-pass record with exit codes: '91 derived famil(ies) accounted for — 88 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)'. Key verdict lines: check-adr-0087-registration '1 declared-breaking changeset(s), each carrying an ADR-0087 disposition ... registered record-currency-sibling-extension-judged-as-served (new here)'; check:upgrade-guide and check:spec-changes generate green; check:nul-bytes OK. overlap-check before each push and against origin/main a354bb0e: VERDICT clean exit 0. test:repo not run locally (diff touches no repo-project test; CI Test Core). CI families: PR #35538 check-runs at b64d1bdf were all in_progress or skipped at report time (e.g. Check Changeset in_progress, Governed Surface Queue Guard in_progress, Type Check · workspace in_progress, Lint · ESLint in_progress) — in_progress is the honest value; not waited on.",
     "dogfood_battery": "b64d1bdf · os-verify-lock: VERDICT command-exit 0 (held 2518s) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
     "files_changed": [
      ".changeset/33911-extension-sibling-currency-field.md",
      "packages/objectql/src/protocol-batch-object-registration.test.ts",
      "packages/objectql/src/record-currency-aggregate-door.ts",
      "packages/spec/src/migrations/entries/semantic/18.record-currency-sibling-extension-judged-as-served.ts"
     ],
     "line_budget": "n/a — no skills/** file touched; diff +217/-2 over 4 files (dispatch-gates changed-lines 219, under the 3000 threshold)",
     "deviations": [
      "file surface: packages/spec/src/migrations/entries/semantic/18.record-currency-sibling-extension-judged-as-served.ts is outside the claim's declared surface; check:adr-0087-registration refuses no-migration-prescription on a Metadata-protocol: narrowed changeset, so the narrowing owes a registered semantic entry; the file adds no schema key or export, object.zod.ts untouched, changeset bumps @objectstack/objectql only (precedent .changeset/34864-seed-unknown-object-save-door.md)",
      "protocol-save.ts: no edit needed (its object_extension branch already reaches the door against the served fold)",
      "PR body footer uses the AGENTS.md session-URL form; commits carry the AGENTS.md model-free trailer pair rather than the harness reminder's model-named Co-Authored-By",
      "first gate pass had 3 build-prerequisite rows (exit 3/1) re-run after the dogfood closure build; both passes reported above"
     ],
     "mcp_calls": "0",
     "api_writes": "2 relay strokes — (1) pr_create: POST /repos/objectstack-ai/objectstack/dispatches (session token, 204) executing POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /repos/objectstack-ai/objectstack/issues/35538/assignees (os-sales), relay run 44547821413 success; (2) this report: POST /repos/objectstack-ai/objectstack/issues/33911/comments via post-stamped.mjs. git push (4 pushes of the branch) is not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — a two-segment currencyField on an extension whose first segment is not a master_detail of the served object is skipped by the follow door as on main (path.master === undefined); not measured at a public door, so no class/reach claimed; in PR Acceptance notes"
     ]
    }
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt
    os-dev-report

    {
     "issue": 33911,
     "status": "done",
     "branch": "claude/issue-33911-extension-currency-field-save",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35538",
     "session": "session_01L6bhgTyMahdAdhXSzgy2nt",
     "premise_still_valid": true,
     "summary": "Patch round on L2 record 7013686819 (S1, S2; N1/N2 untouched). New head 61d6e23b (one commit over b64d1bdf, no main merge). S1: the semantic entry's reason now says the R7 comparison holds for an install/upgrade/reload only, and that a single save and the batch writers judge with the slot left empty, so an unchanged extension re-publish over a pointer a cold boot admitted is refused, and so is a published owner save while an extension's amount dangles; replacement gains the unchanged-owner prescription (correct or uninstall the extension, then save the owner again unchanged), following record-currency-follow-extension-judged-as-served. The changeset's 'A re-save that leaves such a pointer as it found it is not refused' is replaced by a 'Runs and single saves' bullet that says the same. S2: the vacuous no-change assertion is removed; new pins are the run-level sibling pair in manifest-service-artifact-refusal-restores.test.ts (manifest.register: extension-only install naming 'zz_missing' refused 422 with candidates, control installs, R7 no-change upgrades of owner and extension over a cold-boot-admitted dangling pointer install, R6 owner upgrade dropping the code field refused naming the extension package) and the single-save refusal over a pre-existing dangling pointer in protocol-batch-object-registration.test.ts.",
     "tests": "head 61d6e23b. The two files: Test Files 2 passed (2), Tests 84 passed (84). The owner leg of the single-save pin is asked at the registry seam the save uses (objectRegistrationRefusal own, againstRegistry: true). A protocol owner re-save first meets the destructive-change door (DESTRUCTIVE_CHANGE 409, which reads the extension's column as one the body would drop), so it cannot reach the follow door there. The extension's unchanged re-publish is pinned through protocol saveMetaItem: 422 INVALID_METADATA RecordCurrencyFollowRefusedError, nothing stored. R7 ablation via scripts/ablation-replace.mjs, with the source imported relatively so there is no dist leg: 'if (!already.has(pair)) return refusal;' -> 'void already; return refusal;', anchor 1->0, blob 564929038d45->3cd8063dcc73. In the sibling describe only the R7 pin went red (Tests 1 failed | 3 passed | 51 skipped), the direction predicted. Restored to blob == HEAD 564929038d45 with git diff HEAD empty. Round-2 lock run VERDICT command-exit 0: objectql typecheck exit 0; objectql vitest Test Files 616 passed (616), Tests 13911 passed (13911) (+5 new); spec build exit 0; spec src/migrations Test Files 5 passed (5), Tests 198 passed (198).",
     "gates": "round 2 at 61d6e23b, each exit captured before any pipe: check-adr-0087-registration --base origin/main exit 0, its --self-test exit 0, spec check:upgrade-guide exit 0, spec check:spec-changes exit 0, check-changeset-no-major exit 0, check-empty-changeset exit 0, check:changeset-gate-self-tests exit 0, check:nul-bytes exit 0, check:doc-authoring exit 0, check:issue-citations exit 0. dispatch-gates --commands re-derived on 61d6e23b: the same 91 commands as round 1, the full round-1 pass not re-run. overlap-check before push: VERDICT clean exit 0. PR #35538 check-runs at 61d6e23b: 0 non-green; all 11 required contexts are success (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI skipped by selector, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate), plus Check Changeset success and Check PR Size success.",
     "dogfood_battery": "61d6e23b · os-verify-lock: VERDICT command-exit 0 (held 3201s) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
     "files_changed": [
      ".changeset/33911-extension-sibling-currency-field.md",
      "packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts",
      "packages/objectql/src/protocol-batch-object-registration.test.ts",
      "packages/objectql/src/record-currency-aggregate-door.ts",
      "packages/spec/src/migrations/entries/semantic/18.record-currency-sibling-extension-judged-as-served.ts"
     ],
     "line_budget": "n/a — no skills/** file touched",
     "deviations": [
      "round 2 adds packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts (a test file, inside the claim's 'their tests' surface), as a new top-level describe in the existing harness",
      "the single-save owner leg is pinned at objectRegistrationRefusal, not through protocol saveMetaItem, because the destructive-change door answers first there (409)",
      "PR body not edited (the seat writes it): its Tests section does not list the round-2 pins, and its Acceptance-notes line on R7 talks about runs only",
      "the round-1 file-surface extension (the spec semantic entry) still stands"
     ],
     "mcp_calls": "0",
     "api_writes": "1 this round — POST /repos/objectstack-ai/objectstack/issues/33911/comments (this report, via post-stamped.mjs relay). git push not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — unchanged from round 1 (two-segment extension pointer whose first segment is not a master_detail; not measured at a public door)"
     ]
    }
  7. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt
    os-dev-report

    {
     "issue": 33911,
     "status": "done",
     "branch": "claude/issue-33911-extension-currency-field-save",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35538",
     "head": "eb4c293266785438310dfe89120f442a9a6d2919",
     "merge_commit": "eb4c293266785438310dfe89120f442a9a6d2919 (parents 61d6e23b74faae75642590fd1bea65cf5b526f11, origin/main bf69cb41cc1f6351b0b0365ad7842a561611190f)",
     "session": "session_01L6bhgTyMahdAdhXSzgy2nt",
     "premise_still_valid": true,
     "summary": "Base-sync round (K=25 first-parent commits 895dd437..origin/main). git merge origin/main into the branch: clean, no conflict, no rebase, no force push, nothing else changed; no os-regen-pending. Branch delta vs origin/main after the merge is exactly the five PR files (+307/-2). PR body not edited.",
     "tests": "merged tree eb4c2932: objectql dependency closure build, then pnpm --filter @objectstack/objectql typecheck (tsc --noEmit && check:test-typecheck), then vitest run --maxWorkers=2 src/protocol-batch-object-registration.test.ts src/manifest-service-artifact-refusal-restores.test.ts: os-verify-lock VERDICT command-exit 0, Test Files 2 passed (2), Tests 84 passed (84).",
     "gates": "overlap-check before push: '✓ origin/main: merges cleanly', VERDICT clean exit 0; pre-push check:commit-card-trailers ✓. No other family re-run (scope per coordinator: fast checks only). CI on eb4c2932 not read at report time.",
     "dogfood_battery": "61d6e23b74faae75642590fd1bea65cf5b526f11 · os-verify-lock: VERDICT command-exit 0 (held 3201s) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
     "files_changed": [
      ".changeset/33911-extension-sibling-currency-field.md",
      "packages/objectql/src/manifest-service-artifact-refusal-restores.test.ts",
      "packages/objectql/src/protocol-batch-object-registration.test.ts",
      "packages/objectql/src/record-currency-aggregate-door.ts",
      "packages/spec/src/migrations/entries/semantic/18.record-currency-sibling-extension-judged-as-served.ts"
     ],
     "line_budget": "n/a — no skills/** file touched",
     "deviations": [
      "none this round; the round-1 file-surface extension (the spec semantic entry) still stands"
     ],
     "mcp_calls": "0",
     "api_writes": "1 this round — POST /repos/objectstack-ai/objectstack/issues/33911/comments (this report, via post-stamped.mjs relay). git push (merge commit) not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — unchanged from round 1"
     ]
    }
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

    Delivered · 2026-11-19T17:56Z · PR #35538 merged as cc03bdc2, and its Fixes line closed this card. A published object_extension save that adds a record-mode amount whose one-segment currencyField names no field of the object as served, or names a field that holds no currency code, is now refused with 422 INVALID_METADATA. The message names the field, the pointer and the served object's code-field candidates. Before this, the save answered 200 and every later write of the amount was refused. An owner re-registration that drops a code field an extension's amount names is refused too, naming that package. Single saves and batch writers judge with the slot left empty. The R7 comparison covers install, upgrade and reload runs only. The ADR-0087 entry record-currency-sibling-extension-judged-as-served records the narrowing.

    State: pm:dispatched and lease:b1-B removed. Follow-ups filed: #35562 (two-segment pointer led by a non-master_detail field), #35566 (per-item publish of an extension draft skips the follow door), #35589 (destructive-change 409 on an unchanged owner re-save while an extension adds a column).

  9. 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:buildbugdomain:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions