You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
analyze: exit code is 0 even when nothing was successfully processed #115
The analyze command returns exit code 0 unconditionally once it runs, regardless of what happened to the input files. Two observed cases:
Analyzing a Player build without TypeTrees: every file is skipped (Successfully processed files: 0, Failed files: 0, Files without TypeTrees: 4), a fully-formed but empty database is written, and the exit code is 0. This is a total failure presented as success — a script (or AI agent) that checks the exit code, or checks that the .db file exists, will conclude the analysis worked.
A run with Failed files: 8 (mixed input) also exits 0.
The per-file skip reasons do go to stderr, which is good, but detecting "this run produced nothing useful" currently requires parsing the summary sentence on stdout.
Proposal:
Return a non-zero exit code when Successfully processed files == 0 (nothing usable was analyzed).
Decide what partial failure (Failed files > 0 but some successes) should do — a distinct non-zero code, or keep 0 and rely on the stderr lines. Open for discussion; the zero-successes case is the important one.
For comparison, dump and find-refs already return 1 on their failure cases.
Found during a review of how well AI agents can use the tool unattended; the exit code is the main signal such tools rely on.
For partial failures i think we need to continue to return 0. We are trying to make it easier to have a fully clean analyze build, but its still possible that unexpected files are being picked up by the analyze scan.
So we will scope this fix to only address the case where no files at all were successfully processed.
Activity
SkowronskiAndrew commentedon Sep 15, 2026
For partial failures i think we need to continue to return 0. We are trying to make it easier to have a fully clean analyze build, but its still possible that unexpected files are being picked up by the analyze scan.
So we will scope this fix to only address the case where no files at all were successfully processed.
[#115] Use a ContentDirectory build report in the ContentLayout tests
[#115] analyze fails when nothing was successfully analyzed (#137)