Migrate os-backlog remote reads to OsGit and fold in #853 #1594

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

Problem

os-backlog reads the git remote through ShellRunner in inspector/command.rb and project_index/registration.rb. Open ticket #853 covers the same sites (it names the git gem) and a defect: an origin read in the process working directory instead of the repository root stores the wrong remote in the project index.

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-06. Replace each remote read with Repository#remote("origin") and #remotes. Open the repository at the repository root, never at the process working directory. Search plugins/os-backlog/lib for any other remote call (the line numbers in #853 may have moved) and replace those too. After the ticket ships, close #853 as folded into this ticket, with a comment. The gh CLI calls in os-backlog belong to #857, not to this ticket.

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 a repository whose origin is a Forgejo URL, when inspect runs on it, then the findings report the same tracker as before.
  2. Given config-write runs for a repository other than the process working directory, when it reads the origin remote, then it reads the remote of that repository.
  3. Given a repository with no remote, when inspect runs, then it reports no remote and does not raise.
  4. Given the os-backlog tests (rows G-176 to G-181), when they run, then they use OsGit::Testing::ScratchRepo and pass.
  5. Given rows G-043 and G-044 and the test rows G-176 to G-181, 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.
  6. 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.

Owner sketch

OsGit::Repository owns the remote read: #remote("origin") and #remotes, which exist since #1588. Backlog::Inspector::Command and Backlog::ProjectIndex::Registration own the choice of which repository to read: each opens the repository at the root it was given, never at the process working directory. Each keeps its present reply shape; Inspector::RemoteOutputParser keeps parsing a URL if the callers still need it. os-backlog loads OsGit through its Gemfile with a sibling-first path: source, as plugins/os-sdlc/Gemfile does; a session hook must not load the full gem.

Non-goals

The gh to octokit port (#857).

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: remote read in the wrong directory and via a shell call ← os-backlog shells out through ShellRunner ← DESIGN (#853, docs/os-git/call-site-checklist.md group A-06)
  • 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: plugins/os-backlog/lib/backlog/inspector/command.rb, plugins/os-backlog/lib/backlog/project_index/registration.rb
  • Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
## Problem os-backlog reads the git remote through `ShellRunner` in `inspector/command.rb` and `project_index/registration.rb`. Open ticket #853 covers the same sites (it names the `git` gem) and a defect: an origin read in the process working directory instead of the repository root stores the wrong remote in the project index. 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-06. Replace each remote read with `Repository#remote("origin")` and `#remotes`. Open the repository at the repository root, never at the process working directory. Search `plugins/os-backlog/lib` for any other `remote` call (the line numbers in #853 may have moved) and replace those too. After the ticket ships, close #853 as folded into this ticket, with a comment. The `gh` CLI calls in os-backlog belong to #857, not to this ticket. 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 a repository whose `origin` is a Forgejo URL, when inspect runs on it, then the findings report the same tracker as before. 2. Given config-write runs for a repository other than the process working directory, when it reads the origin remote, then it reads the remote of that repository. 3. Given a repository with no remote, when inspect runs, then it reports no remote and does not raise. 4. Given the os-backlog tests (rows G-176 to G-181), when they run, then they use `OsGit::Testing::ScratchRepo` and pass. 5. Given rows G-043 and G-044 and the test rows G-176 to G-181, 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`. 6. 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. ## Owner sketch `OsGit::Repository` owns the remote read: `#remote("origin")` and `#remotes`, which exist since #1588. `Backlog::Inspector::Command` and `Backlog::ProjectIndex::Registration` own the choice of which repository to read: each opens the repository at the root it was given, never at the process working directory. Each keeps its present reply shape; `Inspector::RemoteOutputParser` keeps parsing a URL if the callers still need it. os-backlog loads OsGit through its Gemfile with a sibling-first `path:` source, as `plugins/os-sdlc/Gemfile` does; a session hook must not load the full gem. ## Non-goals The `gh` to `octokit` port (#857). ## 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: remote read in the wrong directory and via a shell call ← os-backlog shells out through ShellRunner ← DESIGN (#853, docs/os-git/call-site-checklist.md group A-06) - 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: plugins/os-backlog/lib/backlog/inspector/command.rb, plugins/os-backlog/lib/backlog/project_index/registration.rb - Session: 1a5b2630-09c9-46cb-aee4-a5a98e2e7d24 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/1a5b2630-09c9-46cb-aee4-a5a98e2e7d24.jsonl
Author
Owner

Port slice #1621 waits for this ticket, because both touch project_index.

Port slice #1621 waits for this ticket, because both touch project_index.
Author
Owner

Work started on branch ticket-1594.

Work started on branch ticket-1594.
Author
Owner

Resolution

Done: Inspector::Command and ProjectIndex::Registration read remotes through OsGit at the given root. os-backlog loads OsGit by path source. #853 folded in.

Evidence: main 177518ea. os-backlog 469 runs, 0 failures; changed files clean in rubocop; design audit: no blockers. Rows G-043, G-044, G-176 to G-181 marked. Hand-finished after run 251 escalated on one test defect; ruling 75 answers the audit minors.

Follow-ups: #1630 now also covers the CLI exit with no os-git link. Inspect keeps first-remote; registration uses origin (old behavior, ruling 75).

## Resolution **Done:** Inspector::Command and ProjectIndex::Registration read remotes through OsGit at the given root. os-backlog loads OsGit by path source. #853 folded in. **Evidence:** main 177518ea. os-backlog 469 runs, 0 failures; changed files clean in rubocop; design audit: no blockers. Rows G-043, G-044, G-176 to G-181 marked. Hand-finished after run 251 escalated on one test defect; ruling 75 answers the audit minors. **Follow-ups:** #1630 now also covers the CLI exit with no os-git link. Inspect keeps first-remote; registration uses origin (old behavior, ruling 75).
jared closed this issue 2026-11-06 22:22:18 +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#1594
No description provided.