os-sdlc tests start git 3,381 times: move Git behind OsGit with a recorded fixture #1645
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1645
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The os-sdlc test suite starts
git3,381 times in 99 test files. Ruling 88 (docs/decisions/rulings.tsv) and.claude/rules/ruby-external-calls.mdforbid this: no test starts a real process, and os-sdlc does not test Git. os-git owns Git (ADR-0305). These process starts make the suite slow and make mutation testing reach its time limit.Observed
A one-time list run of the suite recorded each process start. It found 4,173 process starts in 163 test files. 3,381 are
git. About half start from test code, for example the scratch repository intest/support/git_repo_scenario.rb. The others start from library code:lib/os_sdlc/project/changes.rb514,implementation/commit.rb209,project_shell.rb130,project/base_branch.rb91,implementation/state_dump.rb87,fast_gate/changed_files.rb81,crc/ledger/commits/commit.rb69,crc/sweep/files.rb67.Reproduce
n/a: structure ticket.
Approach
Library Git calls go through the
OsGitinterface. The entry passes it in, as commit737d2e13does for the tracker (ProcessIOcarriestrackers; tests passSeededTicketTracker). Tests receive anOsGitdouble that returns recorded answers. No os-sdlc test builds a scratch repository.Acceptance criteria
gitstarts.Origin
lib/os_sdlc/map(91 of 330 mutants), then a list run of process starts on 2026-11-09.claude/rules/ruby-external-calls.md, ADR-0305)plugins/os-sdlc/lib/os_sdlc/project/changes.rb,plugins/os-sdlc/test/support/git_repo_scenario.rbVERDICT: CREATE (ticket-skeptic, 2026-11-09): ruling 88 is a stated requirement; no open ticket covers os-sdlc git calls.
os-git track: the coverage list is in
docs/os-git/os-sdlc-coverage.md(maincf551aa36).Result: every git call in os-sdlc
lib/,bin/, andhooks/already goes through anOsGitmessage. No file starts git by hand. This pass added no gem operation.OsGit::Backend::Fakeanswers every message thatBackend::Clianswers, so each site can take a fake backend with a recorded answer.The git starts in the tests come from setup:
GitRepoScenario#run_git!calls@scratch.backend.capture(commit 16, add 13, switch 4, rev-parse 3, and others). When a site takes the recorded fixture, that setup goes away. Two directOpen3.capture3("git", "status")strings in cop tests are cop input, not process starts.Nothing in os-git blocks this ticket.
Start (session bc5ad309, 2026-11-09): mutation track works #1645 with #1627 and the last two #1647 items (runtime process guard, mirror_tickle pbm sync adapter) in worktree ticket-1645. The entry passes an OsGit collaborator through ProcessIO; tests pass an OsGit double.
Resolution
Done: Git behind OsGit: the entry passes the repository; tests pass an in-memory git fake; real-git test setup removed; runtime process guard on in test_helper
Evidence: main
38b3284d(pushed); suite 3,676 runs green with the guard on, 26.6 s at load 1.4; git starts 3,371 -> 0; cops ProcessStartOutsideAdapter and AdapterBuiltOutsideEntry 0 hitsFollow-ups: #1652 (os_git ships the repository fake; skeptic CREATE)