Skip to content

feat: catch implicit state machines while writing, in review and in audits (OSS-133) - #298

Open
arzafran wants to merge 1 commit into
mainfrom
franco/oss-133-catch-implicit-state-machines-while-writing
Open

arzafran wants to merge 1 commit into
mainfrom
franco/oss-133-catch-implicit-state-machines-while-writing

Conversation

@arzafran

@arzafran arzafran commented Nov 6, 2026

Copy link
Copy Markdown
Member

What this does

Components that track one lifecycle with several booleans (isLoading, isError, isDone) can land in states that should be impossible, like showing "Uploading…" and an error at the same time with the input stuck disabled. Claude now spots that shape while writing, flags it in review, and can map every case in an app on request.

Linear: OSS-133

Summary

  • rules/typescript.md: the signs of an implicit state machine (several booleans for one lifecycle, a status with optional fields, paired setState calls, effects reacting to each other's flags, run-twice guards) and the fix: one discriminated union with the transitions in one place. Claude converts before adding a second flag; in code it isn't otherwise changing, it mentions the problem once instead of refactoring.
  • skills/dr-review/SKILL.md: a new flag on an existing lifecycle is a Warning. A reachable contradictory state is Critical when it shows wrong UI or loses data.
  • skills/audit/SKILL.md: codebase mode maps each implicit state machine with its states, transitions and impossible combinations. "Find all the implicit state machines" runs only that part across the app. One fd continuation line was merged to stay under the file's 694-line cap.
  • evals/dr-review-implicit-state: an avatar upload diff that adds isError, errorMessage and url next to isUploading. The review passes only if it names the multi-flag shape as the cause of the stuck state.

Test Plan

  • bun run typecheck exits 0
  • bun run lint:skills: 0 errors
  • bun run test: RESULT
  • Codex review: no findings
  • dr-review and audit evals pass, including the new case (pre-push hook)
  • First /audit run that asks for implicit state machines on a client app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant