1.9 KiB
1.9 KiB
id, epic, title, type, status, feature, depends-on, blocks
| id | epic | title | type | status | feature | depends-on | blocks | ||
|---|---|---|---|---|---|---|---|---|---|
| 03-b-ast-eslint-rules | conformance-system-v1 | AST-aware ESLint rules (no-undeclared-event-publish, no-undeclared-audit) | technical-story | done | core-eslint |
|
|
Goal
Ship two AST-aware rules that catch manifest ↔ use-case drift inside factory bodies:
no-undeclared-event-publish:bus.publish("X")in a factory must matchmanifest.useCases[name].publishesno-undeclared-audit:auditLog.record({ type: "X" })must matchmanifest.useCases[name].audits
Why
Boot assertion + structural rules can't see what happens inside a factory body. AST-aware rules catch publish/audit drift the moment a developer (or agent) saves the file.
Done when
- Manifest AST parser extracts per-use-case publishes/audits arrays
- Two rules registered in the conformance plugin
- Tests cover positive (declared event) and negative (undeclared event) cases for each rule
pnpm lintpasses (auth's signUp has empty publishes/audits today → no false positives)
In scope
_manifest-ast.jshelper using@typescript-eslint/parserto extract per-use-case arrays_usecase-name.jshelper (file slug → camelCase use-case key)- The two rules + RuleTester tests
- Plugin + base.js wiring
Out of scope
- Bus / auditLog parameter detection beyond the conventional names
busandauditLog - Detection of dynamic event names (
bus.publish(eventVar, payload)is allowed without warning) - Conditional / nested calls — rules only check top-level CallExpressions in factory bodies
Tasks
- Story 03.b scaffold
- Manifest AST parser + tests
- Use-case name helper + tests
no-undeclared-event-publishrule + testsno-undeclared-auditrule + tests- Plugin update + base.js wiring
- Verify
pnpm lintpasses - Final verification + story closeout (tick 03 + 03.b in epic)