derive-returns-negative-one-on-error
IN premise
`_derive_one_round` returns -1 on error, 0 on saturation, and a positive int for the number of beliefs added, which `cmd_derive` uses to control the exhaust loop.
Summary
The derive function uses a three-way return value to signal different outcomes: errors produce -1 to halt processing, zero means no new conclusions can be drawn, and a positive number counts how many new conclusions were generated in that pass. The main derive command loops until it either hits an error or runs out of new things to conclude, using these return values to decide when to stop.
Dependents
These beliefs depend on this one:
- derive-resilience-preserves-progress-on-error — The derive pipeline is resilient to partial failures: partial results are persisted via JSON reports after each round, and error states are signaled through return codes (-1 for error, 0 for saturation, positive for progress) rather than exceptions, enabling callers to recover and resume.
Details
| Source | entries/2026/04/29/reasons_lib-cli.md |