How do I fix a failing local check?

Table of Contents

This is one branch of the PR monitoring loop. The other branch is addressing review comments.

1. Question

A check failed. How do I find what it was, fix it, and prove the fix?

2. Answer

  1. Read the report. compass check writes build/output/local_checks/report.md. Its Fix these first section names each failing check, the command that reproduces it, the command that fixes it, and the tail of the check's own log:

    ./compass.sh check
    sed -n '/## Fix these first/,/## Every check/p' build/output/local_checks/report.md
    
  2. Re-run just the failing check. Every check has an id, printed in the report's Every check table:

    ./compass.sh check --only component-drift
    
  3. Read the full log when the tail is not enough. Each check writes one file, named after its id:

    less build/output/local_checks/logs/component-drift.log
    
  4. Diagnose by category:
    • Drift (component-drift, model-drift, tangle-*) → regenerate the artefacts the check names, then commit them.
    • Compilation → fix the source file.
    • Test failure → fix or update the failing test, then run ./compass.sh test run -R <name> for a single suite.
    • Formatting → clang-format -i on the files the report names.
    • Documentation → fix the page or the link; site-page names the page.
    • Cross-platform (enum-attributes, exported-types) → the defect is one only MSVC reports; fix the header, no Windows build needed.
  5. Re-run the whole gate and confirm it is green:

    ./compass.sh check
    
  6. If the failure is on main instead. The twelve retired pull-request workflows kept their push to main trigger, so a defect that escaped the runner shows there. Find the run and read the failing step:

    gh run list --branch main
    gh run view <run-id> --log-failed
    

    The fix is the same, and the local check then reproduces it: ./compass.sh check --only <id>.

3. Script

compass check and the report it writes. The GitHub fallback is the bare gh CLI.

4. Tested by

The runner's own suite, build/scripts/tests/test_local_checks.py, pins the decision tree: a documentation change must not reach the compiler, a header change must, and a path nobody classified must ask for everything.

5. See also

Emacs 29.3 (Org mode 9.6.15)