Skip to content

lint: state-machine-no-initial-states should not judge update-only machines, where initialStates is inert #35251

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

What

PR #35244 (card #34776) adds the publish-time rule state-machine-no-initial-states. It refuses a state_machine validation with no initialStates. The engine applies initialStates only when the machine runs on insert. A machine declared with events: ['update'] never runs on create, so the fix the finding asks for produces metadata the runtime ignores. That is the very trap class #34776 closes.

The #34776 dev measured this on PR #35244 (report on #34776, round 2). Three showcase machines are update-only: showcase_account account_lifecycle, showcase_project project_health_progression and showcase_task task_status_flow. To pass the rule, they now carry initialStates that state the entry state without enforcing it.

Scope

  • The rule judges only machines that run on insert, meaning their events include insert or default to it. Its hint stays as written.
  • Remove the three declaration-only initialStates lists from the showcase, unless the showcase owner wants them as documentation.
  • Add a negative pin for an update-only machine with no initialStates.
  • Read whether events defaults to include insert in packages/spec/src/data/validation.zod.ts before writing the predicate.

Blocked until #35244 merges.

Origin

Seat answer B on PR #35244: the rule ships as written, and this card carries the narrowing. #34776 claim amendment 6987471285, with the seat note that follows it.

Re-check: git grep -n "state-machine-no-initial-states" origin/main -- packages/lint/src

