* feat(cli): retain over-budget partial observations from failed CLI runs
When a failed CLI command carries an over-budget partial observation without
--evidence_output, retain the complete partial Evidence in the private
retained-Evidence cache instead of dropping it to a rerun-only fallback.
- Pass the composed source closure into budgetFailurePartialEvidence so cited
source records are written into the retained bundle alongside the partial
observation.
- Report the retained path, byte size, and record_sha256 under
details.diagnostics.evidence_bundle, set details.partial_observation_delivery
to retained: "cache-file" with a paging cursor, and keep all failure facts
(code, message, failure_kind, retryable, remediation, limits, existing
diagnostics) unchanged.
- Honor --no-retain and REA_CLI_RETAINED_EVIDENCE_BYTES=0, fall back to
retained: "not-retained" with rerun arguments and redacted retention_failure
on uncommitted write errors, preserve the original failure and committed
cache receipt on post-commit staging cleanup failures, and keep cancelled
failures on the no-publication contract.
- Document the behavior in docs/reference/limits-and-recovery.md and add
boundary and CLI acceptance tests.
Fixes#14618
* fix(cli): preserve pre-commit cleanup ownership and surviving oversized cache receipts
Address two gaps in the shared retainOverBudgetEvidence path that affected
both successful (deliverRetainedSummary) and failed (budgetFailurePartialEvidence)
CLI retention:
- Preserve pre-commit writer errors whose staging cleanup stayed incomplete
(including exists failures with unfinished cleanup), reporting cleanup_incomplete
and remaining resources via projectFailure on successes and via
refusedPartialPublication (keeping execution_failure and complete inline
partial_observation) on failures.
- When removing an oversized retained cache bundle fails (fileRemains), carry
the surviving file metadata through RetentionStop.remainingFile, record the
complete receipt (path, bytes, record_sha256), and report retained: "cache-file"
with its paging cursor and retention_failure instead of a not-retained fallback.
- Simplify refusedPartialPublication back to a plain delivery value now that
retainOverBudgetEvidence tracks the attempted cache path directly.
- Add public CLI tests for both paths (success and failure) using
evidencePublicationPreload.mjs and update docs/reference/limits-and-recovery.md.
* fix(cli): key retained bundles by complete source closure
* chore(format): format retained evidence publication
* fix(cli): canonicalize retained bundle cache keys
* test(cli): compare retained bundle bytes directly
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Explicit deadlines at or below the project deadline only shortened it:
a literal 30-second value also disabled the coverage scaling, which timed
out wide-capacity regressions on main. Workloads above the built
deadline use the long-running tag. Deadlines derived from an operation
budget remain.
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): publish partial Evidence to --evidence_output on failure
publishCliAnalysisEvidence returned a failed result unchanged before any
--evidence_output handling. When a source reached its deadline, or another
failure carried partial Evidence, the requested file was not written and
--detail summary still printed the complete partial Evidence inline, which
reached more than 64 MB on a large build.
A failure whose details.partial_observation is authenticated Evidence now
publishes it through the same projection and new-file publication as a
successful result. The failure keeps its code, message and remediation.
With --detail summary, details.partial_observation holds the summary
view, and details.diagnostics.evidence_bundle reports the path and bytes.
A refused publication keeps the complete partial Evidence inline and adds
details.diagnostics.evidence_bundle_error with the refusal and a
limitation. Without --evidence_output, for cancellation, and for raw
provider observations the failure output is unchanged.
Fixes#7787
* fix(cli): keep committed partial Evidence receipts on refused publication
When publishing the partial Evidence of a failed analysis, a refusal can
follow a commit. Staging cleanup that stays incomplete after its retry
returns cleanup_incomplete with published_path and bytes, and a
cancellation after commit returns cancelled with
diagnostics.evidence_bundle. The failure path read only the second form,
so a committed file with incomplete cleanup was reported as not
published, without its receipt or the cleanup resources, and the full
partial Evidence went back inline.
Keep the original analysis failure and record the receipt from either
form in details.diagnostics.evidence_bundle. Incomplete publication
cleanup adds published, published_path, bytes, cleanup and resources to
details, the shape a successful run's cleanup_incomplete reports;
resources join any the analysis failure already reports, and its own
cleanup reason is kept. Once the file is committed, the delivered view
(the summary with --detail summary) replaces the inline partial Evidence.
Receipts omit a path that holds an excluded sensitive value, as on
success.
Tests drive the real staged publication through its commit point: cleanup
that stays incomplete, cleanup confirmed by retry, and SIGINT after
commit. A composition test checks receipt redaction on the failure path.
* fix(cli): report incomplete partial publication cleanup
---------
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>