Skip to content

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

Closed

Description

@objectstack-fleet

epic:#34659#1 · hotlong · session_01Q4EjjMnXJdSZifpEN5i7aU

Filing gate: ④ a child of the cross-lane parent #34659 (the 「MCP 二期与问数」 epic); the maintainer set who files this epic's cards, verbatim: 「你应该负责立卡,对方只是派发处理」. The gap was reported by the dispatching seat repo:objectstack#3 on #34659 (comment 6951773597), from area o3-F's five-repetition ask round on #34687; the filer did not re-read the records behind it.

Why

Three quarters of a card's sample rows being refused means its questions are asked over a different data set than the card's truth assumes, and the same cause will meet a customer's first build.

Evidence

  • Per the report: on travel_expense, author validation refused 584 of 757 seed rows.

Scope

  • Reading: which rule refused the rows, and whether the card's seed shape or the skill's seed guidance produced them. Post it on this card, before the next round.
  • Then the fix where the cause lives: the card's seed, or the seed teaching in skills/objectstack-data.

Done when

  • The reading is on the card and a build of travel_expense seeds every row the card's truth counts.

Relations

Activity

  1. added
    area:ai
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch (R1198, 15:5xZ): p2 · domain:server → pm:queue.

    Theme: MCP and epic #34659. This is a reading-first question: why did author validation refuse 584 of 757 seed rows? The card says the same cause will meet a customer's first build. Raise the card to p1 in the claim comment if the reading confirms that.

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

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 1 · 2026-11-17T20:34Z
    Session: session_01WGufzgNCAXyGfBQFZBwixH
    Account: os-support-ai
    Branch: claude/issue-34897-travel-expense-seed-refusals (only if the reading leads to a fix the seat routes here)
    Worktree: objectstack-issue-34897
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: reading first, no code. The reading is posted on this card. A fix is claimed separately (an amendment) once the seat rules where the cause lives: docs/qa/scenarios/travel_expense.json (the card's seed), skills/objectstack-data/** (seed teaching; Tier H), or the runner's seed path in packages/qa/scenarios/src/runner/**.
    Container & model: M, mode:subagent (area o3-G), model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate for a reading), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a until read — the card asks which rule refused the rows and whether the card's seed or the skill's seed guidance produced them
    Thread-read: 6953170279
    Premise: holds as a question (area read at origin/main: the scenario runner seeds run.seed into the authored app and records every refused row with its object, id, code and message, packages/qa/scenarios/src/runner/orchestrate.ts:1172-1207; the 584 of 757 figure is the seat's report on #34659, comment 6951773597, from area o3-F's ask round on #34687. The dev reads the round's recorded refusals and reproduces a build before concluding.)
    Serial constraints cleared: the daily ask rounds (#34869) read the same card; this reading changes no file
    Pre-claim lane: domain:server — epic #34659 child; routed to area o3-G by seat 3 (20:33Z)
    Pre-claim deps: parent #34659; related #34687, #34869
    Prior rulings read: reading,author,validation,refused,seed,rows,travel_expense → 216 hits; ADR-0071 §1, ADR-0155 D1, ADR-0055 §1, ADR-0119 D4, ADR-0144 D5, ADR-0145 D2 keyword-only; thread: triage 6953170279 only (raise to p1 if the reading confirms a customer's first build meets the same cause).

    Lease o3-G (seat post #34584); child of epic #34659. L1 for this epic is L1-c.

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

    @objectstack-fleet
    ContributorAuthor

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

    Reading · 2026-11-17T20:44Z

    Answer in one line. One authored rule refused 114 rows. The other 470 refused rows were children of those 114. The rule is sound and the card's seed is sound. The cause is the runner's seed path. It loads the card's rows through the ordinary data API, which applies the build's status state machine. The platform's own seed path skips that rule on purpose. A customer's first build does not meet this cause, so the card stays p2.

    1. Which rule refused the rows

    Source: the round's record /mnt/project-files/issue-34687/ask-round-2026-11-17/build/travel_expense/2026-11-17-scenario-travel_expense.json, field cardRun.modes[0].run.seed.refused (584 entries, inserted: 173). The Run half ran on dist b7ab31a715d4e83c. That dist is byte-identical to the template.json the ask, day1, five-rep and proof-managed runs replayed. Those five records show the same 173 inserted and 584 refused. So this is one build measured six times, not six builds.

    Object Card rows Refused Code Message Kind
    expense_claim 120 114 VALIDATION_FAILED This status change is not allowed; a paid claim cannot be changed. root
    claim_line 280 266 VALIDATION_FAILED Claim: no demotravel_expense_claim record has id "cNNN" cascade
    approval_step 204 204 VALIDATION_FAILED Claim: no demotravel_expense_claim record has id "cNNN" cascade
    department, employee, travel_standard, trip_request 153 0
    Total 757 584

    The refusing rule is the build's claim_status_flow on demotravel_expense_claim. It runs on insert and update:

    {"name":"claim_status_flow","type":"state_machine","field":"status","events":["insert","update"],
     "initialStates":["draft"],
     "transitions":{"draft":["submitted"],"submitted":["manager_approved","rejected"],"manager_approved":["finance_approved","rejected"],"finance_approved":["paid"],"rejected":["draft"],"paid":[]}}

    initialStates: ["draft"] means a claim can only be created as draft. The card's seed holds 120 claims: 75 paid, 12 rejected, 12 manager_approved, 12 submitted, 3 finance_approved and 6 draft. Every non-draft claim was refused, which is 114. The 6 draft claims (c099, c100, c109, c110, c119, c120) went in. For example, row expense_claim c001 is {"status":"paid","paid_on":"2026-07-13", ...}, and the insert check rejects it (rule-validator.ts:3964).

    2. Where the cause lives

    • (c) The runner's seed path: yes, this is the cause. seedApp sends each card row as app.insertRow (orchestrate.ts:1192). That call is POST /api/v1/data/OBJECT with the admin's session (app.ts:291), so it counts as an ordinary user write, and the engine applies the state machine to it (engine-insert.ts:1363). The platform's own seed writers do something different. AppPlugin replays a stack's data[] (app-plugin.ts:61), and SeedLoaderService and verify's seed() load seed rows. All of them write under SEED_WRITE_EXECUTION_CONTEXT (seedReplay: true, execution-context.zod.ts:829), which skips only the state_machine rule (engine-top-level.ts:4088). The contract says why: without the exemption, a declared initialStates "silently rejects every mid-lifecycle seed row (and cascades its master-detail children)" (execution-context.zod.ts:650-672). That is exactly what this round recorded. The card's rows are established facts, but the runner loads them through the door meant for new records. Neither the runner nor its README mentions state machines, initialStates or seedReplay (zero hits in packages/qa/scenarios/** and .claude/skills/scenario-eval/**). The README even states the door: "rows go in as the admin" (README.md:485). The restore path uses the same door too (orchestrate.ts:1383).
    • (b) The skill: it taught the rule, but the teaching is correct. skills/objectstack-data/SKILL.md:333 says a state_machine "also declares initialStates whenever the status has a real starting point — without it a record can be created already approved / paid". rules/validation.md:18 and :109 say the same. The author transcript (scratch.rec.json) reads that passage before it writes initialStates: ['draft']. The card prompt asks for it as well: "a payment cannot be undone". That is the right design for a real app, so the skill should not change.
    • (a) The card's seed: no contradiction. I replayed the build's own declarative rules over all 757 card rows, using evaluateValidationRules from packages/objectql at 0465f4aa40 with the build's template.json. With the state machine applied: 114 refused, all of them claim_status_flow. Every claim_line and approval_step row passes its own rules (over_standard_needs_reason, decided_on requiredWhen). Every paid claim carries paid_on, and every trip passes end_after_start. With skipStateMachine: true (the seed posture): 0 of 757 refused. This replay covers the rule layer only, not lookups, permissions or hooks.
    • (d) The platform: not a defect. Refusing a non-draft create through the data API is the documented behaviour. An administrator cannot opt out over HTTP either: treatAsHistorical is refused from every caller except the system principal (export.zod.ts:334). That is a design decision, not a bug.

    3. Root and cascade

    There are 114 root refusals, all on expense_claim from claim_status_flow. There are 470 cascaded refusals: 266 claim_line and 204 approval_step. Each one failed the lookup check because its parent claim was never inserted. Their own rules pass, as the replay above shows. No department, employee, trip or standard was refused. What the round lost: 8 question turns and 3 operations were not measured, and the guardrail injection_as_data was not measured either (its row as_013_1 is a cascaded step).

    4. Would a customer's first build meet it?

    No. The build is right to declare initialStates. A customer's demo or bootstrap data, declared as data[] or defineSeed, loads under seedReplay and skips the rule by design (#3433). Records a customer's users create start as draft, as they should. The one customer path that meets the same refusal is importing historical mid-lifecycle claims as a signed-in user. That is a separate, deliberate boundary (treatAsHistorical is system-only), not this defect. So I do not recommend raising the card to p1.

    5. The smallest fix and where it lives

    The fix belongs in the runner (packages/qa/scenarios/src/runner/**), not in the card and not in skills/**, so it is not Tier H. The runner should load run.seed the way the platform loads seed data, under the seed write posture. One route, to be confirmed when the fix is claimed: emit the card's rows as the booted stack's declared data[], so AppPlugin replays them with SEED_WRITE_EXECUTION_CONTEXT. Whether data[] keeps the card's own id values as lookup targets has not been checked yet. Then keep the runner's existing second pass only for what needs runtime ids: owner_id, the persona user field, the user-handle rewrites and the deferred cycle lookups. Those updates leave status unset, so the state machine never checks them (rules/validation.md:18: judged "only when the write sets the field"). Template and ask modes need the same rows carried with the install. restoreSeededRows (orchestrate.ts:1383) needs the same posture when it re-inserts a seeded row.

    A side effect: seed replay also skips record triggers. The runner's current inserts fire them. The card's truths are computed over the seed rows alone, so skipping triggers is closer to what the card measures. Still, the scorecard should report the change.

    I rejected two alternatives. Walking each row through the build's transitions fires flows on every step and depends on each build's own rules. Telling builds through the data contract (prompts.ts:430) not to declare initialStates would teach them to weaken the app.

    Evidence: /mnt/project-files/issue-34687/ask-round-2026-11-17/build/travel_expense/ (record, template.json, scratch.rec.json). The replay was a 30-line tsx script calling evaluateValidationRules(schema, row, 'insert', { skipStateMachine }) for each card row. It was not kept. No code, branch or PR came from this reading.

  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim amended · 2026-11-17T20:49Z (claim 6960228589; reading 6960505974). The seat ruled route A, so this card moves from reading to a fix under the same lease o3-G.

    Branch: claude/issue-34897-travel-expense-seed-refusals
    Worktree: objectstack-issue-34897
    File surface: the scenario runner's seed path, packages/qa/scenarios/src/runner/** (orchestrate.ts seedApp ~:1192 and restoreSeededRows ~:1383, app.ts) and its tests; packages/qa/scenarios/README.md (the seed door and the trigger note); the scorecard note where the runner records seed results; a changeset if the package takes one. Not skills/**, not docs/qa/scenarios/*.json, not packages/spec or packages/objectql.
    Route (seat-ruled A): the card's run.seed rows are loaded as the booted stack's declared data[], so they replay under the platform's seed posture (SEED_WRITE_EXECUTION_CONTEXT, seedReplay: true). The PATCH pass stays for runtime-id fields. restoreSeededRows takes the same posture.
    Conditions:

    1. First measure that data[] keeps the card's ids as lookup targets (a child's lookup to c001 resolves to the parent seeded as c001). If it doesn't, the dev stops and reports before building around it.
    2. The README or scorecard note says that seed inserts no longer fire record triggers, and names the cards, if any, that relied on it.
    3. The PR carries a re-run of the claim card showing 0 of 114 root refusals (and the 470 cascaded rows inserted).
      Container & model: M, mode:subagent, model: TIER_DEFAULT, effort: high
      Clause-②: no (test-runner tooling; no published accept set changes)
      Metadata-protocol: none
      L1 is L1-c (epic Decision: open-source MCP — the client thinks locally, the server keeps a thin door (a metadata draft write entry for building; the data door for 问数), plus policy, version skew and the 问数 eval #34659).
  8. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    os-dev-report

    {
     "issue": 34897,
     "status": "done",
     "branch": "claude/issue-34897-travel-expense-seed-refusals",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34985",
     "session": "session_01WGufzgNCAXyGfBQFZBwixH",
     "premise_still_valid": true,
     "summary": "Route A as ruled. The runner now hands the card's run.seed to the platform's own seed loader. The rows go in as a data-only package's data[] (externalId id, mode insert, one namespace per load), installed through the harness's existing installManaged door, so they are written under SEED_WRITE_EXECUTION_CONTEXT: the state_machine rule is skipped, while every other rule and every hook still runs. Refused rows are still recorded with object, id and the loader's message. The seed door names no code, so the code is absent. restoreSeededRows step 2 takes the same path. Condition 1 was measured before any code (M1: 757 inserted, ids kept, lookups resolve to the card ids; M2: the control is refused and the cascade reported; M3: persona user ids land as sent). Condition 2: the README and the changeset state that seed rows no longer fire record-triggered flows. The census of docs/qa/scenarios/*.json found no card that relies on it: truth is computed from the seed values, and the four record-triggered-flow cards (asset_lifecycle, requisition_to_receipt, service_desk, travel_expense) seed the flow-produced values explicitly. Condition 3: on the kept template.json (sha256 b7ab31a715d4e83c), the replay re-run gives seed inserted 757, refused 0, so 0 of 114 root refusals remain and all 470 cascaded rows are in. The record is at /mnt/project-files/issue-34897/rerun-replay/. One mechanism deviation: persona ids now ride in the load, and the PATCH pass is kept only for the deferred cycle lookups (see open_questions). No exported signature changed, so Clause-② is no.",
     "tests": "On head 81b6323e86, under the lock: pnpm --filter @objectstack/scenarios build, then test, then typecheck. Result: Test Files 39 passed (39), Tests 1091 passed (1091), typecheck clean, VERDICT command-exit 0. New block (5 tests, TravelRulesApp double of the kept build's rules): the user door refuses a paid claim; 757 load with 114 non-draft claims and line/step claim c001; a control trip breaking end_after_start is refused with the loader message and no code, its claim, 2 lines and 2 steps go with it, and 751 are inserted; restore re-inserts a removed paid claim; a missing managed door refuses all 757 with a reason. Ablation via scripts/ablation-replace.mjs on orchestrate.ts from HEAD blob a8c96bc92dd1. The tests import src by relative path, so no dist rebuild was involved. Leg 1, seed loop reverted to per-row data-API insert (blob to 1ff43a1b3708, anchor 1 to 0): 4 of 5 new tests red. Leg 2, restore reverted to data API (blob to 0aaa6d7a3034): only the restore test red, failing 'insert demotravel_expense_claim c001: This status change is not allowed; a paid claim cannot be changed.' After each leg the blob was restored equal to HEAD and git diff HEAD was empty.",
     "gates": "Derived list: node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands gives 67 families at 81b6323e86, the same list as the earlier head. --ran with exit codes: '67 derived, 65 run, 2 NOT-MEASURED, 0 UNRUN'. pnpm check:dispatcher-error-vocabulary exited 1 on the first head (an all(code) objlithelper in loadSeedRows); after the fix it exited 0 on the 81b6323e86 tree. NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, exit 3 (shallow clone lacks the commit it needs; the scan itself exited 0). NOT MEASURED: pnpm check:dual-build-cjs-loads, exit 3 PREREQUISITE NOT MET (no dist for other packages). check:nul-bytes exited 0. Every other derived family exited 0. overlap-check before each push: VERDICT clean exit 0. Commit hook check:commit-card-trailers is green. PR #34985 check-runs at report time: Governed Surface Queue Guard=success; Check Changeset, Check PR Size, every Lint lane, every Type Check lane and PR-body guards=in_progress; the opt-in lanes skipped.",
     "dogfood_battery": "n/a — no ! in the PR title and Clause-② is no (no narrowing arm)",
     "mcp_calls": "0",
     "api_writes": "4 — phase 1: POST issues/34897/comments via the post-stamped relay (comment 6960505974). Phase 2: POST /repos/objectstack-ai/objectstack/dispatches for pr_create; the relay run 44184829685 executed POST pulls (#34985, draft) plus the assignee leg (os-support-ai). POST /dispatches for this os-dev-report comment on #34897. git push is not REST.",
     "open_questions": [
      {
       "question": "The ruling said to keep the PATCH pass for runtime-id fields. M3 measured that data[] carries runtime user ids (owner_id, user fields) as sent, so persona ids ride in the load and the PATCH pass only sets the deferred cycle lookups it set before. Keep it that way?",
       "options": [
        "A: keep it as built. Persona ids in the load, PATCH only for cycle lookups, no update trigger or hook fires on persona-owned rows.",
        "B: PATCH runtime-id fields after the load as ruled. Each persona-owned row then takes a user-door update that fires update triggers and hooks the seed posture is meant to avoid."
       ],
       "recommendation": "A, because the ruling's premise (data[] cannot carry runtime ids) was measured false, and B reintroduces user-write side effects on seed rows."
      },
      {
       "question": "os-dev.md forbids HTML comments in dev-authored GitHub text, but the coordinator order and dispatch.mjs PR_BODY_TRAILER_SHAPE require the signed trailer as an HTML comment on the PR body's last line. Which wins?",
       "options": [
        "A: exempt the signed trailer in os-dev.md next to the harness attribution exemption.",
        "B: drop the trailer from dev-created PR bodies and let the seat add it on its first rewrite."
       ],
       "recommendation": "A, because the repo tooling already parses the trailer and the read-back shows the sanitizer kept it."
      },
      {
       "question": "os-dev.md places Fixes #n right after the attribution line, while the coordinator order put the Requested-by line between them. I followed the coordinator. Should os-dev.md name the Requested-by line?",
       "options": [
        "A: amend os-dev.md to allow the Requested-by line between the attribution and Fixes.",
        "B: move Requested-by below Fixes in future orders."
       ],
       "recommendation": "A, because the closing keyword parses anywhere in the body and the order is the coordinator's standing format."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "class: none of a/b/c proven · reach: not measured · order_to_cash scratch build 1 in the 2026-11-17 round refused 66 demoorder_payment seed rows with 'A payment may not exceed the invoice's open balance.' (build b2 refused 0). Under the new seed path the rows may land in a different order or with different rollup timing. Not reproduced. · dedupe words: order_to_cash, payment, open balance, seed refused, rollup",
      "carrier: none · noted, not filed — the build-authored claim_status_flow message ('a paid claim cannot be changed') was shown for an insert refusal of a non-draft claim. It is build wording, moot now that seed rows skip the state machine."
     ],
     "deviations": "The harness attribution reminder asked for a model-named Co-Authored-By trailer and an emoji footer. I followed the coordinator's exact model-free trailers and the os-dev footer shape. post-stamped.mjs for this comment ran from the shared checkout's scripts/pm (byte-identical to origin/main; executed, not edited) because the worktree had already been removed. Worktree cleanup: every node_modules removed, git worktree remove without --force exited 0."
    }
  9. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Delivered · 2026-11-18T00:48Z

    PR #34985 merged to main at 4df62e6e0d and closed this card (Fixes). The scenario runner now loads a card's run.seed rows as a data-only package's declared data[] through the harness's managed install door. That means they are written under the platform's seed posture (SEED_WRITE_EXECUTION_CONTEXT): a build's state_machine initialStates no longer refuses mid-lifecycle seed rows, while every other rule and hook still judges each row. restoreSeededRows takes the same path. Persona user ids ride in the load, and the second pass sets only the deferred cycle lookups (seat ruling A, 21:58Z). Refused rows are still recorded, now with the loader's sentence and no code.

    Seat conditions:

    1. The card ids stay lookup targets.
    2. The README and the changeset say seed rows no longer fire record-triggered flows, and no card relied on it.
    3. The kept travel_expense build replays with 757 inserted and 0 refused, so 0 of the 114 root refusals remain and the 470 cascaded rows go in (/mnt/project-files/issue-34897/rerun-replay/).

    Reviews: L1-c ACCEPT 6962248251, delta ACCEPT 6962781877, and merge-only ACCEPT 6964373778. pm:dispatched and lease:o3-G removed in this stroke.

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

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions