/*
Maintains packages/os/site-kernel/src/workflow/workflow.module.ts as an authored site-kernel authored module so agents can evolve it without rediscovering local boundaries.
- Do not register app-specific workflow commands.
- Module registers the command only — workflow logic lives in sibling modules.
- RFC-1097: step 6 — compass.migrate codemod run
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.
- RFC-1097: sweep — werkstatt-engine clean
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.
- RFC-1173: declare mutatesState on all kernel commands — collectDeclarationDiagnostics emits error-severity MUTATES-STATE-DECLARED, command.manifest.validate is the blocking consumer in packages.check, sweep declares the flag on every command definition (factories hardcode false for read-only check specs)
- RFC-1231: step 1 — rename supportsAllSites to acceptsAllFlag
Mechanical sweep: the field only ever gated --all argv acceptance; fan-out
follows the parsed selector. Guard renamed assertAllSitesAllowed ->
assertAllFlagAccepted, message updated. 417 declaration sites + type
surfaces (KernelCommandMetadata, ForgeCommandMetadata) in one atomic pass.
- RFC-1276: remove workflow-amend.list and the workflows-amend lint branch — the RFC-0135/0136 amend pipeline is superseded
RFC-0075
*/
import type { ModuleExport } from "@warpgogol/werkstatt-shared/kernel";
export async function createWorkflowModule(): Promise {
const { runWorkflowLint, runWorkflowList } = await import("./handlers.ts");
return {
name: "workflow",
version: "0.1.0",
declarations: [],
commands: [
{
name: "workflow.lint",
mutatesState: false,
contract: "workflow",
rules: [],
modulePath: "packages/werkstatt-engine/src/kernel/workflow/workflow.module.ts",
description:
"Validate .agents/workflows markdown frontmatter, command references, " +
"and per-chain phase links (RFC-0075).",
scope: "workspace",
flags: {},
acceptsAllFlag: true,
reads: [".agents/workflows/**/*.md", ".windsurf/workflows/**/*.md"],
execute: runWorkflowLint,
},
{
name: "workflow.list",
mutatesState: false,
modulePath: "packages/werkstatt-engine/src/kernel/workflow/workflow.module.ts",
description:
"List .agents/workflows entries with phase, IO summary, and next workflow (RFC-0075).",
scope: "workspace",
flags: {},
acceptsAllFlag: true,
reads: [".agents/workflows/**/*.md", ".windsurf/workflows/**/*.md"],
execute: runWorkflowList,
},
],
pipelines: [],
};
}