fix: fail agent rule sync on missing imports - #103
Open
CBOSSX wants to merge 2 commits into
Open
Conversation
Greptile SummaryThe PR makes agent-rule synchronization fail when an imported file is missing and adds an isolated regression test. It also exposes the test through package scripts, but the existing CI workflow still bypasses that test.
Confidence Score: 4/5The PR is not yet safe to merge because its regression test remains bypassed by the CI workflow. The new package scripts run the missing-import regression test locally, but CI continues to invoke lint, typecheck, and build separately, so future regressions can pass the standard automated gate. Files Needing Attention: package.json and .github/workflows/ci.yml
|
| Filename | Overview |
|---|---|
| scripts/sync-agent-rules.sh | Missing AGENTS.md imports now terminate synchronization with a diagnostic instead of producing incomplete instructions. |
| tests/sync-agent-rules.test.sh | The isolated fixture exercises the fail-closed behavior, but the previously reported CI automation gap remains outstanding. |
| package.json | The test is wired into npm test and npm run check, although CI does not invoke either command. |
Reviews (2): Last reviewed commit: "test: run agent sync regression in check..." | Re-trigger Greptile
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
scripts/sync-agent-rules.shwhen anAGENTS.md@fileimport does not exist, instead of silently generating incomplete agent instructions.The root cause was that
resolve_importsemitted an HTML comment for a missing import and continued, so both the command substitution and the overall sync command returned success. That also allowed the generated-file CI check to accept the incomplete output as synchronized.Related Issue
No existing issue; exact issue/PR searches found no implementation of this missing-import failure case.
Type of Change
Regression Evidence
bash tests/sync-agent-rules.test.shexited1because the unmodified script incorrectly returned success.bash tests/sync-agent-rules.test.shexited0and confirmed missing imports fail closed.Verification
bash tests/sync-agent-rules.test.shbash scripts/sync-agent-rules.shbash -n scripts/sync-agent-rules.sh tests/sync-agent-rules.test.shnpm run checkChecklist
npm run checkpasses (lint + typecheck + build)