Repository navigation
feat(scenarios): every Build check traces to the build prompt - #31185
Conversation
The runner's data contract now states, by name, every expect row the exact-name scorer checks beyond the seed: lookup targets, option fields with their minimum option counts, dashboards and app navigation targets, plus the two-option floor of the select-options tag. The iterate prompts state the change's own rows the same way. The five cards that seed approval history as rows model approvals as data: their prose says so and asks for no approval process, and they carry no approvals.* tag. The cards carrying the inline-edit tag say the lines are edited inline on their master. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5n81cbmj4ZjYYxQQAs
📓 Docs Drift Check9 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin fe105207ea3e09f97cac970f09b71946d111299c && git checkout fe105207ea3e09f97cac970f09b71946d111299c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 13c6d8ff8057b1922d1e04455651c7a8b0c705cf 115474c90f517f8de7ccdd68e87416d4fa2a087b && git checkout -B drift-repro 13c6d8ff8057b1922d1e04455651c7a8b0c705cf && git merge --no-ff 115474c90f517f8de7ccdd68e87416d4fa2a087b
node scripts/docs-audit/affected-docs.mjs --json 13c6d8ff8057b1922d1e04455651c7a8b0c705cf |
|
domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7 席位核对Verdict: ACCEPT · head
Generated by Claude Code |
Requested by Leehom · project thread
Fixes #31144
Clause-②: no
Metadata-protocol: none
维护者速读
approvals.*标签并在描述里说清楚;带行内编辑标签的卡片在描述里写明明细在主表单上内联编辑。@objectstack/scenarios与docs/qa/scenarios卡片,不发布;回滚即 revert 本 PR。代价是开放卡库暂时没有一张卡考察平台审批引擎(三条审批标签行保留在表里)。packages/qa/scenarios/src/runner/prompts.ts(structureLines/changeContract)、packages/qa/scenarios/test/runner/prompt-trace.test.ts、docs/qa/scenarios/order_to_cash.json的描述与标签。pnpm --filter @objectstack/scenarios exec vitest run test/runner/prompt-trace.test.ts,预期 40 个用例全绿。What changes
The rule. Every Build check traces to text the build prompt carries; otherwise a faithful build fails for not guessing a name.
dataContract(packages/qa/scenarios/src/runner/prompts.ts) gains aStructure:block, rendered by the newstructureLines, that names everyexpectrow the exact-name scorer (scoreGraph) checks beyond the seed: each lookup's target, each single-choice field with its minimum option count, each dashboard, and each app navigation target. Why this route and not "check by function":scoreGraphShape) is reported, not counted. Every otherexpectrow already traces by name (objects and fields through the seed, persona sets asNAMESPACE_PERSONA); dashboards and nav targets were the only rows that did not.dashboards.reportanddashboards.widget-measurestag rows judge a report or widget over an object the card names. A functionalexpect.dashboardswould duplicate them and change the card schema, the loader's gallery floor,appNavTargetsresolution, the iterate delta and the screenshot exporter (export/screenshots.tspicks the card's dashboard by name).8ef4d309: six cards pin a dashboard and its nav entry, not three.requisition_to_receiptpinspurchasing_spend_by_departmentandservice_deskpinssupport_performance, besides the three the card names. The rule applies to all six.expect.selectFieldsrow is stated as a single-choice field with its count, for example`demopurchase_supplier.category` (4). On a card carryingrecords-forms.select-options, one more line states that tag's check: every other single-choice field the build declares offers two options or more. That is the check behind theasset_category.depreciation_methodfailure: it is the tag rowselect:asset_category.depreciation_method->options>=2, not anexpectrow. Every row is kept: in five rows the minimum is above what the seed shows (leave_day.portion3/2,invoice.status4/3,invoice.aging_bucket5/4,purchase_order.status4/3,escalation_rule.priority4/3), and the prose names each extra option (afternoon, written off, over 90, cancelled, low).asset_lifecycle,leave_balances,order_to_cash,requisition_to_receiptandtravel_expense:approvals.approval-flow,approvals.multi-step-approvalandapprovals.dynamic-approver-routingcome off the cards.master-detail-inline-edit: it is stated in the prompt. The prose of every card carrying the tag now says the lines are details of their master, edited inline on its form:order_to_cash,leave_balances,requisition_to_receiptandtravel_expense, plus the control cardinvoice_with_line_items(one clause).project_with_tasksalready said it.iteratePromptandtemplateIteratePromptnow appendchangeContract. The iterate re-score checkediterate.expectDeltanames that the iterate prompt never stated (demoorder_credit_note,demoasset_asset_transfer.to_department, …). The prompts now state the new objects (with the card's field minimum) and the delta's lookups and option fields. The fix meets all four in-place conditions: the same defect class, the renderer from item 1,prompts.tsheld by this claim, and the same gate family.docs/qa/scenarios/README.mdgains "Build checks trace to the prompt" (names, tags, approvals).Why
The first complete mid-tier run (cloud#3600, main
5f003744) lost Build points on checks the build was never told about: dashboard names, option counts, an approval engine the cards' own data never runs through, and inline edit.Tests
packages/qa/scenarios/test/runner/prompt-trace.test.ts(40 tests). It reads the exact-name checks off the scorer itself, asscoreGraphover an empty graph, and requires each to name text in the build prompt (or in both iterate prompts, for the delta's checks) for all 9 cards. A check kind the contract does not know is reported as untraced. It also pins the two-option floor line where the tag is carried, the inline-edit clause in each language of a tagged card, and that a card seeding a decision date (decided_on/approved_on) carries noapprovals.*tag and asks for no approval process.test/score/scenario-tags.test.ts: the library pin "each row is declared by a card" now exempts the two approval-engine rows, which no open card declares, and says why. The rows stay in the table.scripts/ablation-replace.mjs. Each mutation landed on disk, was restored, and the blob equals HEAD (4dee8b93ba84,git diff HEADempty):Structure:block emptied, the suite read 18 failed of 40 (the build trace for 9 cards and the select floor for 9).changeContract's structure rows emptied, it read 18 failed of 40 (the iterate trace and the floor).Acceptance notes
Item 3: the per-card approval reading
disposal_request.approver,decided_on,statusdr_0005_waiting_onmanager_approves_scrap,employee_approves_own_scrapupdate the requestemployeerow, not a userapproval_step(141 rows)lr_0105_waiting_on,pending_by_approvermanager_approves_step_oneupdates an approval stepsales_order.approver,approved_on,statusso_0120_waiting_onapprove_discount,rep_approves_own_discountupdate the orderemployeelookup, which an engine approver cannot route toapproval_step(184 rows)pr_0111_waiting_onmanager_approves_level_one,manager_approves_finance_levelupdate an approval stepapproval_step(204 rows)ec_0093_waiting_onmanager_approves_step_one,employee_approves_own_claimupdate an approval stepEach card's
agentActionsalso decide approvals on the data object:decide_approval_step,decide_scrap_request,decide_discount_approval.CAPABILITY_TAG_CHECKS, judged and tested, for a card written for the engine: approvers as users, no seeded engine history, and approving through the engine's decide door. Writing such a card is outside this card.invoice_with_line_itemsnow differs from its corpus case. Its prose gains ", inline on its form". The golden case inpackages/cli/src/lint/corpus.tskeeps its wording: the card'sprovenancederives onlyexpectfrom it, andscenario-cards.test.tspins only that.select:…>=Noptsspelling is real forexpectrows. The fourth example the card gives is the tag row's spellingselect:OBJECT.FIELD->options>=2.owner_idand seed logic (Scenario cards: declare which scope fields hold a person handle, and drop only the turns a refused seed row actually feeds #30914 / Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913), and Scenario runner: tell the persona agent the card's date, grade app-defined validation codes, probe permission oversteps, fix scope-figure false positives and an over-strict persona truth #31145's run-grading items.Verification
115474c9, base8ef4d309.pnpm --filter @objectstack/scenarios test: Test Files 24/24, Tests 495/495 on head115474c9(afterpnpm --filter '@objectstack/scenarios^...' buildand the package build).pnpm --filter @objectstack/scenarios typecheck(tsc --noEmit, itsincludecoverstest/**): exit 0.node --stack-size=4000 node_modules/eslint/bin/eslint.js packages/qa/scenarios --no-inline-config(the rootpnpm lintcommand, scoped; the package has no lint script, and the cards are JSON, which the config does not lint): exit 0.Derived gates (dispatch-gates --commands on head, 52 commands)
dispatch-gates --ran: 52 derived, 51 run, 1 NOT MEASURED (check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET: it needs every package'sdist/), 0 unrun.check-plugin-teardown-shape.mjs --self-testfirst answered exit 3 on the shallow clone; aftergit fetch --depth=1 origin 621a4876…it answered exit 0 (48 cases).The rendered structure block, order_to_cash
Human Minimum
packages/specholds no runtime logic. (untouched)pnpm lintpasses (scoped to the touched paths; the repo-wide run is CI's).main, one pull request.@objectstack/scenariosisprivate),skip-changeset.packages/spectouched: no.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code