Skip to content

fix(scenarios): load the card seed through the platform's seed path - #34985

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-34897-travel-expense-seed-refusals
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-34897-travel-expense-seed-refusals

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #34897

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:场景卡运行器不再用数据 API 逐行写入种子数据,改为把卡片种子打成一个只含 data[] 的包,经托管安装门交给平台自己的种子加载器写入;恢复已删除种子行也走同一条路。
  • 为什么改:构建按 skill 指引声明了 initialStates: ['draft'] 的状态机,数据 API 属于用户写入,于是 travel_expense 卡 120 张报销单中 114 张(已付款/已提交等)被拒,其下 470 条明细与审批步骤连带被拒,584/757 行丢失,问数轮次在错误的数据上进行。
  • 风险与回滚:种子行不再触发构建的记录触发流(平台种子语义如此);已普查 9 张卡,没有一张的答案依赖种子时触发流。拒收记录不再带错误码,只有加载器原文。回滚即 revert 本 PR。
  • 先看:packages/qa/scenarios/src/runner/orchestrate.ts 的 loadSeedRows 与 seedApp(风险最高:错误清单到拒收记录的映射);同文件 restoreSeededRows 第 2 步;packages/qa/scenarios/test/runner/orchestrate.test.ts 新增的 TravelRulesApp 一组用例。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts -t "past its entry state",预期 6 个用例全部通过。
  • 需要你做的:无,席位落地。

