Merge git-context into os-git and delete the commit_context fork #1591

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

Problem

ruby-gems/git-context (gem 0.4.0, class GitContext::Git) and cc-plugins/git-context (agents that call its CLI) are a fourth git wrapper. ruby-gems/airtable-api/tools/commit_context holds a read-only fork of GitContext::Git. Two commit models exist: commit --only -- <paths> in os-sdlc, and "stage one path, commit what is staged" in git-context.

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: structural move. Call sites: rows G-067 to G-072, G-117, G-118 in the checklist.

Approach

Move the git-context CLI commands commit, commit-apply, repo-init, and repo-audit into plugins/os-git. Build them on OsGit::Repository, ChangeSet, History, and Commit::Plan. Apply the Q4 ruling (#1585): commit --only is the only commit mode. commit-apply takes path arguments (--path). Keep the refusals that the gem has today: blank message, empty commit, no -a. Do not move the gh repo create and tea repos create calls in repo_init/command.rb and workspace.rb (they are host API work and out of scope; keep them as a proposal step).

Keep the old CLI name git-context working until every reference is updated: the git-context agents (commit.md, repo-init.md), the os-doc-hygiene clean skill (git-context commit-apply, row G-115, owned by the prompt-text ticket #1605), and plugins/os/skills/wrap/SKILL.md (git-context:commit). Skill names follow plugins/cc-architect/references/conventions/cc-os-naming.md. After all references move, the retirement ticket (#1607) deletes the old plugin and gem.

Rows to mark: G-067 to G-072, G-117, G-118, and the test rows G-188 to G-191.

Required work:

  1. os-git commands commit, commit-apply, repo-init, repo-audit — check: present commit-apply in plugins/os-git/bin/os-git

  2. commit-apply accepts --path and refuses a blank message and an empty commit — check: present --path in plugins/os-git/lib/os_git/cli/commit_apply.rb

  3. Move the context sections (status, staged and unstaged diff, recent log, file history, untracked files) and the audit sections (gitignore gaps, tracked secrets, missing standard files) onto Repository messages.

  4. commit-apply keeps the gem's message sources (--message, --message-file, --message-stdin) and its --json report, and --allow-empty reaches a Repository message.

Orchestrator work, outside this worktree, after the merge: update the cc-plugins/git-context agents in that repository (AC 6), and delete ruby-gems/airtable-api/tools/commit_context in that repository after its references are gone. Each commits in its own repository with explicit paths. plugins/os/skills/wrap/SKILL.md moves in #1605. The orchestrator marks the checklist rows (AC 8).

Acceptance criteria

  1. Given staged changes outside the named paths, when commit-apply --path a.rb --message "x" runs, then the commit holds only a.rb.
  2. Given a blank message, when commit-apply runs, then it exits 2 and commits nothing.
  3. Given nothing to commit in the named paths, when commit-apply runs, then it exits 1 and commits nothing (unless --allow-empty is given).
  4. Given a new directory, when repo-init --dry-run --json runs, then it prints the same JSON actions and proposals as the gem did.
  5. Given the same repository, when repo-audit runs, then it reports the same gitignore gaps, tracked secrets, and missing standard files as the gem did.
  6. Given the git-context agents in cc-plugins, when they are read after the orchestrator work, then they call os-git commands, and the no-attribution rule stays in the agent prompts (no regex guard in code). This criterion is verified by the orchestrator, not by a test.
  7. Given GitContext::Git and CommitContext::Git, when the tree is searched, then neither is called by any non-test file in plugins/os-git.
  8. Given rows G-067 to G-072, G-117, G-118, G-188 to G-191, when the ticket closes, then each row is marked - [x] with Replaced by filled in. The orchestrator does this.
  9. Given a repository with status, staged and unstaged changes, recent commits, file history, and untracked files, when commit runs, then its context sections hold the same content as the gem's sections, built on Repository and History messages.

Owner sketch

class OsGit::Cli::CommitApply
  def initialize(repository, io); end
  def call(paths:, message:, allow_empty: false); end
end

Non-goals

Host API calls (gh, tea). Deleting the old gem and plugin (the retirement ticket #1607).

Blocking edges

Blocked by the core ticket (#1588) and the ADR ticket (#1585).

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: two commit models and a forked wrapper ← git-context grew apart from os-sdlc ← DESIGN (docs/os-git/use-cases-and-domain.md sections 2.6, 8 Q4)
  • 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: ruby-gems/git-context/lib/git_context/, cc-plugins/git-context/
  • Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
## Problem `ruby-gems/git-context` (gem 0.4.0, class `GitContext::Git`) and `cc-plugins/git-context` (agents that call its CLI) are a fourth git wrapper. `ruby-gems/airtable-api/tools/commit_context` holds a read-only fork of `GitContext::Git`. Two commit models exist: `commit --only -- <paths>` in os-sdlc, and "stage one path, commit what is staged" in git-context. 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: structural move. Call sites: rows G-067 to G-072, G-117, G-118 in the checklist. ## Approach Move the git-context CLI commands `commit`, `commit-apply`, `repo-init`, and `repo-audit` into `plugins/os-git`. Build them on `OsGit::Repository`, `ChangeSet`, `History`, and `Commit::Plan`. Apply the Q4 ruling (#1585): `commit --only` is the only commit mode. `commit-apply` takes path arguments (`--path`). Keep the refusals that the gem has today: blank message, empty commit, no `-a`. Do not move the `gh repo create` and `tea repos create` calls in `repo_init/command.rb` and `workspace.rb` (they are host API work and out of scope; keep them as a proposal step). Keep the old CLI name `git-context` working until every reference is updated: the `git-context` agents (`commit.md`, `repo-init.md`), the `os-doc-hygiene` clean skill (`git-context commit-apply`, row G-115, owned by the prompt-text ticket #1605), and `plugins/os/skills/wrap/SKILL.md` (`git-context:commit`). Skill names follow `plugins/cc-architect/references/conventions/cc-os-naming.md`. After all references move, the retirement ticket (#1607) deletes the old plugin and gem. Rows to mark: G-067 to G-072, G-117, G-118, and the test rows G-188 to G-191. Required work: 1. `os-git` commands `commit`, `commit-apply`, `repo-init`, `repo-audit` — check: present `commit-apply` in `plugins/os-git/bin/os-git` 2. `commit-apply` accepts `--path` and refuses a blank message and an empty commit — check: present `--path` in `plugins/os-git/lib/os_git/cli/commit_apply.rb` 3. Move the context sections (status, staged and unstaged diff, recent log, file history, untracked files) and the audit sections (gitignore gaps, tracked secrets, missing standard files) onto `Repository` messages. 4. `commit-apply` keeps the gem's message sources (`--message`, `--message-file`, `--message-stdin`) and its `--json` report, and `--allow-empty` reaches a Repository message. Orchestrator work, outside this worktree, after the merge: update the `cc-plugins/git-context` agents in that repository (AC 6), and delete `ruby-gems/airtable-api/tools/commit_context` in that repository after its references are gone. Each commits in its own repository with explicit paths. `plugins/os/skills/wrap/SKILL.md` moves in #1605. The orchestrator marks the checklist rows (AC 8). ## Acceptance criteria 1. Given staged changes outside the named paths, when `commit-apply --path a.rb --message "x"` runs, then the commit holds only `a.rb`. 2. Given a blank message, when `commit-apply` runs, then it exits 2 and commits nothing. 3. Given nothing to commit in the named paths, when `commit-apply` runs, then it exits 1 and commits nothing (unless `--allow-empty` is given). 4. Given a new directory, when `repo-init --dry-run --json` runs, then it prints the same JSON actions and proposals as the gem did. 5. Given the same repository, when `repo-audit` runs, then it reports the same gitignore gaps, tracked secrets, and missing standard files as the gem did. 6. Given the `git-context` agents in `cc-plugins`, when they are read after the orchestrator work, then they call `os-git` commands, and the no-attribution rule stays in the agent prompts (no regex guard in code). This criterion is verified by the orchestrator, not by a test. 7. Given `GitContext::Git` and `CommitContext::Git`, when the tree is searched, then neither is called by any non-test file in `plugins/os-git`. 8. Given rows G-067 to G-072, G-117, G-118, G-188 to G-191, when the ticket closes, then each row is marked `- [x]` with `Replaced by` filled in. The orchestrator does this. 9. Given a repository with status, staged and unstaged changes, recent commits, file history, and untracked files, when `commit` runs, then its context sections hold the same content as the gem's sections, built on `Repository` and `History` messages. ## Owner sketch ```ruby class OsGit::Cli::CommitApply def initialize(repository, io); end def call(paths:, message:, allow_empty: false); end end ``` ## Non-goals Host API calls (`gh`, `tea`). Deleting the old gem and plugin (the retirement ticket #1607). ## Blocking edges Blocked by the core ticket (#1588) and the ADR ticket (#1585). ## 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: two commit models and a forked wrapper ← git-context grew apart from os-sdlc ← DESIGN (docs/os-git/use-cases-and-domain.md sections 2.6, 8 Q4) - 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: ruby-gems/git-context/lib/git_context/, cc-plugins/git-context/ - 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 on branch ticket-1591.

Work started on branch ticket-1591.
Author
Owner

Resolution

Done: git-context commands now run as bin/os-git on OsGit::Cli: commit, commit-apply --path, repo-init, repo-audit. cc-plugins git-context agents call os-git (9df6794). The commit_context fork is deleted; it was untracked in airtable-api. Rows marked. Pipeline run 252 ended verdict:error at contract audit; hand-finished with a fix list and one design audit.

Evidence: Merge ed6d75ca (293eb325). os-git suite 359 runs, 0 failures; rubocop 117 files clean; smoke run through ~/.claude/plugins/os-git/bin/os-git of delete, rename, nothing to commit, and hook stderr.

Follow-ups: none for this ticket: os-doc-hygiene and wrap text move in #1605; the gem stays until then. --yes dropped by design (rulings row 76); os-git bin not confirmed on PATH, so agents use the absolute path.

## Resolution **Done:** git-context commands now run as bin/os-git on OsGit::Cli: commit, commit-apply --path, repo-init, repo-audit. cc-plugins git-context agents call os-git (9df6794). The commit_context fork is deleted; it was untracked in airtable-api. Rows marked. Pipeline run 252 ended verdict:error at contract audit; hand-finished with a fix list and one design audit. **Evidence:** Merge ed6d75ca (293eb325). os-git suite 359 runs, 0 failures; rubocop 117 files clean; smoke run through ~/.claude/plugins/os-git/bin/os-git of delete, rename, nothing to commit, and hook stderr. **Follow-ups:** none for this ticket: os-doc-hygiene and wrap text move in #1605; the gem stays until then. --yes dropped by design (rulings row 76); os-git bin not confirmed on PATH, so agents use the absolute path.
jared closed this issue 2026-11-06 23:30:36 +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#1591
No description provided.