Rule on and migrate the cc-plugins git hook and harness scripts #1600

Closed
opened 2026-11-06 16:53:36 +00:00 by jared · 2 comments
Owner

Problem

cc-plugins/progressive-disclosure/hooks/pre-commit and lib/hook_installer.rb (which emits the same bash in two variants) run git add and always exit 0. cc-plugins/workflow-optimizer/harness/scripts/init-run and capture-diff run add -A in scratch directories. Open item Q-4 in the checklist asks whether the pre-commit hook should call os-git.

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-15. The orchestrator rules Q-4 with /os-me:predict and records the ruling. Recommended: leave the pre-commit hook as bash (it is a git hook, not a Claude hook, and a Ruby start-up cost adds to every commit), and mark G-075 and G-076 out of scope with that reason; merge the duplicated hook body into one source. The harness scripts run only in scratch directories: mark G-077 and G-078 out of scope with that reason unless a ruling says otherwise.

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 the ruling, when the checklist is read, then rows G-075 to G-078 are marked replaced or out of scope with the reason.
  2. Given the hook installer, when it writes the hook body, then it writes it from one source, and the fresh and chain variants produce the same git calls as before.
  3. Given rows G-075 to G-078, 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.
  4. 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).

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: git hook scripts outside the shared design ← bash hook and scratch harness ← DESIGN (docs/os-git/call-site-checklist.md Q-4)
  • 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: cc-plugins/progressive-disclosure/, cc-plugins/workflow-optimizer/harness/scripts/
  • Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
## Problem `cc-plugins/progressive-disclosure/hooks/pre-commit` and `lib/hook_installer.rb` (which emits the same bash in two variants) run `git add` and always exit 0. `cc-plugins/workflow-optimizer/harness/scripts/init-run` and `capture-diff` run `add -A` in scratch directories. Open item Q-4 in the checklist asks whether the pre-commit hook should call `os-git`. 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-15. The orchestrator rules Q-4 with `/os-me:predict` and records the ruling. Recommended: leave the pre-commit hook as bash (it is a git hook, not a Claude hook, and a Ruby start-up cost adds to every commit), and mark G-075 and G-076 out of scope with that reason; merge the duplicated hook body into one source. The harness scripts run only in scratch directories: mark G-077 and G-078 out of scope with that reason unless a ruling says otherwise. 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 the ruling, when the checklist is read, then rows G-075 to G-078 are marked replaced or out of scope with the reason. 2. Given the hook installer, when it writes the hook body, then it writes it from one source, and the fresh and chain variants produce the same git calls as before. 3. Given rows G-075 to G-078, 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`. 4. 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). ## 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: git hook scripts outside the shared design ← bash hook and scratch harness ← DESIGN (docs/os-git/call-site-checklist.md Q-4) - 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: cc-plugins/progressive-disclosure/, cc-plugins/workflow-optimizer/harness/scripts/ - Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
Author
Owner

From #1609: cc-plugins client-management/skills/migrate-client/workflows/migrate-project.md (row G-120) is unsafe. The Phase 0 dirty-tree stop is only text. A replay of reset --hard TAG lost the migration commit (reflog only), mid-run tracked edits (no copy), and staged new files; a dirty start lost tracked edits. Handle this rollback in this ticket, or rule it in G-120.

From #1609: cc-plugins client-management/skills/migrate-client/workflows/migrate-project.md (row G-120) is unsafe. The Phase 0 dirty-tree stop is only text. A replay of reset --hard TAG lost the migration commit (reflog only), mid-run tracked edits (no copy), and staged new files; a dirty start lost tracked edits. Handle this rollback in this ticket, or rule it in G-120.
Author
Owner

Resolution

Done: Q-4 ruled by prediction, rulings row 77: G-075 to G-078 stay out of scope. HookInstaller::RUNNER_BODY is the one source for the fresh and chain hook bodies; generated hooks are unchanged.

Evidence: cc-plugins 841d224, main 6491d48; before/after diff of both generated variants shows no difference; new test passes.

Follow-ups: dropped: spec/hook_installer_spec.rb has 4 failures and 1 error that predate this change (confirmed on 841d224~1); the plugin is installed nowhere, so they stay unfixed

## Resolution **Done:** Q-4 ruled by prediction, rulings row 77: G-075 to G-078 stay out of scope. HookInstaller::RUNNER_BODY is the one source for the fresh and chain hook bodies; generated hooks are unchanged. **Evidence:** cc-plugins 841d224, main 6491d48; before/after diff of both generated variants shows no difference; new test passes. **Follow-ups:** dropped: spec/hook_installer_spec.rb has 4 failures and 1 error that predate this change (confirmed on 841d224~1); the plugin is installed nowhere, so they stay unfixed
jared closed this issue 2026-11-06 23:41:23 +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#1600
No description provided.