Skip to content

[codex] Add typed sample runtime WAL#120

Merged
cm2435 merged 8 commits into
devfrom
codex/episode-sample-pr01-typed-wal
Jun 7, 2026
Merged

[codex] Add typed sample runtime WAL#120
cm2435 merged 8 commits into
devfrom
codex/episode-sample-pr01-typed-wal

Conversation

@cm2435

@cm2435 cm2435 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Review Guide

Stack position: PR 01, base codex/episode-sample-pr00, head codex/episode-sample-pr01-typed-wal.

Implements RFC Docs

  • 03a-persistence-schemas.md: runtime config snapshots and sample runtime WAL tables.
  • 03b-implementation-churn.md: prereq PR 01, typed sample WAL tables.
  • 03c-postgres-table-inventory.md: typed sample WAL inventory.
  • 09-implementation-plan/02-pr-01-typed-sample-wal-tables.md.

Why This PR Exists

This PR makes sample history append-only and typed. Instead of one generic graph mutation stream, every runtime mutation is represented in the appropriate typed WAL table while current-state projections stay available for fast reads.

What Actually Changes

  • Adds typed WAL models in core/persistence/samples/models.py:
    • SampleStatusEventRow
    • SampleTaskEventRow
    • SampleEdgeEventRow
    • SampleWorkerEventRow
    • SampleEvaluatorEventRow
    • SampleSandboxEventRow
    • SampleAnnotationEventRow
  • Adds application event helpers in core/application/samples/events.py:
    • SampleRuntimeEventAppender
    • SampleRuntimeEventReadService
    • SampleRuntimeEventView
  • Adds timestamp replay/slicing in core/application/samples/state.py.
  • Reworks RuntimeGraphRepository so graph writes append typed task/edge/component events while maintaining sample_graph_nodes and sample_graph_edges as projections.
  • Removes generic graph mutation DTOs from runtime application models.
  • Removes generic mutation/annotation persistence from graph persistence models.
  • Deletes the old dashboard graph-mutation mapper.
  • Replaces backend /samples/{sample_id}/mutations with /samples/{sample_id}/events.
  • Adds typed sample runtime event smoke/read helpers.

Gotchas / Review Risks

  • There is intentionally no generic sample_events table and no component interner. Worker/evaluator/sandbox events store full snapshot JSON directly.
  • Projection tables still exist and are written alongside WAL rows; the typed WAL is the durable history source.
  • Event ordering is (event_timestamp, id), not the old mutation sequence column.
  • node.field_changed has no direct v1 typed replacement; field-specific changes should become explicit typed events or remain projection-only.
  • The dashboard still adapts dashboard/sample.runtime_event into the existing graph-mutation reducer shape. That is middle-stack compatibility, not the final dashboard model.
  • Initial typed WAL rows can still be created from definition rows until sample materialization lands later.

Cleaned Later

  • PR 05 materializes authored public samples into these WAL/projection rows.
  • PRs 08 and 10 expose/render typed read APIs and dashboard surfaces more directly.
  • PR 11 deletes the definition-backed initialization path.

Validation Notes

Key coverage includes test_typed_sample_wal.py, test_sample_state_replay.py, test_sample_annotation_events.py, test_typed_sample_wal_boundaries.py, typed event smoke assertions, and dashboard event contract updates.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@cm2435
cm2435 force-pushed the codex/episode-sample-pr01-typed-wal branch from 4f37674 to c569c09 Compare May 25, 2026 20:47
@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@cm2435
cm2435 force-pushed the codex/episode-sample-pr01-typed-wal branch from 5e77817 to 86b810f Compare May 25, 2026 20:54
@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

1 similar comment
@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@cm2435
cm2435 force-pushed the codex/episode-sample-pr01-typed-wal branch from d8705b1 to 8cd4955 Compare May 25, 2026 21:08
@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@cm2435
cm2435 force-pushed the codex/episode-sample-pr01-typed-wal branch from 3d96912 to b048da1 Compare May 25, 2026 21:16
@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-120 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

Screenshots pushed to screenshots/pr-120.

researchrubrics/58d42b18-248d-48b9-8bb5-36e7b988ed1c-activity-stack.png
researchrubrics/58d42b18-248d-48b9-8bb5-36e7b988ed1c-happy.png
researchrubrics/58d42b18-248d-48b9-8bb5-36e7b988ed1c-visual-debugger-full.png
researchrubrics/d9786454-b902-4de1-bfd4-645b0bd14175-activity-stack.png
researchrubrics/d9786454-b902-4de1-bfd4-645b0bd14175-sad.png
researchrubrics/d9786454-b902-4de1-bfd4-645b0bd14175-visual-debugger-full.png
researchrubrics/fef3119f-083f-48aa-bf71-3467aacfa56e-activity-stack.png
researchrubrics/fef3119f-083f-48aa-bf71-3467aacfa56e-happy.png
researchrubrics/fef3119f-083f-48aa-bf71-3467aacfa56e-visual-debugger-full.png

@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

Screenshots pushed to screenshots/pr-120.

swebench-verified/18d08d69-1b2b-4451-bd3d-f08d99a2831d-activity-stack.png
swebench-verified/18d08d69-1b2b-4451-bd3d-f08d99a2831d-happy.png
swebench-verified/18d08d69-1b2b-4451-bd3d-f08d99a2831d-visual-debugger-full.png
swebench-verified/56806f75-3dde-406e-9ebd-05c92a2fcda5-activity-stack.png
swebench-verified/56806f75-3dde-406e-9ebd-05c92a2fcda5-happy.png
swebench-verified/56806f75-3dde-406e-9ebd-05c92a2fcda5-visual-debugger-full.png
swebench-verified/fc18704d-454f-431c-9d44-06bc2bfc9a23-activity-stack.png
swebench-verified/fc18704d-454f-431c-9d44-06bc2bfc9a23-sad.png
swebench-verified/fc18704d-454f-431c-9d44-06bc2bfc9a23-visual-debugger-full.png

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

Screenshots pushed to screenshots/pr-120.

minif2f/28bc3aa3-cdb9-4d3a-a319-d763803d4fee-activity-stack.png
minif2f/28bc3aa3-cdb9-4d3a-a319-d763803d4fee-happy.png
minif2f/28bc3aa3-cdb9-4d3a-a319-d763803d4fee-visual-debugger-full.png
minif2f/646ac16f-98e5-4ff7-8c38-7125c6d685b4-activity-stack.png
minif2f/646ac16f-98e5-4ff7-8c38-7125c6d685b4-happy.png
minif2f/646ac16f-98e5-4ff7-8c38-7125c6d685b4-visual-debugger-full.png
minif2f/e07ac5e4-3f00-407d-b862-38af0a6f43a0-activity-stack.png
minif2f/e07ac5e4-3f00-407d-b862-38af0a6f43a0-sad.png
minif2f/e07ac5e4-3f00-407d-b862-38af0a6f43a0-visual-debugger-full.png

@cm2435
cm2435 changed the base branch from codex/episode-sample-pr00 to dev June 7, 2026 18:36
@cm2435
cm2435 marked this pull request as ready for review June 7, 2026 18:36
@cm2435
cm2435 merged commit 368f245 into dev Jun 7, 2026
8 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.

1 participant