Skip to content

skills: no rule says how to write and show red a test for an API not built yet #2364

Done

Description

@OmarAlJarrah

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-output counts "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-commits runs "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-first asks 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:

  1. 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 --- FAIL naming each one.
  2. Keep the stand-in and its tests in one commit that builds. Vet and the tests run there, and only the assertions fail.
  3. Fill the stand-in in the next commit, and see the same tests pass.
  4. Say what the stand-in owes the archtest reachability rule while nothing calls it (an apiRoots entry, as split-into-tested-commits gives 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

  1. added
    type:feature
    priority:P4
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P4type:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions