Run autocorrect pre-pass rubocop capture through ProjectShell #850
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#850
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 autocorrect pre-pass runs rubocop twice, and the two runs see different environments. The first run goes through
TestRunner, which callsProjectShelland clearsRUBYOPTandBUNDLE_*(#594). The second run callsOpen3.capture3directly, so it inherits the plugin's Bundler environment. The second run can therefore load a different rubocop version or configuration than the first run in the same project.pass.rb:43callsrun.pass.rb:53callsrun_capture3. The audit in #845 found this defect.Reproduce
n/a: the defect shows only when the parent process has
RUBYOPTorBUNDLE_*set. The acceptance criteria give the observable check.Approach
CaptureRunner#run_capture3callsProjectShell.capture3(command)in place ofOpen3.capture3(command). The return shape does not change.Required work: none beyond the acceptance criteria.
Rejected: send
run_capture3throughTestRunner—TestRunnerreturns combined output, andpass.rb:53needs stdout and stderr apart.Acceptance criteria
BUNDLE_GEMFILEandRUBYOPTset, whenCaptureRunner#run_capture3runs a command that prints those variables, then the output shows neither value.CaptureRunner#run_capture3runs it, then it returns the stdout text, the stderr text, and3.Owner sketch
Non-goals
Origin
run_capture3callsOpen3.capture3directly (capture_runner.rb) ← IMPROVISATION: the #594 unbundled-env rule reachedTestRunnerbut not this sibling method.Work started on branch ticket-850 (os-sdlc implement pipeline).
Resolution
Done: CaptureRunner#run_capture3 now calls ProjectShell.capture3, so the second pre-pass rubocop run gets the same unbundled environment as the first (#594).
Evidence: Commit
47c37747on ticket-850 (implementation 14): capture_runner.rb 1 line, contract test +19 lines. All os-sdlc gates passed: behavior-verifier, full suite, contract-auditor.Follow-ups: none