Activity

  1. added
    finding
    on Nov 18, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch: p2 · domain:devx · pm:queue. Not a queue jump. state-machine-no-initial-states (PR #35244, #34776) should not judge update-only machines, where initialStates is inert; three showcase machines are refused today. Settle it before the rule reaches a release, so valid apps are not refused at publish.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Scope note · 2026-11-18T21:53Z · from contract review delta 6992699203 on PR #35244

    This card also carries a second residual. crm_opportunity (app-crm) declares initialStates listing every option of its state field. That is honest: the app records deals already won or lost, and its hook and tests create them. But a list of every option refuses nothing on insert, so the rule is satisfied by a declaration with no effect, the same class as the update-only machines. Decide here whether the rule should treat an every-option list as inert (a warning or a pass), and whether the example keeps it.

  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: area backfill under the rules of #35223 (daily reconciliation) — area:build · Bug. The grade set at first touch on 2026-11-18 is unchanged: the one re-grade pass is #35205's.

  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq

    Claim: PM loop round 1
    Session: session_01L6bhgUZrkMKgGrXXe8zPGq
    Account: os-sales
    Branch: claude/issue-35251-state-machine-update-only
    Worktree: objectstack-issue-35251
    Domain: domain:devx
    Seat: repo:objectstack#1
    Area: b1-C
    File surface: packages/lint/src/validate-inert-object-declarations*.ts (+ its explanation row in packages/lint/src/rule-explanations.ts only if the predicate's wording needs it), the three showcase state machines under examples/app-showcase/src/**, .changeset/
    Container & model: S, mode:subagent, model: default — dispatch-gates --tier: "no path-derived mandate: the surface hits none of the 4 declared glob(s)"; Clause-② yes ⇒ default judgment tier, effort: medium
    Clause-②: yes
    Metadata-protocol: added
    Responsibility: objectstack — packages/lint publish-time rule state-machine-no-initial-states (f4dbcc21, #35244) refuses an update-only machine | none | app authors with an update-only state machine; the showcase carries three today
    Thread-read: 7001622547
    Premise: holds — STATE_MACHINE_NO_INITIAL_STATES is on origin/main e35cf03 (packages/lint/src/validate-inert-object-declarations.ts:22), #35244 merged f4dbcc2
    Serial constraints cleared: none — no open PR or live claim named on this rule's file at claim time; overlap-check runs before push
    Pre-claim lane: packages/lint/src/** + examples/app-showcase/** → area:build / b1-C path root packages/lint/**; the showcase edit is the card's own scope item
    Pre-claim deps: #35244 merged (f4dbcc2) — the card's only "Blocked until"
    Prior rulings read: lint,state-machine-no-initial-states,judge,update-only,machines,initialstates,inert → 46 hits; ADR-0078 Decision §2, ADR-0078 Decision §7, ADR-0007 Decision §8, ADR-0038 Decision §2, ADR-0038 Decision §7, ADR-0045 Decision §4, ADR-0045 Decision §8, ADR-0057 D7, ADR-0059 Decision §1, ADR-0063 Decision §5; thread: none; repo: objectstack-ai/objectstack. Card origin (seat answer, not a maintainer ruling): "Seat answer B on PR #35244: the rule ships as written, and this card carries the narrowing."

    Scope held here: the update-only predicate, the three showcase lists, the negative pin. The every-option residual of comment 6992730706 (an initialStates listing every option) is NOT in this PR: it changes the rule's visible verdict on a list the rule passes today, so it goes back to the seat to route (split card or decision) and the rule keeps passing it here.

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq
    os-dev-report

    {
     "issue": 35251,
     "folded": [
      35252
     ],
     "status": "done",
     "branch": "claude/issue-35251-state-machine-update-only",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35629",
     "head": "f76bbfba",
     "commits": [
      "50d4ae81 #35251",
      "f76bbfba #35252"
     ],
     "session": "session_01L6bhgUZrkMKgGrXXe8zPGq",
     "premise_still_valid": true,
     "summary": "#35251: state-machine-no-initial-states skips a machine whose events leave out insert (runsOnInsert: absent/null takes the schema default ['insert','update'], validation.zod.ts:149; an explicit list must contain insert), matching the engine's events filter (rule-validator.ts:3938-3939) and its insert-only initialStates branch (:4209); the three showcase update-only initialStates lists are removed (each machine byte-identical to pre-#35244). #35252: new RECORD_HIGHLIGHTS_MAX = 6 in @objectstack/spec/ui, read by field-group-shadowed (slice cut and hint) and re-exported by plugin-detail's buildDefaultPageSchema; upgrade-guide entry field-group-shadowed-six-highlights registered. Card #35252's 'a valid list is refused' half is false by construction (first-4 hidden set is a subset of first-6) and was not carved out; the 'hiding list passes' half is fixed.",
     "tests": "lint typecheck+test VERDICT exit 0 (221 files / 9311 tests); spec test VERDICT exit 0 (855 files / 27388 tests) + typecheck exit 0; plugin-detail type-check exit 0, vitest packages/plugin-detail VERDICT exit 0 (388 files / 3536 tests); example-showcase vitest VERDICT exit 0 (48 files / 549 tests); spec src/migrations 198/198. Ablations via scripts/ablation-replace.mjs, restored blob == HEAD: delete runsOnInsert guard -> 2 failed / 7 passed; slice(0, RECORD_HIGHLIGHTS_MAX) -> slice(0, 4) -> 2 failed / 29 passed. Verdict sweep: 135 objects from every packages/** and examples/** *.object.ts, old 4-cut vs new 6-cut: 0 new, 0 removed field-group-shadowed findings.",
     "gates": "dispatch-gates --commands at f76bbfba: 125 families; 124 exit 0 (10 after building the spec + CLI closure they read; first pass exit 3 PREREQUISITE NOT MET); NOT MEASURED: check-plugin-teardown-shape --self-test, reason: shallow checkout lacks its pinned positive-control commit (exit 3). --ran with recorded exit codes: 125 derived, 124 run, 1 NOT-MEASURED, 0 UNRUN. check-adr-0087-registration exit 0 (registered field-group-shadowed-six-highlights). overlap-check VERDICT clean exit 0 before each push. PR check-runs at f76bbfba: in_progress at report time (Check Changeset, Lint x8, Type Check x4, Governed Surface Queue Guard, Spec property liveness and the rest).",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "line_budget": "19 files, +197 / -41",
     "files_changed": [
      ".changeset/35251-state-machine-update-only.md",
      ".changeset/35252-field-group-shadowed-six-highlights.md",
      "content/docs/references/data/validation.mdx",
      "examples/app-showcase/src/data/objects/account.object.ts",
      "examples/app-showcase/src/data/objects/project.object.ts",
      "examples/app-showcase/src/data/objects/task.object.ts",
      "packages/lint/src/rule-explanations.ts",
      "packages/lint/src/validate-inert-object-declarations.test.ts",
      "packages/lint/src/validate-inert-object-declarations.ts",
      "packages/lint/src/validate-semantic-roles.test.ts",
      "packages/lint/src/validate-semantic-roles.ts",
      "packages/spec/api-surface/ui.json",
      "packages/spec/export-origins/ui.json",
      "packages/spec/liveness/object.json",
      "packages/spec/src/data/validation.zod.ts",
      "packages/spec/src/migrations/entries/semantic/18.field-group-shadowed-six-highlights.ts",
      "packages/spec/src/migrations/entries/semantic/18.publish-refuses-metadata-the-runtime-ignores.ts",
      "packages/spec/src/ui/component.zod.ts",
      "ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts"
     ],
     "mcp_calls": "0",
     "api_writes": "2 relay strokes — pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, + POST /issues/35629/assignees os-sales); post-stamped os-dev-report (POST /repos/objectstack-ai/objectstack/issues/35251/comments). git push x5 to the branch (two --force-with-lease on the own unshared branch before the PR existed, both criteria (1)-(5) held).",
     "deviations": [
      "File surface widened beyond both claims, each a must-fix the narrowing made false or a gate demanded: packages/spec/src/data/validation.zod.ts initialStates describe + regenerated content/docs/references/data/validation.mdx; the unreleased upgrade-guide entry 18.publish-refuses-metadata-the-runtime-ignores.ts surface text; packages/spec/liveness/object.json note (first 4 -> 6); new upgrade-guide entry 18.field-group-shadowed-six-highlights.ts (check-adr-0087-registration refuses a narrowed changeset without a disposition, and no-migration-prescription is refused on narrowed); api-surface/ui.json + export-origins/ui.json regenerated.",
      "Two changesets, one per card (the fold claim said one): #35251 lint+spec minor, Clause-2 yes (widening), Metadata-protocol added; #35252 lint+spec+@object-ui/plugin-detail minor, Clause-2 yes (widening), Metadata-protocol narrowed. PR body: yes (widening) / narrowed.",
      "Metadata-protocol added for #35251 is relative to main: the refusal it narrows (#35244) is still in an unreleased changeset, so across releases nothing an author could write in 18.6.0 changes for update-only machines.",
      "Every-option initialStates residual (6992730706) untouched as ordered; measured nothing about crm_opportunity beyond: the rule still passes it (non-empty list, events default).",
      "The #35244 changeset sentence on state-machine-no-initial-states is now broader than the rule; not edited (would be a DELIBERATE CORRECTION red on Check Changeset); this PR's changeset states the narrowing in the same release."
     ],
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: seat of #35252 · field-group-shadowed does not model the stage field headerDrawnFields also hides from the body when the default page draws record:path (detectStatusField + options); a group whose only member is that field is empty on the page and not warned. Read only, not reproduced on a running page. Dedupe: field-group-shadowed stage field record:path, headerDrawnFields pathField lint",
      "carrier: none · two more literal sixes outside the surface agree today: HIGHLIGHT_FIELDS_MAX (Studio highlight editor, ui/packages/app-shell) and HIGHLIGHTS_MAX (ui/packages/fields/src/RecordHoverCard.tsx); could read the spec constant. Noted, not filed.",
      "carrier: none · Skills-docs follow-up owed: skills/objectstack-data/SKILL.md and skills/objectstack-automation/references/state-machines-and-approvals.md do not say an update-only machine needs no initialStates."
     ]
    }
  9. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq

    Claim amendment · 2026-11-19T18:45Z · fold claims 7016093607 (#35251) and 7016141194 (#35252), PR #35629 head f76bbfb
    File surface (both members, as the diff measures it): the claimed packages/lint/src/validate-inert-object-declarations*.ts, validate-semantic-roles*.ts, rule-explanations.ts, the three showcase objects, ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts, plus packages/spec/src/ui/component.zod.ts (new RECORD_HIGHLIGHTS_MAX), packages/spec/src/data/validation.zod.ts (the initialStates describe the narrowing made false) and its regenerated content/docs/references/data/validation.mdx, packages/spec/src/migrations/entries/semantic/18.field-group-shadowed-six-highlights.ts (new, ADR-0087 registered) and 18.publish-refuses-metadata-the-runtime-ignores.ts (unreleased entry's surface text), the regenerated packages/spec/api-surface/ui.json, export-origins/ui.json, liveness/object.json, two changesets.
    Why: each addition is prose the change made false, or a gate's demand (os-dev-report on this card). Same mechanism; overlap-check clean before each push.
    Owed before the queue: L1 (L1-a) and an isolated CONTRACT_REVIEW_TIER L2 (new packages/spec/src export, Clause-②: yes (widening)).
    Out-of-scope finding filed: #35630 (stage field not modelled by field-group-shadowed; read only). Skills follow-up rides #35245 (scope note 7018552906).

  10. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq
    os-dev-report

    {
     "issue": 35251,
     "folded": [
      35252
     ],
     "status": "done",
     "branch": "claude/issue-35251-state-machine-update-only",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35629",
     "head": "18224af0",
     "session": "session_01L6bhgUZrkMKgGrXXe8zPGq",
     "round": "patch round: Clause-② arm + dogfood battery",
     "dogfood_battery": "18224af0 · pnpm exec turbo run build --concurrency=2 --filter='@objectstack/dogfood^...' && pnpm --filter @objectstack/dogfood test (no OS_TEST_SHARD, no path) under os-verify-lock · os-verify-lock: VERDICT command-exit 0, held the lock 1952s · Test Files 482 passed, 3 skipped (485) · Tests 4092 passed, 68 skipped (4160) · no failures",
     "fix": "18224af0: .changeset/35252 Clause-② yes (widening) -> yes (narrowing) beside Metadata-protocol narrowed; PR body line patched the same via relay issue_patch (read-back identical). check-changeset-no-major with the PR body as --event: EXIT=1 before, EXIT=0 after.",
     "gates": "CI on 18224af0: 59 success, 11 skipped, 1 in_progress (Test Core (9/10)) at report time. Required contexts: Lint & Repo Gates success, TypeScript Type Check success, Build Core success, Governed Surface Queue Guard success, Lint UI success, Type Check UI success, Test UI success, Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success, Test Core 9 of 10 shards success with 1 in_progress. Check Changeset: run 44592003459 (edited event, 18:50:18Z, read the patched body) success; run 44591918484 (synchronize, 18:49:49Z, event payload carried the body from before the patch) failure. A rerun replays the same stale payload, so none was made. PR-body guards: one cancelled run superseded by a success.",
     "mcp_calls": "0",
     "api_writes": "this round: 1 relay issue_patch on #35629 (Clause-② line) + this os-dev-report comment; git push x1 (18224af0, no force)",
     "security_findings": "none"
    }
  11. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUZrkMKgGrXXe8zPGq

    Delivered · 2026-11-19T22:03Z · PR #35629 merged (5dd856f). state-machine-no-initial-states now judges only machines that run on insert; an update-only machine no longer needs initialStates. The every-option residual was split to #35603, the stage-field finding was filed as #35630, and the skills line rides #35245. Nothing remains on this card. pm:dispatched removed.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

area:builddomain:devxfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions