feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI - #1034
Conversation
…+ decouple capture from LSP wiring so the pilot A/B runs in CI
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds an ChangesLSP Pilot A/B Plumbing
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Trigger as pr-review-trigger.yml
participant Reusable as pr-review.yml
participant EmitScript as lsp_pilot_emit.sh
participant Log as TOKEN_LOG_FILE
Trigger->>Reusable: forward lsp_pilot_variant input
Reusable->>Reusable: resolve LSP_PILOT_ENABLED / LSP_PILOT_VARIANT
alt variant is on
Reusable->>Reusable: wire LSP MCP (REVIEW_MCP_CONFIG)
else variant is off
Reusable->>Reusable: skip LSP wiring
end
Reusable->>EmitScript: run capture with LSP_PILOT_VARIANT env
EmitScript->>EmitScript: lpe_variant() resolves lsp-on/lsp-off
EmitScript->>Log: emit lsp_pilot_run record
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
There was a problem hiding this comment.
Code Review
This pull request decouples the LSP pilot capture from the LSP wiring by introducing an explicit LSP_PILOT_VARIANT (on|off) variable in scripts/lsp_pilot_emit.sh, and adds corresponding integration and unit tests. The review feedback suggests improving the BATS tests by creating temporary files inside a setup-created, teardown-managed directory instead of using bare mktemp to ensure automatic cleanup. Additionally, it recommends adding defensive checks in the Python test script to handle cases where the parsed YAML document is None.
There was a problem hiding this comment.
Pull request overview
Implements issue #1031 by wiring the LSP pilot capture gate into CI and introducing a decoupled A/B “variant” control so the same pr-review pipeline can emit comparable lsp-off (control) and lsp-on (treatment) lsp_pilot_run records.
Changes:
- Plumbs
LSP_PILOT_ENABLED/LSP_PILOT_VARIANTintopr-review.ymljobenv:and gates the LSP wiring steps on theonvariant (while keeping the legacyvars.LSP_PILOT_ENABLEDpath). - Updates
scripts/lsp_pilot_emit.shto treatLSP_PILOT_VARIANT=on|offas authoritative for labeling (lsp-on/lsp-off), decoupling capture from whetherREVIEW_MCP_CONFIGis readable. - Adds unit + integration coverage (including a workflow-plumbing guard) and wires the new integration check into
test-dev-lead.yml.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dev-lead/unit/test_lsp_pilot_emit.bats | Adds unit tests asserting explicit LSP_PILOT_VARIANT overrides legacy MCP-config-based detection and yields correct emitted records. |
| tests/dev-lead/integration/test_pr_review_lsp_pilot_plumbing.py | Adds an integration check that validates workflow inputs, env plumbing, and step gating for the pilot decoupling. |
| scripts/lsp_pilot_emit.sh | Makes `LSP_PILOT_VARIANT=on |
| .github/workflows/test-dev-lead.yml | Extends path filters and adds a new job to run the integration plumbing test. |
| .github/workflows/pr-review.yml | Adds workflow_call input lsp_pilot_variant, exports LSP_PILOT_ENABLED/LSP_PILOT_VARIANT, and gates LSP wiring steps on on. |
| .github/workflows/pr-review-trigger.yml | Adds a workflow_dispatch choice input and forwards it into the reusable workflow for ring-0 A/B driving. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — fix-bot-comment (applied)Changes committed and pushed. |
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…puts ⊆ declared inputs at the pinned @ref (+ #1034 regression) (#1257) * feat: implement issue #1253 — [#1052 A] CI guard: forwarded caller inputs ⊆ declared inputs at the pinned @ref (+ #1034 regression) * fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] * fix(vci): harden git fetch against argument injection + scope strict mode to direct-exec Addresses the pr-review/Copilot findings on #1257 (Part A of #1052): - Add end-of-options `--` before "$ref" in both git fetch calls so a ref beginning with `-` (from a PR-modifiable, CI-executed workflow file) is treated as a refspec, not parsed as a flag/option (verified: without `--` git errors "unknown option"; with `--` it treats it as a ref). - Move `set -euo pipefail` out of the top level into the execute-directly guard so sourcing the script (bats) no longer leaks strict mode into the caller's shell. shellcheck clean; all 16 bats tests pass; sourced no longer sets errexit. * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…puts ⊆ declared inputs at the pinned @ref (+ #1034 regression) (#1257) * feat: implement issue #1253 — [#1052 A] CI guard: forwarded caller inputs ⊆ declared inputs at the pinned @ref (+ #1034 regression) * fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] * fix(vci): harden git fetch against argument injection + scope strict mode to direct-exec Addresses the pr-review/Copilot findings on #1257 (Part A of #1052): - Add end-of-options `--` before "$ref" in both git fetch calls so a ref beginning with `-` (from a PR-modifiable, CI-executed workflow file) is treated as a refspec, not parsed as a flag/option (verified: without `--` git errors "unknown option"; with `--` it treats it as a ref). - Move `set -euo pipefail` out of the top level into the execute-directly guard so sourcing the script (bats) no longer leaks strict mode into the caller's shell. shellcheck clean; all 16 bats tests pass; sourced no longer sets errexit. * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…puts ⊆ declared inputs at the pinned @ref (+ #1034 regression) (#1257) * feat: implement issue #1253 — [#1052 A] CI guard: forwarded caller inputs ⊆ declared inputs at the pinned @ref (+ #1034 regression) * fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] * fix(vci): harden git fetch against argument injection + scope strict mode to direct-exec Addresses the pr-review/Copilot findings on #1257 (Part A of #1052): - Add end-of-options `--` before "$ref" in both git fetch calls so a ref beginning with `-` (from a PR-modifiable, CI-executed workflow file) is treated as a refspec, not parsed as a flag/option (verified: without `--` git errors "unknown option"; with `--` it treats it as a ref). - Move `set -euo pipefail` out of the top level into the execute-directly guard so sourcing the script (bats) no longer leaks strict mode into the caller's shell. shellcheck clean; all 16 bats tests pass; sourced no longer sets errexit. * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…puts ⊆ declared inputs at the pinned @ref (+ #1034 regression) (#1257) * feat: implement issue #1253 — [#1052 A] CI guard: forwarded caller inputs ⊆ declared inputs at the pinned @ref (+ #1034 regression) * fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] * fix(vci): harden git fetch against argument injection + scope strict mode to direct-exec Addresses the pr-review/Copilot findings on #1257 (Part A of #1052): - Add end-of-options `--` before "$ref" in both git fetch calls so a ref beginning with `-` (from a PR-modifiable, CI-executed workflow file) is treated as a refspec, not parsed as a flag/option (verified: without `--` git errors "unknown option"; with `--` it treats it as a ref). - Move `set -euo pipefail` out of the top level into the execute-directly guard so sourcing the script (bats) no longer leaks strict mode into the caller's shell. shellcheck clean; all 16 bats tests pass; sourced no longer sets errexit. * fix(reviews): address review comments [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
…+ decouple capture from LSP wiring so the pilot A/B runs in CI (#1034) * feat: implement issue #1031 — fix(#844): plumb LSP_PILOT_ENABLED env + decouple capture from LSP wiring so the pilot A/B runs in CI * fix(reviews): address review comments [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] * fix(bot): address bot feedback [skip ci-relay] --------- Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com> Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
…iant to the pinned channel (#1048) Production hotfix: #1034 made the ring-0 trigger stub forward a lsp_pilot_variant input that pr-review.yml@pr-review/next does not declare, causing startup_failure on every review. Restore the stub's with: block to the pre-#1034 set. Re-add forwarding only after pr-review/next is advanced to declare the input (epic #839/#844).
Closes #1031
Implemented by dev-lead agent. Please review.
Summary by CodeRabbit
New Features
Bug Fixes
Tests