Skip to content

fix(qa): travel_expense verified build declares initialStates so install-local accepts it - #36560

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-dh8y3u
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-dh8y3u

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36534

Clause-②: no

维护者速读

  • 用户无感:只改了内部评测用的差旅报销样例应用,修好后它又能在最新代码上装上。
  • 为问数日常评测解决:差旅报销这张场景卡的样例应用被新的发布检查拦下,评测轮次装不上。
  • 出错的影响只在评测:样例里的三个状态流转从此要求新记录从“草稿/待审批”起步,可直接撤回。
  • 无

What changes

Which side was wrong: the fixture. The rule is the declared, ruled contract, not an undeclared narrowing:

  • The spec's own description of initialStates (packages/spec/src/data/validation.zod.ts:197) says the author-time rule state-machine-no-initial-states refuses an active machine without it at publish when its events include insert.
  • The rule landed as a declared narrowing: changeset .changeset/34776-publish-checks-build-probes.md (Clause-②: no (narrowing …), Metadata-protocol: narrowed, ADR-0087 registered as publish-refuses-metadata-the-runtime-ignores), with the upgrade-guide entry packages/spec/src/migrations/entries/semantic/18.publish-refuses-metadata-the-runtime-ignores.ts; its card (lint: six publish-time checks for metadata that passes the schema and does nothing at run time #34776) carries the maintainer's ruling E1 = A, enforce first. .changeset/35251-state-machine-update-only.md later exempted update-only machines.
  • The fixture was built on 2026-11-18 against published 18.6.0, before the rule shipped, and its three machines all run on insert (events: ["insert", "update"]).

So no Clause-② stop: the fixture is fixed, the rule is untouched.

The fix. docs/qa/scenarios/builds/travel_expense.json gains initialStates on each of its three active state_machine validations, each the state its field defaults to and the build's own create paths write:

object machine initialStates why that state
demotravel_approval_step step_decision ["pending"] field default pending; the flow's open_finance_step creates the step with decision: "pending"
demotravel_expense_claim claim_lifecycle ["draft"] field default draft; the demotravel_file_expense_claim action inserts status: 'draft'
demotravel_trip_request trip_lifecycle ["draft"] field default draft

Nothing else in the file changed (a parse of the new file with the three keys removed equals the old file). The card names two machines; the third, trip_lifecycle, is the same shape and the publish gate refuses it too (see Tests).

travel_expense.provenance.json gets the new sha256 and an amended entry with the replaced sha256, what changed and why; the README section Verified builds says a build may be hand-amended when the platform starts refusing it, and that the provenance records it.

Docs fold-in (seat ruling on L1: a bug fix carries its docs). Two pages still described an omitted initialStates as the legacy no-check-on-insert choice. Each now says what main does, quoting the rule's own explanation (packages/lint/src/rule-explanations.ts, STATE_MACHINE_NO_INITIAL_STATES_EXPLANATION): an active machine that runs on insert with no or an empty initialStates is refused at publish and by os validate; only a machine whose events leave out insert may omit it. The rest of each paragraph is unchanged.

  • content/docs/protocol/objectql/state-machine.mdx: the initialStates table row, and the On insert bullet of Enforcement semantics (its runtime description kept; one sentence appended saying which machines it still reaches).
  • content/docs/data-modeling/validation.mdx: the initialStates table row.

File surface: docs/qa/scenarios/builds/travel_expense.json, docs/qa/scenarios/builds/travel_expense.provenance.json, docs/qa/scenarios/README.md, content/docs/** (these two pages only).

Other committed scenario builds: docs/qa/scenarios/builds/ holds only travel_expense.json (plus its provenance), so there is no other build to check.

Tests

Publish gate over every item of the build, before and after (runRuntimeAuthoringRules, built lint dist, stack context = the build's objects/permissions/datasets/flows)
before.json items judged: 31 errors: 3
   object:demotravel_approval_step state-machine-no-initial-states objects.demotravel_approval_step.validations[0]
   object:demotravel_expense_claim state-machine-no-initial-states objects.demotravel_expense_claim.validations[0]
   object:demotravel_trip_request state-machine-no-initial-states objects.demotravel_trip_request.validations[1]
travel_expense.json items judged: 31 errors: 0
The card's own re-check: a real host (dogfood showcase boot + MarketplaceInstallLocalPlugin), POST install-local unmanaged, body shaped as the scenario runner's installableManifest

One-off scratch test, run once under the verify lock and removed (never committed); dogfood closure built at d463c46 tree.

PROBE BEFORE (origin/main bytes) status 422 code INVALID_METADATA state-machine-no-initial-states mentions 1
PROBE body {"success":false,"error":{"code":"INVALID_METADATA","message":"The unmanaged install of 'com.example.demotravel' was rolled back: object 'demotravel_approval_step' could not be written — object/demotravel_approval_step failed author-time validation: 1 issue — objects.demotravel_approval_step.validations[0] [state-machine-no-initial-states]. …","details":{"failedItem":{"type":"object","name":"demotravel_approval_step"},"copiedBeforeFailure":0,"rolledBack":true}}}
PROBE AFTER (this PR) status 200 code - state-machine-no-initial-states mentions 0
 Test Files  1 passed (1)
      Tests  2 passed (2)
os-verify-lock: VERDICT command-exit 0
Derived gate families, local, at 7416619

node scripts/pm/dispatch-gates.mjs --commands derived 45 commands for the 5 paths (merge base ad50d61); each ran with its exit code captured before any pipe:

EXIT=0 :: node scripts/check-adr-links.mjs :: ✅ check-adr-links: 1166 relative link destination(s) under docs/adr/ resolve
EXIT=0 :: node scripts/check-adr-links.mjs --self-test :: ✅ check-adr-links --self-test: discrimination, census, ADR-0046 pin and baseline staleness all verified
EXIT=0 :: node scripts/check-closing-keyword-parity.mjs ::   • ui/packages/types/CHANGELOG.md -- 2228711 bytes exceeds the sweep's 2097152-byte cutoff for UNREGISTERED f
EXIT=0 :: node scripts/check-closing-keyword-parity.mjs --self-test :: ✓ check-closing-keyword-parity --self-test: 40 assertions, 5 mutations of the shipped parsers each driven to r
EXIT=0 :: node scripts/check-comment-mask-corpus.mjs :: ✓ comment-mask corpus sweep [scripts/js-comment-mask.mjs]: 23545 files, 0 disagree, 0 unparseable, 190.5s (com
EXIT=0 :: node scripts/check-doc-route-spelling.mjs --advisory :: ✓ route-spelling guard (advisory): population clean — every shape-matched literal spells its ledger row.
EXIT=0 :: node scripts/check-doc-route-spelling.mjs --self-test :: ✓ check-doc-route-spelling self-test: extraction tidy-up, the variant relation (plural + pinned lexicon, no pr
EXIT=0 :: node scripts/check-docs-section-name.mjs ::      so it is carried by --self-test rather than by this corpus.
EXIT=0 :: node scripts/check-docs-section-name.mjs --self-test :: ✓ check-docs-section-name self-test: 85 cases pass (real temp trees on disk; both historical misses reproduced
EXIT=0 :: node scripts/check-section-landing-index.mjs :: ✓ check-section-landing-index: 9 section index block(s) enumerate their meta.json pages, in order, both direct
EXIT=0 :: node scripts/check-section-landing-index.mjs --self-test :: ✓ check-section-landing-index --self-test: 31 assertions over synthetic inputs and a temp fixture (real judge(
EXIT=0 :: node scripts/ci/plan-test-core-shards.mjs --self-test :: ✓ plan-test-core-shards self-test: 23 case(s) across 5 batteries.
EXIT=0 :: pnpm --filter @objectstack/lint run check:doc-formula-expressions ::   #11673).
EXIT=0 :: pnpm --filter @objectstack/lint run check:doc-security-posture :: ✅ 41 ObjectSchema.create example(s) in 330 marked block(s) across 335 prose file(s) in 2 root(s) carry an os v
EXIT=0 :: pnpm --filter @objectstack/spec run check:docs :: ✅ 249 generated files in sync with packages/spec
EXIT=0 :: pnpm --filter @objectstack/spec run check:empty-state :: ✓ all classified (2 closed, 1 open, 4 output, 15 scope)
EXIT=0 :: pnpm --filter @objectstack/spec run check:liveness ::   (not a completeness claim about the 499 child key(s) under the declared blanket verdicts above — those are r
EXIT=0 :: pnpm --filter @objectstack/spec run check:skill-examples :: ✅ 349 prose examples type-check across 3 surface(s) (re-run after building @objectstack/client-react; first ru
EXIT=0 :: pnpm --filter @objectstack/spec run check:strictness-ledger ::     untriaged: 1381 object site(s) across 9 director(ies)
EXIT=0 :: pnpm --filter @objectstack/spec run check:variant-docs :: ✓ variant/doc gate: 28 discriminated union(s) — 13 governed (every variant mentioned in a bound doc), 15 exemp
EXIT=0 :: pnpm --filter @objectstack/spec run check:yaml-examples ::    ↳ 18 component node(s) also judged against their ComponentPropsMap props schema; 1 skipped (no row for the 
EXIT=0 :: pnpm check:adr-anchors ::   · packages/plugins/plugin-security/src/permission-evaluator.ts → ADR-0057
EXIT=0 :: pnpm check:ci-filter-parity :: OK: all 9 root input(s) of `test` / `test:repo` in turbo.json are covered by `core` or `crosspkg`, which the `
EXIT=0 :: pnpm check:closed-ceremony-text :: ✓ check-closed-ceremony-text: 6673 shipped file(s) read; none says the ownership ceremony is closed.
EXIT=0 :: pnpm check:corpus-claim-drift ::   Ledger:  2 baselined file(s) in scripts/corpus-claim-drift-baseline.json.
EXIT=0 :: pnpm check:cross-package-test-inputs :: OK: 32 package(s) read outside themselves, all declared, and turbo.json hashes every declared glob (6 of them 
EXIT=0 :: pnpm check:doc-anchors :: ✅ check-doc-anchors: 1108 internal #fragment link(s) across 500 source file(s) all resolve to a real heading
EXIT=0 :: pnpm check:doc-authoring :: ✓ doc authoring guard: sibling-package prose ids hold the baseline — 0 pinned site(s) across 0 file(s), 167647
EXIT=0 :: pnpm check:doc-frontmatter :: ✓ check-doc-frontmatter: 2 content root(s) verified, each against its own floor — content/docs 494, content/bl
EXIT=0 :: pnpm check:docs-audit-scope :: ✓ scope injection is live: the workflow audits the list handed in as args.handwritten, and refuses an invocati
EXIT=0 :: pnpm check:docs-redirects :: check-docs-redirects: OK (apps/docs/redirects.mjs objectuiRedirects: 184 entries -- 184 page destination(s) re
EXIT=0 :: pnpm check:docs-single-h1 :: ✓ check-docs-single-h1: 494 page(s) under content/docs/ carry no body-level `# ` heading (0 subtree(s) exclude
EXIT=0 :: pnpm check:docs-spec-enumerations :: OK the hand-written spec enumerations agree with packages/spec/package.json -- 18 subpath(s) held ORDERED in c
EXIT=0 :: pnpm check:docs-transcript-drift :: ✓ check-docs-transcript-drift: 4 declared transcript value(s) across 494 page(s) under content/docs/ equal wha
EXIT=0 :: pnpm check:driver-memory-census :: 
EXIT=0 :: pnpm check:gitlink-declared :: check-gitlink-declared: OK (27226 index entries -- 0 gitlink(s) at mode 160000; no .gitmodules in the index, s
EXIT=0 :: pnpm check:nul-bytes :: check-nul-bytes: OK (scanned 27122 text file(s) -- 27122 tracked, 0 untracked-not-ignored; skipped 101 binary;
EXIT=0 :: pnpm check:pm-expected-skips :: ✓ l1-face self-test: 51 cases pass across 7 batteries — offline, no network.
EXIT=0 :: pnpm check:published-readme-links :: ✓ check:published-readme-links — 557 outbound link(s) across 163 published markdown file(s): 0 root-relative, 
EXIT=0 :: pnpm check:react-page-adapter-contract :: ✓ check-react-page-adapter-contract: 22 app-showcase page module(s) + 3 content/docs react-page sample(s) (fro
EXIT=0 :: pnpm check:refd-timer-probe ::     1 code site(s), all inside the approved module, which is present and still reads it.
EXIT=0 :: pnpm check:role-word ::   Ledger: 45 baselined file(s) still carrying it (151 occurrence(s)) in scripts/role-word-baseline.json.
EXIT=0 :: pnpm check:skill-identifier-liveness :: check-skill-identifier-liveness OK — Leg 1: 549 citation(s) over 75 published file(s) checked against 274266 i
EXIT=0 :: pnpm check:vendor-version-stamps ::   attestations. Re-verify one and you may restamp it; otherwise it stays a historical fact.
EXIT=0 :: pnpm check:watch-hint-literal :: ✓ check-watch-hint-literal: 80 declaration(s) across 4 rostered name(s) -- ROOT_DIR_WATCH_HINTS 52, ROOT_FILE_

All 45 exit 0. Everything outside the derivation (artifact rosters, wide-population families, type-check lanes) is CI's.

Acceptance notes

  • No changeset: the diff is under docs/qa/, which no package's files[] ships; skip-changeset is declared on the create.
  • The ask rounds' seed is unaffected: rows go in through the platform seed path, which skips the state_machine rule (packages/qa/scenarios/src/runner/orchestrate.ts, seedApp), so seeded paid / approved rows still land. No Build check in packages/qa/scenarios/src/score reads initialStates (zero grep hits), so the provenance's verified scores stand.
  • A direct create of a claim already submitted is now refused invalid_initial_state; the card's file_and_submit_from_text operation expects the claim to end submitted, which is reached by create-as-draft then the draft → submitted transition, as the build's own filing action already does.
  • Not in this PR: skills/objectstack-data/evals/objects-fields-relationships.json eval id 3's expected_output models a draft → active → terminated machine with no initialStates; the seat routes it elsewhere.

Verification

Read first:

  1. docs/qa/scenarios/builds/travel_expense.json: the three initialStates hunks (risk: the wrong entry state would refuse the build's own create paths; each matches the field default).
  2. docs/qa/scenarios/builds/travel_expense.provenance.json: the amended entry and new sha256.
  3. content/docs/protocol/objectql/state-machine.mdx and content/docs/data-modeling/validation.mdx: the rewritten initialStates sentences (risk: overstating the rule; it reaches only machines that run on insert).
  4. docs/qa/scenarios/README.md: the one sentence on hand amendment.

Two-minute check: sha256sum docs/qa/scenarios/builds/travel_expense.json prints 4ab7e603101e6adee0ede53563a13a9a830c8323d8e3f702222986042e726fd8, the provenance's new sha256.


Generated by Claude Code

…all-local accepts it

The committed scenario build docs/qa/scenarios/builds/travel_expense.json
carried three active state_machine validations that run on insert with no
initialStates. The publish-time rule state-machine-no-initial-states refuses
that shape, so POST /api/v1/marketplace/install-local answered 422 on the
current tree. Each machine now lists the state its field defaults to and the
build's own create paths write (pending, draft, draft). The provenance
records the amendment and the new sha256; the README says when a verified
build may be hand-amended.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZkPEE1u9xgGA2sJjH
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 22, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 22, 2026
…is refused at publish

The state machine protocol page and the validation modeling page still
described an omitted initialStates as the legacy no-check-on-insert
choice. Publish and os validate refuse that shape on a machine that runs
on insert (state-machine-no-initial-states); only a machine whose events
leave out insert may omit it. The sentences now say so, quoting the
rule's own explanation.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

差旅报销场景的样例包现在能装上了:错在样例,它的三个状态机没写起始状态,现在的发布规则会拒;规则本身没错。顺带把两页还写着「不写起始状态也行」的过时文档改成了现行规则。
CI 全绿,34 行,非受管面,席位落地。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 74166193 · 2026-11-23T00:15Z

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

travel_expense scenario fixture cannot be installed on main: install-local answers 422 state-machine-no-initial-states

2 participants