Manifest-first: connectWorkspace declared mutates:true with the workspace-connected audit event, requiredCores gains audit. Workspace entity gains gitUrl + persisted status enum (created/connecting/ready/ error). Input takes name + git URL + PAT; the output schema is the credential-free workspace entity, so the PAT can never round-trip. Audit emission asserted with RecordingAuditLog; binders wire the use case through wireUseCase with the __audited brand, and web-next bindAll now binds core-audit (payload+stdout sinks in production, stdout in dev-seed) so boot conformance passes in both modes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
63 lines
1.9 KiB
TypeScript
63 lines
1.9 KiB
TypeScript
import { defineFeature } from "@repo/core-shared/conformance";
|
|
|
|
/**
|
|
* The workspaces 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.
|
|
*
|
|
* 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)
|
|
* - `publishes` / `consumes` cover cross-feature events through `IEventBus`
|
|
*/
|
|
export const workspacesManifest = defineFeature({
|
|
name: "workspaces",
|
|
requiredCores: ["audit"],
|
|
useCases: {
|
|
connectWorkspace: {
|
|
mutates: true,
|
|
audits: ["workspace-connected"],
|
|
publishes: [],
|
|
consumes: [],
|
|
analyticsEvents: [],
|
|
},
|
|
getWorkspace: {
|
|
mutates: false,
|
|
audits: [],
|
|
publishes: [],
|
|
consumes: [],
|
|
analyticsEvents: [],
|
|
},
|
|
},
|
|
realtimeChannels: [],
|
|
jobs: [],
|
|
// <gen:coverage>
|
|
// Coverage bands — single source of truth (ADR-020). Read by:
|
|
// - vitest.config.ts (test-time thresholds, L0)
|
|
// - assertFeatureConformance (boot-time, fails dev/prod on drift)
|
|
// - pnpm coverage:diff (cover-the-diff gate, L1)
|
|
// Edit here; the helper in vitest.config picks up the new numbers.
|
|
coverage: {
|
|
bands: {
|
|
baseline: { statements: 80, branches: 75, functions: 80, lines: 80 },
|
|
entities: { statements: 100, branches: 100, functions: 100, lines: 100 },
|
|
"use-cases": {
|
|
statements: 100,
|
|
branches: 95,
|
|
functions: 100,
|
|
lines: 100,
|
|
},
|
|
controllers: {
|
|
statements: 100,
|
|
branches: 95,
|
|
functions: 100,
|
|
lines: 100,
|
|
},
|
|
},
|
|
mutationTargets: ["entities", "use-cases"],
|
|
},
|
|
} as const);
|
|
|
|
export type WorkspacesManifest = typeof workspacesManifest;
|