fix(review): bound manifest path instruction globs#1396
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
0928953 to
cd868c0
Compare
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (93.10%) is below the target coverage (97.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1396 +/- ##
==========================================
- Coverage 95.38% 95.37% -0.01%
==========================================
Files 201 201
Lines 21598 21621 +23
Branches 7807 7813 +6
==========================================
+ Hits 20601 20622 +21
Misses 416 416
- Partials 581 583 +2
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review — blocked
🛑 Blocked CI checks failing
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Closing — |
Motivation
review.path_instructions[].pathfield was accepted without per-item length/character limits and was repeatedly compiled into regexes and emitted verbatim into the AI prompt, enabling CPU/memory/AI-budget exhaustion from malicious manifests.Description
MAX_REVIEW_PATH_GUIDANCE_LENGTHandCONTROL_CHARACTER_PATTERNand validatereview.path_instructions[].pathto reject control characters and truncate toMAX_ITEM_LENGTHduring parsing inparseReviewPathInstructionsinsrc/signals/focus-manifest.ts.resolveReviewPathInstructionsto normalize changed paths once, compile each manifest glob once viacompileManifestPathMatcher, and evaluate those matchers against normalized paths rather than recompiling per path.test/unit/focus-manifest.test.tsto cover control-character rejection, overlong-path truncation, prompt guidance bounding, and blank-normalized-path behavior.Testing
npx vitest run test/unit/focus-manifest.test.tsand all tests in that file passed (113 tests) covering the new branches and regressions.npm run typecheckandtsc --noEmitwhich succeeded with no type errors.npx vitest --coveragefor the unit file andnpm run test:coveragefor the full suite executed tests, but coverage generation failed due to an unrelated coverage provider/runtime error (TypeError: jsTokens is not a function) coming from the coverage toolchain; this prevented producing a full coverage report locally.npm audit --audit-level=moderatecould not complete due to the registry returning403 Forbiddenin this environment.Codex Task