diff --git a/docs/work/conformance-system-v1/01-define-feature-helper/_story.md b/docs/work/conformance-system-v1/01-define-feature-helper/_story.md new file mode 100644 index 0000000..5af374f --- /dev/null +++ b/docs/work/conformance-system-v1/01-define-feature-helper/_story.md @@ -0,0 +1,49 @@ +--- +id: 01-define-feature-helper +epic: conformance-system-v1 +title: defineFeature helper + Instrumented/Captured/Audited brands +type: technical-story +status: in-progress +feature: core-shared +depends-on: [] +blocks: [02-boot-assertions] +--- + +## Goal +Manifest helper + brand types enable type-level enforcement that every +use-case binding is wrapped with `withSpan` + `withCapture` +(and `withAudit` when mutating with audits declared). + +## Why +Compile-time feedback is the cheapest layer and the foundation every other +milestone reads. + +## Done when +Compile-time TS2322 fires when an unwrapped factory is bound through +`ProductionUseCase<...>`, and `auth.signIn` is rebound through the new slot. + +## In scope +- `Instrumented` and `Captured` brand types in `@repo/core-shared/conformance` +- Brand attachment in `withSpan` and `withCapture` +- `Audited` brand and `withAudit` wrapper in `@repo/core-audit` +- `defineFeature` helper + `FeatureManifest` / `UseCaseManifest` types +- `ProductionUseCase` branded slot type +- `authManifest` declaring `signIn`, `signUp`, `signOut` +- `auth.signIn` rebound through the branded slot + +## Out of scope +- `auth.signUp` / `auth.signOut` rebinding through branded slots (separate tasks within this story or a follow-up story; signUp requires `Audited` once we declare its `audits`) +- Boot-time `assertConformance` (story 02) +- ESLint rules reading the manifest (story 03) +- Generator emitting manifest stubs (story 05) + +## Tasks +- [ ] Brand types: `Instrumented` and `Captured` +- [ ] `withSpan` attaches `Instrumented` +- [ ] `withCapture` attaches `Captured` +- [ ] `defineFeature` helper + manifest types +- [ ] `ProductionUseCase` slot type +- [ ] `withAudit` wrapper + `Audited` brand +- [ ] `authManifest` declaration +- [ ] `auth.signIn` rebound through branded slot +- [ ] Negative test: unwrapped factory rejected at type level