What changes

  • seedApp builds one dataset per object in its existing load order (the card's own id on each row; persona user ids, owner_id and rewritten handles as before; deferred cycle lookups still left out) and hands them to a new module-private loadSeedRows.
  • loadSeedRows installs a data-only package (data[], externalId: 'id', mode: 'insert', its own namespace per load) through the harness's existing installManaged door. The platform's seed loader writes package data under SEED_WRITE_EXECUTION_CONTEXT: the state_machine rule is skipped, every other rule and hook still runs, and record-change flows are suppressed. It maps the answer's data.seeded.errorList into the same seed.refused records: one per row the loader could not write, plus fields for a written row whose reference did not resolve. A refused package, a harness with no managed door, or a load that did not run inline refuses every row, with the reason.
  • The second pass (PATCH of the lookups that close a reference cycle) is unchanged.
  • restoreSeededRows step 2 re-inserts the round's missing seeded rows as one load through the same path.
  • No exported signature or type changes: the harness interface gains no member, and the new helpers are module-private. The installManaged doc comment and the door table in app.ts say the seed loads through it.
  • README: the Seed paragraph names the door and the posture. It states that seed rows fire no record-triggered flow and that no card relies on one.
  • Test doubles: both FakeApps give the managed door the measured answer shape (test/runner/seed-door.ts).

Route A, and one place the mechanism moved

The seat ruled route A: load the rows as declared data[] under the seed posture, and keep the PATCH pass for runtime-id fields. I measured that assumption before building (condition 1, below). data[] carries runtime user ids as sent: owner_id and the user field landed, and the persona read its own 10 claims (M3). The seat then ruled on that deviation (A, 21:58Z): persona ids ride in the load, and the PATCH pass now sets only the deferred cycle lookups. Re-patching the persona ids would put a user-door update, with its update triggers and hooks, back on every persona-owned seed row, and the seed posture exists to avoid exactly that. The README's Seed paragraph says the same.

Tests

  • New block seedApp — a card row already past its entry state loads through the seed path…, run on the travel_expense card with a double of the kept build's rules (TravelRulesApp):
    • the user door refuses a paid claim;
    • through seedApp, all 757 rows load: 114 non-draft claims, and ln_001_hotel / as_001_1 hold claim: 'c001';
    • control: a trip that breaks end_after_start is refused with the loader's message and no code, and its claim, two lines and two steps go with it (751 inserted);
    • restoreSeededRows puts a removed paid claim back;
    • a reference the loader drops from a row it wrote (an errorList entry whose field is the lookup): the row is refused with fields: ['parent'], inserted drops by one (755), and its deferred manager patch still runs (secondPass 3); a row with both a write entry and a reference entry counts once, without fields; and a restore counts the written row as reinserted. The double (test/runner/seed-door.ts) can now drop a reference from a row it writes, as the real loader reports one (referencesDropped).
    • a harness with no managed door refuses every row, saying so.
  • Updated: the partial-tally test (one load, which throws, counts nothing); two refusal expectations now read the loader's message and no code; the fresh-copy seed-difference regex; UnmanagedOnly now drops the managed door explicitly.

Gates and test runs (head 1c5dbc3)

  • pnpm --filter @objectstack/scenarios build && … test && … typecheck, under the verify lock: Test Files 39 passed (39), Tests 1092 passed (1092), typecheck clean, VERDICT command-exit 0.
  • S1 round (1c5dbc3, two commits: a README sentence and the S1 test): the package run above is on this head. The README path derives 42 gate families and the two test paths add 7; all exit 0 except the two standing NOT MEASURED (check-plugin-teardown-shape --self-test and check:dual-build-cjs-loads, both exit 3). overlap-check: VERDICT clean exit 0.
  • Derived gate list: node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands gives 67 families at 81b6323. That is the same list as on the earlier head. The reconciliation (--ran with each exit code captured before any pipe) reads 67 derived, 65 run, 2 NOT-MEASURED, 0 UNRUN.
  • pnpm check:dispatcher-error-vocabulary was red on the first head. It flagged a refusal helper that took a code parameter it could not name as a literal. 81b6323 removes it: a refused seed package now puts the door's code in the message. The gate was re-run on that tree and exited 0.
  • NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test. It exited 3 because the shallow clone lacks the commit it needs ("Deepen the clone"). The scan itself, node scripts/check-plugin-teardown-shape.mjs, exited 0.
  • NOT MEASURED: pnpm check:dual-build-cjs-loads. It exited 3 with PREREQUISITE NOT MET: other packages have no dist/ in this worktree. CI builds them and runs it.
  • Not run locally: test:repo and the repo-wide scans. Both belong to CI.
Derived families, exit codes
exit 0 · node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0 · node scripts/check-adr-0087-registration.mjs --self-test
exit 0 · node scripts/check-changeset-no-major.mjs --base origin/main
exit 0 · node scripts/check-closing-keyword-parity.mjs
exit 0 · node scripts/check-closing-keyword-parity.mjs --self-test
exit 0 · node scripts/check-comment-mask-adoption.mjs
exit 0 · node scripts/check-comment-mask-adoption.mjs --self-test
exit 0 · node scripts/check-comment-mask-corpus.mjs
exit 0 · node scripts/check-dts-emitted.mjs --self-test
exit 0 · node scripts/check-empty-changeset.mjs --base origin/main
exit 0 · node scripts/check-empty-changeset.mjs --self-test
exit 0 · node scripts/check-issue-citations.mjs
exit 0 · node scripts/check-plugin-teardown-shape.mjs
exit 3 · node scripts/check-plugin-teardown-shape.mjs --self-test
exit 0 · node scripts/ci/assert-turbo-remote-cache.mjs --self-test
exit 0 · node scripts/ci/plan-test-core-shards.mjs --self-test
exit 0 · node scripts/ci/prune-turbo-cache.mjs --self-test
exit 0 · node scripts/ci/snapshot-next.mjs --self-test
exit 0 · node scripts/docs-audit/check-affected-docs.mjs
exit 0 · node scripts/docs-audit/check-drift-comment.mjs
exit 0 · node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0 · node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0 · node scripts/release-pending-publish.mjs --self-test
exit 0 · pnpm --filter @objectstack/spec run check:duration-unit-keys
exit 0 · pnpm --filter @objectstack/spec run check:error-code-provenance
exit 0 · pnpm check:adr-anchors
exit 0 · pnpm check:changeset-gate-self-tests
exit 0 · pnpm check:ci-filter-parity
exit 0 · pnpm check:cli-command-ids
exit 0 · pnpm check:closed-ceremony-text
exit 0 · pnpm check:cross-package-test-inputs
exit 0 (re-run on 81b6323e86; 1 on the first head) · pnpm check:dispatcher-error-vocabulary
exit 0 · pnpm check:doc-authoring
exit 0 · pnpm check:driver-memory-census
exit 0 · pnpm check:dts-closure
exit 3 · pnpm check:dual-build-cjs-loads
exit 0 · pnpm check:engine-double-contract
exit 0 · pnpm check:error-status-conformance
exit 0 · pnpm check:gitlink-declared
exit 0 · pnpm check:issue-citations
exit 0 · pnpm check:keyed-text-bounds
exit 0 · pnpm check:lean-entry-closure
exit 0 · pnpm check:logger-receiver-detach
exit 0 · pnpm check:nul-bytes
exit 0 · pnpm check:object-def-param-keys
exit 0 · pnpm check:objectql-double-limit
exit 0 · pnpm check:optional-error-sink
exit 0 · pnpm check:org-identifier
exit 0 · pnpm check:page-declaration-shape
exit 0 · pnpm check:platform-object-tenancy-census
exit 0 · pnpm check:published-files
exit 0 · pnpm check:query-options-erasure
exit 0 · pnpm check:refd-timer-probe
exit 0 · pnpm check:registry-log-declared
exit 0 · pnpm check:rest-log-spy-declared
exit 0 · pnpm check:settings-bind-window
exit 0 · pnpm check:slot-lookup
exit 0 · pnpm check:sourcemap-no-sources-content
exit 0 · pnpm check:system-context-census
exit 0 · pnpm check:test-source-alias
exit 0 · pnpm check:tier-file-adoption
exit 0 · pnpm check:type-check-coverage
exit 0 · pnpm check:type-check-debt
exit 0 · pnpm check:undeclared-dep-imports
exit 0 · pnpm check:vouch-for-reference-callers
exit 0 · pnpm check:watch-hint-literal
exit 0 · pnpm check:where-matcher
Ablation: the seed path and the restore path, one leg each

The scenarios tests import the runner from src/ by relative path, so neither leg needs a dist rebuild. Each leg was written with node scripts/ablation-replace.mjs from the HEAD blob a8c96bc92dd1 of orchestrate.ts and restored the same way. After each restore, the blob equalled HEAD and git diff HEAD was empty.

  • Leg 1: the seed loop goes back to one data-API insert per row (blob a8c96bc92dd1 -> 1ff43a1b3708, anchor 1 -> 0). 4 of the 5 new tests go red: all 757 load, the control, the restore (its seed already failed) and the missing-door case. The user-door test stays green, as it should.
  • Leg 2: only the restore re-insert goes back to the data API (blob a8c96bc92dd1 -> 0aaa6d7a3034). Only the restore test goes red: failed: … demotravel_expense_claim: 1 missing (c001) (refused: insert demotravel_expense_claim c001: This status change is not allowed; a paid claim cannot be changed.).
  • Leg 3 (S1, head 1c5dbc3): the reference branch ignores entries (unheld.set(key, held) replaced by void held, blob 004bb0c7c0f6 -> 21619f29c539, anchor 1 -> 0). Only the S1 test goes red (expected { inserted: 756 } to deeply equal { inserted: 755 }), 5 pass. Restored: blob == HEAD 004bb0c7c0f6, git diff HEAD empty.

Acceptance notes

  • Seed refusals now carry the seed loader's sentence (Failed to write OBJECT record #N (id=ID): …) and no code, because the door's errorList names none. seedDifference and the scorecard read them unchanged.
  • In the re-run, the replayed ask turns score Run-问数 3/13 and Run-operations 2/6. Those answers were recorded over the old 173-row seed and are now graded against the full truth. This is not a regression: the old round had 8 turns not measured, and those turns are now asked.
  • Not exercised live: the write-back restore (restoreSeededRows). Ask mode took the fresh-copy route, whose copy seeded alike. The write-back restore is covered by the unit test and its ablation.

Verification

Condition 1 asked whether data[] keeps the card's ids as lookup targets. I measured it before writing code, on a blank 18.5.0 host with the kept template.json installed, through POST /api/v1/marketplace/install-local (installMode: 'managed'):

  • M1, the template plus the card seed as data[] (externalId: 'id', mode: 'insert'): seeded.mode inline, inserted 757, errors 0. The ids are kept: c001 exists, ln_001_hotel.claim = c001, dep_eng.manager = e05.
  • M2, a separate data-only package with trip t001 broken (end before start): inserted 751, errors 11. The trip is refused with the rule's message, and its claim, two lines and two steps go with it (two entries per dependent row: write plus lookup).
  • M3: owner_id and the user field carry persona user ids as sent, and the employee persona reads its own 10 claims. A second data-only package with its own namespace installs. The same namespace again is refused with 422.

Condition 3 is the re-run on the round's kept build. That is template.json, sha256 b7ab31a715d4e83c…, in ask mode with the round's recorded ask turns (--driver recorded:…/issue-34687/ask-round-2026-11-17/proof-managed/ask.rec.json, --create-version 18.5.0). The record is on the project mount: issue-34897/rerun-replay/ (rerun.sh, run.log, started, exit, out/2026-11-17-scenario-travel_expense.json).

  • It started at 2026-11-17T21:19:04Z on runner head 8308c29 and exited with EXIT=0 at 21:22:39Z.
  • Template: installMode managed, after the unmanaged attempt was refused 422 UNMANAGED_INSTALL_UNCOPYABLE.
  • Seed: inserted 757, refused [], secondPass {demotravel_department.manager: 4}. The scorecard reads seed {inserted 757, total 757, refused 0}.
  • Before: the same build seeded through the data API refused 114 claims at the root and 470 lines and steps in cascade, 584 of 757 rows. Now 0 of the 114 root rows are refused, and all 470 cascaded rows are inserted.
  • What changed after 8308c29 does not touch this path: the README, the changeset, and the message of a refused seed package, which this run never met.

Generated by Claude Code

The runner wrote every seed row through the data API, a user write, so a
build's state_machine with initialStates refused every mid-lifecycle row
and cascaded its children. The seed now goes in as a data-only package's
data[] through the managed install door, which the platform's seed loader
writes under its seed posture; restores re-insert the same way.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…no record-triggered flow

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…not a code field

A refused seed package refuses every row with the door's status, code and
message in one sentence, so no helper stamps a code it cannot name as a
literal.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/scenarios, touching 11 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/client-sdk.mdx (via data.create (sdk, the route ledger binds it to POST /api/v1/data/:object), data.find (sdk, the route ledger binds it to GET /api/v1/data/:object))
  • content/docs/api/data-flow.mdx (via data.create (sdk, the route ledger binds it to POST /api/v1/data/:object))
  • content/docs/api/environment-routing.mdx (via data.find (sdk, the route ledger binds it to GET /api/v1/data/:object))
  • content/docs/api/error-catalog.mdx (via data.create (sdk, the route ledger binds it to POST /api/v1/data/:object))
  • content/docs/deployment/troubleshooting.mdx (via data.find (sdk, the route ledger binds it to GET /api/v1/data/:object))
  • content/docs/kernel/runtime-services/data-service.mdx (via data.create (sdk, the route ledger binds it to POST /api/v1/data/:object), data.find (sdk, the route ledger binds it to GET /api/v1/data/:object))
  • content/docs/permissions/authentication.mdx (via data.find (sdk, the route ledger binds it to GET /api/v1/data/:object))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v16.mdx (via data.create (sdk, the route ledger binds it to POST /api/v1/data/:object))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: /api/v1/data/:object (route, 38 pages)
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 54ee6c2f6e123d131b66f401946b60a188a16a2f — the merge of head b88c632b10cf415af60c1258ccc755562cf97a73 into base 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 54ee6c2f6e123d131b66f401946b60a188a16a2f && git checkout 54ee6c2f6e123d131b66f401946b60a188a16a2f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa b88c632b10cf415af60c1258ccc755562cf97a73 && git checkout -B drift-repro 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa && git merge --no-ff b88c632b10cf415af60c1258ccc755562cf97a73

node scripts/docs-audit/affected-docs.mjs --json 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ookups

The seed package carries persona user ids as sent, so the second pass no
longer re-patches them: that would bring user-door update triggers and
hooks back onto seed rows.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT · 2026-11-17T22:01Z

Head-sha: 81b6323
Reviewer: seat 3 L1-c, for card #34897. The contract is claim amendment 6960622194 (seat-ruled route A and its three conditions) and reading 6960505974. The report is os-dev 6962163959.

席位核对

PR shape. Fixes #34897, base main. Seven paths, +339/-43, all in packages/qa/scenarios/** plus one changeset:

  • orchestrate.ts, with the new loadSeedRows, seedApp, and step 2 of restoreSeededRows;
  • the doors doc in app.ts;
  • README.md;
  • the test double test/runner/seed-door.ts, the export fixture's installManaged, and five new tests.

This stays inside the claim's file surface: nothing touches skills/**, the cards, packages/spec or packages/objectql. '@objectstack/scenarios': patch. Clause-②: no / Metadata-protocol: none match a runner change with no exported signature moved. Not governed.

CI. It was still running when I read it (16 pending, 14 success, nothing failed). This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

(1) The door. loadSeedRows builds one data-only manifest, data[] with one dataset per object (mode: 'insert', externalId: 'id'), and sends it through the harness's existing installManaged, which is POST /api/v1/marketplace/install-local with installMode: 'managed' as the admin. That door hands data[] to the platform's seed loader, which writes under SEED_WRITE_EXECUTION_CONTEXT. So it is the route the reading named: only state_machine is skipped, and every other rule and hook still judges each row. Some details I checked:

  • One namespace per load (scenarioseeda, …b, …, letters only). The doc measures that a second package claiming a held namespace is refused with PLUGIN_REGISTER_FAILED. The counter is process-wide, which is safe because each half boots its own environment.
  • Only an inline load is a load. A door refusal, a missing managed door, or seeded.mode other than inline refuses every row with the reason in its message. So a harness that cannot seed shows up in the record and is never silently empty.
  • Ownership is unchanged for rows no persona owns. The loader writes as system with no user, and the install-local door's stampSeedOwner (marketplace-install-local-seed-owner.ts) then sets owner_id and created_by to the caller, the admin, and only where they are empty. So "those rows keep the inserter (the admin)" in seedApp's doc still holds, and a persona owner the body sets is kept (M3).

Condition 1, ids kept as lookup targets: met. The report's M1, measured before any code: 757 inserted, ids kept, and lookups resolve to the card ids. The re-run record agrees: seed: { inserted: 757, refused: [] }, with secondPass setting demotravel_department.manager ×4. The cycle pass still works after the load.

(2) Refusals with no code: a scorecard shape change I accept. seed.refused[] entries were already {object, id, code?, message?}, with code optional. Nothing in packages/qa/scenarios/src reads a seed refusal's code (I grepped every refused reader). seedDrift compares two loads that now both lack a code, so its comparison is still like for like. The loader's sentence carries the reason, and it names the record. The README says "the seed door names no error code", so a reader of an old record and a new one knows why the field is gone.

(3) Persona ids in the load, PATCH only for cycle lookups. The seat has ruled this A since the report, on the condition that the README and the PR body state it and why. I read the code as built. seedRowBody is unchanged, so owner_id, the persona user field and the handle rewrites ride in the body. The second pass still sets only plan.deferred. The README and body push gets a docs delta read.

(4) Condition 2, the trigger note: met. The README's Seed paragraph and the changeset both say seed rows fire no record-triggered flow. They name the four cards that ask for such flows and say each seeds the flow's values itself (a ticket's group, SLA policy and breach flag, a line's over-standard flag, the statuses). They also say an operation's own write still goes through the agent's door.

(5) Condition 3, the re-run: met. In /mnt/project-files/issue-34897/rerun-replay/, the ask mode on the kept template.json (dist b7ab31a715d4e83c) exited 0, with Seed 757/757. So 0 of the 114 root refusals remain, and the 470 cascaded rows are in. The Run scores in that record come from recorded turns of the old round, so they say nothing about this change, and the PR doesn't claim they do.

Tests and ablation. The double (seed-door.ts) writes each row through the harness's own insertRow, so a row the double's rules refuse is refused at the door too. TravelRulesApp carries the kept build's rules:

  • the user door refuses a paid claim;
  • the seed loads all 757;
  • a control trip breaking end_after_start takes its claim, 2 lines and 2 steps with it;
  • a restore re-inserts a removed paid claim;
  • a missing managed door refuses all 757 with a reason.

The ablation legs are each red on the half they revert: 4 of 5 for the seed loop, and the restore test alone for the restore.

Must-fix

None.

Should-fix

  • S1. The reference-entry branch of loadSeedRows is untested. The loader reports two kinds of errorList entry:

    • field: '(write)' for a row it could not write;
    • field: <lookup field> for a reference it dropped from a row it did write. That is pushError in seed-loader.ts around line 2252, and the row still lands (referencesDropped, framework#3932).

    The code handles both. A dropped reference counts the row as refused with fields, takes it out of inserted, and keeps its second-pass patch. A row with both kinds of entry is one refusal without fields. But the double only ever emits (write), so none of that runs in a test. On a real host it is not hypothetical. A child whose lookup names a row the load refused, with that lookup optional in the build, lands with the link dropped instead of being refused. It is then present in the database while the tally calls it refused. Please add one test where the door's answer carries a reference entry for a written row, and pin all of these:

    • (a) the refusal has fields: ['<field>'];
    • (b) inserted is one lower;
    • (c) the row's deferred patch still runs;
    • (d) a row with both a reference entry and a (write) entry counts once, without fields;
    • (e) in restoreSeededRows, such a row counts as reinserted.

Notes

  • N1. Each load installs a package: the seed, every restore round that re-inserts, and each fresh copy. So an ask run can leave several com.scenario.seed.* packages installed. They declare no app, object or navigation, only data[], so I expect the agent sees nothing new. Nothing measures what the MCP tools list after the seed, though. If a later round shows a "Scenario seed" entry in an agent's reading, this is where it came from.
  • N2. The re-run's one restore came through a fresh copy (restored: {freshCopy: [...]}), so the live path of restoreSeededRows step 2 through the door has only the double's test so far. The first ask round after landing will exercise it.
  • N3. The report's out-of-scope note: order_to_cash build 1 refused 66 payment rows on "may not exceed the invoice's open balance", and the seed loader's order and roll-up timing now decide that check. It is worth a look on the first round after landing, because a roll-up-dependent rule is exactly what the seed posture still runs.

Next: the README and body push for the seat's ruling A, and the S1 test, then an L1-c delta read. Then o3-G lands once the three aggregates are green. No seat L2 is owed: the seat already ruled route A, and the deviation is ruled too.

The seed door double can now drop a reference from a row it writes, as
the real loader reports one it could not resolve. One test pins the
refusal's fields, the tally, the deferred cycle patch, a row also refused
on write counting once, and a restore counting the written row back.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT (delta) · 2026-11-17T22:24Z

Head-sha: 1c5dbc3
Reviewer: seat 3 L1-c. This is a delta read of 81b6323e..1c5dbc3a against my 6962248251.

席位核对

Delta. Two commits on top of my ACCEPTed head, three paths, +71/-4. No src/ file moved.

  • 6a38c579 (README): the Seed paragraph now says the second pass sets only the deferred cycle lookups, and why. data[] carries a persona's user id as sent, and patching it again would put a user-door update, with its triggers and hooks, back on every seed row. That is the condition the seat set when it ruled the PATCH point A. The PR body states it too.
  • 1c5dbc3a (S1): the double seedDoorAnswer takes an optional drops. For each dropped reference it removes the field, writes the row without it, and adds an errorList entry with field set to that lookup and the loader's "Deferred reference unresolved" sentence. That matches the real loader's pushError shape (seed-loader.ts around line 2252). Doubles that pass no drops behave as before.

S1: closed. The new test covers each point I asked for:

  • (a) dep_ops, written without its parent, is refused with fields: ['parent'] and the loader's sentence;
  • (b) inserted is 755: 757, less dep_fin refused on write, less dep_ops counted refused;
  • (c) its deferred patch still runs: dep_ops.manager is e09 after the second pass, and secondPass counts 3 managers, because dep_fin is not there to patch;
  • (d) dep_fin has both a reference entry and a (write) entry, and it counts once, without fields;
  • (e) after dep_ops is removed, restoreSeededRows reports it in reinserted, with its manager set back.

The S1 ablation (unheld.set neutered) turns only this test red (756 vs 755), so the test reaches the branch it is meant to reach.

CI. The report says the first head's red on Lint · docs & code guards / Lint & Repo Gates was a 25-minute checkout timeout. On this head nothing has failed so far: 11 success, 18 skipped, 15 pending. This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

Must-fix

None.

Should-fix

None.

Notes

  • N1 to N3 of my first read stand as notes (the seed packages that build up, restore step 2 having no live run yet, and order_to_cash on the first round after landing). None is owed.

Next: o3-G lands once the three aggregates are green. No seat L2 is owed. A later push owes an L1-c delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT (merge-only hop) · 2026-11-17T23:44Z

Head-sha: b88c632
Reviewer: seat 3 L1-c. This is a merge-only read of 1c5dbc3a..b88c632b against my delta ACCEPT 6962781877.

席位核对

One merge commit. Its first parent is 1c5dbc3a, my ACCEPTed head, and its second is main at 44430146. The PR's diff from the old merge-base to 1c5dbc3a and the diff from 44430146 to b88c632b have the same patch-id (1c3f9029…). So the merge adds nothing to the PR's own change and resolved no conflict. The four scenarios paths main brought in sit outside the branch's seven files.

CI. This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

Must-fix

None.

Should-fix

None.

Notes

None.

Next: o3-G lands on green. No seat L2 is owed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH

Landing · 2026-11-18T00:08Z

Probe Reading
L1 L1-c ACCEPT 6962248251 at 81b6323e8 with S1 (the reference-entry branch is untested). Delta ACCEPT 6962781877 at 1c5dbc3a45 closes S1 and checks the README note for ruling A. Merge-only ACCEPT 6964373778 at b88c632b10cf415af60c1258ccc755562cf97a73 (the patch-id matches the delta's). No open must-fix or should-fix. N1 to N3 are notes, not owed.
L2 Not owed: Clause-②: no (L1-c).
Seat rulings Route A (claim amendment 6960622194), and the PATCH-pass deviation ruled A at 21:58Z (persona ids ride in the load; the second pass sets only the deferred cycle lookups; stated in the README and the PR body).
Conditions (1) Card ids stay lookup targets: measured before the code (M1). (2) The README and the changeset say seed rows no longer fire record-triggered flows; the census found no card relying on it. (3) The kept template.json replay gives 757 inserted and 0 refused (/mnt/project-files/issue-34897/rerun-replay/).
Governed check-governed-merges.mjs --pr 34985: NOT governed, 451 lines ≤ 3000 (the count includes the merge's diff against the old base).
CI at head 49 check runs: 33 success, 16 skipped, 0 failed.
K behind main Main merged at 4443014630 in b88c632b10; 10 first-parent commits on main since (< 15).
Overlap overlap-check.mjs: VERDICT clean exit 0.

Ready + auto-merge into the queue. Area o3-G (repo:objectstack#3) watches it to MERGED and closes out #34897.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 18, 2026 00:09
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 4df62e6 Nov 18, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34897-travel-expense-seed-refusals branch November 18, 2026 00:47
os-support-ai pushed a commit that referenced this pull request Nov 18, 2026
main's #34985 brought in loadSeedRows, which declared `mode: 'insert'` on
every card dataset. This PR retires that mode, and the install door refuses
a dataset declaring it, so no card seed (and no restore) would load. Drop
the mode so the default `ignore` loads them, make the test seed door judge
`mode` with SeedMode as the real door does, and pin that the seed and
restore packages carry no retired mode.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reading first: why author validation refused 584 of 757 seed rows on travel_expense

2 participants