Audit shell calls in cc-os plugins and replace them with native Ruby or gems #845
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#845
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
The cc-os plugins start shell processes where native Ruby or a gem can do the same work. A shell call parses free text, depends on the PATH, and fails with process errors such as
Errno::ENOENT. It also hides errors behind an exit code. #843 found one case: the Required-work check runs ticket text throughProjectShell.capture2e, although each check is a text search in a file. Other shell calls can have the same problem. Git commands are the largest known group.Reproduce
n/a: audit ticket; nothing to reproduce.
Approach
Audit each shell call in
plugins/*/libandplugins/*/bin:ProjectShell.capture2e,Open3.*,system, backticks,%x,spawn, andIO.popen.For each call site, record:
path:lineand the command it runs;File,Dir,FileUtils), thegitgem, or another library; or the reason to keep the shell.Known inputs:
gitgem. The user is adding the gem in session f531ed01.Output: an audit report as a comment on this ticket, and one follow-up ticket for each group of replacements.
Required work: none beyond the acceptance criteria.
Acceptance criteria
Origin
/os-adr:find← check text runs as a shell command (adapter/required_work_check.rb:16) ← DESIGN: ADR-0209, ADR-0244 decision 4Audit report: shell calls in plugins//lib and plugins//bin (2026-09-30)
Forms searched:
ProjectShell.*,Open3.*,system, backticks,%x,spawn,IO.popen,exec. There are 27 direct call sites. Backticks,%x,IO.popen, andexechave no real hits.rubocop --stop-serverbin/refresh-pluginsgit show HEAD:<path>git remote,whichgit remote→ #853.which→ #852tea/gh issue list --jsontmux new-session ... claudegit diff,git ls-filesrubocop -apbm syncIndirect git calls through generic runners:
adapter/git/diff.rb:34(git gem, f531ed01),os-backlog config_write_command.rb:57andinspect_command.rb:16(#853).Follow-up tickets
which→ PATH check (os-backlog).Pending decision (no ticket yet)
tea and gh stay as shell calls until a decision is made. The git gem cannot manage issues. A Forgejo REST client (and octokit for GitHub) would put ticket text in a JSON request body in place of argv, and it would return JSON.
tea issues create(tea 0.13.0) has no--output json, so the create path cannot stop text parsing through tea. This change needs an ADR before tickets.Pending decision resolved: ADR-0256 (
81331418). Tracker backends call the Forgejo and GitHub REST APIs in-process; tokens come from FORGEJO_TOKEN and GITHUB_TOKEN. Follow-up tickets: #855 forgejo-client gem, #856 os-backlog tea → forgejo-client, #857 os-backlog gh → octokit, #858 os-sdlc tea/gh → forgejo-client/octokit. Status: #850, #851, #852 closed; #853 waits for the git gem.