fix: compile-check says how to get its changed-files check back

Merged
HA
1d ago
+16-10

Summary

  • When compile-check falls back to a full compile because the last one had errors, the reason now says what brings the changed-files check back.
  • The skill and docs now cover two cases an agent using compile-check ran into: using changes, and projects that treat warnings as errors.

User Impact

These come from an agent writing a game on a project with 561 assemblies and running compile-check 32 times.

  • Fallback reason. Before: no baseline: the last full compile had errors. The agent saw three full compiles in a row and could not tell from the output when the fast check would return. After: no baseline: the last full compile had errors; the first full compile without errors records one.
  • using directives. Adding or removing a using directive makes the next run a full compile, because it can change what every name in the file resolves to. Neither the skill nor the docs said so, so the full compile came without an explanation. Both now say it counts as a declaration change.
  • Warnings as errors. In a project that compiles with -warnaserror, rules the changed-files check cannot run, such as CS0414, fail only the --full run. The skill and docs now say this, next to the advice to run --full before finishing.

Changes

  • The reason string of a missing baseline after a failed full compile, with the store's comment that lists the reasons.
  • docs/compile-check.md:
    • the new reason, and that the assembly is compiled in full until a compile succeeds;
    • using directives in the list of conditions;
    • -warnaserror among what the check does not guarantee.
  • The compile-check skill: one sentence each on using directives and -warnaserror. It is now 7,004 bytes.

Verification

  • The two tests that expect the reason (TestFailedFullCompileLeavesNoBaseline and the store's TestLoadBaselineExplainsAMissingBaseline) were changed first and failed before the string changed.
  • git grep 'last full compile had errors' finds only the new string.
  • 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 ./internal/compilecheck/... pass.
    • Coverage with the CI exclusions: 94.26% (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.
  • This PR is stacked on #3331.