test(config-audit): add Opus 4.7 pattern fixtures (cache, redundant, imports, sonnet-era)

This commit is contained in:
Kjell Tore Guttormsen 2026-04-19 22:34:41 +02:00
commit 2a8dc8655f
11 changed files with 255 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Layer 1
First layer of the deep import chain. Each layer contributes substantive
content so the chain is not trivially dismissable as "all short stubs".
## Section A
Coding conventions for the fictitious project that exists solely to
exercise the TOK scanner's import-depth detection logic.
- Prefer async/await over raw Promises.
- Annotate return types even when TypeScript can infer them.
- Keep functions under 40 lines where practical.
- Use `readonly` generously on types.
- Dependency-inject side effects at module boundaries.
- Validate inputs at system boundaries only.
## Section B
Error handling patterns:
- Subclass `Error` with typed messages.
- Never swallow errors silently.
- Prefer `Result<T, E>` return types in business logic.
- Log at boundaries, never inside pure functions.
## Section C
Testing patterns:
- Test fixtures live under `tests/fixtures/{name}/`.
- Each fixture has a single shape it exercises.
- Use `describe(...)` + `it(...)` from `node:test`.
- Prefer table-driven tests for permutations.
- Keep test setup idempotent.
## Section D
CI/CD conventions:
- Conventional Commits for every commit.
- PR-free single-branch workflow on Forgejo.
- Lint and typecheck on every push.
- Release tags follow `{plugin}-v{semver}`.
@layer2.md