Replace the .git probes in hooks with OsGit RepoRoot #1598
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#1598
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
Eight sites find the repository root by testing for
.gitwithout starting git:os/lib/os_hooks/project_root.rb,os-backlog/lib/backlog/config_locator.rb(reads the.gitfile of a linked worktree),os-backlog/lib/backlog/session_start.rb,os-adr/lib/adr/pre_tool_use.rb,os-adr/lib/adr/session_start.rb, and three Python files inos-doc-hygiene(scanner.py,reminder.py,state_store.py). They repeat one job and run in hooks.Design:
docs/os-git/use-cases-and-domain.md(design) anddocs/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 inplugins/os-gitwith apath:source;git-contextandos:worktreemerge intoos-git; old wrappers go only after all references are updated; design order is use-cases, objects, interfaces;os-contextandos-vaultbecome Ruby; ticket tracking stays out ofos-git.Reproduce
n/a: migration of existing call sites; behavior stays the same unless a criterion says otherwise.
Approach
Group A-11. Replace each Ruby site with
OsGit::RepoRoot.find(path)(process-free, from the core ticket #1588).config_locator.rbalso needsprimary_rootfor a linked worktree: use the same finder. The three Python sites stay untilos-doc-hygieneis ported (see #1597): mark rows G-063 to G-065 deferred with that reason. The os-vault probes sit inside rows G-053 to G-055 and belong to the Sync ticket (#1590).Mark every row in the checklist from the
Donecolumn as it is replaced. Mark the matching test rows in the same change. Runbin/refresh-pluginsafter changes toSKILL.md, hooks, or CLIs.Required work: none beyond the acceptance criteria.
Acceptance criteria
gitprocess starts.config_locatorresolves the main checkout, then it gets the main checkout path.nilas before.- [x]withReplaced byfilled in, or marked out of scope with a reason, indocs/os-git/call-site-checklist.md.Open3,system(,%x, backticks, andgitargv, then no git call remains outsideOsGitadapters, except sites marked out of scope with a reason.Blocking edges
Blocked by the core ticket (#1588).
Origin
Resolution
Done: RepoRoot at os ProjectRoot, both session_start hooks, and config_locator. Hooks load repo_root.rb alone and warn when the link is missing. pre_tool_use keeps File.exist? so the guard fails closed.
Evidence: main
ea19631d. os 242, os-adr 169, os-backlog 413, os-git 291 runs, 0 failures. pre_tool_use cold start unchanged. G-058 to G-060, G-062 marked; G-061 out of scope (ruling 6); G-063 to G-065 deferred to #1597.Follow-ups: #1630 os-git link setup on a new machine (ticket-skeptic verdict).