Migrate the ticket-takedown eval harness git calls to OsGit #1593

Closed
opened 2026-11-06 16:53:32 +00:00 by jared · 1 comment
Owner

Problem

The ticket-takedown eval harness builds scratch repositories and reads the git common dir with its own git calls (adapter/scratch_repo.rb, adapter/case_preparer.rb, adapter/principle_files.rb, adapter/repro_sandbox.rb, command/judge_pairs.rb).

Design: docs/os-git/use-cases-and-domain.md (design) and docs/os-git/call-site-checklist.md (call sites). Settled decisions are in design section 1 (docs/os-git/use-cases-and-domain.md): the gem lives in plugins/os-git with a path: source; git-context and os:worktree merge into os-git; old wrappers go only after all references are updated; design order is use-cases, objects, interfaces; os-context and os-vault become Ruby; ticket tracking stays out of os-git.

Reproduce

n/a: migration of existing call sites; behavior stays the same unless a criterion says otherwise.

Approach

Group A-05. Scratch repositories use OsGit::Testing::ScratchRepo (it may stage everything because it is a fixture). The git common dir comes from Repository#primary_root (G-040, G-041). rev-parse HEAD is Repository#resolve("HEAD") (G-042). git archive HEAD | tar (G-038, G-039) has no use-case: decide whether to add Repository#export(ref, into:) to the design or leave the call out of scope with a reason.
Eval discipline applies (docs/eval-discipline.md): change adapter code only. Do not read or run scenario Task blocks, reserve sets, or cases and results files.

Mark every row in the checklist from the Done column as it is replaced. Mark the matching test rows in the same change. Run bin/refresh-plugins after changes to SKILL.md, hooks, or CLIs.

Required work: none beyond the acceptance criteria.

Acceptance criteria

  1. Given a case preparation, when the harness builds its scratch checkout, then the checkout holds the same files and one initial commit as before.
  2. Given the harness runs inside a linked worktree, when it needs the common git dir, then it gets the primary checkout path.
  3. Given the eval harness tests (rows G-172 to G-174), when they run, then they pass.
  4. Given rows G-038 to G-042 and the test rows G-172 to G-174, when the ticket closes, then each row is marked - [x] with Replaced by filled in, or marked out of scope with a reason, in docs/os-git/call-site-checklist.md.
  5. Given the touched code, when it is searched for Open3, system(, %x, backticks, and git argv, then no git call remains outside OsGit adapters, except sites marked out of scope with a reason.

Blocking edges

Blocked by the core ticket (#1588). Run after the os-sdlc migration (#1592).

Origin

  • Trigger: User request in session 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 on 2026-11-06: one os-git gem for all local git work in cc-os and the user's projects.
  • Improvised this session: none
  • Chain: eval harness runs git on its own ← scratch repo code predates a shared fixture builder ← DESIGN (docs/os-git/call-site-checklist.md group A-05)
  • Root candidate: none found; searched open issues for git, worktree, octokit, ruby port, python, statusline, reset --hard. Related but not a match: #845, #853, #857, #1527, #1554.
  • Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/, command/judge_pairs.rb
  • Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
## Problem The ticket-takedown eval harness builds scratch repositories and reads the git common dir with its own git calls (`adapter/scratch_repo.rb`, `adapter/case_preparer.rb`, `adapter/principle_files.rb`, `adapter/repro_sandbox.rb`, `command/judge_pairs.rb`). Design: `docs/os-git/use-cases-and-domain.md` (design) and `docs/os-git/call-site-checklist.md` (call sites). Settled decisions are in design section 1 (`docs/os-git/use-cases-and-domain.md`): the gem lives in `plugins/os-git` with a `path:` source; `git-context` and `os:worktree` merge into `os-git`; old wrappers go only after all references are updated; design order is use-cases, objects, interfaces; `os-context` and `os-vault` become Ruby; ticket tracking stays out of `os-git`. ## Reproduce n/a: migration of existing call sites; behavior stays the same unless a criterion says otherwise. ## Approach Group A-05. Scratch repositories use `OsGit::Testing::ScratchRepo` (it may stage everything because it is a fixture). The git common dir comes from `Repository#primary_root` (G-040, G-041). `rev-parse HEAD` is `Repository#resolve("HEAD")` (G-042). `git archive HEAD | tar` (G-038, G-039) has no use-case: decide whether to add `Repository#export(ref, into:)` to the design or leave the call out of scope with a reason. Eval discipline applies (`docs/eval-discipline.md`): change adapter code only. Do not read or run scenario `Task` blocks, reserve sets, or cases and results files. Mark every row in the checklist from the `Done` column as it is replaced. Mark the matching test rows in the same change. Run `bin/refresh-plugins` after changes to `SKILL.md`, hooks, or CLIs. Required work: none beyond the acceptance criteria. ## Acceptance criteria 1. Given a case preparation, when the harness builds its scratch checkout, then the checkout holds the same files and one initial commit as before. 2. Given the harness runs inside a linked worktree, when it needs the common git dir, then it gets the primary checkout path. 3. Given the eval harness tests (rows G-172 to G-174), when they run, then they pass. 4. Given rows G-038 to G-042 and the test rows G-172 to G-174, when the ticket closes, then each row is marked `- [x]` with `Replaced by` filled in, or marked out of scope with a reason, in `docs/os-git/call-site-checklist.md`. 5. Given the touched code, when it is searched for `Open3`, `system(`, `%x`, backticks, and `git` argv, then no git call remains outside `OsGit` adapters, except sites marked out of scope with a reason. ## Blocking edges Blocked by the core ticket (#1588). Run after the os-sdlc migration (#1592). ## Origin - Trigger: User request in session 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 on 2026-11-06: one os-git gem for all local git work in cc-os and the user's projects. - Improvised this session: none - Chain: eval harness runs git on its own ← scratch repo code predates a shared fixture builder ← DESIGN (docs/os-git/call-site-checklist.md group A-05) - Root candidate: none found; searched open issues for git, worktree, octokit, ruby port, python, statusline, reset --hard. Related but not a match: #845, #853, #857, #1527, #1554. - Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/, command/judge_pairs.rb - Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
Author
Owner

Resolution

Done: Harness git calls moved to OsGit. Added Repository#export and #file_log. Scratch checkouts use ScratchRepo. Takedown::GitGuard keeps the Failure contract.

Evidence: main ea19631d. takedown 623 runs, 0 failures. Old and new builds give the same tree sha on this repository, one commit, branch main. primary_root equals the old value from a linked worktree. Rows G-038 to G-042, G-172 to G-174 marked.

Follow-ups: none

## Resolution **Done:** Harness git calls moved to OsGit. Added Repository#export and #file_log. Scratch checkouts use ScratchRepo. Takedown::GitGuard keeps the Failure contract. **Evidence:** main ea19631d. takedown 623 runs, 0 failures. Old and new builds give the same tree sha on this repository, one commit, branch main. primary_root equals the old value from a linked worktree. Rows G-038 to G-042, G-172 to G-174 marked. **Follow-ups:** none
jared closed this issue 2026-11-06 22:05:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1593
No description provided.