Skip to content

Journal allocation intent and recover interrupted experiments - #4

Merged
gpu004 merged 4 commits into
mainfrom
fix/issue-2-allocation-journal
Nov 12, 2026
Merged

gpu004 merged 4 commits into
mainfrom
fix/issue-2-allocation-journal

Conversation

@gpu004

@gpu004 gpu004 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #2.

A runner killed after remote create could leave a live box without an attempt row, allowing restart to allocate a replacement. Persist per-allocation intent with file and directory fsync before dispatch, then recover incomplete allocations under the experiment lock before reading results or building the schedule. Burst workers use separate state files.

Recovery verifies Modal allocation tags and E2B metadata before deleting exact allocations. Missing or ambiguous identity, provider errors, and unsupported recovery contracts block launches. The reconcile command records explicit operator evidence for terminal outcomes. Recovery receipts stay separate from measurements; an interrupted allocation consumes its scheduled key with one censored row, while staged or already-synced results retain their allocation identity and are not duplicated. Torn JSONL is preserved and blocks scheduling after cleanup recovery.

Validation:

  • 42 unit/regression/model tests through the updated drive-tests helper, including child-process SIGKILL at create, readiness, workload, cleanup, append/flush/fsync, and journal-completion boundaries; repeated recovery, peer ownership, manual receipt failure, and burst coverage.
  • 16 property tests, CLI doctor, fixture report generation, Ruff checks for changed modules, and git diff --check.
  • Executable bounded model: 137 states and 192 transitions with two scheduled keys and up to two restarts; UnrecordedBoxBlocksLaunch holds, and removing the journal gate reproduces the original bug. The issue's original TLA+ source is absent from this checkout.

No live cloud resources or credentials were used. Namespace, Tesser, unconfirmed persistent Modal creates without an ID, and inconclusive E2B lookups require manual reconciliation. launch_ms excludes journal fsync; returned-ID persistence contributes to cold wall time and is reported separately. ty check retains one pre-existing TemplateBuilder.copy type diagnostic, reproduced from the unchanged base source.

@gpu004
gpu004 force-pushed the fix/issue-2-allocation-journal branch from 92a6f40 to c842422 Compare November 12, 2026 19:54
@gpu004

gpu004 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto main after #3 merged. Resolved conflicts so both resolve-cleanup (saved cleanup warnings) and reconcile/allocation journaling coexist: journal auto-recovery clears live-allocation safety when verified; otherwise startup still requires exact-attempt resolution.

Proof after rebase: verify doctor READY; drive-tests PASS; drive-report PASS.

@gpu004

gpu004 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Addressed Sol BLOCK on c842422:

  • Heal receipt-without-journal crash window in reconcile_results (always confirm cleanup before result_committed)
  • Stop hard-rejecting resolved legacy cleanup warnings inside reconcile_results
  • Run cleanup unresolved check before config-change rejection
  • Include test_cleanup in drive-tests and add restart-heal regression

Proof on b7e8877: doctor READY; drive-tests PASS (with test_cleanup); drive-report PASS.

@gpu004
gpu004 merged commit e2838f2 into main Nov 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant