feat(checks): add TODOs & stubs check, replace noop template

/pygienium-todos inventories TODO/FIXME/HACK markers and stub bodies via a
deterministic pre-scan plus the todos sub-agent; --fix converts silent
stubs (placeholder returns, empty/pass bodies) into loud failures,
never implementing TODOs or deleting markers. Replaces the noop
reference check; the extensibility suite now registers a synthetic
witness. Adds agents/todos.md and tests/todos.test.ts.
This commit is contained in:
2026-08-09 16:45:29 -04:00
parent 2caeb2f790
commit 288506e84d
6 changed files with 1132 additions and 145 deletions

View File

@@ -61,19 +61,22 @@ this table and the live help always agree on the registered set.
| `/pygienium-deep-modules` | deep-modules | `deep-modules` | Detect shallow modules (pass-throughs, trivial wrappers, re-export barrels) and consolidate the safe ones. |
| `/pygienium-dead-code` | dead-code | `scanner` / `fixer` | Find unreferenced exports, dead files, obsolete compat shims, migration helpers, and unused dependencies; remove clearly-dead items and flag dynamic ones. |
| `/pygienium-defensive-guards` | defensive-guards | `defensive-guards` | Remove redundant defensive guarding (null checks on non-nullable types, swallowing try/catch, masking fallbacks) while keeping boundary guards (IO, parsing, untrusted input). |
| `/pygienium-noop` | noop | `scanner` / `fixer` | Reference/template check — performs no analysis, writes zero-issue artifacts. Clone it to start a new check. |
| `/pygienium-todos` | todos | `todos` / `fixer` | Inventory TODO/FIXME markers and stub implementations; with `--fix`, convert silent stubs (placeholder returns, empty bodies) into loud failures — never implementing TODOs or deleting markers. |
## Artifacts
Each check writes its report under `<cwd>/pygienium/checks/<name>/`:
Every check writes its reports under `<cwd>/.pygienium/checks/<name>/` (run
state lives at `<cwd>/.pygienium/run-state.json`):
- `findings.md` — what the scan found (per-file line refs).
- `changes.md` — what the fix phase changed + anything deferred for human review.
`/pygienium-export` merges every check's artifacts into one
`pygienium/export.md` (or `export.json`). Some checks historically wrote under
`.pygienium/checks/`; export walks **both** roots and merges by check name
(`pygienium/` wins).
`.pygienium/export.md` (or `export.json`).
On first run in a git work tree, pygienium appends `.pygienium/` to the
target repo's `.gitignore` so a run never stages its own state/artifacts into
git (opt out with `--no-gitignore`).
## Adding a check
@@ -82,7 +85,7 @@ One file + one `registerCheck()` call. **No `index.ts` command-wiring changes.**
startup, so a new file self-registers and `/pygienium-<name>` appears
automatically.
1. Clone `src/checks/noop.ts` `src/checks/<name>.ts`.
1. Create `src/checks/<name>.ts` from the template below.
2. Edit the `name`, `label`, `description`, the rubric in the scan/fix task
builders, and the `gate` precondition.
3. Keep the trailing `registerCheck(<name>Check)`. Done.