Skip to content

Fix retention scan and pre-execution cancellation races - #2108

Merged
JAORMX merged 6 commits into
mainfrom
fix/recovery-baseline-races-20261005
Oct 5, 2026
Merged

JAORMX merged 6 commits into
mainfrom
fix/recovery-baseline-races-20261005

Conversation

@JAORMX

@JAORMX JAORMX commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Routine fixes for inherited failures that blocked verification of #1920. No provider-recovery feature or new public API is introduced here.

  • JSONL inventory and storage-health scans tolerate entries removed concurrently by retention. Wrapped not-exist errors are recognized; permission, corruption, and unsafe-file errors still propagate.
  • Read-batch cancellation preserves already-decided outcomes and creates canonical cancellation results for unanswered calls, including cancellation before execution starts.
  • Canonical results stay in original call order; live availability retains its separate guarded delivery. Prepared review evidence closes exactly once, and cancellation during final reauthorization prevents execution.
  • The reflector partial-usage timeout test uses virtual time rather than assuming scheduling completes within a 1ms wall-clock window. Its timeout and usage assertions are unchanged.

Regression proof

Deterministic tests failed before the fixes. Coverage includes enumerate-then-remove and header-open races; wrapped-error and permission/corruption/symlink controls; mixed denied/prepared/canceled batches; canonical event/session pairing; no execution after cancellation; evidence cleanup; and transport disconnect during preparation. Existing transport assertions were retained, not relaxed.

Main refresh and verification

Conflict-resolution merge: e14994977ba7a0a0bd045e85a03c18145c2e73a9, incorporating main c65826ecc381da28e66bd93c634856823dd90fde without rewriting history.

The merge preserves main's review preparation after human approval and its review-deadline cancellation guards, together with this PR's ordered read-batch results and cancellation close-out. The pre-approval cancellation test now expects no evidence preparation, matching main; separate tests retain exactly-once prepared-evidence cleanup coverage.

After resolving the conflicts, focused engine tests and targeted race tests passed. JSONL inventory/health, live server projection, and directly relevant app deadline tests passed. A broader app test selection exceeded its 180s bound and is not claimed passed; the narrowed directly relevant selection passed. Independent security and merge-semantics reviews found no blockers, important findings, or advisories.

Before this refresh, affected package suites, focused race/repetition tests, and the full local non-race suite passed. Full local lint/race completion was limited by local execution resources and is not claimed green. As directed by the operator, focused local tests plus CI provide verification without making the capacity of their only computer a readiness blocker. The PR remains ready for human review; required CI checks on the current head must pass before merge.

Integration

This baseline repair remains separate from the recovery plan (#1912) and implementation (#1920). Accounting and provider-display changes previously published as #2097/#2098 are consolidated into #1920; those redundant PRs are closed.

Merge this baseline repair before the dependent recovery implementation. Humans retain merge authority. No PR merged or deployment performed.

Relates to #1912 and #1920.

Resolve review deadline and read-batch cancellation interactions while preserving canonical ordered results.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX merged commit 5755fc6 into main Oct 5, 2026
37 checks passed
@JAORMX
JAORMX deleted the fix/recovery-baseline-races-20261005 branch October 5, 2026 14:58
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant