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:
@@ -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
|
||||
|
||||
@@ -74,6 +74,39 @@ guarantees is noise.
|
||||
checked (`grep` for its declaration/annotation). A `null` check on a
|
||||
`string | null` union is legitimate; on a bare `string` it is redundant.
|
||||
|
||||
# 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
|
||||
|
||||
@@ -22,6 +22,39 @@ files; that is the fixer's job. You only inspect and report.
|
||||
Never mutate files.
|
||||
- Emit a concise findings report as your final message.
|
||||
|
||||
# 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`).
|
||||
|
||||
# Findings format
|
||||
|
||||
End your response with a fenced `findings` block summarising what you found:
|
||||
|
||||
Reference in New Issue
Block a user