Repository navigation
Description
Problem
A plan or design document often names an API before it exists: a function, a type, or a field of the IR. No skill says how to write its tests first and show them red, and the rules that do exist turn such tests into no verdict at all.
- Against an API that does not exist, a test fails to compile.
mutation.md#read-the-kill-in-the-outputcounts "a[build failed]or[setup failed]line" as no verdict, so a build failure is not the red the test needs. commits-and-prs.md#split-into-tested-commitsruns "vet and the touched packages' tests in a detached worktree of each commit". So a test-first commit that does not build fails that check, and no rule says whether such a commit may stand on the branch.rounds.md#design-the-fix-firstasks to "see the test showing the defect fail, the fix make it pass, and the fix reverted make it fail again". That covers a defect in code that exists, not a new API.
$ git grep -n -i -E 'tests? first|test-first|fail first|does not build|not yet exist' -- '.claude/skills/*.md' CONTRIBUTING.md
$ echo $?
1
A builder working from #2354's plan had to settle each point alone: where the failing test lives, what it type-checks against, and what counts as its red.
Direction
A draft, as a rule in morphic-verifying-changes/references/tests-that-bite.md:
- Declare the planned signature first, as a stand-in that compiles and returns zero values or an error saying it is not built. The tests then build, and fail on their assertions, which is the red the run reads, with
--- FAILnaming each one. - Keep the stand-in and its tests in one commit that builds. Vet and the tests run there, and only the assertions fail.
- Fill the stand-in in the next commit, and see the same tests pass.
- Say what the stand-in owes the archtest reachability rule while nothing calls it (an
apiRootsentry, assplit-into-tested-commitsgives an exported helper committed before its caller), and that it never merges unfilled.
The alternative is a commit that does not build, allowed on the branch only before its first push. It needs split-into-tested-commits to exempt it, and it gives no red but a build failure.
Out of scope
Which skill owns test-first work for an emitter package, once one exists.
Related: #2354
Priority: P4, rule 1 (housekeeping): a skills change that alters no lowering, validation, IR or emit-contract behaviour. The git grep above → no match (morphic @4a7a384c9).
Activity