You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review Guide
Stack position: PR 08, base
codex/episode-sample-pr07-examples-vertical, headcodex/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
core/views/experiments:core/views/samples:SampleDetailViewSampleEventsViewSampleGraphViewSampleStateView/experiments/experiments/{experiment_id}/experiments/{experiment_id}/samples/experiments/{experiment_id}/sampler-invocations/samples/{sample_id}/samples/{sample_id}/events/samples/{sample_id}/graph/samples/{sample_id}/workspace.core/application/samples/event_views.py, discriminated byeventType.Gotchas / Review Risks
/samples/{id}changes from old workspace snapshot semantics to provenance detail;/workspacepreserves frontend hydration compatibility.ValueError; review whether that should be a typed 404/422 response.Cleaned Later
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.