fix: compile-check's summary says 1 assembly and 1 error

Merged
HA
9h ago
+210-77

Summary

  • compile-check's one-line Message now says 1 assembly, 1 error, and 1 warning instead of 1 assemblies, 1 errors, and 1 warnings.
  • The skill now says which full compiles drop an assembly's baseline, and how a failure of the command itself is printed.

User Impact

These came out of a second round of real use: an agent wrote a small game in a project with 561 assemblies and ran compile-check 37 times along the way.

  • Plurals: the summary read Reused 1 assemblies and fast-checked 1 with 1 errors and 0 warnings. 28 assemblies were not compiled because ... 1 assemblies were checked on their changed files only; .... Every count followed by a noun now takes the singular for exactly one, and the plural for zero and for more than one (0 errors).
  • Which runs drop the baseline: the skill said the changed-files check is lost "after a --full that had errors". A normal run that fell back to a full compile and ended in errors drops it too. A run that compiled the assembly only because one it references changed records no baseline either. The agent could not tell from the skill whether its next run would be a full compile again.
  • Exit codes: the skill said only that the process exits 1 when ErrorCount is above zero. A failure of the command itself, such as COMPILE_CHECK_UNITY_BUILD_REQUIRED, also exits 1, so the exit code alone does not tell the two apart. The skill now says that such a failure prints no payload on stdout and writes the error, with its ErrorCode, to stderr.

Changes

  • The functions that build Message move unchanged into compile_check_message.go (separate commit), since compile_check.go was close to the file-length limit.
  • A small helper picks singular or plural from the count. The sentence for blocked assemblies and the one for assemblies checked on their changed files switch as a whole (1 assembly was ... it references / 2 assemblies were ... they reference).
  • Counts after the first item stay bare (reused 1, fast-checked 19), as before.
  • SKILL.md and docs/compile-check.md: the baseline sentence covers fallback full compiles (and, in the skill, compiles caused by a changed reference), and the exit-code sentence covers command failures.

Verification

  • Tests:

    • The existing tests that pinned the old wording now expect the new one. The test that pins Reused 2 assemblies with 0 errors and 0 warnings. is unchanged.
    • A new table test covers the counts 0, 1, and 2 for the first noun, errors, warnings, the blocked sentence, and the changed-files sentence.
    • Before the fix, the failing tests were exactly the updated ones and the new count-of-one cases; the zero and two cases passed.
  • Mutations, each restored afterwards:

    MutationFails
    Singular when count <= 1every zero case (0 error), plus the old-wording tests
    Singular when count == 2every one and two case
    The blocked sentence never takes the singularonly the one-blocked case
  • cli/dispatcher:

    • golangci-lint fmt --diff is empty; go vet ./... passes; golangci-lint run and the complexity config both report 0 issues.
    • go test ./... and go test -race on the compile-check and dispatcher packages pass.
    • Coverage with the CI exclusions: 94.25% (baseline 94.2).
  • cli/release-automation: go test ./... passes; check-skill-size passes; the file-length check passes.

  • scripts/sync-tool-docs.sh --check reports no drift.

  • Repository CI does not run on pull requests into this branch; the checks above were run locally.