Repository navigation
Description
What to build
Deepen the Session recording module so each recorded Session interprets its output using the chosen Harness, Session prompt and launched process's directory and HOME. Callers should supply execution facts and an ordinary or Security interpretation policy, rather than constructing Interpretation themselves.
This closes a concrete omission: ordinary sandboxed Sessions redirect Codex's native quota reader to their fresh HOME, but Model Graders construct Interpretation without that redirection. A sandboxed Codex Grader can therefore miss a native plan-limit warning. This consequence follows from the code; this review did not reproduce a production incident.
Acceptance criteria
- Recording constructs Interpretation internally from the selected Harness and the recording input's Session prompt. Its production interface no longer accepts a caller-created Interpretation or an arbitrary Interpretation factory.
- Recording uses the launch command's working directory, resolving a relative directory against the parent process's current directory and using that current directory when the command supplies none. It does not canonicalize the directory.
- An explicit HOME value configured on the launch command redirects Interpretation's native readers before any output is consumed. When the launch supplies no HOME value, the adapter keeps its existing inherited-environment behavior. The scoped Model Grader receives the same redirection as an ordinary sandboxed Session.
- Recording input exposes a small ordinary/Security interpretation policy, defaulting to ordinary. Security audit, Security fix publishing and Security review Sessions select Security policy and retain the selected Model's existing refusal/reporting rules. Model Graders select ordinary policy.
- Both production callers migrate together. They retain ownership of invocation selection and launch preparation; Recording owns Interpretation construction, streamed recording and completion. Session skill linking, Resume, reports, fixed Grader executables, scope observation, deadlines and private diagnostics retain their current behavior.
- Interface tests exercise native Codex quota records beneath an explicit launch HOME with no observer HOME or CODEX_HOME override, using a direct Command and the existing local scope fixture. A matching current-Session warning stops private execution, records the warning and prevents later child work. Stale records and records from another Session/directory do not stop it.
- Tests cover ordinary and Security interpretation through the same Recording interface and preserve streamed Model evidence, interrupted execution, authoritative empty/conflicting retained evidence, progress ordering and Grader memory-cap diagnostics.
- Recording tests that combine one Harness's stream decoder with another Harness's retained reader are replaced with matching Harness protocols and local retained fixtures or fake exports. Configure fixture working directories explicitly; remove injection-only helpers that become unused. Keep focused decoder/reconciliation tests at their existing interface.
- Update the domain-to-code navigation to identify Recording as the owner of recorded Interpretation construction. Run focused Recording, Session execution, Model Grader, Harness interpretation and Trial regressions, then the repository's affected-test validation. Any environment-gated checks are reported accurately.
Blocked by
None (can start immediately).
Decisions
The design tree is settled in three rounds; each round resolves the decisions whose prerequisites the previous round established.
Round 1 — responsibility and scope
- Deepen existing Recording. It already owns supervision, streamed evidence, retained completion and the selected Harness. Giving it Interpretation construction removes the caller's obligation to keep the decoder, prompt and launch environment consistent, rather than adding another module with a shallow interface.
- Use one standalone Ticket. There are two production recording callers and one shared test migration. They can move together in one fresh context window, so no staged compatibility interface, parent Spec or blocking edge is needed.
- Keep the launch seam where it is. Ordinary Commands and scoped invocations already satisfy the process invocation interface. Recording can inspect their actual Command before supervision; moving sandbox preparation or Session sequencing into it would add unrelated responsibilities.
Round 2 — interface and integration
- Remove the Interpretation argument. Build it from the recording Choice and prompt, because these are already authoritative inputs to the Session trace. This prevents a caller from recording one Harness while interpreting another.
- Derive the directory from the Command. Both production callers set it already, including scoped Graders. The relative-directory and parent-directory rules match process launch semantics; avoiding canonicalization preserves the caller's path spelling and adds no filesystem lookup requirement.
- Read explicit launch HOME from the Command. Sandbox construction puts HOME on the actual Command even when a scope encloses bwrap. Apply the existing native-home redirection before streaming; retain adapter defaults when no explicit value exists. This gives the missing Grader behavior the same owner as the existing Session behavior, without changing native record matching rules.
- Make Security interpretation an explicit two-value input policy. Only ordinary and Security Interpretation differ among production callers. Default to ordinary and map all three Security purposes to Security using the chosen Model, because log labels and private-output settings are separate concerns.
- Migrate both recording callers together. Ordinary Session execution loses its Interpretation construction and sandbox-HOME scan; Model Grader recording loses its independent construction. Their invocation selection, private-output policy, scope lifetime and error classification stay with their existing owners, because those behaviors are not shared Interpretation responsibilities.
- Keep non-recording Interpretation consumers independent. Historical replay, Trial-result recovery, summaries and old-Arm monitoring do not execute through Recording. They retain their own interpretation interfaces, because their inputs and evidence lifetimes differ from a recorded Session's.
- Keep persisted formats stable. No change to Session traces, Model evidence, Trial protocol, saved Experiments or User config is required; the change concerns who constructs the existing Interpretation. Existing domain terms already describe the responsibility, and this reversible internal ownership change requires no glossary definition or ADR.
Round 3 — verification and maintenance
- The interface is the test surface. Exercise the recording interface with matching Harness streams, local native files and direct/scoped invocation adapters. These two existing adapters justify the seam; no new external dependency or production injection interface is needed.
- Replace artificial stream injection. The current mixed-Harness fixtures test combinations that production never uses. Matching Harness fixtures preserve their evidence assertions while allowing Recording to enforce Harness/Interpretation agreement. Retain focused interpretation tests for decoder and reconciliation behavior.
- Prove launch context behavior through observable results. Assert Session ending, retained warning/evidence and absence of later child work for native quotas; retain ordinary/Security outcomes, evidence replacement and private memory diagnostics. These checks survive internal refactors and test the coordination bug, rather than a helper's field values.
- Update navigation and validate the complete migration. Ownership moves across the existing navigation entries and test call sites, so the Ticket includes those changes and the normal affected-test validation. The review itself made no repository edits; its affected-test selection against the reviewed origin/main head reported no changed files.
Architecture review
Strength: Strong · Dependencies: local-substitutable
Files: src/session/recording.rs, src/session.rs, src/evals/experiment/model_grader.rs, src/session/recording/tests.rs, src/session/execution_tests.rs, src/evals/experiment/model_grader/tests.rs, src/harness/interpretation_tests.rs, src/harness/muse/log.rs, src/harness/opencode/export.rs, src/harness/codex/limits.rs, src/harness/codex/patches.rs, tests/trial.rs, docs/code-navigation.md
Before
flowchart LR
S[Session execution] --> L[Launched invocation]
G[Model Grader] --> L
S --> I[Harness Interpretation]
G --> I
L -. HOME and directory .-> I
S --> R[Session recording]
G --> R
I --> R
classDef leak stroke:#dc2626,stroke-width:2px;
class I leak
After
flowchart LR
S[Session execution] --> L[Launched invocation]
G[Model Grader] --> L
S --> R
G --> R
L --> R
subgraph R[Session recording]
I[Harness Interpretation]
end
classDef deep stroke-width:3px;
class R deep
Problem: the recording module leaks Interpretation construction across its seam, making callers coordinate Harness, prompt, directory and HOME while the Model Grader omits native-home redirection.
Solution: increase Recording's depth by absorbing that implementation behind its existing execution interface, using the existing direct and scoped invocation adapters.
Deletion test: deleting the deep module would redistribute interpretation, recording and evidence-lifetime knowledge across both callers.
Covered by: none; all 114 open issue titles and bodies were checked, and no issue proposes this deepening of these modules.
Wins
- Locality: Interpretation follows launch context
- Leverage: both recording callers agree
- Tests cross one execution interface
- Caller interpretation assembly disappears
Activity