Repository navigation
Conversation
…codebase audits (OSS-133)
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.
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, pairedsetStatecalls, 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. Onefdcontinuation line was merged to stay under the file's 694-line cap.evals/dr-review-implicit-state: an avatar upload diff that addsisError,errorMessageandurlnext toisUploading. The review passes only if it names the multi-flag shape as the cause of the stuck state.Test Plan
bun run typecheckexits 0bun run lint:skills: 0 errorsbun run test: RESULTdr-reviewandauditevals pass, including the new case (pre-push hook)/auditrun that asks for implicit state machines on a client app