GateEvaluator gate subprocesses inherit caller cwd instead of chdir to project root #520

Closed
opened 2026-08-26 22:02:36 +00:00 by jared · 1 comment
Owner

Context

GateEvaluator#run_gate shells out via Open3.capture3 with no chdir, so gate commands run from the invoking process's real cwd, not the target project root. Second independent collision in two days: the diff-test quoting fix (2eb29a6) noted the cwd boundary, and the lint-lessons TDD run (merge 87aaf9a) had to wrap its integration tests in Dir.chdir plus seed a .rubocop.yml to get real gate JSON. Existing tests masked it with substring-only assertions.

Tasks

  • Make gate subprocess cwd explicit (chdir: project_root on the capture3 call, or an equivalent seam)
  • Un-mask: adjust the lint-lessons integration tests to drop their Dir.chdir workaround
  • Audit other GateEvaluator callers for cwd assumptions

Acceptance criteria

  • A gate run from any cwd produces identical results to one run from the project root

Origin

  • Trigger: lint-lessons TDD run 2026-08-26; agent report of Dir.chdir workaround in tests/support/lint_lesson_scenario.rb
  • Improvised this session: integration tests wrap the gate call in Dir.chdir(@dir) and seed .rubocop.yml with NewCops: disable
  • Chain: gate output depends on caller cwd ← Open3.capture3(command) without chdir in GateEvaluator#run_gate ← DESIGN (gate_evaluator.rb, present since the gate CLI was built)
  • Root candidate: this ticket
## Context GateEvaluator#run_gate shells out via Open3.capture3 with no chdir, so gate commands run from the invoking process's real cwd, not the target project root. Second independent collision in two days: the diff-test quoting fix (2eb29a6) noted the cwd boundary, and the lint-lessons TDD run (merge 87aaf9a) had to wrap its integration tests in Dir.chdir plus seed a .rubocop.yml to get real gate JSON. Existing tests masked it with substring-only assertions. ## Tasks - [ ] Make gate subprocess cwd explicit (chdir: project_root on the capture3 call, or an equivalent seam) - [ ] Un-mask: adjust the lint-lessons integration tests to drop their Dir.chdir workaround - [ ] Audit other GateEvaluator callers for cwd assumptions ## Acceptance criteria - [ ] A gate run from any cwd produces identical results to one run from the project root ## Origin - Trigger: lint-lessons TDD run 2026-08-26; agent report of Dir.chdir workaround in tests/support/lint_lesson_scenario.rb - Improvised this session: integration tests wrap the gate call in Dir.chdir(@dir) and seed .rubocop.yml with NewCops: disable - Chain: gate output depends on caller cwd ← Open3.capture3(command) without chdir in GateEvaluator#run_gate ← DESIGN (gate_evaluator.rb, present since the gate CLI was built) - Root candidate: this ticket
Author
Owner

Resolution

Done: Closed in the 2026-09-23 relevance pass of retired-template tickets: DONE.

Evidence: plugins/os-sdlc/lib/os_sdlc/pipeline/gate_evaluator.rb:20 uses ProjectShell.capture3(command, chdir: @root); fixed by 8615acc9 (#624)

Follow-ups: none

## Resolution **Done:** Closed in the 2026-09-23 relevance pass of retired-template tickets: DONE. **Evidence:** plugins/os-sdlc/lib/os_sdlc/pipeline/gate_evaluator.rb:20 uses ProjectShell.capture3(command, chdir: @root); fixed by 8615acc9 (#624) **Follow-ups:** none
jared closed this issue 2026-09-23 20:23:12 +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#520
No description provided.