Skip to content

feat(runtime): retain artifacts across execution retries - #29

Merged
jamespud merged 1 commit into
mainfrom
codex/t5-artifact-retention
Oct 10, 2026
Merged

jamespud merged 1 commit into
mainfrom
codex/t5-artifact-retention

Conversation

@jamespud

@jamespud jamespud commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

A delayed case-wide retry cleanup can delete a newer generation's artifacts, including references of an already committed Resolution. Retry correctness must hold with all older rows retained.

This removes ArtifactCleaner, CleanupCaseArtifacts, and RunManager's cleaner dependency and cleanup-failure settlement. Retries use a new generation and the existing T3/T4 reads and owned reset/commit transactions. History is retained indefinitely, including billing data, checkpoints and legacy rows with unknown provenance. The retention policy and the requirements for any future physical GC are documented in docs/execution-generation-retention.md.

The old optional cleaner capability is intentionally removed rather than kept as a callable compatibility API. Explicit user Case deletion keeps its existing semantics. No physical GC, TTL, scheduler, migration, or T6 deployment gate is introduced.

Validation:

  • Real MySQL 8.4 RED → GREEN for a delayed G1 cleanup after G2 terminal commit and a stale cleanup request while G2 owns execution. Full-row snapshots cover artifacts, Case, Job/claims, Resolution, Events/cursor and another Case's history.
  • Restoring the original destructive method makes both final race tests fail again and deletes seven artifact families; removing it restores GREEN.
  • Real RunManager retry retains G1/G2 artifacts across all seven families and checkpoints, with scoped current reads, history provenance, indirect AgentRun relationships, unknown legacy rows and token/cost history. A SQLite regression also checks successful retry with retained evidence.
  • go test -race -p 1 -count=1 -json ./... with real MySQL: all 52 packages with tests pass; only four real CodeRunner sandbox tests skip. Migration parity and T1–T4 regressions run in this suite.
  • go vet ./..., formatting and git diff --check pass.
  • GitHub CI run 38009584246: all five gates pass on exact HEAD 334951c7a9c624b75d597fee4f47e25b794c20b3 (backend, frontend, operational scripts, runtime conformance and MySQL migration compatibility).

These tests prove removal of deletion authority. They do not claim transaction fencing for physical GC. Any future reclamation requires new real-DELETE race/rollback/reply-loss acceptance tests; excluding old binaries remains T6 scope.

Closes #23

@jamespud
jamespud merged commit 0fcb9d8 into main Oct 10, 2026
5 checks passed
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.

[IMPL] T5 — Demote retry cleanup to generation-scoped retention/GC

1 participant