Skip to content

Publishing an object_extension draft per item may skip the record-currency follow door that a published save asks #35566

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

Filing gate: ① product defect, measure first · Source: fleet · escalated in section ③ of the contract-review record 7013686819 on PR #35538 (card #33911). The seat ruled that a card is filed, with the grade left to triage's first touch. ⛔ Not a claim. Read off the code, not measured, and it predates #35538.

Grade: area:build · Bug · reach not measured → grade left to triage.

Business reason

A published save of an object_extension (PUT /api/v1/meta/object_extension/NAME) asks the registry's record-currency follow door and refuses a record-mode amount whose currencyField the served object cannot satisfy (pair (a) on main, and pair (b) after PR #35538). An author who saves the same extension as a draft and then publishes it per item appears to get no such answer. If so, the extension becomes live with an amount that every later write refuses, which is the symptom #33911 fixes for the save door.

What happens (read, not measured)

promoteDraftForPublish (packages/metadata-protocol/src/protocol-history-and-publish.ts) asks the registry's follow door only for type object. A per-item publish of an object_extension draft therefore appears to reach the registry without the follow door being asked, for pair (a) and pair (b) alike.

Expected

Every door that makes an object_extension body live asks the same follow door that its published save asks, and answers 422 INVALID_METADATA with the same message.

Done when

  • First step: measure at the public door. Save an object_extension draft that adds a record-mode amount with currencyField: 'zz_missing' (one segment, after fix(objectql)!: an object_extension amount naming a sibling currencyField the served object does not hold is refused at the save #35538) and one with a master_detail-led pointer the served object cannot satisfy (pair (a)). Then publish each per item (POST /meta/object_extension/NAME/publish). Record whether it answers published and whether the first write of the amount is refused.
  • If it reproduces: the per-item publish refuses both, with a pin over the publish door (status, code, message, draft not promoted) and a control showing that a satisfiable pointer still publishes, plus an ablation.

Who acts: the owner of the metadata-protocol publish path, together with the area that owns the objectql record-currency follow door.
Dedupe: repo:objectstack-ai/objectstack is:issue is:open currencyField extension master_detail gave only #33628 (package lifecycle verbs never ask the follow door, which is a different door) and #35562 (two-segment pointer led by a non-master_detail field, at the save door). Neither covers the draft-publish door.

Activity

  1. added
    bug
    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:queue; rationale: area:build · Bug · Severe·data wrong if confirmed (publishing an object_extension draft per item may skip the record-currency follow door, leaving rows without a currency code) · rare → p2 (severe × rare). Measure first, as the review asked; if the publish path is shown safe, close it.

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 19, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgVLY5efsfaT3UG2zwH

    Claim: PM loop round 1 · card thread of repo:objectstack#1 (the #35228 card thread, running this card in series while #35228 waits for the maintainer) · 2026-11-19T21:00Z · dispatched to an os-dev subagent of this card thread
    Area: b1-C
    Session: session_01L6bhgVLY5efsfaT3UG2zwH
    Account: os-sales
    Branch: claude/project-thread-nbjebo (harness-assigned name, not claude/issue-35566-…; the PR body notes it for the Duplicate Fix Guard)
    Worktree: objectstack-issue-35566
    Domain: domain:server
    Seat: repo:objectstack#1 (card thread)
    File surface: packages/metadata-protocol/src/protocol-history-and-publish.ts (the per-item publish's promoteDraftForPublish), one new test file named for this card under packages/metadata-protocol/src/, one changeset. Stop on breach.
    Container & model: S/M, mode:subagent (inside this card thread), model: default (opus) — dispatch-gates --tier: no path-derived mandate, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code in objectstack-ai/objectstack (promoteDraftForPublish asks the registry's follow door only for type object) | the published save of an object_extension already asks it (protocol-save.ts, the #33593 ruling R1 block) | Studio authors who save an extension as a draft and publish it per item; reach not measured
    Thread-read: 7014313950
    Premise: holds as read — at origin/main 2495486f the per-item publish asks objectRegistrationRefusal inside the singularType === 'object' block only (protocol-history-and-publish.ts ~L963-981), and for an object_extension draft asks objectExtensionItemRefusal (~L1056-1064), which is not the follow door. The card is measure-first: the dev measures at the public door before any fix; no defect ⇒ the card closes with the reading.
    Pre-claim lane: packages/metadata-protocol/src/** is a path the card names for the save/publish doors of area b1-C (area-lease.md; the area brief lists this card).
    Pre-claim deps: none named; PR #35538 (card #33911), which the card cites for pair (b), merged 2026-11-19T17:56Z. No open PR touches protocol-history-and-publish.ts or protocol-save.ts (open-PR file listing read at claim time); overlap-check runs before each push.
    Prior rulings read: publishing,object_extension,draft,item,skip,record-currency,follow,door,published,save,asks → 138 hits; #33593 ruling R1 as cited in protocol-save.ts (a face that makes the one body live asks the follow door: same direction as this card); ADR-0144 D2 and D6, amended; thread: none; repo: objectstack-ai/objectstack
    Serial constraints cleared: none in flight on these files. #35589 (same thread, next in series) touches protocol-save.ts's destructive-change door, not this file. #35562 (p3, unclaimed) is the save door's pointer shape; this card's pin does not assert its behaviour.

    Fold-or-serial: not folded with #35228 (fold gate ③: #35228 is waiting for a maintainer ruling; gate ①: a different door and a different fix) nor with #35589 (gate ①: a missing follow-door question at publish versus a destructive-change diff base at save). Serial in this thread: #35566, then #35589.

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

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 35566,
     "status": "done",
     "branch": "claude/project-thread-nbjebo",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35656",
     "session": "session_01L6bhgVLY5efsfaT3UG2zwH",
     "premise_still_valid": true,
     "summary": "Measured first (base eca20d22, real kernel + real SchemaRegistry + real protocol, in-memory driver, the rig of packages/objectql/src/protocol-batch-object-registration.test.ts, calling publishMetaItem, the method POST /meta/:type/:name/publish calls): an object_extension draft adding a record-mode amount with currencyField 'zz_missing' (one segment), 'invoice.title' or 'invoice.nothing' (master_detail-led, pair (a)) saved as a draft, and its per-item publish answered success:true, promoted the draft and registered the amount, while the published save of the same body answered 422 INVALID_METADATA. The first write of the amount was then refused 400 ERR_CURRENCY_CODE_REQUIRED for 'zz_missing' and 'invoice.nothing', and for 'invoice.title' it was WRITTEN, with the parent's title read as the currency. publishPackageDrafts of the same drafts already answered outcome 'refused' (INVALID_METADATA in failed[], nothing promoted), so it was left unchanged. Fix: promoteDraftForPublish now asks registry.objectRegistrationRefusal({...contribution, name: extend}, promoteInto, 'extend', {againstRegistry: true}) for an object_extension draft on the against-registry (per-item) question, before repo.promoteDraft writes. Re-measured on the same real-registry rig: each refused shape now answers 422 INVALID_METADATA with the byte-identical message of the published save, no active row, the draft row kept, the amount not served; both controls still publish and write. Metadata-protocol none holds: the fix refuses nothing the published save accepts (only the publish of a draft the body-only draft save accepted, as before). Scope deviation, declared: scripts/engine-double-contract.pinned.json gained three generated rows (check-engine-double-contract --write) for the new test file's pinned doubles, outside the claimed file surface; check:engine-double-contract was red (exit 1) without them. Local branch name in the worktree is wt/issue-35566 because the assigned branch is checked out in the shared checkout; every push went to refs/heads/claude/project-thread-nbjebo.",
     "tests": "Head d2b00426. `pnpm --filter @objectstack/metadata-protocol typecheck && pnpm --filter @objectstack/metadata-protocol test` under the lock: VERDICT command-exit 0, Test Files 362 passed | 9 skipped (371), Tests 23289 passed | 45 skipped (23334). New file packages/metadata-protocol/src/protocol.extension-publish-follow-door-35566.test.ts: Tests 4 passed (4) (two refusal cases: status 422, code INVALID_METADATA, name RecordCurrencyFollowRefusedError, message === the published save's message for the same body, draft row kept and no active row, the question asked = target as name, no extend/priority, packageId = package promoted into, 'extend', againstRegistry true; two CONTROL cases publish and promote). The registry in that file is a double (metadata-protocol cannot import objectql: cycle); real-registry evidence is the before/after scratch measurement (uncommitted, deleted) whose rows are in the PR body. objectql consumers against the rebuilt metadata-protocol dist: protocol-batch-object-registration.test.ts + record-currency-guards.test.ts: Test Files 2 passed, Tests 104 passed. Ablation (fix committed at c82e8370 first; node scripts/ablation-replace.mjs replaced `if (followRefusal) throw followRefusal;` with a no-op marker: anchor x1 -> x0, marker x0 -> x1, blob 32d7db9a -> 32f0f490; marker grep 1 inside the run): Tests 2 failed | 2 passed (4), both refusal cases red ('expected { code: undefined, status: undefined } to deeply equal { code: INVALID_METADATA, ... }'), controls green; restore: blob after restore 32d7db9a == HEAD blob, git diff HEAD empty. The test imports ./protocol.js from source (no dist on the path), so no rebuild was needed between legs.",
     "gates": "dispatch-gates --commands at head d2b00426 derives 77 families (69 at c82e8370 before the ledger file was added; the 8 extra were run after). --ran reconciliation with exit codes: '77 derived famil(ies) accounted for — 74 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)', exit 0. Every run family exit 0 except: pnpm check:engine-double-contract :: exit 1 at c82e8370 (RETAINED rows for the new test file), exit 0 at d2b00426 after the generated ledger rows. NOT MEASURED (exit 3, PREREQUISITE NOT MET): node scripts/check-plugin-teardown-shape.mjs --self-test (shallow clone cannot reach its pinned fixture commit), pnpm check:dual-build-cjs-loads and pnpm check:lean-entry-closure (built output of packages outside the diff absent in this worktree). Note: the 68-family batch ran while the ledger commit landed mid-run (that commit adds only a JSON file). node scripts/pm/overlap-check.mjs :: exit 0 (VERDICT clean, against origin/main 1104ee59) before the final push; the first push (c82e8370) went out BEFORE overlap-check ran (it then answered clean exit 0) — deviation. node scripts/check-nul-bytes.mjs :: exit 0. PR #35656 check-runs at report time: all gate-carrying runs in_progress (Check Changeset, Governed Surface Queue Guard, Lint · *, Type Check · *, PR-body guards); opt-in and queue/schedule jobs skipped. Not run locally by rule: test:repo, pnpm lint, Test Core/Build Core (CI-owned).",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — pr_create via fleet-write relay (repository_dispatch, run 44621649668: POST pulls -> #35656 + assignees os-sales); os-dev-report comment on #35566 via post-stamped.mjs. Plus 2 git pushes (not REST).",
     "open_questions": [
      {
       "question": "The dispatch asked commits to end with a `Co-Authored-By` trailer naming a model, but the same dispatch and AGENTS.md forbid model identifiers in committed text and the pre-push hook refuses one in the pair; which wins?",
       "options": [
        "A keep the model-free pair (Claude-Session + Co-authored-by: Claude) as used",
        "B amend to the dispatch's spelling"
       ],
       "recommendation": "A, because AGENTS.md binds and the hook refuses B; already applied."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — the published save (protocol-save.ts R1 block) and the per-item publish now spell the same follow-door call twice; one helper in protocol-object-extension-item.ts would fold them but touches files outside this card's surface (protocol-save.ts is held for #35589). Noted in PR Acceptance notes."
     ]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:buildbugdomain:serverpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions