Add OsGit::Sync and replace the os-vault and memsearch git hooks #1590
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#1590
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
plugins/os-vault/hooks/vault_sync.pyandmemsearch_sync.pyare near copies. Both runadd -A, commit, and push at SessionEnd.session_start.pyruns a networkpull --ff-onlyat SessionStart.session_context.pyandsession_end.pyrunrev-parse --show-toplevelon every prompt and at session end. The house rule bansadd -A, and no object owns the exception.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: structural change. The call sites are rows G-051 to G-057 in the checklist.
Approach
Build
OsGit::Sync(design section 3.1):Sync.new(repository, branch:, message:),#pull(timeout: 10),#publish(timeout: 30). Both returnOutcome(:done | :skipped, reason)and raiseOsGit::Erroron failure. The hook edge wraps each call inOsGit::FailOpen.call(default:)so a hook never disturbs a session. OnlySyncmay stage everything.Commit::Planstays path-only.Q1 ruling (made by
/os-me:predictand recorded in design section 8):Syncmay stage everything inside the vault and memsearch repositories, only for a repository whose.gitignorethe caller names (ADR-0015 whitelist.gitignore). Theos-doc-hygieneWIP checkpoint does not use this exception.The Ruby port of the os-vault hooks is ticket #1527. This ticket starts after #1527 ships, because
Syncreplaces the git code in the new Ruby hooks, and the Python files go with the port. Capture applies no state labels, so the wait is stated here and nowaitinglabel is set.Rows to mark in
docs/os-git/call-site-checklist.md: G-051 to G-055 (replaced bySyncandRepoRoot), G-056 and G-057 (eval harness: replace withRepositoryor mark out of scope with a reason), and G-187 (plugins/os-vault/tests/generate-fixtures.sh).Required work:
OsGit::Syncwith pull and publish — check: presentpublishinplugins/os-git/lib/os_git/sync.rbSyncandRepoRootand never rungitthemselves — check: absentgitinplugins/os-vault/hooks/vault_sync.rbAcceptance criteria
Sync#publishruns, then it stages, commits with the message, and pushes, and returns:done.Sync#publishruns, then it makes no commit and returns:skipped.Sync#pullor#publishruns, then it raisesOsGit::TimedOut, and the hook prints one stderr line and exits 0.Sync#pullruns, then it raisesOsGit::Diverged, and the hook exits 0.Syncobject as the vault hook, and no second copy of the sequence exists..git, when the hooks run, then they skip silently, as the Python hooks did.gitprocess starts (RepoRoot).- [x]or marked out of scope with a reason.Owner sketch
Non-goals
The Ruby port of os-vault itself (#1527). The graphify rebuild hook (#1576).
Blocking edges
Blocked by #1527 (the Ruby port of the os-vault hooks has not shipped) and by the core ticket (#1588).
Origin
Skipped in the #1610 build: blocker #1527 is open. Rows G-051 to G-057 and G-187 are marked deferred in docs/os-git/call-site-checklist.md. OsGit::Sync is not built; the hooks stay as they are until the Ruby port.
Blocked by #1527 (open, P3): the os-vault hooks are still Python (
plugins/os-vault/hooks/*.py), andOsGit::Syncreplaces the git code in the Ruby port. Checklist rows G-051 to G-057 and G-187 already carry the deferral with that reason (docs/os-git/call-site-checklist.md). Removewaitingwhen #1527 ships.