Skip to content

PR 08: Add sample-centered read APIs#127

Closed
cm2435 wants to merge 7 commits into
codex/episode-sample-pr07-examples-verticalfrom
codex/episode-sample-pr08-read-apis
Closed

PR 08: Add sample-centered read APIs#127
cm2435 wants to merge 7 commits into
codex/episode-sample-pr07-examples-verticalfrom
codex/episode-sample-pr08-read-apis

Conversation

@cm2435

@cm2435 cm2435 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Review Guide

Stack position: PR 08, base codex/episode-sample-pr07-examples-vertical, head codex/episode-sample-pr08-read-apis.

Implements RFC Docs

  • 03-core-runtime-persistence-fe.md: sample-centered read APIs and typed event views.
  • 03b-implementation-churn.md: read model/service changes for experiments, environments, sampler invocations, samples, and events.
  • 09-implementation-plan/09-pr-08-read-apis.md.

Why This PR Exists

This creates the backend read substrate that CLI and dashboard can consume: experiment detail, environment contributions, sampler invocations, sample detail, sample graph, sample state, and typed runtime events.

What Actually Changes

  • Adds experiment view DTOs/services under core/views/experiments:
    • experiment detail/list views.
    • environment contribution views.
    • sample summary views.
    • sampler invocation views.
  • Adds sample view DTOs/services under core/views/samples:
    • SampleDetailView
    • SampleEventsView
    • SampleGraphView
    • SampleStateView
  • Adds REST routes for:
    • /experiments
    • /experiments/{experiment_id}
    • /experiments/{experiment_id}/samples
    • /experiments/{experiment_id}/sampler-invocations
    • /samples/{sample_id}
    • /samples/{sample_id}/events
    • /samples/{sample_id}/graph
  • Moves old dashboard snapshot hydration to /samples/{sample_id}/workspace.
  • Adds typed sample runtime event views in core/application/samples/event_views.py, discriminated by eventType.
  • Updates generated dashboard REST/event contracts enough for typed WAL events to hydrate graph mutations.

Gotchas / Review Risks

  • The plan says this PR should avoid dashboard source, but the actual diff touches generated contracts and some dashboard adapter files. The practical reason is typed event DTO contract alignment.
  • Legacy definition/read surfaces coexist with these APIs, including old definition-oriented experiment reads and dashboard snapshot/index paths.
  • /samples/{id} changes from old workspace snapshot semantics to provenance detail; /workspace preserves frontend hydration compatibility.
  • Missing environment provenance can raise ValueError; review whether that should be a typed 404/422 response.
  • Event DTOs move to top-level typed fields with camel aliases; this is the canonical direction for FE contracts.

Cleaned Later

  • PR 10 moves the dashboard to these read APIs.
  • PR 11 removes legacy definition routes and compatibility paths.
  • Later remediation tightens generated contracts and removes dashboard adapter leftovers.

Validation Notes

Key tests include read-model service tests, route tests, typed event union tests, and dashboard contract tests. At agent review time, Python lint/type, unit/state, and integration were passing on this PR; frontend and smokes still had stack-level failures.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

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

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@cm2435
cm2435 force-pushed the codex/episode-sample-pr07-examples-vertical branch from 0431edd to a8b2c7d Compare May 26, 2026 23:13
@cm2435
cm2435 force-pushed the codex/episode-sample-pr08-read-apis branch from 36d4fe1 to 78097f1 Compare May 26, 2026 23:16
@github-actions

Copy link
Copy Markdown

E2E smoke — swebench-verified

Screenshots pushed to screenshots/pr-127.

swebench-verified/44014822-877c-4acc-a47f-871f83b139c4-activity-stack.png
swebench-verified/44014822-877c-4acc-a47f-871f83b139c4-sad.png
swebench-verified/44014822-877c-4acc-a47f-871f83b139c4-visual-debugger-full.png
swebench-verified/837239dd-74bd-4931-8b66-fbfb74bbad16-activity-stack.png
swebench-verified/837239dd-74bd-4931-8b66-fbfb74bbad16-happy.png
swebench-verified/837239dd-74bd-4931-8b66-fbfb74bbad16-visual-debugger-full.png
swebench-verified/a0573363-9151-4212-bb2e-6c1f7fe717df-activity-stack.png
swebench-verified/a0573363-9151-4212-bb2e-6c1f7fe717df-happy.png
swebench-verified/a0573363-9151-4212-bb2e-6c1f7fe717df-visual-debugger-full.png

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

Screenshots pushed to screenshots/pr-127.

minif2f/514082d5-4552-4aea-97a9-ca48d571882b-activity-stack.png
minif2f/514082d5-4552-4aea-97a9-ca48d571882b-happy.png
minif2f/514082d5-4552-4aea-97a9-ca48d571882b-visual-debugger-full.png
minif2f/6e4345cd-d61f-4ae5-9f20-99314cff9be7-activity-stack.png
minif2f/6e4345cd-d61f-4ae5-9f20-99314cff9be7-happy.png
minif2f/6e4345cd-d61f-4ae5-9f20-99314cff9be7-visual-debugger-full.png
minif2f/d63794f5-1a1c-4f2e-9b07-306a9d9cf150-activity-stack.png
minif2f/d63794f5-1a1c-4f2e-9b07-306a9d9cf150-sad.png
minif2f/d63794f5-1a1c-4f2e-9b07-306a9d9cf150-visual-debugger-full.png

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

Screenshots pushed to screenshots/pr-127.

researchrubrics/43b4bc45-89c4-4090-ba95-79c3309a200f-activity-stack.png
researchrubrics/43b4bc45-89c4-4090-ba95-79c3309a200f-happy.png
researchrubrics/43b4bc45-89c4-4090-ba95-79c3309a200f-visual-debugger-full.png
researchrubrics/931c7e50-d7dc-4037-a5ee-3c5580a20b64-activity-stack.png
researchrubrics/931c7e50-d7dc-4037-a5ee-3c5580a20b64-happy.png
researchrubrics/931c7e50-d7dc-4037-a5ee-3c5580a20b64-visual-debugger-full.png
researchrubrics/b4b6ad37-55c6-4941-8b94-bb31b44e6815-activity-stack.png
researchrubrics/b4b6ad37-55c6-4941-8b94-bb31b44e6815-sad.png
researchrubrics/b4b6ad37-55c6-4941-8b94-bb31b44e6815-visual-debugger-full.png

@cm2435
cm2435 force-pushed the codex/episode-sample-pr07-examples-vertical branch from 35596c3 to 6477e05 Compare May 27, 2026 14:00
@cm2435
cm2435 force-pushed the codex/episode-sample-pr08-read-apis branch from 78097f1 to 1aa7fd9 Compare May 27, 2026 14:00
@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

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

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

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

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

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

@cm2435
cm2435 force-pushed the codex/episode-sample-pr07-examples-vertical branch from 6477e05 to 9603f8e Compare May 27, 2026 14:44
@cm2435
cm2435 force-pushed the codex/episode-sample-pr08-read-apis branch from c0584b5 to 76c0d70 Compare May 27, 2026 14:44
@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

No PNG screenshots were uploaded for this leg. See screenshots/pr-127 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-127 for the uploaded placeholder.

@github-actions

Copy link
Copy Markdown

E2E smoke — minif2f

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

@github-actions

Copy link
Copy Markdown

E2E smoke — researchrubrics

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

@cm2435

cm2435 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Closed after landing the cumulative episode/sample stack snapshot through PR132 directly onto dev in merge commit 1c22130. This PR's changes are included in dev.

@cm2435 cm2435 closed this Jun 7, 2026
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