fix(gates): allow explicit structure-debt bypass (sc-1528) - #372
Merged
Conversation
## Summary - add an explicit one-run `GUARD_STRUCTURE_OK=1` bypass, with `GUARD_NO_STRUCTURE` as a compatibility alias - skip only the configured structure-lint command while preserving every other deterministic gate - make bypass use loud output, collector-supported non-run telemetry, and a distinct prefix-cache scope - avoid re-emitting bypass output or telemetry when a retry is served by the prefix cache - document the escape hatch in `devkit help ship` and cover it with regression tests ## Root cause `devkit ship` passed the configured structure command to the deterministic orchestrator as an arbitrary whole-tree ESLint invocation. Because that raw command never entered `guard-structure`, an escape hatch implemented inside the structure checker could not help repositories carrying pre-existing structure debt. ## Validation - reproduced Story #1528 against Frink commit `7a87f35ce5eb93db52b6d8523c6ce9afc98547ee`: without the flag the gate reports the five known base-tree errors; with the flag it exits successfully and prints the bypass warning - focused deterministic tests: 57/57 passed, including cache-hit retry and telemetry reader-contract coverage - isolated TypeScript check: passed - GitNexus change detection: three intended symbols, four affected gate flows, medium risk - commit guard: no clone or semantic duplication findings ## Full-suite note The shared checkout full suite was also attempted. It is currently blocked by unrelated concurrent edits in the review setup modules and one pre-existing process-reaping timing failure; the isolated clean-base typecheck and all focused tests for this change pass.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change adds per-run structure-lint bypassing through two environment flags. The deterministic runner records bypass telemetry, isolates cache scopes, preserves other gates, emits warnings, and provides remediation guidance. Tests cover execution, telemetry, logging, and cache behavior. ChangesStructure bypass flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ShipCommand
participant DeterministicRunner
participant PrefixCache
participant Telemetry
ShipCommand->>DeterministicRunner: start run with structure bypass flag
DeterministicRunner->>PrefixCache: select structure-bypassed cache scope
DeterministicRunner->>Telemetry: emit could_not_run event
DeterministicRunner->>DeterministicRunner: skip structure gate
DeterministicRunner->>ShipCommand: continue with other deterministic gates
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GUARD_STRUCTURE_OK=1bypass, withGUARD_NO_STRUCTUREas a compatibility aliasdevkit help shipand cover it with regression testsRoot cause
devkit shippassed the configured structure command to the deterministic orchestrator as an arbitrary whole-tree ESLint invocation. Because that raw command never enteredguard-structure, an escape hatch implemented inside the structure checker could not help repositories carrying pre-existing structure debt.Validation
7a87f35ce5eb93db52b6d8523c6ce9afc98547ee: without the flag the gate reports the five known base-tree errors; with the flag it exits successfully and prints the bypass warningFull-suite note
The shared checkout full suite was also attempted. It is currently blocked by unrelated concurrent edits in the review setup modules and one pre-existing process-reaping timing failure; the isolated clean-base typecheck and all focused tests for this change pass.
Summary by CodeRabbit
GUARD_STRUCTURE_OK=1or its supported alias.