import { defineFeature } from "@repo/core-shared/conformance";

/**
 * The auth feature's conformance manifest. Drives binding-slot types in
 * `di/bind-production.ts` and is read by ESLint, the boot assertion, and
 * the CI drift gate (later milestones).
 *
 * Conventions:
 * - `mutates: true` for any use case that creates, updates, or deletes state
 * - `audits` lists every audit event the use case emits (must match calls
 *   to `auditLog.record(...)` in the factory body — ESLint enforces this
 *   in a later story)
 * - `publishes` / `consumes` cover cross-feature events through `IEventBus`
 */
export const authManifest = defineFeature({
  name: "auth",
  requiredCores: [],
  useCases: {
    signIn: {
      mutates: false,
      audits: [],
      publishes: [],
      consumes: [],
    },
    signUp: {
      mutates: true,
      audits: [],
      publishes: [],
      consumes: [],
    },
    signOut: {
      mutates: true,
      audits: [],
      publishes: [],
      consumes: [],
    },
  },
  realtimeChannels: [],
  jobs: [],
} as const);

export type AuthManifest = typeof authManifest;
