Repository navigation
Description
What to build
Make the Eval repository preparation module return a complete repository for a Trial: the Base branch, the Issue branch with the reviewed change committed, the excluded issue input, and, for Spec review, the corresponding refs in its private local origin. Trial execution should request that result once before establishing the Harness instruction fallback and taking the integrity snapshot.
Today repository preparation isolates Git from the caller's settings, but Trial execution then creates branches and pushes through ordinary Git. A host checkout hook can therefore change the repository before its integrity snapshot. Keep the complete preparation under the repository module's existing Git policy so both Arms review the intended inputs.
Keep thirdshift evals prepare as the existing inspection operation: a detached base with the reviewed patch staged. This change fits one implementation session and is one standalone Ticket.
Acceptance criteria
- Trial execution obtains a complete Trial repository through one preparation operation; its separate branch/commit/push procedure and issue-input exclusion call are removed.
- Trial branch validation, checkout, synthetic reviewed commit, local-origin publication, and issue-input exclusion belong to the repository preparation module and use its isolated Git policy where Git is needed. Ordinary application Git behavior is unchanged.
- With a temporary caller Git configuration installing observable checkout and push hooks, complete Trial preparation invokes neither hook. A production-path regression verifies that Trial execution uses this operation; its fixture must actually pass the custom configuration to the operation under test.
- Code-review and Spec-review preparation preserve custom Base branch and Issue branch names, including slash-containing names, and reject missing Trial inputs, invalid refs, and identical branch names before returning a repository.
- The Base branch points at the recorded base. The checked-out Issue branch has one synthetic reviewed commit directly above that base. It commits the already staged reviewed patch without adding copied input files or committing their worktree overlays. Original change and later commit objects remain absent.
- Code review has no origin. Spec review's private bare origin contains the requested Base branch and Issue branch refs, remains usable after the prepared repository is published, and its configured and returned paths name the final destination.
- Complete Trial preparation finishes before publishing the destination. A preparation failure leaves the requested destination absent and starts no Arm process. Existing destinations are refused.
- Existing
evals prepareandevals verifybehavior remains covered: detached base, staged patch, confined inputs, source object format, base-only ancestry, independent Spec-review origin, and cleanup on failure. - Update the domain-to-code navigation entry for the moved preparation ownership and the Eval preparation documentation to distinguish inspection preparation from complete Trial preparation. Check the hand-written site pages' Trial descriptions and correct any affected claims in the same change.
- Preserve the existing Trial execution and Experiment regressions, including reviewed diffs, frozen inputs, integrity detection, and Spec-review local pushes; run the repository's affected-tests entry point against the implementation's base.
Blocked by
None (can start immediately).
Decisions
Design tree, settled in dependency order; every branch below is closed.
Round 1: scope and seam
- Deepen the existing Eval repository preparation module. Its seam owns the transition from an approved Eval task to an isolated repository. Branch creation and the synthetic reviewed commit are part of that transition, because an Arm must never receive a repository that still needs caller-side preparation. Removing the shallow Trial branch procedure concentrates this knowledge instead of renaming it.
- Keep two complete operations with shared private implementation. Retain inspection preparation and add complete Trial preparation, taking the task directory, validated Eval task, and absent destination and returning the existing prepared-repository result. Inspection preparation intentionally leaves the patch staged; changing it would break an established CLI contract. No caller-facing mode flags, staged builder, new trait, or additional adapter are needed.
- Limit the change to preparation. Resource admission, the Trial protocol, Arm selection, execution evidence, scoring, the Bar, retries, and integrity comparison keep their current owners. This makes the Ticket independently implementable and preserves the recently deepened Trial execution module.
Round 2: implementation behind the seam
- Validate Trial inputs before preparation can be published. Complete Trial preparation requires the Trial input table and checks ref syntax and distinctness with the repository module's Git policy. Preserve the Experiment preflight that names all missing Trial inputs before Arm builds. Preserve valid custom names, including an Issue branch named
basewhen its actual Base branch differs; introduce no reserved-name rule. - Keep the existing import and verification order. Import only base ancestry, stage the reviewed patch, copy the declared inputs, and verify the working repository and any bare origin while they still contain base-only history. Then create the requested Trial branches and the synthetic commit. The existing verification operation deliberately requires a detached base, so running it after the synthetic commit would reject the intended result. Preserve the source object format and full commit IDs.
- Commit the existing index only. Use the current synthetic commit identity and message and disable signing and hooks for that commit. Do not add files or use an all-files commit: copied inputs can intentionally override tracked worktree content while the index still represents the reviewed patch.
- Own all preparation effects under one Git policy. Reuse the repository module's private isolated Git execution, including disabled system/global configuration, replacement-object suppression, local transport allowance, and cleared Git directory/index/object-store overrides. Apply that policy to branch validation, branch creation, checkout, commit, and local push. Write the issue-input exclusion inside the uniquely owned temporary repository rather than using the shared-worktree exclusion operation, which needs ordinary Git and a shared lock. This improves locality without changing how normal Runs use Git or how integrity snapshots include ignored files.
- Finish in staging and publish once. For Spec review, push the requested refs directly to the staged bare origin's actual path. Keep the configured origin URL and returned origin path pointed at the final destination, then rename the complete repository into place. Pushing through that final URL before the rename cannot work. Reuse temporary-directory cleanup so failure leaves no published partial repository. Preserve the bare origin's existing seed refs.
- Keep Harness preparation after repository preparation. Trial execution still establishes the selected Harness's instruction fallback and only then captures integrity. Those effects depend on the Arm's Harness rather than the Eval repository preparation contract, so they stay outside this seam.
Round 3: tests and documentation
- The interface is the test surface. Exercise complete preparation with real local Git repositories and temporary directories. Assert the resulting refs, synthetic commit/tree, copied input overlays, ignored issue input, usable final origin, rejection behavior, and absent destination on failure. These local dependencies need no new mock adapter and no subscription sessions.
- Retain inspection tests and add one execution regression. Existing Eval CLI tests already pin detached-base preparation, history confinement, binary/submodule changes, and local-origin independence; retain them. Use the existing isolated Trial execution fixture to verify the caller crosses the new seam. Install its custom caller Git configuration after constructing the source fixture, since the fixture currently forces global Git configuration off and would otherwise mask the defect.
- Cover both review kinds and the publication transition. Check code review without an origin and Spec review with its requested refs readable and pushable after the rename. Include a tracked input overlay so a refactor that stages all inputs is caught, and a rejected ref or preparation failure so no incomplete result reaches an Arm. Keep existing Experiment regressions rather than adding duplicate tests of private helper ordering.
- Update navigation and preparation documentation with implementation. The ownership moves but the domain language does not. No new glossary term or ADR is needed: this is a reversible internal consolidation that preserves existing decisions and CLI contracts. No glossary or ADR was edited during this review.
Review evidence at 825378485fe6efd0e9f7fa2bd6f36ba04761d388: an isolated local Git probe observed no checkout hook during isolated preparation, a hook during the current ordinary-Git branch checkout, and no hook with preparation's Git policy restored. A second throwaway Git prototype passed both review kinds with staging, the synthetic reviewed commit, a tracked input overlay, issue exclusion, a direct push to the staged bare origin, and a usable final origin after rename. These validate the design constraints; they are not product regression tests. The worktree remained unchanged; scripts/affected-tests origin/main reported no affected tests. All 114 open issue titles and bodies were read and rechecked immediately before publication; none covers this deepening.
Architecture review
Strength: Strong · Dependencies: local-substitutable
Files: src/evals/repository.rs, src/evals/experiment/execution.rs, src/evals/experiment/execution/tests.rs, tests/evals.rs, tests/experiments.rs, docs/code-navigation.md, docs/eval-tasks.md
Before
flowchart LR
E[Trial execution module] --> I[Eval repository preparation]
E -.-> B[Trial branches and reviewed commit]
E -.-> X[Issue-input exclusion]
I -->|isolated settings| G[Git adapter]
B -->|caller settings| G
X -->|caller settings| G
classDef leak stroke:#dc2626,stroke-width:2px;
class B,X leak
After
flowchart LR
E[Trial execution module] --> P
subgraph P[Deep Eval repository preparation module]
direction LR
I[Eval repository preparation] --> B[Trial branches and reviewed commit]
B --> X[Issue-input exclusion]
end
I -->|isolated settings| G[Git adapter]
B -->|isolated settings| G
classDef deep stroke-width:3px;
class P deep
Problem: the shallow Trial branch module exposes repository preparation ordering and Git policy across its seam, allowing caller settings to affect the reviewed inputs.
Solution: deepen the existing repository preparation module so one complete Trial preparation interface hides branch, commit, origin, and exclusion implementation.
Wins
- Depth: complete repository per call
- Locality: preparation policy stays together
- Leverage: shared preparation implementation
- Tests cross the production interface
- Existing Git adapter remains sufficient
Activity