Spike: confirm ruby-git v6 coverage and hook load cost #1586

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

Problem

The Backend table in design section 4.2 marks many ruby-git v6 operations "unconfirmed" or "absent". Version 6 also adds activesupport as a dependency, which may slow hooks that start often. The choice between a Backend::Cli default and a Backend::RubyGit default depends on these facts. 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: this is a measurement task. Evidence base: design section 4.2 and Appendix B (docs/os-git/use-cases-and-domain.md).

Approach

Run the checks against the released git 6.x gem, not only against master. Use a scratch repository. Write results into Appendix B of the design doc under a heading Spike results.

Required work:

  1. Add a Spike results section to Appendix B with one row per Backend table row that was "unconfirmed" or "absent": confirmed, absent, or works only through the raw capture escape hatch — check: present Spike results in docs/os-git/use-cases-and-domain.md

Orchestrator work: run the timing measurements and record the Cli versus RubyGit default decision for the ADR ticket (#1585) and for the scaffold ticket.

Acceptance criteria

  1. Given each "unconfirmed" or "absent" cell in the Backend table, when Appendix B is read, then the cell has a result and names the call or flag that produced it.
  2. Given a hook-like process with a cold start, when require "git" (with activesupport) is timed against an Open3 call to git rev-parse --show-toplevel, then Appendix B lists the median of at least 10 runs for each.
  3. Given the released 6.x gem and master, when Git::Repository methods are compared, then Appendix B names any method that exists only on master.
  4. Given a command that exceeds its timeout:, when ruby-git kills it, then Appendix B states whether the child process ends (the README warns it may hang after SIGKILL).
  5. Given the results, when design section 8 Q3 is read, then Q3 records the default adapter and the rule for the per-prompt hook.
  6. Given the results, when Appendix B is read, then it states that commit --only and update-index go through capture, or names a native call.

Non-goals

No production code. No change to any plugin.

Blocking edges

None. The ADR ticket (#1585) can run in parallel. Scaffold waits for this ticket.

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: default adapter unknown ← many ruby-git v6 operations unconfirmed ← DESIGN (docs/os-git/use-cases-and-domain.md section 4.2)
  • 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: docs/os-git/use-cases-and-domain.md Appendix B
  • Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
## Problem The Backend table in design section 4.2 marks many ruby-git v6 operations "unconfirmed" or "absent". Version 6 also adds `activesupport` as a dependency, which may slow hooks that start often. The choice between a `Backend::Cli` default and a `Backend::RubyGit` default depends on these facts. 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: this is a measurement task. Evidence base: design section 4.2 and Appendix B (`docs/os-git/use-cases-and-domain.md`). ## Approach Run the checks against the released `git` 6.x gem, not only against master. Use a scratch repository. Write results into Appendix B of the design doc under a heading `Spike results`. Required work: 1. Add a `Spike results` section to Appendix B with one row per Backend table row that was "unconfirmed" or "absent": confirmed, absent, or works only through the raw `capture` escape hatch — check: present `Spike results` in `docs/os-git/use-cases-and-domain.md` Orchestrator work: run the timing measurements and record the Cli versus RubyGit default decision for the ADR ticket (#1585) and for the scaffold ticket. ## Acceptance criteria 1. Given each "unconfirmed" or "absent" cell in the Backend table, when Appendix B is read, then the cell has a result and names the call or flag that produced it. 2. Given a hook-like process with a cold start, when `require "git"` (with `activesupport`) is timed against an `Open3` call to `git rev-parse --show-toplevel`, then Appendix B lists the median of at least 10 runs for each. 3. Given the released 6.x gem and master, when `Git::Repository` methods are compared, then Appendix B names any method that exists only on master. 4. Given a command that exceeds its `timeout:`, when ruby-git kills it, then Appendix B states whether the child process ends (the README warns it may hang after `SIGKILL`). 5. Given the results, when design section 8 Q3 is read, then Q3 records the default adapter and the rule for the per-prompt hook. 6. Given the results, when Appendix B is read, then it states that `commit --only` and `update-index` go through `capture`, or names a native call. ## Non-goals No production code. No change to any plugin. ## Blocking edges None. The ADR ticket (#1585) can run in parallel. Scaffold waits for this ticket. ## 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: default adapter unknown ← many ruby-git v6 operations unconfirmed ← DESIGN (docs/os-git/use-cases-and-domain.md section 4.2) - 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: docs/os-git/use-cases-and-domain.md Appendix B - Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
Author
Owner

Work started by the #1610 orchestrator, session 5b14a4ef-91b2-45c0-a729-baa17682a39a. Branch: ticket-1586.

Work started by the #1610 orchestrator, session 5b14a4ef-91b2-45c0-a729-baa17682a39a. Branch: ticket-1586.
Author
Owner

Resolution

Done: Appendix B Spike results records every Backend-table cell, timings, master comparison, timeout result, and the adapter decision. Q3 records the default adapter and the per-prompt hook rule.

Evidence: e53390b5. Medians over 21 cold starts: baseline 42.5 ms, Open3 rev-parse 45.0 ms, require git plus call 210.8 ms, .git walk 43.2 ms. 135 Repository methods identical on 6.0.0 and master. Timeout killed hook and child. 6 of 21 rows work through public methods.

Follow-ups: Backend::RubyGit dropped; #1587 item 5 records why in the leaf. setsid and MERGE_HEAD-in-worktree checks go to Backend::Cli tests in #1587 and #1589. Bundler timing dropped: the gem is not used.

## Resolution **Done:** Appendix B Spike results records every Backend-table cell, timings, master comparison, timeout result, and the adapter decision. Q3 records the default adapter and the per-prompt hook rule. **Evidence:** e53390b5. Medians over 21 cold starts: baseline 42.5 ms, Open3 rev-parse 45.0 ms, require git plus call 210.8 ms, .git walk 43.2 ms. 135 Repository methods identical on 6.0.0 and master. Timeout killed hook and child. 6 of 21 rows work through public methods. **Follow-ups:** Backend::RubyGit dropped; #1587 item 5 records why in the leaf. setsid and MERGE_HEAD-in-worktree checks go to Backend::Cli tests in #1587 and #1589. Bundler timing dropped: the gem is not used.
jared closed this issue 2026-11-06 17:20:19 +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#1586
No description provided.