Files
agentic-dev/docs/work/conformance-system-v1/01-define-feature-helper/_story.md

1.8 KiB

id, epic, title, type, status, feature, depends-on, blocks
id epic title type status feature depends-on blocks
01-define-feature-helper conformance-system-v1 defineFeature helper + Instrumented/Captured/Audited brands technical-story done core-shared
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<F> and Captured<F> brand types in @repo/core-shared/conformance
  • Brand attachment in withSpan and withCapture
  • Audited<F> brand and withAudit wrapper in @repo/core-audit
  • defineFeature helper + FeatureManifest / UseCaseManifest types
  • ProductionUseCase<I, O, M> 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<F> 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<F> and Captured<F>
  • withSpan attaches Instrumented
  • withCapture attaches Captured
  • defineFeature helper + manifest types
  • ProductionUseCase<I, O, M> slot type
  • withAudit wrapper + Audited brand
  • authManifest declaration
  • auth.signIn rebound through branded slot
  • Negative test: unwrapped factory rejected at type level