fix: correct scanner positions, suppress stderr noise, and fix stdin hang#155
Merged
rhuanbarreto merged 3 commits intomainfrom Mar 23, 2026
Merged
fix: correct scanner positions, suppress stderr noise, and fix stdin hang#155rhuanbarreto merged 3 commits intomainfrom
rhuanbarreto merged 3 commits intomainfrom
Conversation
…mode - Remove logError in loader that printed scanner violations to stderr unconditionally — violations now flow only through the result pipeline - Fix wrong line/column in scanner violations: Bun.Transpiler strips comments and types which shifted AST positions. Added string-search remapping that finds violations in the original source by occurrence - Skip matches in comments and string literals when remapping positions so patterns like "// Don't use Bun.spawn" don't confuse the mapping - Fix stdin hang in check command when spawned by editors or in pipes by racing Bun.stdin.text() against a 100ms timeout - Suppress git credential prompts in test preload via GIT_TERMINAL_PROMPT, GCM_INTERACTIVE, and GIT_ASKPASS environment variables - Add 39 new tests for position remapping and adversarial edge cases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploying archgate-cli with
|
| Latest commit: |
91842c2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://470c68a8.archgate-cli.pages.dev |
| Branch Preview URL: | https://fix-scanner-positions.archgate-cli.pages.dev |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merged
3 tasks
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
logErrorthat printed scanner violations to stderr unconditionally — violations now flow only through the structured JSON/console reporter, so--jsonoutput is cleanBun.Transpilerstrips comments and types, shifting AST positions. Added string-search remapping (source-positions.ts) that finds violations in the original source by occurrence order, skipping matches inside comments and string literalsarchgate checkblocked forever when spawned by editors or in pipe chains becauseBun.stdin.text()waited for EOF on an empty stdin. Now races against a 100ms timeoutGIT_TERMINAL_PROMPT=0,GCM_INTERACTIVE=never, andGIT_ASKPASS=""to test preload so credential managers don't pop up during test runsbin/to.gitignore, useBun.envinstead ofprocess.envin test preloadChanges
src/engine/loader.tslogErrorloop for scanner violationssrc/engine/rule-scanner.tsloc(node)withpushViolation+remapViolationssrc/engine/source-positions.tssrc/commands/check.tsBun.stdin.text()against 100ms timeout to prevent hangtests/preload.tsBun.envtests/engine/rule-scanner-positions.test.tstests/engine/rule-scanner-adversarial.test.tstests/engine/source-positions.test.tsTest plan
bun run validatepassesarchgate check --jsonproduces clean JSON on stdout with no stderr noise for scanner violationsecho "src/cli.ts" | archgate checkstill works (stdin pipe)archgate checkfrom VS Code extension doesn't hangbun test🤖 Generated with Claude Code