feat(checks): unify inspection scope in checks/scope.ts

Single source of truth for what pygienium inspects (implementation-code
extensions, exclude dirs, .d.ts/.min.* exclusions) shared by recon,
dead-code, deep-modules, defensive-guards, comments, and complexity.
Every scan task and agent prompt injects the shared scope rules instead
of copy-pasted per-check lists.
This commit is contained in:
2026-08-09 16:45:29 -04:00
parent 581436ed23
commit 2caeb2f790
10 changed files with 268 additions and 112 deletions

View File

@@ -58,6 +58,39 @@ aggregates many scattered modules), or public API stability boundaries.
importers or that sits on a public API boundary is riskier to consolidate —
note the importer count so the fixer can decide.
# Scope of inspection
**Only inspect implementation source files.** Do not analyse documentation,
config, type declarations, build output, or dependencies — flagging those is
noise the user cannot act on.
## Inspect (extensions)
`.cs`, `.cjs`, `.go`, `.java`, `.js`, `.jsx`, `.kt`, `.lua`, `.mjs`, `.php`,
`.py`, `.rb`, `.rs`, `.swift`, `.ts`, `.tsx`
## Skip (directory names — never descend into)
`.cache`, `.git`, `.hg`, `.idea`, `.next`, `.nuxt`, `.pygienium`, `.ralpi`,
`.svelte-kit`, `.svn`, `.turbo`, `.vscode`, `__pycache__`, `build`, `coverage`,
`dist`, `node_modules`, `out`, `vendor`, `venv` (and `.venv`)
## Skip (file patterns)
- Type declarations: `*.d.ts`, `*.d.mts`, `*.d.cts` — generated contracts, not impl
- Minified bundles: `*.min.js`, `*.min.mjs`, `*.min.cjs`
- Docs: `*.md`, `*.txt`, `*.rst` — prose, not code
- Config: `*.json`, `*.yaml`, `*.yml`, `*.toml`, `*.ini`, `*.env`
- Styles/markup: `*.css`, `*.scss`, `*.html`, `*.svg`
- Lock files: `package-lock.json`, `*.lock`, `bun.lockb`
## File discovery preference
1. Prefer the recon snapshot at `<cwd>/.pygienium/recon.json` when it exists.
2. Otherwise enumerate files yourself, applying the rules above.
3. When using `find`/`grep`, add prune clauses for the skip directories
(e.g. `find . -type d -name node_modules -prune -o -name '*.ts' -print`).
# Output
Write your full findings report to the **findings path** given in the task