Skip to content

feat(scenarios): every Build check traces to the build prompt - #31185

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-rfhqc9
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-rfhqc9

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #31144

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:场景跑测的建造提示词现在按名写明 Build 半场逐条检查的结构(查找字段指向、单选字段最少选项数、仪表盘名、应用导航目标),迭代提示词同样写明新增对象与字段;五张把审批历史当普通数据种入的卡片改为“审批即数据”,去掉 approvals.* 标签并在描述里说清楚;带行内编辑标签的卡片在描述里写明明细在主表单上内联编辑。
  • 为什么改:首次完整中档跑测里,忠实按描述建造的应用因为猜不中仪表盘名、选项个数、审批引擎而丢分;原则是每条 Build 检查都必须能在提示词里找到出处。
  • 风险与回滚:只动私有包 @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.

  1. Item 1, dashboard / report names: the route chosen is "state each name in the data contract". dataContract (packages/qa/scenarios/src/runner/prompts.ts) gains a Structure: block, rendered by the new structureLines, that names every expect row 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":
    • The counted Build score is the exact-name scorer; the name-agnostic one (scoreGraphShape) is reported, not counted. Every other expect row already traces by name (objects and fields through the seed, persona sets as NAMESPACE_PERSONA); dashboards and nav targets were the only rows that did not.
    • "By function" already exists where it belongs: the dashboards.report and dashboards.widget-measures tag rows judge a report or widget over an object the card names. A functional expect.dashboards would duplicate them and change the card schema, the loader's gallery floor, appNavTargets resolution, the iterate delta and the screenshot exporter (export/screenshots.ts picks the card's dashboard by name).
    • The cost is that a card prescribes the name. The naming rule already prescribes the prefix of every item, and the run showed builds follow contract names verbatim (every persona set was built by its contract name).
    • Measured on main 8ef4d309: six cards pin a dashboard and its nav entry, not three. requisition_to_receipt pins purchasing_spend_by_department and service_desk pins support_performance, besides the three the card names. The rule applies to all six.
  2. Item 2, option minimums: the route chosen is "state the minimum in the contract". Each expect.selectFields row is stated as a single-choice field with its count, for example `demopurchase_supplier.category` (4). On a card carrying records-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 the asset_category.depreciation_method failure: it is the tag row select:asset_category.depreciation_method->options>=2, not an expect row. Every row is kept: in five rows the minimum is above what the seed shows (leave_day.portion 3/2, invoice.status 4/3, invoice.aging_bucket 5/4, purchase_order.status 4/3, escalation_rule.priority 4/3), and the prose names each extra option (afternoon, written off, over 90, cancelled, low).
  3. Item 3, approval tags: all five cards model approvals as data. I decided each card separately; the table is in Acceptance notes. The card's stop condition does not apply, because modelling approvals as data keeps every approval-history question answerable. For asset_lifecycle, leave_balances, order_to_cash, requisition_to_receipt and travel_expense:
    • Tags: approvals.approval-flow, approvals.multi-step-approval and approvals.dynamic-approver-routing come off the cards.
    • Prose (zh and en): says where each decision is recorded (an approval step record, or the approver and decision date on the request) and that deciding updates that record. It no longer lists "an approval process" among the preferred declarative tools.
    • Seed: unchanged. It already modelled approvals this way.
  4. Item 4, 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_receipt and travel_expense, plus the control card invoice_with_line_items (one clause). project_with_tasks already said it.
  5. Bounded in-place fix in the same class: the iterate prompts. iteratePrompt and templateIteratePrompt now append changeContract. The iterate re-score checked iterate.expectDelta names 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.ts held by this claim, and the same gate family.
  6. Docs:
    • docs/qa/scenarios/README.md gains "Build checks trace to the prompt" (names, tags, approvals).
    • The package README gains a "Structure contract" bullet.

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

  • New packages/qa/scenarios/test/runner/prompt-trace.test.ts (40 tests). It reads the exact-name checks off the scorer itself, as scoreGraph over 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 no approvals.* 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.
  • Ablations, run through scripts/ablation-replace.mjs. Each mutation landed on disk, was restored, and the blob equals HEAD (4dee8b93ba84, git diff HEAD empty):
    • With the Structure: block emptied, the suite read 18 failed of 40 (the build trace for 9 cards and the select floor for 9).
    • With 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
