Evaluate in-process RuboCop (measure first; ADR-0191 applies) #636
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#636
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?
Context
User requested during the shell-call/ENV audit in session 16bf37b3-8cff-4121-896c-4a5fc61f2e9e. This is a measure-then-decide spike, not a committed change: ADR-0191 (Accepted, 2026-09-15) already classifies rubocop invocation as an "os-sdlc-internal spawn" via the rbenv shim, verified indifferent to bundled ENV, and deliberately not routed through ProjectShell. Moving to
RuboCop::Runner/RuboCop::CLIin-process would reverse that premise and needs a superseding/amending ADR if adopted -- per this repo's rule that an Accepted ADR is never silently reversed. /os-adr:find on both files below confirms ADR-0191 is the relevant record; ADR-0066 (rubocop config generation) and ADR-0205 (env hashes over process-global writes) are adjacent background.Observed
Both call sites shell out to the rubocop binary once per invocation:
rubocop is a bundled gem, so RuboCop::Runner/RuboCop::CLI could run in the same process, saving a Ruby boot. Caveat: an in-process call still loads all cops;
stop_rubocop_serverin plugins/os/lib/worktree/finish_command.rb:111 already stops the rubocop server at worktree finish, which suggests the rubocop server (not a bare CLI boot) already removes most of the cop-loading cost the in-process change would target.Reproduce
Expected
One prose sentence: the ticket measures wall time for both the subprocess path and an in-process RuboCop::Runner/RuboCop::CLI path (with and without the rubocop server running) and changes the implementation only if the in-process gain is real; either way the measurement is recorded on the ticket.
Origin
Acceptance criteria
Resolution
Done: Measured on 2026-09-24 in plugins/os-sdlc against lib/, 3 runs each, medians in seconds: subprocess
bundle exec rubocop --format jsoncold 0.92 / warm server 0.73; in-processRuboCop::CLI.new.runcold 0.98 / warm server 0.94. In-process is never faster. The warm server only helps therubocopclient binary; the Ruby API does not use it. No code change; ADR-0191 stands.Evidence: Timing table above, plus the in-process script shape (
require "rubocop"; $stdout = StringIO.new; RuboCop::CLI.new.run(["--format","json","--config",".rubocop.yml","lib"])), and the note that an adopted in-process path would also need $stdout redirection, which ADR-0205 forbids for production code.Follow-ups: none