Repository navigation
fix(qa): travel_expense verified build declares initialStates so install-local accepts it - #36560
Merged
Merged
Conversation
…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
…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
Contributor
Author
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读差旅报销场景的样例包现在能装上了:错在样例,它的三个状态机没写起始状态,现在的发布规则会拒;规则本身没错。顺带把两页还写着「不写起始状态也行」的过时文档改成了现行规则。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
This was referenced Nov 23, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
initialStates(packages/spec/src/data/validation.zod.ts:197) says the author-time rulestate-machine-no-initial-statesrefuses an active machine without it at publish when itseventsincludeinsert..changeset/34776-publish-checks-build-probes.md(Clause-②: no (narrowing …),Metadata-protocol: narrowed, ADR-0087 registered aspublish-refuses-metadata-the-runtime-ignores), with the upgrade-guide entrypackages/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.mdlater exempted update-only machines.events: ["insert", "update"]).So no Clause-② stop: the fixture is fixed, the rule is untouched.
The fix.
docs/qa/scenarios/builds/travel_expense.jsongainsinitialStateson each of its three activestate_machinevalidations, each the state its field defaults to and the build's own create paths write:initialStatesdemotravel_approval_stepstep_decision["pending"]pending; the flow'sopen_finance_stepcreates the step withdecision: "pending"demotravel_expense_claimclaim_lifecycle["draft"]draft; thedemotravel_file_expense_claimaction insertsstatus: 'draft'demotravel_trip_requesttrip_lifecycle["draft"]draftNothing 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.jsongets the newsha256and anamendedentry 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
initialStatesas 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 emptyinitialStatesis refused at publish and byos validate; only a machine whoseeventsleave outinsertmay omit it. The rest of each paragraph is unchanged.content/docs/protocol/objectql/state-machine.mdx: theinitialStatestable 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: theinitialStatestable 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 onlytravel_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)
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.
Derived gate families, local, at 7416619
node scripts/pm/dispatch-gates.mjs --commandsderived 45 commands for the 5 paths (merge base ad50d61); each ran with its exit code captured before any pipe:All 45 exit 0. Everything outside the derivation (artifact rosters, wide-population families, type-check lanes) is CI's.
Acceptance notes
docs/qa/, which no package'sfiles[]ships;skip-changesetis declared on the create.state_machinerule (packages/qa/scenarios/src/runner/orchestrate.ts,seedApp), so seededpaid/approvedrows still land. No Build check inpackages/qa/scenarios/src/scorereadsinitialStates(zero grep hits), so the provenance's verified scores stand.submittedis now refusedinvalid_initial_state; the card'sfile_and_submit_from_textoperation expects the claim to endsubmitted, which is reached by create-as-draft then thedraft → submittedtransition, as the build's own filing action already does.skills/objectstack-data/evals/objects-fields-relationships.jsoneval id 3'sexpected_outputmodels adraft → active → terminatedmachine with noinitialStates; the seat routes it elsewhere.Verification
Read first:
docs/qa/scenarios/builds/travel_expense.json: the threeinitialStateshunks (risk: the wrong entry state would refuse the build's own create paths; each matches the field default).docs/qa/scenarios/builds/travel_expense.provenance.json: theamendedentry and new sha256.content/docs/protocol/objectql/state-machine.mdxandcontent/docs/data-modeling/validation.mdx: the rewritteninitialStatessentences (risk: overstating the rule; it reaches only machines that run on insert).docs/qa/scenarios/README.md: the one sentence on hand amendment.Two-minute check:
sha256sum docs/qa/scenarios/builds/travel_expense.jsonprints4ab7e603101e6adee0ede53563a13a9a830c8323d8e3f702222986042e726fd8, the provenance's newsha256.Generated by Claude Code