Card Approval history in the seed 问数 reading it Operations grading approval Under the engine route Decision
asset_lifecycle disposal_request.approver, decided_on, status dr_0005_waiting_on manager_approves_scrap, employee_approves_own_scrap update the request the waiting-on question loses its rows; the approver is an employee row, not a user data
leave_balances approval_step (141 rows) lr_0105_waiting_on, pending_by_approver manager_approves_step_one updates an approval step the approval step object leaves the seed, with two questions and two persona scopes data
order_to_cash sales_order.approver, approved_on, status so_0120_waiting_on approve_discount, rep_approves_own_discount update the order the approver is an employee lookup, which an engine approver cannot route to data
requisition_to_receipt approval_step (184 rows) pr_0111_waiting_on manager_approves_level_one, manager_approves_finance_level update an approval step the same as leave_balances data
travel_expense approval_step (204 rows) ec_0093_waiting_on manager_approves_step_one, employee_approves_own_claim update an approval step the same as leave_balances data

Each card's agentActions also decide approvals on the data object: decide_approval_step, decide_scrap_request, decide_discount_approval.

Verification

  • Head 115474c9, base 8ef4d309.
  • pnpm --filter @objectstack/scenarios test: Test Files 24/24, Tests 495/495 on head 115474c9 (after pnpm --filter '@objectstack/scenarios^...' build and the package build).
  • pnpm --filter @objectstack/scenarios typecheck (tsc --noEmit, its include covers test/**): exit 0.
  • node --stack-size=4000 node_modules/eslint/bin/eslint.js packages/qa/scenarios --no-inline-config (the root pnpm lint command, scoped; the package has no lint script, and the cards are JSON, which the config does not lint): exit 0.
  • Not measured:
    • A recorded-driver replay. No recording is in this container, and the recorded driver replays turns by card, mode and phase, not by prompt.
    • A live model run. Live runs are paused by the maintainer.
Derived gates (dispatch-gates --commands on head, 52 commands)
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: 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-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: 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/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:engine-double-contract :: 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:objectql-double-limit :: 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: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 :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
  • dispatch-gates --ran: 52 derived, 51 run, 1 NOT MEASURED (check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET: it needs every package's dist/), 0 unrun.
  • check-plugin-teardown-shape.mjs --self-test first answered exit 3 on the shallow clone; after git fetch --depth=1 origin 621a4876… it answered exit 0 (48 cases).
  • Every CI-run family is read from this PR's check-runs.
The rendered structure block, order_to_cash
Structure: besides the objects and fields above, the build is checked for these, by the exact names shown:
- Lookups, each referencing the object shown: `demoorder_employee.manager` → `demoorder_employee`, `demoorder_account.owner` → `demoorder_employee`, `demoorder_sales_order.account` → `demoorder_account`, `demoorder_sales_order.owner` → `demoorder_employee`, `demoorder_sales_order.approver` → `demoorder_employee`, `demoorder_order_line.order` → `demoorder_sales_order`, `demoorder_order_line.product` → `demoorder_product`, `demoorder_invoice.order` → `demoorder_sales_order`, `demoorder_invoice.account` → `demoorder_account`, `demoorder_payment.invoice` → `demoorder_invoice`, `demoorder_activity.account` → `demoorder_account`, `demoorder_activity.invoice` → `demoorder_invoice`, `demoorder_activity.owner` → `demoorder_employee`.
- Single-choice (select) fields, each offering at least the number of options shown: `demoorder_employee.role` (4), `demoorder_employee.team` (3), `demoorder_account.payment_terms` (2), `demoorder_product.category` (3), `demoorder_sales_order.status` (5), `demoorder_invoice.status` (4), `demoorder_invoice.aging_bucket` (5), `demoorder_payment.method` (3), `demoorder_activity.type` (4).
- Every other single-choice field you declare offers at least two options: a field with one option is no choice.
- Dashboards, each a dashboard named exactly: `demoorder_receivables_aging_report`. A report the description asks for may be shown on one; it does not stand in for it.
- The app's navigation has an entry for each of: `demoorder_account`, `demoorder_sales_order`, `demoorder_invoice`, `demoorder_payment`, `demoorder_activity`, `demoorder_receivables_aging_report`.


---ITERATE---
 Add credit notes for returns and allowances: a credit note is issued against an invoice and reduces its balance.

The change is checked for these, by the exact names shown:
- New objects, named exactly: `demoorder_credit_note`, each with at least 4 fields.
- Lookups, each referencing the object shown: `demoorder_credit_note.invoice` → `demoorder_invoice`, `demoorder_credit_note.account` → `demoorder_account`.
- Every single-choice field you declare offers at least two options: a field with one option is no choice.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (untouched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (scoped to the touched paths; the repo-wide run is CI's).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset: this one does not publish (@objectstack/scenarios is private), skip-changeset.
  • 6. packages/spec touched: no.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the lane's Chinese summary).

Generated by Claude Code

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
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 7, 2026
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

9 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 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.

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
  • the SDK route bridge reached 63 of 226 client-bound route-ledger rows — the other 163 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 163: 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; 104 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 — 0 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 13c6d8ff8057b1922d1e04455651c7a8b0c705cf → packageMentionDocs.

Which tree this was computed on

This run read content/docs from fe105207ea3e09f97cac970f09b71946d111299c — the merge of head 115474c90f517f8de7ccdd68e87416d4fa2a087b into base 13c6d8ff8057b1922d1e04455651c7a8b0c705cf, 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 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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7

席位核对

Verdict: ACCEPT · head 115474c90f517f8de7ccdd68e87416d4fa2a087b · card #31144 · report 6709866486.

  • Shape: draft → main, Fixes #31144 on the body's first content line and no other open card number beside a closing keyword; 11 files, +255/-25, all inside the claim's file surface (claim 6709176988): docs/qa/scenarios/*.json (6 cards), docs/qa/scenarios/README.md, packages/qa/scenarios/{README.md, src/runner/prompts.ts, test/runner/prompt-trace.test.ts, test/score/scenario-tags.test.ts}.
  • Premise: held; the dev disproved one PM hypothesis (requisition_to_receipt and service_desk pin a dashboard too) and applied the rule to all six cards that pin one.
  • Rulings applied (read in the diff): item 1 route = names stated in the contract (structureLines renders lookups, select minimums, dashboards and nav targets into dataContract; changeContract does the same for iterate prompts, a same-class bounded fix declared in the PR); item 2 = minimums stated; item 3 = all five approval cards model approvals as data, approvals.* tags removed, prose says where each decision is recorded; the card's stop condition did not trigger (reason stated: the engine route would lose every waiting-on question); item 4 = inline edit stated in the prose.
  • Gates (check-runs on this head): 35 success, 18 skipped, 0 failed, 0 pending; Lint & Repo Gates, TypeScript Type Check and all eight Test Core shards success. Local: scenarios suite 495/495, two ablations red then restored.
  • Changeset: @objectstack/scenarios is private: true; cards and docs ship in no package, so skip-changeset is correct.
  • Clause-②: no (no packages/spec/src/** path, private package); check-governed-merges --pr 31185: NOT governed, 280 changed lines ≤ 3000. No contract review owed.
  • Accepted deviations: check:dual-build-cjs-loads NOT MEASURED locally (exit 3, needs every dist); CI covers the package.
  • Out of scope: (1) after this PR no open card declares the three approvals.* tag rows (they stay judged and tested in CAPABILITY_TAG_CHECKS): Acceptance notes; whether the library gains an engine-approval card is a library-scope call, reported to the maintainer. (2) invoice_with_line_items prose now differs by one clause from its packages/cli/src/lint/corpus.ts golden case; only expect derives from the corpus: Acceptance notes.
  • Landing: not governed; queue landing would follow under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z). The seat's relay landing call (pr_ready + automerge_enable through scripts/pm/fleet-write/dispatch.mjs) was refused by this session's permission classifier ("Merge Without Review"). Per landing-operations the seat stops and asks the maintainer; the PR stays draft until then.

Generated by Claude Code

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 skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

1 participant