os-sdlc: Git namespace owns every git call; Project::Changes maps the change set; delete the five Runner diff classes #558
Labels
No labels
P0
P1
P2
P3
bug
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
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#558
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?
Context
Four production classes run the git binary through their own Open3 calls instead of the existing adapter
OsSdlc::Git(lib/os_sdlc/git.rb):Runner::PathDiff,Runner::DiffedRubyFiles,Project.git_repo?(project.rb:186), and test-support helpers. Five Runner classes answer diff questions with overlapping code: PathDiff, CodeDiff, TestDiff, DiffedRubyFiles, DiffedTestPaths. Git-shaped knowledge also hides inImplementation::Commit(changed/staged path math, commit.rb:38-55) andRunner::StateDump(rev-parse --abbrev-ref HEAD, state_dump.rb:59). ADR-0169 moved git work out of BriefFacts to the nearest owner in Runner; it did not choose Runner on purpose. Decision (user, 2026-09-11): one boundary. Git knows files and revisions; the project knows layout. One class per file.Design
OsSdlc::Gitbecomes a module (Zeitwerk needs this to nest).Git::Repoabsorbs today's adapter (run/read/succeeds?/capture) and owns repo queries:repo?,tracked?(path),changed_paths(glob:)(diff --name-only + ls-files --others),staged_paths,current_branch,stage(paths),commit(message, paths),diff(paths, base: "HEAD").Git::Diff(repo, paths, base:) → unified diff; tracked paths vs base, untracked vs /dev/null.base:is the hook for #556.Git::WorktreeandGit::Branch: existingOsSdlc::WorktreeandOsSdlc::Branchmove under the namespace, logic unchanged, constructed with aGit::Repo.Project::Changes(project, repo):code_paths,test_paths(changed test files + tests mapped from changed code files),code_diff,test_diff.CandidateTestPathsbecomesProject#tests_for(code_file)or a Project collaborator. Git::Diff never learns code_path or test_path.BriefFacts(code_changes/test_changes via Project::Changes),GateCommands(3 sites),Implementation::Commit(uses Repo#changed_paths/staged_paths/stage/commit),StateDump(Repo#current_branch),Project.git_repo?(Repo#repo?).OsSdlc::Git.hooks/lint_changed.rb(standalone hook, must not load lib),Project#boundary?(filesystem heuristic), plugins/os worktree CLI (other plugin, ADR-0157).Tasks
"git"shell-out outside Git::Repo and tests/support; report.Related
#555 (introduced PathDiff/CodeDiff), #556 (start commit → Git::Diff base:), ADR-0157, ADR-0162, ADR-0169, ADR-0173.
Origin
Resolution
Done: Git::Repo is the only class in lib/ that runs git (adapter verbs plus repo?, tracked?, changed_paths, staged_paths, current_branch, stage, commit, remote_url, diff); Git::Diff renders a path set against a base revision; Git::Worktree and Git::Branch moved under the namespace unchanged; Project::Changes owns code_paths/test_paths/code_diff/test_diff and Project#tests_for wraps CandidateTestPaths; five Runner diff classes and the old Git class deleted; BriefFacts, GateCommands, Implementation::Commit, StateDump, Project.git_repo?, IssueSource rewired; ADR-0174 amends 0162/0169/0173
Evidence: main
7fbc15fon 2026-09-11; suite 1192 runs 0 failures; rubocop clean on touched files; post-implementation sweep grep -rn '"git"' plugins/os-sdlc/lib shows only lib/os_sdlc/git/repo.rb; History row in docs/implementation-status/os-sdlc.md; bin/refresh-plugins runFollow-ups: #556 start commit now plugs into Git::Diff base: and Repo#changed_paths(base:); left alone by decision: hooks/lint_changed.rb (standalone hook), Project#boundary? (filesystem heuristic), plugins/os worktree CLI (ADR-0157 boundary); pre-existing FeatureEnvy offense on StateDump#green_entry untouched, no ticket