Preserve capture failures when a run is canceled

This commit is contained in:
2026-11-26 04:16:32 +00:00
parent cc3628e231
commit 5ffe22f5ac
4 changed files with 115 additions and 7 deletions

View File

@@ -6,7 +6,8 @@ Reviewed all 36 stages of [the implementation plan](implementation.md) against
`c5d8697d9f645a7b3b9041769da02704bd495b7a`, including the changes since planning
commit `cecd68f`, their tests, the accepted
[feature roadmap](audit-remediation.md), and current canonical
architecture/internal documentation. This is a review, not implementation.
architecture/internal documentation. The review below records that snapshot;
the remediation status records the subsequent correction.
The targeted architecture is substantially in place. Core retains typed operation
execution; a separate capture package serves operations and one-shot validators.
@@ -17,14 +18,19 @@ layout, target selection, and pure copying. Families own scene rules, duplicate
eligibility/identity, and prepared ordering keys. The executable owns cooperative
signals; embedded callers retain context ownership.
One required failure-cause retention gap remains. No other required correctness,
code-quality, architectural/documentation gap, or inadvertently strengthened
requirement was substantiated in the inspected changes. The previously resolved
standalone native-executor cancellation finding remains fixed; the issue below
is at the enclosing runner's error-selection boundary.
The one required failure-cause retention gap is now resolved. No other required
correctness, code-quality, architectural/documentation gap, or inadvertently
strengthened requirement was substantiated in the inspected changes. The previously
resolved standalone native-executor cancellation finding remains fixed; the issue
below is at the enclosing runner's error-selection boundary.
## Finding 1 — Retain Drained Capture Failures Alongside Caller Cancellation
**Status:** Resolved. The runner now joins caller cancellation with capture-bearing
errors from drained jobs, preserving their scope and typed causes in canonical
stage/lane/chunk order. Unrelated sibling errors remain suppressed, and ordinary
uncanceled error selection is unchanged.
**Priority:** P2, error integrity; requires concurrent cancellation and a capture
failure, not an ordinary successful run.
@@ -99,6 +105,23 @@ call. Ordinary cancellation still returns cancellation; uncanceled failures reta
their established canonical selection. Available diagnostics and capture remain
under the existing lifecycle.
### Implemented Remediation
`selectRunError` retains drained job errors containing `contracts.CaptureError`
when caller cancellation takes precedence. It returns the caller context error
first in the joined chain, keeping every capture cause from those jobs without
changing retry, fallback, finalization, or publication behavior.
Permanent runner regressions cancel the caller and fail outcome capture at each
of extraction, merge, and normalization. They verify cancellation, capture cause
and type, one outcome write, no deliverables, and no fallback. Selection coverage
also checks multiple capture failures, canonical ordering, and suppression of an
unrelated ordinary sibling failure.
Post-remediation checks passed: the focused cancellation/capture/finalization
and error-selection tests (ten consecutive runs), `go test ./...`, `go vet ./...`,
`go build ./cmd/notarius`, and the five-package race command below.
## Stage-By-Stage Review Coverage
| Stages | Evidence inspected / result |