@vaubaan/harness 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +517 -68
- package/dist/cli/index.js +153 -121
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/doc-audit.cmd.md +1 -1
- package/dist/commands/intent.cmd.md +33 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +90 -58
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/init.js +90 -58
- package/dist/init.js.map +1 -1
- package/dist/linters/index.js +124 -117
- package/dist/linters/index.js.map +1 -1
- package/dist/parser/index.d.ts +65 -32
- package/dist/parser/index.js +42 -38
- package/dist/parser/index.js.map +1 -1
- package/dist/{render-BzrBb_l4.d.ts → render-CTx7VNOK.d.ts} +3 -3
- package/dist/render.d.ts +1 -1
- package/dist/render.js +37 -32
- package/dist/render.js.map +1 -1
- package/dist/skills/doc-audit.skill.md +21 -20
- package/dist/skills/drift-detector.skill.md +17 -17
- package/dist/skills/handbook-writer.skill.md +3 -3
- package/dist/skills/intent-writer.skill.md +174 -0
- package/dist/templates/e2e-tests.md.tmpl +1 -1
- package/dist/templates/integration-tests.md.tmpl +1 -1
- package/dist/templates/{journey.md.tmpl → intent.md.tmpl} +8 -7
- package/package.json +3 -7
- package/dist/commands/journey.cmd.md +0 -22
- package/dist/commands/story.cmd.md +0 -24
- package/dist/skills/journey-writer.skill.md +0 -159
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/linters/util.ts","../../src/linters/adr-no-tracks.ts","../../src/linters/cardinal-files.ts","../../src/linters/config.ts","../../src/linters/cross-links.ts","../../src/linters/decision-schema.ts","../../src/linters/doc-layout.ts","../../src/linters/frontmatter-tracks.ts","../../src/linters/generated-fresh.ts","../../src/cli/managed-paths.ts","../../src/cli/manifest.ts","../../src/cli/plan-render.ts","../../src/loader.ts","../../src/parser/common.ts","../../src/parser/schemas.ts","../../src/types.ts","../../src/parser/cmd.ts","../../src/parser/skill.ts","../../src/util/yaml.ts","../../src/parser/journey.ts","../../src/renderers/common.ts","../../src/renderers/claude-code.ts","../../src/renderers/codex-cli.ts","../../src/renderers/opencode.ts","../../src/renderers/index.ts","../../src/renderers/journeys-index.ts","../../src/render.ts","../../src/linters/gitignore-harness.ts","../../src/linters/journey-anchors.ts","../../src/linters/journey-graph.ts","../../src/linters/journey-util.ts","../../src/linters/journey-schema.ts","../../src/linters/journey-vocabulary.ts","../../src/linters/orphan-decisions.ts","../../src/linters/quality-schema.ts","../../src/linters/readme-presence.ts","../../src/linters/readme-sections.ts","../../src/linters/spec-has-content.ts","../../src/linters/spec-tech-agnostic.ts","../../src/linters/tracks-drift.ts","../../src/linters/index.ts"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { existsSync, readFileSync, statSync } from \"node:fs\";\nimport { join, relative } from \"node:path\";\nimport fg from \"fast-glob\";\nimport matter from \"gray-matter\";\n\nexport function fileExists(repoRoot: string, relativePath: string): boolean {\n return existsSync(join(repoRoot, relativePath));\n}\n\nexport function readText(repoRoot: string, relativePath: string): string {\n return readFileSync(join(repoRoot, relativePath), \"utf8\");\n}\n\n/**\n * A `tracks:` entry or a journey anchor: a path from the repo root, or a glob\n * (any `*`) that must match at least one file.\n */\nexport function trackedPathExists(repoRoot: string, pattern: string): boolean {\n if (pattern.includes(\"*\")) {\n return fg.sync(pattern, { cwd: repoRoot, absolute: false }).length > 0;\n }\n return existsSync(join(repoRoot, pattern));\n}\n\nexport function listMarkdown(repoRoot: string, dir: string): string[] {\n const cwd = join(repoRoot, dir);\n if (!existsSync(cwd)) return [];\n return fg\n .sync(\"**/*.md\", { cwd, absolute: false, ignore: [\"**/node_modules/**\", \"**/dist/**\"] })\n .filter((f) => !f.endsWith(\"README.md\"))\n .map((f) => join(dir, f));\n}\n\nexport function listAllMarkdown(repoRoot: string, dir: string): string[] {\n const cwd = join(repoRoot, dir);\n if (!existsSync(cwd)) return [];\n return fg\n .sync(\"**/*.md\", { cwd, absolute: false, ignore: [\"**/node_modules/**\", \"**/dist/**\"] })\n .map((f) => join(dir, f));\n}\n\nexport function dirExists(repoRoot: string, relativePath: string): boolean {\n const full = join(repoRoot, relativePath);\n if (!existsSync(full)) return false;\n return statSync(full).isDirectory();\n}\n\nexport function parseFrontmatter(text: string): { data: Record<string, unknown>; body: string } {\n const m = matter(text);\n return { data: m.data, body: m.content };\n}\n\nexport interface GitLogEntry {\n hash: string;\n timestamp: number;\n}\n\nexport function gitLastCommitForPath(\n repoRoot: string,\n relativePath: string,\n): GitLogEntry | undefined {\n try {\n const out = execFileSync(\"git\", [\"log\", \"-1\", \"--format=%H:%ct\", \"--\", relativePath], {\n cwd: repoRoot,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n if (!out) return undefined;\n const idx = out.indexOf(\":\");\n if (idx < 0) return undefined;\n const hash = out.slice(0, idx);\n const ts = Number.parseInt(out.slice(idx + 1), 10);\n return { hash, timestamp: ts };\n } catch {\n return undefined;\n }\n}\n\nexport function gitCommitsSince(\n repoRoot: string,\n relativePath: string,\n sinceCommit: string,\n): number {\n try {\n const out = execFileSync(\n \"git\",\n [\"log\", `${sinceCommit}..HEAD`, \"--format=%H\", \"--\", relativePath],\n {\n cwd: repoRoot,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n },\n ).trim();\n if (!out) return 0;\n return out.split(\"\\n\").filter(Boolean).length;\n } catch {\n return 0;\n }\n}\n\nexport function relPath(repoRoot: string, abs: string): string {\n return relative(repoRoot, abs);\n}\n\nexport function findLineNumber(text: string, needle: string | RegExp): number | undefined {\n const lines = text.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n if (typeof needle === \"string\" ? line.includes(needle) : needle.test(line)) {\n return i + 1;\n }\n }\n return undefined;\n}\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, parseFrontmatter, readText } from \"./util.js\";\n\nconst ADR_DIR = \"docs/decisions\";\n\nexport const adrNoTracks: Linter = {\n id: \"lint:adr-no-tracks\",\n pillars: [\"decisions\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/decision\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, ADR_DIR);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n if (!(\"tracks\" in data)) continue;\n const value = data.tracks;\n if (Array.isArray(value) && value.length === 0) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message:\n \"ADRs must not declare `tracks:` (or must set it to []). ADRs document a decision frozen in time, not the current state of code — use status: superseded to mark them obsolete instead.\",\n });\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\nconst REQUIRED_FILES = [\n \"docs/tests/integration-tests.md\",\n \"docs/tests/e2e-tests.md\",\n \"docs/workflow/coding-workflow.md\",\n];\n\nexport const cardinalFiles: Linter = {\n id: \"lint:cardinal-files\",\n pillars: [\"tests\", \"workflow\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/test-plan\", \"/workflow\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const f of REQUIRED_FILES) {\n if (!fileExists(repoRoot, f)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `missing required cardinal file: ${f}`,\n });\n }\n }\n return issues;\n },\n};\n","import { cosmiconfigSync } from \"cosmiconfig\";\n\nexport interface HarnessLintConfig {\n ignore: ReadonlyArray<string>;\n}\n\nconst DEFAULT_CONFIG: HarnessLintConfig = { ignore: [] };\n\nexport function loadLintConfig(repoRoot: string): HarnessLintConfig {\n const explorer = cosmiconfigSync(\"harness\", {\n searchPlaces: [\n \"package.json\",\n \".harnessrc\",\n \".harnessrc.json\",\n \".harnessrc.yaml\",\n \".harnessrc.yml\",\n \"harness.config.js\",\n \"harness.config.cjs\",\n ],\n });\n const result = explorer.search(repoRoot);\n if (!result || result.isEmpty) return DEFAULT_CONFIG;\n\n const raw = result.config as Record<string, unknown> | undefined;\n if (!raw) return DEFAULT_CONFIG;\n\n const lint = raw.lint as Record<string, unknown> | undefined;\n if (!lint) return DEFAULT_CONFIG;\n\n const ignore = lint.ignore;\n if (!Array.isArray(ignore)) return DEFAULT_CONFIG;\n\n return { ignore: ignore.filter((x): x is string => typeof x === \"string\") };\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport fg from \"fast-glob\";\nimport type { LintContext, LintIssue, Linter } from \"./types.js\";\nimport { readText } from \"./util.js\";\n\nconst LINK_REGEX = /\\[([^\\]]+)\\]\\(([^)]+)\\)/g;\n\nfunction maskCodeSpans(text: string): string {\n return text\n .replace(/```[\\s\\S]*?```/g, (m) => m.replace(/[^\\n]/g, \" \"))\n .replace(/`[^`\\n]*`/g, (m) => \" \".repeat(m.length));\n}\n\nfunction isExternalOrAnchor(url: string): boolean {\n if (url.startsWith(\"http://\") || url.startsWith(\"https://\")) return true;\n if (url.startsWith(\"mailto:\")) return true;\n if (url.startsWith(\"#\")) return true;\n return false;\n}\n\nfunction stripFragment(url: string): string {\n const i = url.indexOf(\"#\");\n return i < 0 ? url : url.slice(0, i);\n}\n\nfunction resolveLink(repoRoot: string, sourceFile: string, link: string): string {\n const noFrag = stripFragment(link);\n if (isAbsolute(noFrag)) return join(repoRoot, noFrag);\n return resolve(dirname(join(repoRoot, sourceFile)), noFrag);\n}\n\nexport const crossLinks: Linter = {\n id: \"lint:cross-links\",\n pillars: [\"all\"],\n defaultSeverity: \"error\",\n run(repoRoot: string, ctx?: LintContext): LintIssue[] {\n const extra = ctx?.config.ignore ?? [];\n const issues: LintIssue[] = [];\n const allDocs = fg.sync(\"**/*.md\", {\n cwd: repoRoot,\n absolute: false,\n ignore: [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \".harness-overrides/**\",\n \"skills/**\",\n \"agents/**\",\n \"commands/**\",\n \"templates/**\",\n \"**/*.skill.md\",\n \"**/*.cmd.md\",\n \"**/*.agent.md\",\n ...extra,\n ],\n });\n for (const f of allDocs) {\n const text = maskCodeSpans(readText(repoRoot, f));\n const lines = text.split(\"\\n\");\n for (let lineNo = 0; lineNo < lines.length; lineNo++) {\n const line = lines[lineNo] ?? \"\";\n LINK_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n match = LINK_REGEX.exec(line);\n while (match !== null) {\n const url = match[2];\n if (url && !isExternalOrAnchor(url)) {\n const noFrag = stripFragment(url);\n if (noFrag !== \"\" && !noFrag.startsWith(\"data:\")) {\n const target = resolveLink(repoRoot, f, url);\n if (!existsSync(target)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n line: lineNo + 1,\n message: `broken link: ${url}`,\n });\n }\n }\n }\n match = LINK_REGEX.exec(line);\n }\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, readText } from \"./util.js\";\n\n// English headings are canonical; the French ones are still accepted so\n// projects written before the switch to English keep passing.\nconst REQUIRED_SECTIONS: Array<{ label: string; pattern: RegExp }> = [\n { label: \"Context\", pattern: /^##\\s+(Context|Contexte)\\b/m },\n { label: \"Decision\", pattern: /^##\\s+(Decision|D[ée]cision)\\b/m },\n { label: \"Consequences\", pattern: /^##\\s+(Consequences|Cons[ée]quences)\\b/m },\n {\n label: \"Rejected alternatives\",\n pattern: /^##\\s+(Rejected\\s+alternatives|Alternatives(\\s+rejet[ée]es)?)\\b/im,\n },\n];\n\nexport const decisionSchema: Linter = {\n id: \"lint:decision-schema\",\n pillars: [\"decisions\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/decision\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, \"docs/decisions\");\n for (const f of files) {\n const text = readText(repoRoot, f);\n for (const { label, pattern } of REQUIRED_SECTIONS) {\n if (!pattern.test(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `missing required section: \"${label}\"`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists } from \"./util.js\";\n\nconst REQUIRED_DIRS = [\n \"docs/spec\",\n \"docs/decisions\",\n \"docs/handbook\",\n \"docs/tests\",\n \"docs/workflow\",\n];\n\nexport const docLayout: Linter = {\n id: \"lint:doc-layout\",\n pillars: [\"all\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of REQUIRED_DIRS) {\n if (!dirExists(repoRoot, dir)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: dir,\n message: `missing required directory: ${dir}/`,\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, parseFrontmatter, readText, trackedPathExists } from \"./util.js\";\n\nconst TRACKED_DIRS = [\"docs/handbook\", \"docs/tests\", \"docs/workflow\"];\n\nexport const frontmatterTracks: Linter = {\n id: \"lint:frontmatter-tracks\",\n pillars: [\"handbook\", \"tests\", \"workflow\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/handbook\", \"/test-plan\", \"/workflow\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of TRACKED_DIRS) {\n const files = listMarkdown(repoRoot, dir);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n if (!Array.isArray(data.tracks)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: \"missing frontmatter `tracks:` array\",\n });\n continue;\n }\n for (const tracked of data.tracks as unknown[]) {\n if (typeof tracked !== \"string\") {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: \"`tracks` entries must be strings\",\n });\n continue;\n }\n if (!trackedPathExists(repoRoot, tracked)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `tracked path does not exist: ${tracked}`,\n });\n }\n }\n }\n }\n return issues;\n },\n};\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { RELEASED_PATHS } from \"../cli/managed-paths.js\";\nimport { readManifest } from \"../cli/manifest.js\";\nimport { planInit } from \"../cli/plan-render.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\n\nconst FIX = \"run `npx @vaubaan/harness update .` and commit the result\";\n\n/**\n * Generated files are committed; this linter is what keeps them honest. It\n * renders the harness with the engines and overrides the manifest records\n * and compares every file with the working tree\n * (docs/decisions/generated-files-committed.md).\n */\nexport const generatedFresh: Linter = {\n id: \"lint:generated-fresh\",\n pillars: [\"repo-root\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n const issue = (file: string, message: string): LintIssue => ({\n linter: this.id,\n severity: \"error\",\n file,\n message,\n });\n let manifest: ReturnType<typeof readManifest>;\n try {\n manifest = readManifest(repoRoot);\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n return [issue(\".harness-manifest.json\", `invalid harness manifest: ${reason}`)];\n }\n if (!manifest) return [];\n const overridesParent = manifest.overridesDir\n ? resolve(repoRoot, manifest.overridesDir)\n : repoRoot;\n const hasOverrides = existsSync(join(overridesParent, \".harness-overrides\"));\n let rendered: ReturnType<typeof planInit>;\n try {\n rendered = planInit({\n targetDir: repoRoot,\n engines: manifest.engines,\n overridesDir: hasOverrides ? overridesParent : undefined,\n });\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n return [issue(\".harness-manifest.json\", `cannot render the harness: ${reason}`)];\n }\n const preserved = new Set(manifest.preservedFiles ?? []);\n const issues: LintIssue[] = [];\n const renderedPaths = new Set<string>();\n for (const file of rendered.output.files) {\n if (preserved.has(file.path)) continue;\n renderedPaths.add(file.path);\n const full = join(repoRoot, file.path);\n if (!existsSync(full)) {\n issues.push(issue(file.path, `generated file is missing; ${FIX}`));\n } else if (readFileSync(full, \"utf8\") !== file.content) {\n issues.push(\n issue(\n file.path,\n `generated file differs from the current render; edit its source in docs/ or .harness-overrides/, then ${FIX}`,\n ),\n );\n }\n }\n for (const path of manifest.files) {\n if (renderedPaths.has(path) || preserved.has(path) || RELEASED_PATHS.includes(path)) continue;\n if (existsSync(join(repoRoot, path))) {\n issues.push(issue(path, `stale generated file, no longer rendered; ${FIX}`));\n }\n }\n return issues;\n },\n};\n","import { lstatSync, realpathSync, statSync } from \"node:fs\";\nimport { basename, dirname, isAbsolute, join, resolve, win32 } from \"node:path\";\n\nconst MANAGED_FILES = new Set([\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".harness-manifest.json\",\n // Index of the optional journeys pillar, rendered while a journey exists.\n \"docs/journeys/README.md\",\n]);\n\n/**\n * Files 1.x wrote or edited and 2.0 never touches again: MCP configurations\n * and engine settings holding the Stop hook. A manifest that still lists one\n * drops it with a warning; the file stays in place as the project's.\n */\nexport const RELEASED_PATHS: ReadonlyArray<string> = [\n \".mcp.json\",\n \".codex/config.toml\",\n \".opencode/opencode.json\",\n \".opencode/mcp.json\",\n \".claude/settings.json\",\n \".codex/hooks.json\",\n];\n\n// Includes legacy layouts so upgrades can remove their generated artifacts.\nconst MANAGED_DIRECTORIES = [\n \".claude/agents/\",\n \".claude/commands/\",\n \".claude/skills/\",\n \".codex/agents/\",\n \".codex/commands/\",\n \".codex/skills/\",\n \".agents/skills/\",\n \".opencode/agents/\",\n \".opencode/commands/\",\n \".opencode/skills/\",\n \".opencode/plugins/\",\n];\n\nfunction canonicalTargetRoot(root: string): string {\n let ancestor = resolve(root);\n const missing: string[] = [];\n while (!lstatSync(ancestor, { throwIfNoEntry: false })) {\n missing.unshift(basename(ancestor));\n ancestor = dirname(ancestor);\n }\n const canonical = realpathSync(ancestor);\n if (!statSync(canonical).isDirectory()) {\n throw new Error(`harness target is not a directory: ${root}`);\n }\n return join(canonical, ...missing);\n}\n\nfunction assertManagedLocation(path: string): void {\n const invalidSegment = path\n .split(\"/\")\n .some((part) => part === \"\" || part === \".\" || part === \"..\");\n if (\n isAbsolute(path) ||\n win32.isAbsolute(path) ||\n path.includes(\"\\\\\") ||\n path.includes(\"\\0\") ||\n invalidSegment\n ) {\n throw new Error(`unsafe harness path: ${path}`);\n }\n if (!MANAGED_FILES.has(path) && !MANAGED_DIRECTORIES.some((prefix) => path.startsWith(prefix))) {\n throw new Error(`path is outside harness-managed locations: ${path}`);\n }\n}\n\nfunction assertNoSymbolicComponents(root: string, path: string): void {\n const parts = path.split(\"/\");\n let current = root;\n for (const [index, part] of parts.entries()) {\n current = join(current, part);\n const info = lstatSync(current, { throwIfNoEntry: false });\n if (!info) return;\n if (info.isSymbolicLink()) {\n throw new Error(`symbolic link in harness path: ${path}`);\n }\n const isLeaf = index === parts.length - 1;\n if (isLeaf ? !info.isFile() : !info.isDirectory()) {\n throw new Error(`unexpected file type in harness path: ${path}`);\n }\n }\n}\n\n/**\n * Preflight the complete list before callers mutate any artifact. The target\n * itself may resolve through a symlink; every component below it, including\n * leaf files and the manifest, must be a regular file or directory, never a\n * symlink (even one pointing inside the target). Missing targets are allowed.\n * This checks the current filesystem, not concurrent changes by other processes.\n */\nexport function assertManagedPaths(root: string, files: ReadonlyArray<string>): void {\n for (const path of files) assertManagedLocation(path);\n const canonicalRoot = canonicalTargetRoot(root);\n for (const path of files) assertNoSymbolicComponents(canonicalRoot, path);\n}\n","import { createHash } from \"node:crypto\";\nimport { chmodSync, existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { z } from \"zod\";\nimport type { Engine } from \"../types.js\";\nimport { VERSION } from \"../version.js\";\nimport { assertManagedPaths } from \"./managed-paths.js\";\n\nexport const MANIFEST_FILENAME = \".harness-manifest.json\";\nexport const MANIFEST_VERSION = \"6\";\n\n// Fields written by 1.x and dropped on read as unknown keys: the entry\n// ownership of shared files (`hookConfigs`, `opencodeConfig`, `mcpConfig`)\n// and the Stop hook preference (`stopHookInstalled`, `stopHookEngines`).\n// Decisions: safe-init, lint-in-ci-and-pre-commit.\nconst ManifestSchema = z.object({\n version: z.enum([\"4\", \"5\", MANIFEST_VERSION]),\n engines: z.array(z.string()),\n renderedAt: z.string(),\n files: z.array(z.string()),\n harnessVersion: z.string().optional(),\n overridesDir: z.string().optional(),\n fileHashes: z.record(z.string().regex(/^[a-f0-9]{64}$/)).optional(),\n preservedFiles: z.array(z.string()).optional(),\n});\n\nexport type Manifest = z.infer<typeof ManifestSchema>;\n\nexport interface WriteManifestExtras {\n overridesDir?: string;\n preservedFiles?: string[];\n}\n\nexport function manifestPath(targetDir: string): string {\n return join(targetDir, MANIFEST_FILENAME);\n}\n\nexport function writeManifest(\n targetDir: string,\n engines: ReadonlyArray<Engine>,\n files: string[],\n extras: WriteManifestExtras = {},\n): void {\n assertManagedPaths(targetDir, [MANIFEST_FILENAME]);\n const manifest: Manifest = {\n version: MANIFEST_VERSION,\n harnessVersion: VERSION,\n engines: [...engines].sort(),\n renderedAt: new Date().toISOString(),\n files: [...files].sort(),\n fileHashes: Object.fromEntries(\n files\n .filter((file) => existsSync(join(targetDir, file)))\n .sort()\n .map((file) => [file, hashContent(readFileSync(join(targetDir, file)))]),\n ),\n ...(extras.overridesDir ? { overridesDir: extras.overridesDir } : {}),\n ...(extras.preservedFiles ? { preservedFiles: extras.preservedFiles } : {}),\n };\n const path = manifestPath(targetDir);\n if (existsSync(path)) chmodSync(path, 0o600);\n writeFileSync(path, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 0o600 });\n}\n\nexport function hashContent(content: string | Buffer): string {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nexport function readManifest(targetDir: string): Manifest | null {\n assertManagedPaths(targetDir, [MANIFEST_FILENAME]);\n const path = manifestPath(targetDir);\n if (!existsSync(path)) return null;\n const raw = JSON.parse(readFileSync(path, \"utf8\"));\n return ManifestSchema.parse(raw);\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { loadHarness, loadOverrides, loadProjectSkills } from \"../loader.js\";\nimport { loadJourneys } from \"../parser/journey.js\";\nimport { type RenderOutput, render } from \"../render.js\";\nimport { ENGINES, type Engine } from \"../types.js\";\n\n/** Cardinal file of the optional `docs/quality/` pillar. */\nconst QUALITY_DOC_PATH = \"docs/quality/code-quality.md\";\n\nexport interface RenderPlanArgs {\n targetDir: string;\n engines: ReadonlyArray<string>;\n overridesDir?: string;\n packageDir?: string;\n}\n\n/**\n * The engine choice is mandatory: nothing is rendered for a tool the project\n * does not use (docs/spec/coding-agent-harness.md §8).\n */\nexport function resolveEngineList(requested: ReadonlyArray<string> | undefined): Engine[] {\n if (!requested || requested.length === 0) {\n throw new Error(\n `no engine selected: pass --engines=<list> with one or more of ${ENGINES.join(\", \")}`,\n );\n }\n const engines = requested.map((e) => {\n if (!ENGINES.includes(e as Engine)) {\n throw new Error(`unknown engine: ${e} (expected one of ${ENGINES.join(\", \")})`);\n }\n return e as Engine;\n });\n return [...new Set(engines)];\n}\n\n/**\n * Resolves the harness package's bundled content directory. The harness\n * tsup config emits this module into every entry that needs it\n * (`dist/init.js`, `dist/cli/index.js`, `dist/linters/index.js`). The\n * content (`skills/`, `commands/`, `templates/`) always sits at `dist/`:\n * same dir as `dist/init.js`, parent of `dist/cli/index.js` and\n * `dist/linters/index.js`. In dev (`src/cli/plan-render.ts`) the content\n * also sits at `src/`. We disambiguate by checking which ancestor contains\n * `skills/`.\n */\nfunction defaultPackageDir(): string {\n const here = dirname(fileURLToPath(import.meta.url));\n if (existsSync(join(here, \"skills\"))) return here;\n return resolve(here, \"..\");\n}\n\nexport function planInit(args: RenderPlanArgs): { engines: Engine[]; output: RenderOutput } {\n const engines = resolveEngineList(args.engines);\n const packageDir = args.packageDir ?? defaultPackageDir();\n const harness = loadHarness(packageDir);\n const overrides = args.overridesDir ? loadOverrides(args.overridesDir) : undefined;\n const projectSkills = loadProjectSkills(args.targetDir);\n const hasQualityDoc = existsSync(join(args.targetDir, QUALITY_DOC_PATH));\n const journeys = loadJourneys(args.targetDir);\n const output = render({ harness, engines, overrides, projectSkills, hasQualityDoc, journeys });\n return { engines, output };\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport fg from \"fast-glob\";\nimport { z } from \"zod\";\nimport { parseCmd } from \"./parser/cmd.js\";\nimport { type Skill, parseSkill } from \"./parser/skill.js\";\nimport type { Harness, HarnessOverrides } from \"./render.js\";\nimport { parseYAML } from \"./util/yaml.js\";\n\nexport const DisableYamlSchema = z\n .object({ disable: z.array(z.string()).optional() })\n .passthrough();\n\nexport interface LoadOptions {\n skillsDir?: string;\n commandsDir?: string;\n}\n\nexport function loadHarness(packageDir: string, opts: LoadOptions = {}): Harness {\n const skillsDir = opts.skillsDir ?? join(packageDir, \"skills\");\n const commandsDir = opts.commandsDir ?? join(packageDir, \"commands\");\n\n const skillFiles = fg.sync(\"*.skill.md\", { cwd: skillsDir, absolute: true });\n const cmdFiles = fg.sync(\"*.cmd.md\", { cwd: commandsDir, absolute: true });\n\n return {\n skills: skillFiles.map((f) => parseSkill(f, readFileSync(f, \"utf8\"))),\n cmds: cmdFiles.map((f) => parseCmd(f, readFileSync(f, \"utf8\"))),\n };\n}\n\nexport function loadProjectSkills(targetDir: string): Skill[] {\n const skillsDir = join(targetDir, \"docs\", \"skills\");\n if (!existsSync(skillsDir)) return [];\n const skillFiles = fg.sync(\"*.skill.md\", { cwd: skillsDir, absolute: true });\n return skillFiles.map((f) => parseSkill(f, readFileSync(f, \"utf8\")));\n}\n\nexport function loadOverrides(worktreeDir: string): HarnessOverrides | undefined {\n const overridesDir = join(worktreeDir, \".harness-overrides\");\n if (!existsSync(overridesDir)) return undefined;\n\n const added = loadHarness(overridesDir, {\n skillsDir: join(overridesDir, \"skills\"),\n commandsDir: join(overridesDir, \"commands\"),\n });\n\n const disablePath = join(overridesDir, \"disable.yaml\");\n let disable: string[] = [];\n if (existsSync(disablePath)) {\n try {\n const parsed = DisableYamlSchema.safeParse(parseYAML(readFileSync(disablePath, \"utf8\")));\n if (parsed.success && parsed.data.disable) {\n disable = parsed.data.disable;\n }\n } catch {\n // corrupt YAML — leave disable as []\n }\n }\n\n return { add: added, disable };\n}\n","import { readFileSync } from \"node:fs\";\nimport matter from \"gray-matter\";\nimport type { z } from \"zod\";\nimport { ParseError } from \"./schemas.js\";\n\nexport interface ParsedFile<T> {\n meta: T;\n body: string;\n sourcePath: string;\n}\n\nexport function parseWithSchema<T extends z.ZodTypeAny>(\n filePath: string,\n source: string,\n schema: T,\n): ParsedFile<z.infer<T>> {\n const parsed = matter(source);\n const result = schema.safeParse(parsed.data);\n if (!result.success) {\n throw new ParseError(filePath, result.error.issues);\n }\n return {\n meta: result.data,\n body: parsed.content.trim(),\n sourcePath: filePath,\n };\n}\n\nexport function parseFileWithSchema<T extends z.ZodTypeAny>(\n filePath: string,\n schema: T,\n): ParsedFile<z.infer<T>> {\n const source = readFileSync(filePath, \"utf8\");\n return parseWithSchema(filePath, source, schema);\n}\n","import { z } from \"zod\";\nimport { CAPABILITIES, ENGINES } from \"../types.js\";\n\nconst IdSchema = z\n .string()\n .min(1)\n .regex(/^[a-z][a-z0-9-]*$/, \"id must be kebab-case (lowercase + digits + hyphens)\");\n\nconst SkillFrontmatterSchema = z\n .object({\n id: IdSchema,\n description: z.string().min(1),\n engines: z.array(z.enum(ENGINES)).min(1).optional(),\n requires: z.array(z.enum(CAPABILITIES)).optional(),\n tags: z.array(z.string()).optional(),\n })\n .strict();\n\nexport type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;\n\nconst CmdArgEnumSchema = z\n .object({\n name: z.string().min(1),\n type: z.literal(\"enum\"),\n values: z.array(z.string()).min(1),\n default: z.string().optional(),\n })\n .strict();\n\nconst CmdArgStringSchema = z\n .object({\n name: z.string().min(1),\n type: z.literal(\"string\"),\n default: z.string().optional(),\n })\n .strict();\n\nconst CmdArgSchema = z.discriminatedUnion(\"type\", [CmdArgEnumSchema, CmdArgStringSchema]);\n\nexport type CmdArg = z.infer<typeof CmdArgSchema>;\n\nconst CmdFrontmatterSchema = z\n .object({\n id: IdSchema,\n trigger: z.string().regex(/^\\/[a-z][a-z0-9-]*$/, \"trigger must be /kebab-case\"),\n invokes_skill: IdSchema,\n args: z.array(CmdArgSchema).optional(),\n description: z.string().min(1),\n })\n .strict();\n\nexport type CmdFrontmatter = z.infer<typeof CmdFrontmatterSchema>;\n\nexport const JOURNEY_STATUSES = [\"proposed\", \"implemented\", \"deprecated\"] as const;\nexport type JourneyStatus = (typeof JOURNEY_STATUSES)[number];\n\n// gray-matter parses a bare YAML date (`2026-11-09`) into a Date object.\nconst JourneyFrontmatterSchema = z\n .object({\n title: z.string().min(1),\n status: z.enum(JOURNEY_STATUSES),\n actors: z.array(z.string().min(1)).min(1),\n spec: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]),\n last_reviewed: z.union([z.date(), z.string().min(1)]),\n })\n .strict();\n\nexport type JourneyFrontmatter = z.infer<typeof JourneyFrontmatterSchema>;\n\nexport const Schemas = {\n Skill: SkillFrontmatterSchema,\n Cmd: CmdFrontmatterSchema,\n Journey: JourneyFrontmatterSchema,\n} as const;\n\nexport class ParseError extends Error {\n constructor(\n public readonly file: string,\n public readonly issues: z.ZodIssue[],\n ) {\n const messages = issues\n .map((i) => ` - ${i.path.join(\".\") || \"<root>\"}: ${i.message}`)\n .join(\"\\n\");\n super(`Frontmatter validation failed for ${file}:\\n${messages}`);\n this.name = \"ParseError\";\n }\n}\n","export const ENGINES = [\"claude-code\", \"codex-cli\", \"opencode\"] as const;\nexport type Engine = (typeof ENGINES)[number];\n\nexport const ENGINE_ROOT_DIR: Record<Engine, string> = {\n \"claude-code\": \".claude\",\n \"codex-cli\": \".codex\",\n opencode: \".opencode\",\n};\n\nexport const CAPABILITIES = [\"multi-step\", \"slash-command\", \"inline-exec\"] as const;\nexport type Capability = (typeof CAPABILITIES)[number];\n\nexport interface RenderedFile {\n path: string;\n content: string;\n}\n\nexport interface CapabilitiesMatrix {\n [engine: string]: ReadonlyArray<Capability>;\n}\n\nexport const CAPABILITIES_MATRIX: Record<Engine, ReadonlyArray<Capability>> = {\n \"claude-code\": [\"multi-step\", \"slash-command\", \"inline-exec\"],\n \"codex-cli\": [\"multi-step\", \"slash-command\", \"inline-exec\"],\n opencode: [\"multi-step\", \"slash-command\", \"inline-exec\"],\n};\n\nexport const DEGRADED_CAPABILITIES: Partial<Record<Engine, ReadonlyArray<Capability>>> = {\n \"codex-cli\": [\"multi-step\"],\n};\n\nexport function engineSupports(engine: Engine, capability: Capability): boolean {\n return CAPABILITIES_MATRIX[engine].includes(capability);\n}\n","import { parseFileWithSchema, parseWithSchema } from \"./common.js\";\nimport type { ParsedFile } from \"./common.js\";\nimport { type CmdFrontmatter, Schemas } from \"./schemas.js\";\n\nexport type Cmd = ParsedFile<CmdFrontmatter>;\n\nexport function parseCmd(filePath: string, source: string): Cmd {\n return parseWithSchema(filePath, source, Schemas.Cmd);\n}\n\nexport function parseCmdFile(filePath: string): Cmd {\n return parseFileWithSchema(filePath, Schemas.Cmd);\n}\n","import { parseFileWithSchema, parseWithSchema } from \"./common.js\";\nimport type { ParsedFile } from \"./common.js\";\nimport { Schemas, type SkillFrontmatter } from \"./schemas.js\";\n\nexport type Skill = ParsedFile<SkillFrontmatter>;\n\nexport function parseSkill(filePath: string, source: string): Skill {\n return parseWithSchema(filePath, source, Schemas.Skill);\n}\n\nexport function parseSkillFile(filePath: string): Skill {\n return parseFileWithSchema(filePath, Schemas.Skill);\n}\n","import { parse as yamlParse } from \"yaml\";\n\nexport function parseYAML(source: string): unknown {\n return yamlParse(source);\n}\n","import { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { basename, join } from \"node:path\";\nimport matter from \"gray-matter\";\nimport {\n JOURNEY_STATUSES,\n type JourneyFrontmatter,\n type JourneyStatus,\n Schemas,\n} from \"./schemas.js\";\n\n/** The optional journeys pillar (docs/spec/coding-agent-harness.md §9.1.3). */\nexport const JOURNEYS_DIR = \"docs/journeys\";\n/** The generated index of the pillar; never a journey. */\nexport const JOURNEYS_INDEX_PATH = `${JOURNEYS_DIR}/README.md`;\n\nexport const NODE_FIELDS = [\n \"status\",\n \"spec\",\n \"anchors\",\n \"acceptance\",\n \"requires\",\n \"creates\",\n] as const;\nexport type NodeField = (typeof NODE_FIELDS)[number];\n/** Fields only a leaf may carry. */\nexport const LEAF_FIELDS: ReadonlyArray<NodeField> = [\n \"anchors\",\n \"acceptance\",\n \"requires\",\n \"creates\",\n];\n\nexport interface JourneyError {\n line?: number;\n message: string;\n}\n\nexport interface JourneyNode {\n title: string;\n /** Heading depth minus one: `##` is level 1. */\n level: number;\n /** 1-based line of the heading in the file. */\n line: number;\n /** Index of the parent node in `nodes`, absent for a level-1 node. */\n parent?: number;\n isLeaf: boolean;\n /** Line of each known field the node declares. */\n fieldLines: Partial<Record<NodeField, number>>;\n status?: JourneyStatus;\n spec?: string;\n anchors: string[];\n acceptance: string[];\n requires: string[];\n creates: string[];\n unknownFields: Array<{ key: string; line: number }>;\n /** Nearest `status:` up the tree, else the file status. */\n effectiveStatus?: JourneyStatus;\n}\n\nexport interface JourneyParse {\n meta?: JourneyFrontmatter;\n title: string;\n story?: string;\n nodes: JourneyNode[];\n errors: JourneyError[];\n}\n\nexport interface ParsedJourney extends JourneyParse {\n /** Path from the repo root, e.g. `docs/journeys/harness-a-project.md`. */\n path: string;\n /** File name, e.g. `harness-a-project.md`. */\n file: string;\n}\n\n/** Stands for a line of fenced code: not blank, not a field, not a heading. */\nconst MASKED_LINE = \"\\u0000\";\nconst FENCE_RE = /^ {0,3}(`{3,}|~{3,})/;\nconst HEADING_RE = /^(#{1,6})[ \\t]+(.+?)(?:[ \\t]+#+)?[ \\t]*$/;\nconst FIELD_RE = /^([a-z][a-z-]*):\\s*(.*)$/;\nconst LIST_ITEM_RE = /^\\s*-\\s+(.*)$/;\n\n/** Replaces every line of fenced code (fences included), keeping line numbers. */\nexport function maskFencedCode(lines: ReadonlyArray<string>): string[] {\n let fence: string | undefined;\n return lines.map((line) => {\n const m = FENCE_RE.exec(line);\n if (fence !== undefined) {\n if (m?.[1] && m[1][0] === fence[0] && m[1].length >= fence.length) fence = undefined;\n return MASKED_LINE;\n }\n if (m?.[1]) {\n fence = m[1];\n return MASKED_LINE;\n }\n return line;\n });\n}\n\nexport function parseHeading(line: string): { depth: number; title: string } | undefined {\n const m = HEADING_RE.exec(line);\n if (!m?.[1] || !m[2]) return undefined;\n return { depth: m[1].length, title: m[2] };\n}\n\nfunction splitList(value: string): string[] {\n return value\n .split(\",\")\n .map((v) => v.trim())\n .filter(Boolean);\n}\n\n/** Index of the first body line, after the frontmatter block when there is one. */\nfunction bodyStart(lines: ReadonlyArray<string>): number {\n if (lines[0]?.trim() !== \"---\") return 0;\n for (let i = 1; i < lines.length; i++) {\n const l = lines[i]?.trim();\n if (l === \"---\" || l === \"...\") return i + 1;\n }\n return lines.length;\n}\n\nfunction parseFrontmatter(text: string, errors: JourneyError[]): JourneyFrontmatter | undefined {\n let data: Record<string, unknown>;\n try {\n data = matter(text).data;\n } catch (error) {\n const reason = error instanceof Error ? error.message.split(\"\\n\")[0] : String(error);\n errors.push({ line: 1, message: `invalid frontmatter YAML: ${reason}` });\n return undefined;\n }\n const result = Schemas.Journey.safeParse(data);\n if (result.success) return result.data;\n for (const issue of result.error.issues) {\n const where = issue.path.length ? ` \\`${issue.path.join(\".\")}\\`` : \"\";\n errors.push({ line: 1, message: `frontmatter${where}: ${issue.message}` });\n }\n return undefined;\n}\n\nfunction newNode(title: string, level: number, line: number): JourneyNode {\n return {\n title,\n level,\n line,\n isLeaf: true,\n fieldLines: {},\n anchors: [],\n acceptance: [],\n requires: [],\n creates: [],\n unknownFields: [],\n };\n}\n\n/** Reads the field block directly under a heading, up to its first non-field line. */\nfunction parseFields(\n node: JourneyNode,\n lines: ReadonlyArray<string>,\n from: number,\n to: number,\n errors: JourneyError[],\n): void {\n let lastKey: string | undefined;\n for (let i = from; i < to; i++) {\n const line = lines[i] ?? \"\";\n if (line.trim() === \"\") continue;\n const lineNo = i + 1;\n const field = FIELD_RE.exec(line.trimEnd());\n if (field?.[1] !== undefined) {\n const key = field[1];\n const value = (field[2] ?? \"\").trim();\n lastKey = key;\n if (!(NODE_FIELDS as ReadonlyArray<string>).includes(key)) {\n node.unknownFields.push({ key, line: lineNo });\n continue;\n }\n const known = key as NodeField;\n node.fieldLines[known] = lineNo;\n if (known === \"status\") {\n if ((JOURNEY_STATUSES as ReadonlyArray<string>).includes(value)) {\n node.status = value as JourneyStatus;\n } else {\n errors.push({\n line: lineNo,\n message: `invalid status \\`${value}\\` (expected ${JOURNEY_STATUSES.join(\" | \")})`,\n });\n }\n } else if (known === \"spec\") {\n node.spec = value;\n } else if (known === \"acceptance\") {\n if (value) node.acceptance.push(value);\n } else {\n node[known] = splitList(value);\n }\n continue;\n }\n const item = LIST_ITEM_RE.exec(line);\n if (lastKey === \"acceptance\" && item) {\n const text = (item[1] ?? \"\").trim();\n if (text) node.acceptance.push(text);\n continue;\n }\n return;\n }\n}\n\n/**\n * Parses one journey (docs/spec/coding-agent-harness.md §9.1.3). Never\n * throws: frontmatter and node problems are collected in `errors` and the\n * nodes are parsed regardless, so a linter reports everything at once.\n */\nexport function parseJourney(relPath: string, text: string): JourneyParse {\n const errors: JourneyError[] = [];\n const meta = parseFrontmatter(text, errors);\n const lines = maskFencedCode(text.split(/\\r?\\n/));\n const start = bodyStart(lines);\n\n const headings: Array<{ index: number; depth: number; title: string }> = [];\n for (let i = start; i < lines.length; i++) {\n const h = parseHeading(lines[i] ?? \"\");\n if (h) headings.push({ index: i, ...h });\n }\n\n const h1 = headings.find((h) => h.depth === 1);\n let story: string | undefined;\n if (h1) {\n const paragraph: string[] = [];\n for (let i = h1.index + 1; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n if (line.trim() === \"\") {\n if (paragraph.length) break;\n continue;\n }\n if (line === MASKED_LINE || parseHeading(line)) break;\n paragraph.push(line.trim());\n }\n if (paragraph.length) story = paragraph.join(\" \");\n }\n\n const nodes: JourneyNode[] = [];\n const stack: number[] = [];\n for (const [k, h] of headings.entries()) {\n if (h.depth < 2) continue;\n const node = newNode(h.title, h.depth - 1, h.index + 1);\n while (stack.length) {\n const top = nodes[stack[stack.length - 1] as number];\n if (top && top.level < node.level) break;\n stack.pop();\n }\n const parentIndex = stack[stack.length - 1];\n if (parentIndex !== undefined) {\n node.parent = parentIndex;\n const parent = nodes[parentIndex];\n if (parent) parent.isLeaf = false;\n }\n const next = headings[k + 1];\n parseFields(node, lines, h.index + 1, next ? next.index : lines.length, errors);\n const inherited =\n parentIndex !== undefined ? nodes[parentIndex]?.effectiveStatus : meta?.status;\n node.effectiveStatus = node.status ?? inherited;\n stack.push(nodes.length);\n nodes.push(node);\n }\n\n const title = meta?.title ?? h1?.title ?? basename(relPath, \".md\");\n return { ...(meta ? { meta } : {}), title, ...(story ? { story } : {}), nodes, errors };\n}\n\n/** Journey files: `docs/journeys/*.md` minus the generated index, sorted by file name. */\nexport function listJourneyFiles(targetDir: string): string[] {\n const dir = join(targetDir, JOURNEYS_DIR);\n if (!existsSync(dir) || !statSync(dir).isDirectory()) return [];\n return readdirSync(dir)\n .filter((f) => f.endsWith(\".md\") && f !== \"README.md\")\n .filter((f) => statSync(join(dir, f)).isFile())\n .sort();\n}\n\n/** Parses every journey without throwing; linters read their `errors`. */\nexport function readJourneys(targetDir: string): ParsedJourney[] {\n return listJourneyFiles(targetDir).map((file) => {\n const path = `${JOURNEYS_DIR}/${file}`;\n const text = readFileSync(join(targetDir, path), \"utf8\");\n return { path, file, ...parseJourney(path, text) };\n });\n}\n\n/**\n * The journeys the render needs. A journey that does not parse fails the\n * render, like an invalid project skill: `init`, `update` and\n * `lint:generated-fresh` report it.\n */\nexport function loadJourneys(targetDir: string): ParsedJourney[] {\n const journeys = readJourneys(targetDir);\n const problems = journeys.flatMap((j) =>\n j.errors.map((e) => ` - ${j.path}${e.line !== undefined ? `:${e.line}` : \"\"}: ${e.message}`),\n );\n if (problems.length) {\n throw new Error(\n `invalid journeys (run \\`npx @vaubaan/harness lint --pillar journeys\\`):\\n${problems.join(\"\\n\")}`,\n );\n }\n return journeys;\n}\n","import { stringify as yamlStringify } from \"yaml\";\nimport type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport {\n CAPABILITIES_MATRIX,\n type Capability,\n DEGRADED_CAPABILITIES,\n type Engine,\n type RenderedFile,\n} from \"../types.js\";\n\nexport interface UmbrellaExtras {\n availableSkills: ReadonlyArray<Skill>;\n availableCommands: ReadonlyArray<Cmd>;\n hasProjectSkills?: boolean;\n hasQualityDoc?: boolean;\n hasJourneys?: boolean;\n}\n\nexport interface RenderResult {\n files: RenderedFile[];\n warnings: string[];\n}\n\nexport interface Renderer {\n readonly engine: Engine;\n renderSkill(skill: Skill): RenderResult;\n renderCmd(cmd: Cmd): RenderResult;\n}\n\nexport interface CapabilityCheck {\n blockingWarnings: string[];\n degradedWarnings: string[];\n}\n\nexport function checkSkillCapabilities(skill: Skill, engine: Engine): CapabilityCheck {\n const blockingWarnings: string[] = [];\n const degradedWarnings: string[] = [];\n const supported = CAPABILITIES_MATRIX[engine];\n const degraded = DEGRADED_CAPABILITIES[engine] ?? [];\n if (!skill.meta.requires) return { blockingWarnings, degradedWarnings };\n for (const cap of skill.meta.requires) {\n if (!supported.includes(cap as Capability)) {\n blockingWarnings.push(\n `skill \"${skill.meta.id}\" requires \"${cap}\" not supported by \"${engine}\" — skipped`,\n );\n } else if (degraded.includes(cap as Capability)) {\n degradedWarnings.push(\n `skill \"${skill.meta.id}\" requires \"${cap}\" — supported by \"${engine}\" with degradation`,\n );\n }\n }\n return { blockingWarnings, degradedWarnings };\n}\n\nexport function isSkillEngineAllowed(skill: Skill, engine: Engine): boolean {\n if (!skill.meta.engines) return true;\n return skill.meta.engines.includes(engine);\n}\n\nexport function yamlFrontmatter(data: Record<string, unknown>): string {\n const rendered = yamlStringify(data, { lineWidth: 0 }).trimEnd();\n return `---\\n${rendered}\\n---\\n`;\n}\n\nexport function frontmatterDataForSkill(skill: Skill): Record<string, unknown> {\n // Agent Skills spec (agentskills.io): `name` must match the directory name.\n const data: Record<string, unknown> = {\n name: skill.meta.id,\n description: skill.meta.description,\n };\n if (skill.meta.tags && skill.meta.tags.length > 0) data.tags = skill.meta.tags;\n return data;\n}\n\nexport function frontmatterDataForCmd(cmd: Cmd): Record<string, unknown> {\n const data: Record<string, unknown> = {\n id: cmd.meta.id,\n trigger: cmd.meta.trigger,\n description: cmd.meta.description,\n };\n if (cmd.meta.args && cmd.meta.args.length > 0) {\n data.args = cmd.meta.args.map((a) => {\n if (a.type === \"enum\") {\n return a.default !== undefined\n ? { name: a.name, type: a.type, values: a.values, default: a.default }\n : { name: a.name, type: a.type, values: a.values };\n }\n return a.default !== undefined\n ? { name: a.name, type: a.type, default: a.default }\n : { name: a.name, type: a.type };\n });\n }\n return data;\n}\n\n/**\n * The engine-neutral umbrella: the one working rule the harness imposes,\n * the project map, the checks, and the doc skills the engines expose.\n * Everything project-specific lives in `README.md` and `docs/`.\n */\nexport function buildUmbrellaBody(extras: UmbrellaExtras): string {\n // One skill may be invoked by several commands (`/journey`, `/story`):\n // list every trigger, in command order.\n const triggersBySkill = new Map<string, string[]>();\n for (const c of extras.availableCommands) {\n const triggers = triggersBySkill.get(c.meta.invokes_skill) ?? [];\n triggers.push(c.meta.trigger);\n triggersBySkill.set(c.meta.invokes_skill, triggers);\n }\n const skillLines = extras.availableSkills.map((s) => {\n const triggers = triggersBySkill.get(s.meta.id) ?? [];\n const label =\n triggers.length > 0\n ? `\\`${s.meta.id}\\` (${triggers.map((t) => `\\`${t}\\``).join(\", \")})`\n : `\\`${s.meta.id}\\``;\n return `- ${label} — ${s.meta.description.split(\"\\n\")[0]}`;\n });\n const sections: string[] = [\n \"# How we work\",\n \"\",\n \"This file describes **how to work in this project**. The **business context** (what the project does, how to run it, which subsystems it contains) lives in `README.md` and `docs/`. Read them first.\",\n \"\",\n \"## Project map\",\n \"\",\n \"- `README.md` — pitch, quick start, scripts. Entry point.\",\n \"- `docs/spec/<subsystem>.md` — *what* and *why* (tech-agnostic).\",\n \"- `docs/handbook/<feature>.md` — what the code does not say: entry points, traps, settings outside the repo, manual procedures.\",\n \"- `docs/decisions/<slug>.md` — ADRs: structural choices and rejected alternatives.\",\n \"- `docs/tests/integration-tests.md` & `e2e-tests.md` — test scope, stack, conventions, known gaps.\",\n \"- `docs/workflow/coding-workflow.md` — CI, branches, PR, release. How this team works: follow it.\",\n ...(extras.hasProjectSkills\n ? [\"- `docs/skills/*.skill.md` — the project's domain skills.\"]\n : []),\n ...(extras.hasQualityDoc\n ? [\n \"- `docs/quality/code-quality.md` — the project's code-quality rules: mechanical checks, judgment rules, accepted deviations. Read it before writing or auditing code.\",\n ]\n : []),\n ...(extras.hasJourneys\n ? [\n \"- `docs/journeys/<journey>.md` — user intentions and journeys, anchored to the code. `docs/journeys/README.md` is the generated index.\",\n ]\n : []),\n \"\",\n \"## Doc-first\",\n \"\",\n \"The order is: **understand the docs → fill the gaps → code → update the docs → commit**. If the docs are silent or stale on something you change, fill the gap upfront with the doc-skill writers — not downstream, not after the fact.\",\n \"\",\n ...(extras.hasJourneys\n ? [\n \"- Visible change of behavior → a `proposed` leaf first (`/story <intent>`), never the code first.\",\n ]\n : []),\n \"- Missing spec for a subsystem you touch → **do not code**, report the gap.\",\n \"- Implicit structural decision in your changes → an ADR (`/decision`).\",\n \"- Changed feature behavior → update the matching handbook (`/handbook`).\",\n \"- Suspected code ↔ doc drift → `/drift` before moving on.\",\n \"\",\n \"## Checks\",\n \"\",\n \"Run `npx @vaubaan/harness lint` before you commit; CI runs the same linters on every pull request. Fix what it reports with the skill it suggests.\",\n \"\",\n \"The files the harness generates (`AGENTS.md`, `CLAUDE.md`, the `.claude/`, `.agents/` and `.opencode/` folders, `.harness-manifest.json`) are committed. Never edit them by hand: change their source in `docs/` or `.harness-overrides/`, run `npx @vaubaan/harness update .`, and commit the result. The linter fails when a generated file no longer matches its render.\",\n ];\n if (skillLines.length > 0) {\n sections.push(\"\", \"## Doc-skills\", \"\", skillLines.join(\"\\n\"));\n }\n return `${sections.join(\"\\n\")}\\n`;\n}\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForCmd,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"claude-code\";\nconst BASE = \".claude\";\n\nexport const claudeCodeRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${BASE}/skills/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n renderCmd(cmd: Cmd): RenderResult {\n const content = `${yamlFrontmatter(frontmatterDataForCmd(cmd))}\\n${cmd.body}\\n`;\n return {\n files: [{ path: `${BASE}/commands/${cmd.meta.id}.md`, content }],\n warnings: [],\n };\n },\n};\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"codex-cli\";\n// Codex discovers repo skills under `.agents/skills/` only — `.codex/skills/` is not scanned.\nconst SKILLS_BASE = \".agents/skills\";\n\nexport const codexCliRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${SKILLS_BASE}/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n // Codex custom prompts are deprecated in favour of skills: nothing to render.\n renderCmd(_cmd: Cmd): RenderResult {\n return { files: [], warnings: [] };\n },\n};\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"opencode\";\nconst BASE = \".opencode\";\n\nexport const opencodeRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${BASE}/skills/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n renderCmd(cmd: Cmd): RenderResult {\n // OpenCode names the command after the file; only `description` is a known key.\n const content = `${yamlFrontmatter({ description: cmd.meta.description })}\\n${cmd.body}\\n`;\n return {\n files: [{ path: `${BASE}/commands/${cmd.meta.id}.md`, content }],\n warnings: [],\n };\n },\n};\n","import type { Engine } from \"../types.js\";\nimport { claudeCodeRenderer } from \"./claude-code.js\";\nimport { codexCliRenderer } from \"./codex-cli.js\";\nimport type { Renderer } from \"./common.js\";\nimport { opencodeRenderer } from \"./opencode.js\";\n\nexport const RENDERERS: Record<Engine, Renderer> = {\n \"claude-code\": claudeCodeRenderer,\n \"codex-cli\": codexCliRenderer,\n opencode: opencodeRenderer,\n};\n\nexport function getRenderer(engine: Engine): Renderer {\n return RENDERERS[engine];\n}\n\nexport type { Renderer, RenderResult } from \"./common.js\";\n","import type { ParsedJourney } from \"../parser/journey.js\";\n\nconst INTRO =\n \"User intentions and journeys of this project, anchored to the code. Generated by `@vaubaan/harness` from `docs/journeys/*.md`: edit the journeys, not this file, then run `npx @vaubaan/harness update .`.\";\n\n/**\n * `docs/journeys/README.md`: every journey (sorted by file name) and its\n * whole tree, one line per node with its effective status, the actors on\n * the journey line (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport function buildJourneysIndex(journeys: ReadonlyArray<ParsedJourney>): string {\n const lines = [\"# Journeys\", \"\", INTRO, \"\"];\n const sorted = [...journeys].sort((a, b) => (a.file < b.file ? -1 : a.file > b.file ? 1 : 0));\n for (const journey of sorted) {\n const status = journey.meta?.status ?? \"proposed\";\n const actors = journey.meta?.actors.join(\", \") ?? \"\";\n lines.push(`- [${journey.title}](./${journey.file}) — ${status} · ${actors}`);\n for (const node of journey.nodes) {\n lines.push(`${\" \".repeat(node.level)}- ${node.title} — ${node.effectiveStatus ?? status}`);\n }\n }\n return `${lines.join(\"\\n\")}\\n`;\n}\n","import type { Cmd } from \"./parser/cmd.js\";\nimport { JOURNEYS_INDEX_PATH, type ParsedJourney } from \"./parser/journey.js\";\nimport type { Skill } from \"./parser/skill.js\";\nimport { buildUmbrellaBody } from \"./renderers/common.js\";\nimport { getRenderer } from \"./renderers/index.js\";\nimport { buildJourneysIndex } from \"./renderers/journeys-index.js\";\nimport type { Engine, RenderedFile } from \"./types.js\";\n\nexport interface Harness {\n skills: ReadonlyArray<Skill>;\n cmds: ReadonlyArray<Cmd>;\n}\n\nexport interface HarnessOverrides {\n add?: Partial<Harness>;\n disable?: ReadonlyArray<string>;\n}\n\nexport interface RenderInput {\n harness: Harness;\n engines: ReadonlyArray<Engine>;\n overrides?: HarnessOverrides;\n projectSkills?: ReadonlyArray<Skill>;\n /** True when the target project ships `docs/quality/code-quality.md` (optional pillar). */\n hasQualityDoc?: boolean;\n /** The project's parsed `docs/journeys/*.md` (optional pillar); renders their index. */\n journeys?: ReadonlyArray<ParsedJourney>;\n}\n\nexport interface RenderOutput {\n files: RenderedFile[];\n warnings: string[];\n}\n\nexport class RenderError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"RenderError\";\n }\n}\n\nfunction mergeById<T extends { meta: { id: string } }>(\n stock: ReadonlyArray<T>,\n added: ReadonlyArray<T> | undefined,\n): T[] {\n const result = new Map<string, T>();\n for (const item of stock) result.set(item.meta.id, item);\n if (added) {\n for (const item of added) result.set(item.meta.id, item);\n }\n return Array.from(result.values());\n}\n\nfunction removeByIds<T extends { meta: { id: string } }>(\n items: ReadonlyArray<T>,\n disabled: ReadonlyArray<string>,\n): T[] {\n if (disabled.length === 0) return [...items];\n const disabledSet = new Set(disabled);\n return items.filter((item) => !disabledSet.has(item.meta.id));\n}\n\nexport function applyOverrides(harness: Harness, overrides: HarnessOverrides | undefined): Harness {\n const disabled = overrides?.disable ?? [];\n return {\n skills: removeByIds(mergeById(harness.skills, overrides?.add?.skills), disabled),\n cmds: removeByIds(mergeById(harness.cmds, overrides?.add?.cmds), disabled),\n };\n}\n\n// `@AGENTS.md` is Claude Code's import syntax: the umbrella is really loaded,\n// on every version and provider, and never read twice alongside native\n// AGENTS.md support (cf. ADR engine-native-layouts-1-0).\nconst CLAUDE_MD_STUB = \"@AGENTS.md\\n\";\n\n// OpenCode also scans `.claude/skills/` and `.agents/skills/`. It goes last so\n// its own copy of a skill is dropped when another rendered engine exposes it.\nfunction opencodeLast(engines: ReadonlyArray<Engine>): Engine[] {\n return [...engines].sort((a, b) => Number(a === \"opencode\") - Number(b === \"opencode\"));\n}\n\n/**\n * Pure transformation `(catalog, engines, overrides) → files`. The harness\n * ships no agent persona and no engine hook: only the doc skills, their\n * commands, and the engine-neutral umbrella\n * (docs/decisions/no-personas-no-code-judgment.md,\n * docs/decisions/lint-in-ci-and-pre-commit.md).\n */\nexport function render(input: RenderInput): RenderOutput {\n const { engines } = input;\n if (engines.length === 0) {\n throw new RenderError(\"at least one engine must be selected\");\n }\n const base: Harness = input.projectSkills?.length\n ? { ...input.harness, skills: mergeById(input.harness.skills, input.projectSkills) }\n : input.harness;\n const harness = applyOverrides(base, input.overrides);\n\n const files: RenderedFile[] = [];\n const warnings: string[] = [];\n\n // Track skills + commands successfully exposed on at least one engine,\n // for the engine-neutral umbrella's \"Doc-skills\" section.\n const exposedSkills = new Map<string, Skill>();\n const exposedCmds = new Map<string, Cmd>();\n\n for (const engine of opencodeLast(engines)) {\n const renderer = getRenderer(engine);\n\n const renderedSkillIds = new Set<string>();\n for (const skill of harness.skills) {\n const result = renderer.renderSkill(skill);\n warnings.push(...result.warnings);\n if (result.files.length > 0) {\n const alreadyVisible = engine === \"opencode\" && exposedSkills.has(skill.meta.id);\n if (!alreadyVisible) files.push(...result.files);\n renderedSkillIds.add(skill.meta.id);\n exposedSkills.set(skill.meta.id, skill);\n }\n }\n\n for (const cmd of harness.cmds) {\n if (!renderedSkillIds.has(cmd.meta.invokes_skill)) continue;\n const result = renderer.renderCmd(cmd);\n warnings.push(...result.warnings);\n if (result.files.length > 0) {\n files.push(...result.files);\n exposedCmds.set(cmd.meta.id, cmd);\n }\n }\n }\n\n // Engine-neutral umbrella at the root\n const umbrellaContent = buildUmbrellaBody({\n availableSkills: Array.from(exposedSkills.values()),\n availableCommands: Array.from(exposedCmds.values()),\n hasProjectSkills: (input.projectSkills?.length ?? 0) > 0,\n hasQualityDoc: input.hasQualityDoc === true,\n hasJourneys: (input.journeys?.length ?? 0) > 0,\n });\n files.push({ path: \"AGENTS.md\", content: umbrellaContent });\n\n // CLAUDE.md stub only if claude-code is enabled (Claude Code reads it historically)\n if (engines.includes(\"claude-code\")) {\n files.push({ path: \"CLAUDE.md\", content: CLAUDE_MD_STUB });\n }\n\n // The journeys index is a generated file too, rendered only while a journey exists.\n if (input.journeys && input.journeys.length > 0) {\n files.push({ path: JOURNEYS_INDEX_PATH, content: buildJourneysIndex(input.journeys) });\n }\n\n return { files, warnings };\n}\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\n/** Local, disposable state: never in Git. */\nexport const REQUIRED_GITIGNORE_ENTRIES: ReadonlyArray<string> = [\n \".harness-overrides/\",\n \".vaubaan/\",\n];\n\n/**\n * Generated files are committed, so a clone has the whole context without\n * the harness installed (docs/decisions/generated-files-committed.md).\n */\nexport const FORBIDDEN_GITIGNORE_ENTRIES: ReadonlyArray<string> = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".claude/\",\n \".codex/\",\n \".agents/\",\n \".opencode/\",\n \".harness-manifest.json\",\n \"docs/journeys/README.md\",\n];\n\n/** Non-empty, non-comment lines, with a leading `/` and a trailing `/` normalized away. */\nexport function gitignoreEntries(text: string): Set<string> {\n const entries = new Set<string>();\n for (const raw of text.split(\"\\n\")) {\n const line = raw.trim();\n if (!line || line.startsWith(\"#\")) continue;\n entries.add(line.replace(/^\\//, \"\").replace(/\\/$/, \"\"));\n }\n return entries;\n}\n\nfunction normalize(entry: string): string {\n return entry.replace(/\\/$/, \"\");\n}\n\nexport function missingGitignoreEntries(text: string): string[] {\n const lines = gitignoreEntries(text);\n return REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !lines.has(normalize(entry)));\n}\n\nexport function forbiddenGitignoreEntries(text: string): string[] {\n const lines = gitignoreEntries(text);\n return FORBIDDEN_GITIGNORE_ENTRIES.filter((entry) => lines.has(normalize(entry)));\n}\n\nexport const gitignoreHarness: Linter = {\n id: \"lint:gitignore-harness\",\n pillars: [\"repo-root\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n if (!fileExists(repoRoot, \".gitignore\")) {\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: \".gitignore is missing at repo root\",\n },\n ];\n }\n const text = readText(repoRoot, \".gitignore\");\n const issues: LintIssue[] = [];\n for (const entry of missingGitignoreEntries(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: `.gitignore must contain \"${entry}\"`,\n });\n }\n for (const entry of forbiddenGitignoreEntries(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: `.gitignore must not contain \"${entry}\": files the harness generates are committed`,\n });\n }\n return issues;\n },\n};\n","import { readJourneys } from \"../parser/journey.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { trackedPathExists } from \"./util.js\";\n\n/**\n * Every anchor of a journey node matches at least one file, with the\n * resolution of `tracks:`. A `deprecated` node is skipped: its anchors may\n * already be gone (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport const journeyAnchors: Linter = {\n id: \"lint:journey-anchors\",\n pillars: [\"journeys\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/journey\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const journey of readJourneys(repoRoot)) {\n for (const node of journey.nodes) {\n if (node.effectiveStatus === \"deprecated\") continue;\n for (const anchor of node.anchors) {\n if (trackedPathExists(repoRoot, anchor)) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: journey.path,\n line: node.line,\n message: `\"${node.title}\": anchor matches no file: ${anchor}`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import { readJourneys } from \"../parser/journey.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\n\n/**\n * Across all journeys, an entity a leaf requires that no leaf creates: the\n * leaf is unreachable in the doc (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport const journeyGraph: Linter = {\n id: \"lint:journey-graph\",\n pillars: [\"journeys\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/journey\"],\n run(repoRoot: string): LintIssue[] {\n const journeys = readJourneys(repoRoot);\n const leaves = journeys.flatMap((journey) =>\n journey.nodes.filter((node) => node.isLeaf).map((node) => ({ journey, node })),\n );\n const created = new Set(leaves.flatMap(({ node }) => node.creates));\n const issues: LintIssue[] = [];\n for (const { journey, node } of leaves) {\n for (const entity of node.requires) {\n if (created.has(entity)) continue;\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: journey.path,\n line: node.line,\n message: `\"${node.title}\": entity \\`${entity}\\` is required here but no leaf creates it`,\n });\n }\n }\n return issues;\n },\n};\n","import { posix } from \"node:path\";\nimport type { JourneyFrontmatter } from \"../parser/schemas.js\";\n\n/** The frontmatter `spec:` as a list. */\nexport function journeySpecs(meta: JourneyFrontmatter | undefined): string[] {\n if (!meta) return [];\n return typeof meta.spec === \"string\" ? [meta.spec] : [...meta.spec];\n}\n\n/** A `spec:` path, relative to the journey file, as a path from the repo root (fragment stripped). */\nexport function resolveSpecPath(journeyPath: string, spec: string): string {\n const withoutFragment = spec.split(\"#\")[0] ?? \"\";\n return posix.normalize(posix.join(posix.dirname(journeyPath), withoutFragment));\n}\n","import { LEAF_FIELDS, readJourneys } from \"../parser/journey.js\";\nimport { journeySpecs, resolveSpecPath } from \"./journey-util.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\n/** Facts the code or the tree already says: never declared on a node. */\nconst DERIVABLE_FIELDS = new Set([\"uses\", \"guards\"]);\n\n/**\n * The grammar of the optional journeys pillar\n * (docs/spec/coding-agent-harness.md §9.1.3). No effect when\n * `docs/journeys/` is absent.\n */\nexport const journeySchema: Linter = {\n id: \"lint:journey-schema\",\n pillars: [\"journeys\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/journey\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const journey of readJourneys(repoRoot)) {\n const report = (message: string, line?: number): void => {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: journey.path,\n ...(line !== undefined ? { line } : {}),\n message,\n });\n };\n for (const error of journey.errors) report(error.message, error.line);\n for (const spec of journeySpecs(journey.meta)) {\n if (!fileExists(repoRoot, resolveSpecPath(journey.path, spec))) {\n report(`frontmatter \\`spec\\` does not resolve: ${spec}`, 1);\n }\n }\n for (const node of journey.nodes) {\n const at = (message: string): void => report(`\"${node.title}\": ${message}`, node.line);\n for (const { key, line } of node.unknownFields) {\n report(\n DERIVABLE_FIELDS.has(key)\n ? `\"${node.title}\": \\`${key}:\\` is derivable, never declared`\n : `\"${node.title}\": unknown field \\`${key}:\\``,\n line,\n );\n }\n if (\n node.spec !== undefined &&\n !fileExists(repoRoot, resolveSpecPath(journey.path, node.spec))\n ) {\n report(`\"${node.title}\": \\`spec:\\` does not resolve: ${node.spec}`, node.fieldLines.spec);\n }\n if (!node.isLeaf) {\n for (const field of LEAF_FIELDS) {\n const line = node.fieldLines[field];\n if (line !== undefined) {\n report(\n `\"${node.title}\": \\`${field}:\\` is a leaf field, this node has children`,\n line,\n );\n }\n }\n continue;\n }\n if (Object.keys(node.fieldLines).length === 0) {\n at(\"a leaf carries at least one field\");\n continue;\n }\n if (node.effectiveStatus === \"implemented\" && node.anchors.length === 0) {\n at(\"an `implemented` leaf needs `anchors:`\");\n }\n if (node.effectiveStatus === \"proposed\" && node.acceptance.length === 0) {\n at(\"a `proposed` leaf needs `acceptance:` with at least one `- ` item\");\n }\n }\n }\n return issues;\n },\n};\n","import { maskFencedCode, parseHeading, readJourneys } from \"../parser/journey.js\";\nimport { journeySpecs, resolveSpecPath } from \"./journey-util.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\nconst VOCABULARY_HEADING = /^#+\\s*(\\d+(\\.\\d+)*\\.?\\s*)?(Vocabulary|Vocabulaire)\\b/i;\nconst TERM = /^\\s*[-*]\\s+\\*\\*([^*]+)\\*\\*/;\n\n/** `**Generated file**` gives `generated-file`. */\nexport function entitySlug(term: string): string {\n return term\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\n/**\n * The entities of a spec: the slugs of the bold terms opening a bullet of\n * its Vocabulary section, up to the next heading of the same or a higher\n * level. `undefined` when the spec has no Vocabulary section.\n */\nexport function vocabularyOf(specText: string): Set<string> | undefined {\n const lines = maskFencedCode(specText.split(/\\r?\\n/));\n let depth: number | undefined;\n let terms: Set<string> | undefined;\n for (const line of lines) {\n const heading = parseHeading(line);\n if (depth !== undefined) {\n if (heading && heading.depth <= depth) break;\n const term = TERM.exec(line)?.[1];\n if (term) terms?.add(entitySlug(term));\n continue;\n }\n if (heading && VOCABULARY_HEADING.test(line)) {\n depth = heading.depth;\n terms = new Set();\n }\n }\n return terms;\n}\n\n/**\n * Every entity a journey leaf requires or creates is a term of the\n * Vocabulary section of one of the journey's specs. Downgraded to one\n * warning per journey when none of its specs has a Vocabulary section.\n */\nexport const journeyVocabulary: Linter = {\n id: \"lint:journey-vocabulary\",\n pillars: [\"journeys\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const journey of readJourneys(repoRoot)) {\n const used = journey.nodes.flatMap((node) =>\n [...node.requires, ...node.creates].map((entity) => ({ entity, node })),\n );\n if (used.length === 0) continue;\n // A spec that does not resolve is lint:journey-schema's report.\n const specs = journeySpecs(journey.meta)\n .map((spec) => resolveSpecPath(journey.path, spec))\n .filter((path) => fileExists(repoRoot, path));\n if (specs.length === 0) continue;\n const entities = new Set<string>();\n let hasVocabulary = false;\n for (const spec of specs) {\n const terms = vocabularyOf(readText(repoRoot, spec));\n if (!terms) continue;\n hasVocabulary = true;\n for (const term of terms) entities.add(term);\n }\n if (!hasVocabulary) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: journey.path,\n message: `no Vocabulary section in ${specs.join(\", \")}; entities not checked`,\n });\n continue;\n }\n for (const { entity, node } of used) {\n if (entities.has(entity)) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: journey.path,\n line: node.line,\n message: `\"${node.title}\": entity \\`${entity}\\` is not a Vocabulary term of ${specs.join(\", \")}`,\n });\n }\n }\n return issues;\n },\n};\n","import { basename } from \"node:path\";\nimport fg from \"fast-glob\";\nimport type { LintContext, LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, readText } from \"./util.js\";\n\nexport const orphanDecisions: Linter = {\n id: \"lint:orphan-decisions\",\n pillars: [\"decisions\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/handbook\"],\n run(repoRoot: string, ctx?: LintContext): LintIssue[] {\n const extra = ctx?.config.ignore ?? [];\n const issues: LintIssue[] = [];\n const adrs = listMarkdown(repoRoot, \"docs/decisions\");\n if (adrs.length === 0) return issues;\n\n const otherDocs = fg.sync(\"**/*.md\", {\n cwd: repoRoot,\n absolute: false,\n ignore: [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \".harness-overrides/**\",\n \"docs/decisions/**\",\n \"skills/**\",\n \"agents/**\",\n \"commands/**\",\n \"templates/**\",\n ...extra,\n ],\n });\n\n const referenceCorpus = otherDocs.map((f) => readText(repoRoot, f)).join(\"\\n\");\n\n for (const adr of adrs) {\n const filename = basename(adr);\n const stem = filename.replace(/\\.md$/, \"\");\n const referenced = referenceCorpus.includes(filename) || referenceCorpus.includes(stem);\n if (!referenced) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: adr,\n message: \"ADR is not referenced by any other doc file (orphan)\",\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists, fileExists, readText } from \"./util.js\";\n\nconst QUALITY_DIR = \"docs/quality\";\nconst CARDINAL_FILE = `${QUALITY_DIR}/code-quality.md`;\n\n// English headings are canonical; the French ones are still accepted so\n// projects written before the switch to English keep passing.\nconst REQUIRED_SECTIONS: ReadonlyArray<{ label: string; pattern: RegExp }> = [\n {\n label: \"Mechanical checks\",\n pattern: /^##\\s+(Mechanical\\s+checks|V[ée]rifications\\s+m[ée]caniques)\\s*$/im,\n },\n { label: \"Project rules\", pattern: /^##\\s+(Project\\s+rules|R[èe]gles\\s+du\\s+projet)\\s*$/im },\n {\n label: \"Accepted deviations\",\n pattern: /^##\\s+(Accepted\\s+deviations|[ÉE]carts\\s+assum[ée]s)\\s*$/im,\n },\n];\n\n/**\n * `docs/quality/` is an optional pillar: absent directory = nothing to\n * report. Once the directory exists, its cardinal file and sections are\n * required.\n */\nexport const qualitySchema: Linter = {\n id: \"lint:quality-schema\",\n pillars: [\"quality\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n if (!dirExists(repoRoot, QUALITY_DIR)) return [];\n if (!fileExists(repoRoot, CARDINAL_FILE)) {\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: CARDINAL_FILE,\n message: `missing required cardinal file: ${CARDINAL_FILE}`,\n },\n ];\n }\n const text = readText(repoRoot, CARDINAL_FILE);\n return REQUIRED_SECTIONS.filter(({ pattern }) => !pattern.test(text)).map(({ label }) => ({\n linter: this.id,\n severity: \"error\" as const,\n file: CARDINAL_FILE,\n message: `missing required section: \"${label}\"`,\n }));\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\nexport const readmePresence: Linter = {\n id: \"lint:readme-presence\",\n pillars: [\"readme\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/readme\"],\n run(repoRoot: string): LintIssue[] {\n if (fileExists(repoRoot, \"README.md\")) return [];\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: \"README.md\",\n message: \"README.md is missing at repo root\",\n },\n ];\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\nconst REQUIRED_SECTIONS = [\n /^#\\s+\\S/m,\n /^##?\\s+(What is this|Quick start)/im,\n /^##?\\s+(Quick start|Install|Getting started)/im,\n];\n\nconst REQUIRED_LABELS = [\"title (# H1)\", \"What is this / intro\", \"Quick start / Install\"];\n\nexport const readmeSections: Linter = {\n id: \"lint:readme-sections\",\n pillars: [\"readme\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/readme\"],\n run(repoRoot: string): LintIssue[] {\n if (!fileExists(repoRoot, \"README.md\")) return [];\n const text = readText(repoRoot, \"README.md\");\n const issues: LintIssue[] = [];\n for (let i = 0; i < REQUIRED_SECTIONS.length; i++) {\n const pattern = REQUIRED_SECTIONS[i];\n const label = REQUIRED_LABELS[i];\n if (pattern && !pattern.test(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \"README.md\",\n message: `missing required section: ${label}`,\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists, listMarkdown } from \"./util.js\";\n\nexport const specHasContent: Linter = {\n id: \"lint:spec-has-content\",\n pillars: [\"spec\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n if (!dirExists(repoRoot, \"docs/spec\")) return [];\n const files = listMarkdown(repoRoot, \"docs/spec\");\n if (files.length > 0) return [];\n return [\n {\n linter: this.id,\n severity: \"warning\",\n file: \"docs/spec\",\n message: \"docs/spec/ has no markdown files — write at least one spec document\",\n },\n ];\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { findLineNumber, listMarkdown, readText } from \"./util.js\";\n\nfunction maskFencedBlocks(text: string): string {\n return text.replace(/```[\\s\\S]*?```/g, (m) => m.replace(/[^\\n]/g, \" \"));\n}\n\nconst TECH_BLOCKLIST: Array<{ pattern: RegExp; keyword: string }> = [\n { pattern: /\\bNext\\.?js\\b/i, keyword: \"Next.js\" },\n { pattern: /\\bSupabase\\b/i, keyword: \"Supabase\" },\n { pattern: /\\bVercel\\b/i, keyword: \"Vercel\" },\n { pattern: /\\bReact\\b/, keyword: \"React\" },\n { pattern: /\\bTypeScript\\b/, keyword: \"TypeScript\" },\n { pattern: /\\bDocker\\b/, keyword: \"Docker\" },\n { pattern: /\\bKubernetes\\b/i, keyword: \"Kubernetes\" },\n { pattern: /\\bPostgres(QL)?\\b/i, keyword: \"Postgres\" },\n { pattern: /\\bMySQL\\b/i, keyword: \"MySQL\" },\n { pattern: /\\bRedis\\b/i, keyword: \"Redis\" },\n { pattern: /\\bnpm\\b/, keyword: \"npm\" },\n { pattern: /\\bpnpm\\b/, keyword: \"pnpm\" },\n { pattern: /\\byarn\\b/, keyword: \"yarn\" },\n];\n\nexport const specTechAgnostic: Linter = {\n id: \"lint:spec-tech-agnostic\",\n pillars: [\"spec\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, \"docs/spec\");\n for (const f of files) {\n const text = maskFencedBlocks(readText(repoRoot, f));\n for (const { pattern, keyword } of TECH_BLOCKLIST) {\n if (pattern.test(text)) {\n const issue: LintIssue = {\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `forbidden tech keyword \"${keyword}\" — should be in handbook/ or decisions/`,\n };\n const line = findLineNumber(text, pattern);\n if (line !== undefined) issue.line = line;\n issues.push(issue);\n }\n }\n }\n return issues;\n },\n};\n","import fg from \"fast-glob\";\nimport { parseJourney } from \"../parser/journey.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport {\n gitCommitsSince,\n gitLastCommitForPath,\n listMarkdown,\n parseFrontmatter,\n readText,\n} from \"./util.js\";\n\nconst TRACKED_DIRS = [\"docs/handbook\", \"docs/tests\", \"docs/workflow\"];\n/** A journey declares no `tracks:`: its tracked paths are the union of its nodes' anchors. */\nconst JOURNEYS_DIR = \"docs/journeys\";\nconst DEFAULT_DRIFT_THRESHOLD = 10;\n\nfunction expandGlob(repoRoot: string, pattern: string): string[] {\n if (pattern.includes(\"*\")) {\n return fg.sync(pattern, { cwd: repoRoot, absolute: false });\n }\n return [pattern];\n}\n\nfunction trackedPaths(dir: string, file: string, text: string, data: Record<string, unknown>) {\n if (dir === JOURNEYS_DIR) {\n const anchors = parseJourney(file, text).nodes.flatMap((node) => node.anchors);\n return anchors.length > 0 ? [...new Set(anchors)] : undefined;\n }\n return Array.isArray(data.tracks) ? (data.tracks as unknown[]) : undefined;\n}\n\nexport const tracksDrift: Linter = {\n id: \"lint:tracks-drift\",\n pillars: [\"handbook\", \"tests\", \"workflow\", \"journeys\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/drift\", \"/handbook\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of [...TRACKED_DIRS, JOURNEYS_DIR]) {\n const files = listMarkdown(repoRoot, dir);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n const tracks = trackedPaths(dir, f, text, data);\n if (!tracks) continue;\n const docCommit = gitLastCommitForPath(repoRoot, f);\n if (!docCommit) continue;\n const threshold =\n typeof data.driftThreshold === \"number\" && data.driftThreshold > 0\n ? data.driftThreshold\n : DEFAULT_DRIFT_THRESHOLD;\n let driftCount = 0;\n for (const tracked of tracks) {\n if (typeof tracked !== \"string\") continue;\n const targets = expandGlob(repoRoot, tracked);\n for (const t of targets.length > 0 ? targets : [tracked]) {\n driftCount += gitCommitsSince(repoRoot, t, docCommit.hash);\n }\n }\n if (driftCount > threshold) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: f,\n message: `tracked files changed in ${driftCount} commits since doc last edit (threshold ${threshold})`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import { adrNoTracks } from \"./adr-no-tracks.js\";\nimport { cardinalFiles } from \"./cardinal-files.js\";\nimport { loadLintConfig } from \"./config.js\";\nimport { crossLinks } from \"./cross-links.js\";\nimport { decisionSchema } from \"./decision-schema.js\";\nimport { docLayout } from \"./doc-layout.js\";\nimport { frontmatterTracks } from \"./frontmatter-tracks.js\";\nimport { generatedFresh } from \"./generated-fresh.js\";\nimport { gitignoreHarness } from \"./gitignore-harness.js\";\nimport { journeyAnchors } from \"./journey-anchors.js\";\nimport { journeyGraph } from \"./journey-graph.js\";\nimport { journeySchema } from \"./journey-schema.js\";\nimport { journeyVocabulary } from \"./journey-vocabulary.js\";\nimport { orphanDecisions } from \"./orphan-decisions.js\";\nimport { qualitySchema } from \"./quality-schema.js\";\nimport { readmePresence } from \"./readme-presence.js\";\nimport { readmeSections } from \"./readme-sections.js\";\nimport { specHasContent } from \"./spec-has-content.js\";\nimport { specTechAgnostic } from \"./spec-tech-agnostic.js\";\nimport { tracksDrift } from \"./tracks-drift.js\";\nimport type { LintContext, LintIssue, LintReport, Linter } from \"./types.js\";\n\nexport const ALL_LINTERS: ReadonlyArray<Linter> = [\n readmePresence,\n readmeSections,\n docLayout,\n cardinalFiles,\n decisionSchema,\n adrNoTracks,\n frontmatterTracks,\n tracksDrift,\n specTechAgnostic,\n specHasContent,\n crossLinks,\n orphanDecisions,\n gitignoreHarness,\n qualitySchema,\n journeySchema,\n journeyAnchors,\n journeyVocabulary,\n journeyGraph,\n generatedFresh,\n];\n\nexport interface RunOptions {\n pillar?: string;\n only?: ReadonlyArray<string>;\n}\n\nexport function runLinters(repoRoot: string, opts: RunOptions = {}): LintReport {\n const config = loadLintConfig(repoRoot);\n const ctx: LintContext = { repoRoot, config };\n const filtered = ALL_LINTERS.filter((l) => {\n if (opts.only && !opts.only.includes(l.id)) return false;\n if (opts.pillar && !l.pillars.includes(opts.pillar) && !l.pillars.includes(\"all\")) return false;\n return true;\n });\n const issues: LintIssue[] = [];\n for (const linter of filtered) {\n try {\n issues.push(...linter.run(repoRoot, ctx));\n } catch (err) {\n issues.push({\n linter: linter.id,\n severity: \"error\",\n file: \"<internal>\",\n message: `linter crashed: ${err instanceof Error ? err.message : String(err)}`,\n });\n }\n }\n const errors = issues.filter((i) => i.severity === \"error\").length;\n const warnings = issues.filter((i) => i.severity === \"warning\").length;\n return {\n version: 1,\n summary: { errors, warnings, pass: errors === 0 },\n issues,\n };\n}\n\nfunction suggestedSkillsFor(linterId: string): ReadonlyArray<string> {\n const linter = ALL_LINTERS.find((l) => l.id === linterId);\n return linter?.suggestedSkills ?? [];\n}\n\nexport function formatReportText(report: LintReport): string {\n const lines: string[] = [];\n for (const issue of report.issues) {\n const location = issue.line !== undefined ? `:${issue.line}` : \"\";\n lines.push(`${issue.file}${location}: ${issue.severity}[${issue.linter}]\\n ${issue.message}`);\n const hints = suggestedSkillsFor(issue.linter);\n if (hints.length > 0) {\n lines.push(` → Try: ${hints.join(\", \")}`);\n }\n }\n const { errors, warnings, pass } = report.summary;\n lines.push(\"\");\n lines.push(\n `${errors} ${errors === 1 ? \"error\" : \"errors\"}, ${warnings} ${warnings === 1 ? \"warning\" : \"warnings\"}. ${pass ? \"✔ CI passes.\" : \"✘ CI fails.\"}`,\n );\n return lines.join(\"\\n\");\n}\n\nexport type { HarnessLintConfig } from \"./config.js\";\nexport { loadLintConfig } from \"./config.js\";\nexport type { LintContext, Linter, LintIssue, LintReport, Severity } from \"./types.js\";\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc,gBAAgB;AACnD,SAAS,MAAM,gBAAgB;AAC/B,OAAO,QAAQ;AACf,OAAO,YAAY;AAEZ,SAAS,WAAW,UAAkB,cAA+B;AAC1E,SAAO,WAAW,KAAK,UAAU,YAAY,CAAC;AAChD;AAEO,SAAS,SAAS,UAAkB,cAA8B;AACvE,SAAO,aAAa,KAAK,UAAU,YAAY,GAAG,MAAM;AAC1D;AAMO,SAAS,kBAAkB,UAAkB,SAA0B;AAC5E,MAAI,QAAQ,SAAS,GAAG,GAAG;AACzB,WAAO,GAAG,KAAK,SAAS,EAAE,KAAK,UAAU,UAAU,MAAM,CAAC,EAAE,SAAS;AAAA,EACvE;AACA,SAAO,WAAW,KAAK,UAAU,OAAO,CAAC;AAC3C;AAEO,SAAS,aAAa,UAAkB,KAAuB;AACpE,Q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mBAAmB,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,MAC9E,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,SAAS,OAAO,OAAO,CAAC,MAAM,EAAE,aAAa,OAAO,EAAE;AAC5D,QAAM,WAAW,OAAO,OAAO,CAAC,MAAM,EAAE,aAAa,SAAS,EAAE;AAChE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS,EAAE,QAAQ,UAAU,MAAM,WAAW,EAAE;AAAA,IAChD;AAAA,EACF;AACF;AAEA,SAAS,mBAAmB,UAAyC;AACnE,QAAM,SAAS,YAAY,KAAK,CAAC,MAAM,EAAE,OAAO,QAAQ;AACxD,SAAO,QAAQ,mBAAmB,CAAC;AACrC;AAEO,SAAS,iBAAiB,QAA4B;AAC3D,QAAM,QAAkB,CAAC;AACzB,aAAW,SAAS,OAAO,QAAQ;AACjC,UAAM,WAAW,MAAM,SAAS,SAAY,IAAI,MAAM,IAAI,KAAK;AAC/D,UAAM,KAAK,GAAG,MAAM,IAAI,GAAG,QAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,MAAM;AAAA,IAAQ,MAAM,OAAO,EAAE;AAC7F,UAAM,QAAQ,mBAAmB,MAAM,MAAM;AAC7C,QAAI,MAAM,SAAS,GAAG;AACpB,YAAM,KAAK,iBAAY,MAAM,KAAK,IAAI,CAAC,EAAE;AAAA,IAC3C;AAAA,EACF;AACA,QAAM,EAAE,QAAQ,UAAU,KAAK,IAAI,OAAO;AAC1C,QAAM,KAAK,EAAE;AACb,QAAM;AAAA,IACJ,GAAG,MAAM,IAAI,WAAW,IAAI,UAAU,QAAQ,KAAK,QAAQ,IAAI,aAAa,IAAI,YAAY,UAAU,KAAK,OAAO,sBAAiB,kBAAa;AAAA,EAClJ;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["existsSync","join","fg","join","fg","existsSync","existsSync","readFileSync","join","resolve","statSync","dirname","isAbsolute","join","resolve","existsSync","readFileSync","join","join","existsSync","readFileSync","existsSync","dirname","join","resolve","existsSync","readFileSync","join","fg","z","readFileSync","matter","z","z","matter","z","join","fg","readFileSync","existsSync","existsSync","readFileSync","statSync","basename","join","matter","parseFrontmatter","matter","basename","join","existsSync","statSync","readFileSync","ENGINE","ENGINE","BASE","dirname","existsSync","join","resolve","resolve","existsSync","join","readFileSync","basename","fg","fg","basename","REQUIRED_SECTIONS","REQUIRED_SECTIONS","fg","TRACKED_DIRS","JOURNEYS_DIR","fg"]}
|
|
1
|
+
{"version":3,"sources":["../../src/linters/util.ts","../../src/linters/adr-no-tracks.ts","../../src/linters/cardinal-files.ts","../../src/linters/config.ts","../../src/linters/cross-links.ts","../../src/linters/decision-schema.ts","../../src/linters/doc-layout.ts","../../src/linters/frontmatter-tracks.ts","../../src/linters/generated-fresh.ts","../../src/cli/managed-paths.ts","../../src/cli/manifest.ts","../../src/cli/plan-render.ts","../../src/loader.ts","../../src/parser/common.ts","../../src/parser/schemas.ts","../../src/types.ts","../../src/parser/cmd.ts","../../src/parser/skill.ts","../../src/util/yaml.ts","../../src/parser/intent.ts","../../src/renderers/common.ts","../../src/renderers/claude-code.ts","../../src/renderers/codex-cli.ts","../../src/renderers/opencode.ts","../../src/renderers/index.ts","../../src/renderers/intents-index.ts","../../src/render.ts","../../src/linters/gitignore-harness.ts","../../src/linters/intent-anchors.ts","../../src/linters/intent-graph.ts","../../src/linters/intent-util.ts","../../src/linters/intent-schema.ts","../../src/linters/intent-vocabulary.ts","../../src/linters/orphan-decisions.ts","../../src/linters/quality-schema.ts","../../src/linters/readme-presence.ts","../../src/linters/readme-sections.ts","../../src/linters/spec-has-content.ts","../../src/linters/spec-tech-agnostic.ts","../../src/linters/tracks-drift.ts","../../src/linters/index.ts"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { existsSync, readFileSync, statSync } from \"node:fs\";\nimport { join, relative } from \"node:path\";\nimport fg from \"fast-glob\";\nimport matter from \"gray-matter\";\n\nexport function fileExists(repoRoot: string, relativePath: string): boolean {\n return existsSync(join(repoRoot, relativePath));\n}\n\nexport function readText(repoRoot: string, relativePath: string): string {\n return readFileSync(join(repoRoot, relativePath), \"utf8\");\n}\n\n/**\n * A `tracks:` entry or an intent anchor: a path from the repo root, or a glob\n * (any `*`) that must match at least one file.\n */\nexport function trackedPathExists(repoRoot: string, pattern: string): boolean {\n if (pattern.includes(\"*\")) {\n return fg.sync(pattern, { cwd: repoRoot, absolute: false }).length > 0;\n }\n return existsSync(join(repoRoot, pattern));\n}\n\nexport function listMarkdown(repoRoot: string, dir: string): string[] {\n const cwd = join(repoRoot, dir);\n if (!existsSync(cwd)) return [];\n return fg\n .sync(\"**/*.md\", { cwd, absolute: false, ignore: [\"**/node_modules/**\", \"**/dist/**\"] })\n .filter((f) => !f.endsWith(\"README.md\"))\n .map((f) => join(dir, f));\n}\n\nexport function listAllMarkdown(repoRoot: string, dir: string): string[] {\n const cwd = join(repoRoot, dir);\n if (!existsSync(cwd)) return [];\n return fg\n .sync(\"**/*.md\", { cwd, absolute: false, ignore: [\"**/node_modules/**\", \"**/dist/**\"] })\n .map((f) => join(dir, f));\n}\n\nexport function dirExists(repoRoot: string, relativePath: string): boolean {\n const full = join(repoRoot, relativePath);\n if (!existsSync(full)) return false;\n return statSync(full).isDirectory();\n}\n\nexport function parseFrontmatter(text: string): { data: Record<string, unknown>; body: string } {\n const m = matter(text);\n return { data: m.data, body: m.content };\n}\n\nexport interface GitLogEntry {\n hash: string;\n timestamp: number;\n}\n\nexport function gitLastCommitForPath(\n repoRoot: string,\n relativePath: string,\n): GitLogEntry | undefined {\n try {\n const out = execFileSync(\"git\", [\"log\", \"-1\", \"--format=%H:%ct\", \"--\", relativePath], {\n cwd: repoRoot,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n if (!out) return undefined;\n const idx = out.indexOf(\":\");\n if (idx < 0) return undefined;\n const hash = out.slice(0, idx);\n const ts = Number.parseInt(out.slice(idx + 1), 10);\n return { hash, timestamp: ts };\n } catch {\n return undefined;\n }\n}\n\nexport function gitCommitsSince(\n repoRoot: string,\n relativePath: string,\n sinceCommit: string,\n): number {\n try {\n const out = execFileSync(\n \"git\",\n [\"log\", `${sinceCommit}..HEAD`, \"--format=%H\", \"--\", relativePath],\n {\n cwd: repoRoot,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n },\n ).trim();\n if (!out) return 0;\n return out.split(\"\\n\").filter(Boolean).length;\n } catch {\n return 0;\n }\n}\n\nexport function relPath(repoRoot: string, abs: string): string {\n return relative(repoRoot, abs);\n}\n\nexport function findLineNumber(text: string, needle: string | RegExp): number | undefined {\n const lines = text.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n if (typeof needle === \"string\" ? line.includes(needle) : needle.test(line)) {\n return i + 1;\n }\n }\n return undefined;\n}\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, parseFrontmatter, readText } from \"./util.js\";\n\nconst ADR_DIR = \"docs/decisions\";\n\nexport const adrNoTracks: Linter = {\n id: \"lint:adr-no-tracks\",\n pillars: [\"decisions\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/decision\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, ADR_DIR);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n if (!(\"tracks\" in data)) continue;\n const value = data.tracks;\n if (Array.isArray(value) && value.length === 0) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message:\n \"ADRs must not declare `tracks:` (or must set it to []). ADRs document a decision frozen in time, not the current state of code — use status: superseded to mark them obsolete instead.\",\n });\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\nconst REQUIRED_FILES = [\n \"docs/tests/integration-tests.md\",\n \"docs/tests/e2e-tests.md\",\n \"docs/workflow/coding-workflow.md\",\n];\n\nexport const cardinalFiles: Linter = {\n id: \"lint:cardinal-files\",\n pillars: [\"tests\", \"workflow\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/test-plan\", \"/workflow\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const f of REQUIRED_FILES) {\n if (!fileExists(repoRoot, f)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `missing required cardinal file: ${f}`,\n });\n }\n }\n return issues;\n },\n};\n","import { cosmiconfigSync } from \"cosmiconfig\";\n\nexport interface HarnessLintConfig {\n ignore: ReadonlyArray<string>;\n}\n\nconst DEFAULT_CONFIG: HarnessLintConfig = { ignore: [] };\n\nexport function loadLintConfig(repoRoot: string): HarnessLintConfig {\n const explorer = cosmiconfigSync(\"harness\", {\n searchPlaces: [\n \"package.json\",\n \".harnessrc\",\n \".harnessrc.json\",\n \".harnessrc.yaml\",\n \".harnessrc.yml\",\n \"harness.config.js\",\n \"harness.config.cjs\",\n ],\n });\n const result = explorer.search(repoRoot);\n if (!result || result.isEmpty) return DEFAULT_CONFIG;\n\n const raw = result.config as Record<string, unknown> | undefined;\n if (!raw) return DEFAULT_CONFIG;\n\n const lint = raw.lint as Record<string, unknown> | undefined;\n if (!lint) return DEFAULT_CONFIG;\n\n const ignore = lint.ignore;\n if (!Array.isArray(ignore)) return DEFAULT_CONFIG;\n\n return { ignore: ignore.filter((x): x is string => typeof x === \"string\") };\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport fg from \"fast-glob\";\nimport type { LintContext, LintIssue, Linter } from \"./types.js\";\nimport { readText } from \"./util.js\";\n\nconst LINK_REGEX = /\\[([^\\]]+)\\]\\(([^)]+)\\)/g;\n\nfunction maskCodeSpans(text: string): string {\n return text\n .replace(/```[\\s\\S]*?```/g, (m) => m.replace(/[^\\n]/g, \" \"))\n .replace(/`[^`\\n]*`/g, (m) => \" \".repeat(m.length));\n}\n\nfunction isExternalOrAnchor(url: string): boolean {\n if (url.startsWith(\"http://\") || url.startsWith(\"https://\")) return true;\n if (url.startsWith(\"mailto:\")) return true;\n if (url.startsWith(\"#\")) return true;\n return false;\n}\n\nfunction stripFragment(url: string): string {\n const i = url.indexOf(\"#\");\n return i < 0 ? url : url.slice(0, i);\n}\n\nfunction resolveLink(repoRoot: string, sourceFile: string, link: string): string {\n const noFrag = stripFragment(link);\n if (isAbsolute(noFrag)) return join(repoRoot, noFrag);\n return resolve(dirname(join(repoRoot, sourceFile)), noFrag);\n}\n\nexport const crossLinks: Linter = {\n id: \"lint:cross-links\",\n pillars: [\"all\"],\n defaultSeverity: \"error\",\n run(repoRoot: string, ctx?: LintContext): LintIssue[] {\n const extra = ctx?.config.ignore ?? [];\n const issues: LintIssue[] = [];\n const allDocs = fg.sync(\"**/*.md\", {\n cwd: repoRoot,\n absolute: false,\n ignore: [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \".harness-overrides/**\",\n \"skills/**\",\n \"agents/**\",\n \"commands/**\",\n \"templates/**\",\n \"**/*.skill.md\",\n \"**/*.cmd.md\",\n \"**/*.agent.md\",\n ...extra,\n ],\n });\n for (const f of allDocs) {\n const text = maskCodeSpans(readText(repoRoot, f));\n const lines = text.split(\"\\n\");\n for (let lineNo = 0; lineNo < lines.length; lineNo++) {\n const line = lines[lineNo] ?? \"\";\n LINK_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n match = LINK_REGEX.exec(line);\n while (match !== null) {\n const url = match[2];\n if (url && !isExternalOrAnchor(url)) {\n const noFrag = stripFragment(url);\n if (noFrag !== \"\" && !noFrag.startsWith(\"data:\")) {\n const target = resolveLink(repoRoot, f, url);\n if (!existsSync(target)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n line: lineNo + 1,\n message: `broken link: ${url}`,\n });\n }\n }\n }\n match = LINK_REGEX.exec(line);\n }\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, readText } from \"./util.js\";\n\n// English headings are canonical; the French ones are still accepted so\n// projects written before the switch to English keep passing.\nconst REQUIRED_SECTIONS: Array<{ label: string; pattern: RegExp }> = [\n { label: \"Context\", pattern: /^##\\s+(Context|Contexte)\\b/m },\n { label: \"Decision\", pattern: /^##\\s+(Decision|D[ée]cision)\\b/m },\n { label: \"Consequences\", pattern: /^##\\s+(Consequences|Cons[ée]quences)\\b/m },\n {\n label: \"Rejected alternatives\",\n pattern: /^##\\s+(Rejected\\s+alternatives|Alternatives(\\s+rejet[ée]es)?)\\b/im,\n },\n];\n\nexport const decisionSchema: Linter = {\n id: \"lint:decision-schema\",\n pillars: [\"decisions\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/decision\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, \"docs/decisions\");\n for (const f of files) {\n const text = readText(repoRoot, f);\n for (const { label, pattern } of REQUIRED_SECTIONS) {\n if (!pattern.test(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `missing required section: \"${label}\"`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists } from \"./util.js\";\n\nconst REQUIRED_DIRS = [\n \"docs/spec\",\n \"docs/decisions\",\n \"docs/handbook\",\n \"docs/tests\",\n \"docs/workflow\",\n];\n\nexport const docLayout: Linter = {\n id: \"lint:doc-layout\",\n pillars: [\"all\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of REQUIRED_DIRS) {\n if (!dirExists(repoRoot, dir)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: dir,\n message: `missing required directory: ${dir}/`,\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, parseFrontmatter, readText, trackedPathExists } from \"./util.js\";\n\nconst TRACKED_DIRS = [\"docs/handbook\", \"docs/tests\", \"docs/workflow\"];\n\nexport const frontmatterTracks: Linter = {\n id: \"lint:frontmatter-tracks\",\n pillars: [\"handbook\", \"tests\", \"workflow\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/handbook\", \"/test-plan\", \"/workflow\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of TRACKED_DIRS) {\n const files = listMarkdown(repoRoot, dir);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n if (!Array.isArray(data.tracks)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: \"missing frontmatter `tracks:` array\",\n });\n continue;\n }\n for (const tracked of data.tracks as unknown[]) {\n if (typeof tracked !== \"string\") {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: \"`tracks` entries must be strings\",\n });\n continue;\n }\n if (!trackedPathExists(repoRoot, tracked)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `tracked path does not exist: ${tracked}`,\n });\n }\n }\n }\n }\n return issues;\n },\n};\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { RELEASED_PATHS } from \"../cli/managed-paths.js\";\nimport { readManifest } from \"../cli/manifest.js\";\nimport { planInit } from \"../cli/plan-render.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\n\nconst FIX = \"run `npx @vaubaan/harness update .` and commit the result\";\n\n/**\n * Generated files are committed; this linter is what keeps them honest. It\n * renders the harness with the engines and overrides the manifest records\n * and compares every file with the working tree\n * (docs/decisions/generated-files-committed.md).\n */\nexport const generatedFresh: Linter = {\n id: \"lint:generated-fresh\",\n pillars: [\"repo-root\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n const issue = (file: string, message: string): LintIssue => ({\n linter: this.id,\n severity: \"error\",\n file,\n message,\n });\n let manifest: ReturnType<typeof readManifest>;\n try {\n manifest = readManifest(repoRoot);\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n return [issue(\".harness-manifest.json\", `invalid harness manifest: ${reason}`)];\n }\n if (!manifest) return [];\n const overridesParent = manifest.overridesDir\n ? resolve(repoRoot, manifest.overridesDir)\n : repoRoot;\n const hasOverrides = existsSync(join(overridesParent, \".harness-overrides\"));\n let rendered: ReturnType<typeof planInit>;\n try {\n rendered = planInit({\n targetDir: repoRoot,\n engines: manifest.engines,\n overridesDir: hasOverrides ? overridesParent : undefined,\n });\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n return [issue(\".harness-manifest.json\", `cannot render the harness: ${reason}`)];\n }\n const preserved = new Set(manifest.preservedFiles ?? []);\n const issues: LintIssue[] = [];\n const renderedPaths = new Set<string>();\n for (const file of rendered.output.files) {\n if (preserved.has(file.path)) continue;\n renderedPaths.add(file.path);\n const full = join(repoRoot, file.path);\n if (!existsSync(full)) {\n issues.push(issue(file.path, `generated file is missing; ${FIX}`));\n } else if (readFileSync(full, \"utf8\") !== file.content) {\n issues.push(\n issue(\n file.path,\n `generated file differs from the current render; edit its source in docs/ or .harness-overrides/, then ${FIX}`,\n ),\n );\n }\n }\n for (const path of manifest.files) {\n if (renderedPaths.has(path) || preserved.has(path) || RELEASED_PATHS.includes(path)) continue;\n if (existsSync(join(repoRoot, path))) {\n issues.push(issue(path, `stale generated file, no longer rendered; ${FIX}`));\n }\n }\n return issues;\n },\n};\n","import { lstatSync, realpathSync, statSync } from \"node:fs\";\nimport { basename, dirname, isAbsolute, join, resolve, win32 } from \"node:path\";\n\nconst MANAGED_FILES = new Set([\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".harness-manifest.json\",\n // Index of the optional intents pillar, rendered while an intent file exists.\n \"docs/intents/README.md\",\n // Its 2.2 location, kept managed so `update` can remove it (see MOVED_PATHS).\n \"docs/journeys/README.md\",\n]);\n\n/**\n * Generated files whose path changed. A manifest entry at the old path\n * follows the file to its new path once the project moved it; while the\n * file still sits at the old path, `update` removes it there.\n */\nexport const MOVED_PATHS: ReadonlyMap<string, string> = new Map([\n // 2.3: the journeys pillar became the intents pillar.\n [\"docs/journeys/README.md\", \"docs/intents/README.md\"],\n]);\n\n/**\n * Files 1.x wrote or edited and 2.0 never touches again: MCP configurations\n * and engine settings holding the Stop hook. A manifest that still lists one\n * drops it with a warning; the file stays in place as the project's.\n */\nexport const RELEASED_PATHS: ReadonlyArray<string> = [\n \".mcp.json\",\n \".codex/config.toml\",\n \".opencode/opencode.json\",\n \".opencode/mcp.json\",\n \".claude/settings.json\",\n \".codex/hooks.json\",\n];\n\n// Includes legacy layouts so upgrades can remove their generated artifacts.\nconst MANAGED_DIRECTORIES = [\n \".claude/agents/\",\n \".claude/commands/\",\n \".claude/skills/\",\n \".codex/agents/\",\n \".codex/commands/\",\n \".codex/skills/\",\n \".agents/skills/\",\n \".opencode/agents/\",\n \".opencode/commands/\",\n \".opencode/skills/\",\n \".opencode/plugins/\",\n];\n\nfunction canonicalTargetRoot(root: string): string {\n let ancestor = resolve(root);\n const missing: string[] = [];\n while (!lstatSync(ancestor, { throwIfNoEntry: false })) {\n missing.unshift(basename(ancestor));\n ancestor = dirname(ancestor);\n }\n const canonical = realpathSync(ancestor);\n if (!statSync(canonical).isDirectory()) {\n throw new Error(`harness target is not a directory: ${root}`);\n }\n return join(canonical, ...missing);\n}\n\nfunction assertManagedLocation(path: string): void {\n const invalidSegment = path\n .split(\"/\")\n .some((part) => part === \"\" || part === \".\" || part === \"..\");\n if (\n isAbsolute(path) ||\n win32.isAbsolute(path) ||\n path.includes(\"\\\\\") ||\n path.includes(\"\\0\") ||\n invalidSegment\n ) {\n throw new Error(`unsafe harness path: ${path}`);\n }\n if (!MANAGED_FILES.has(path) && !MANAGED_DIRECTORIES.some((prefix) => path.startsWith(prefix))) {\n throw new Error(`path is outside harness-managed locations: ${path}`);\n }\n}\n\nfunction assertNoSymbolicComponents(root: string, path: string): void {\n const parts = path.split(\"/\");\n let current = root;\n for (const [index, part] of parts.entries()) {\n current = join(current, part);\n const info = lstatSync(current, { throwIfNoEntry: false });\n if (!info) return;\n if (info.isSymbolicLink()) {\n throw new Error(`symbolic link in harness path: ${path}`);\n }\n const isLeaf = index === parts.length - 1;\n if (isLeaf ? !info.isFile() : !info.isDirectory()) {\n throw new Error(`unexpected file type in harness path: ${path}`);\n }\n }\n}\n\n/**\n * Preflight the complete list before callers mutate any artifact. The target\n * itself may resolve through a symlink; every component below it, including\n * leaf files and the manifest, must be a regular file or directory, never a\n * symlink (even one pointing inside the target). Missing targets are allowed.\n * This checks the current filesystem, not concurrent changes by other processes.\n */\nexport function assertManagedPaths(root: string, files: ReadonlyArray<string>): void {\n for (const path of files) assertManagedLocation(path);\n const canonicalRoot = canonicalTargetRoot(root);\n for (const path of files) assertNoSymbolicComponents(canonicalRoot, path);\n}\n","import { createHash } from \"node:crypto\";\nimport { chmodSync, existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { z } from \"zod\";\nimport type { Engine } from \"../types.js\";\nimport { VERSION } from \"../version.js\";\nimport { assertManagedPaths } from \"./managed-paths.js\";\n\nexport const MANIFEST_FILENAME = \".harness-manifest.json\";\nexport const MANIFEST_VERSION = \"6\";\n\n// Fields written by 1.x and dropped on read as unknown keys: the entry\n// ownership of shared files (`hookConfigs`, `opencodeConfig`, `mcpConfig`)\n// and the Stop hook preference (`stopHookInstalled`, `stopHookEngines`).\n// Decisions: safe-init, lint-in-ci-and-pre-commit.\nconst ManifestSchema = z.object({\n version: z.enum([\"4\", \"5\", MANIFEST_VERSION]),\n engines: z.array(z.string()),\n renderedAt: z.string(),\n files: z.array(z.string()),\n harnessVersion: z.string().optional(),\n overridesDir: z.string().optional(),\n fileHashes: z.record(z.string().regex(/^[a-f0-9]{64}$/)).optional(),\n preservedFiles: z.array(z.string()).optional(),\n});\n\nexport type Manifest = z.infer<typeof ManifestSchema>;\n\nexport interface WriteManifestExtras {\n overridesDir?: string;\n preservedFiles?: string[];\n}\n\nexport function manifestPath(targetDir: string): string {\n return join(targetDir, MANIFEST_FILENAME);\n}\n\nexport function writeManifest(\n targetDir: string,\n engines: ReadonlyArray<Engine>,\n files: string[],\n extras: WriteManifestExtras = {},\n): void {\n assertManagedPaths(targetDir, [MANIFEST_FILENAME]);\n const manifest: Manifest = {\n version: MANIFEST_VERSION,\n harnessVersion: VERSION,\n engines: [...engines].sort(),\n renderedAt: new Date().toISOString(),\n files: [...files].sort(),\n fileHashes: Object.fromEntries(\n files\n .filter((file) => existsSync(join(targetDir, file)))\n .sort()\n .map((file) => [file, hashContent(readFileSync(join(targetDir, file)))]),\n ),\n ...(extras.overridesDir ? { overridesDir: extras.overridesDir } : {}),\n ...(extras.preservedFiles ? { preservedFiles: extras.preservedFiles } : {}),\n };\n const path = manifestPath(targetDir);\n if (existsSync(path)) chmodSync(path, 0o600);\n writeFileSync(path, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 0o600 });\n}\n\nexport function hashContent(content: string | Buffer): string {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nexport function readManifest(targetDir: string): Manifest | null {\n assertManagedPaths(targetDir, [MANIFEST_FILENAME]);\n const path = manifestPath(targetDir);\n if (!existsSync(path)) return null;\n const raw = JSON.parse(readFileSync(path, \"utf8\"));\n return ManifestSchema.parse(raw);\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { loadHarness, loadOverrides, loadProjectSkills } from \"../loader.js\";\nimport { loadIntentFiles } from \"../parser/intent.js\";\nimport { type RenderOutput, render } from \"../render.js\";\nimport { ENGINES, type Engine } from \"../types.js\";\n\n/** Cardinal file of the optional `docs/quality/` pillar. */\nconst QUALITY_DOC_PATH = \"docs/quality/code-quality.md\";\n\nexport interface RenderPlanArgs {\n targetDir: string;\n engines: ReadonlyArray<string>;\n overridesDir?: string;\n packageDir?: string;\n}\n\n/**\n * The engine choice is mandatory: nothing is rendered for a tool the project\n * does not use (docs/spec/coding-agent-harness.md §8).\n */\nexport function resolveEngineList(requested: ReadonlyArray<string> | undefined): Engine[] {\n if (!requested || requested.length === 0) {\n throw new Error(\n `no engine selected: pass --engines=<list> with one or more of ${ENGINES.join(\", \")}`,\n );\n }\n const engines = requested.map((e) => {\n if (!ENGINES.includes(e as Engine)) {\n throw new Error(`unknown engine: ${e} (expected one of ${ENGINES.join(\", \")})`);\n }\n return e as Engine;\n });\n return [...new Set(engines)];\n}\n\n/**\n * Resolves the harness package's bundled content directory. The harness\n * tsup config emits this module into every entry that needs it\n * (`dist/init.js`, `dist/cli/index.js`, `dist/linters/index.js`). The\n * content (`skills/`, `commands/`, `templates/`) always sits at `dist/`:\n * same dir as `dist/init.js`, parent of `dist/cli/index.js` and\n * `dist/linters/index.js`. In dev (`src/cli/plan-render.ts`) the content\n * also sits at `src/`. We disambiguate by checking which ancestor contains\n * `skills/`.\n */\nfunction defaultPackageDir(): string {\n const here = dirname(fileURLToPath(import.meta.url));\n if (existsSync(join(here, \"skills\"))) return here;\n return resolve(here, \"..\");\n}\n\nexport function planInit(args: RenderPlanArgs): { engines: Engine[]; output: RenderOutput } {\n const engines = resolveEngineList(args.engines);\n const packageDir = args.packageDir ?? defaultPackageDir();\n const harness = loadHarness(packageDir);\n const overrides = args.overridesDir ? loadOverrides(args.overridesDir) : undefined;\n const projectSkills = loadProjectSkills(args.targetDir);\n const hasQualityDoc = existsSync(join(args.targetDir, QUALITY_DOC_PATH));\n const intentFiles = loadIntentFiles(args.targetDir);\n const output = render({ harness, engines, overrides, projectSkills, hasQualityDoc, intentFiles });\n return { engines, output };\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport fg from \"fast-glob\";\nimport { z } from \"zod\";\nimport { parseCmd } from \"./parser/cmd.js\";\nimport { type Skill, parseSkill } from \"./parser/skill.js\";\nimport type { Harness, HarnessOverrides } from \"./render.js\";\nimport { parseYAML } from \"./util/yaml.js\";\n\nexport const DisableYamlSchema = z\n .object({ disable: z.array(z.string()).optional() })\n .passthrough();\n\nexport interface LoadOptions {\n skillsDir?: string;\n commandsDir?: string;\n}\n\nexport function loadHarness(packageDir: string, opts: LoadOptions = {}): Harness {\n const skillsDir = opts.skillsDir ?? join(packageDir, \"skills\");\n const commandsDir = opts.commandsDir ?? join(packageDir, \"commands\");\n\n const skillFiles = fg.sync(\"*.skill.md\", { cwd: skillsDir, absolute: true });\n const cmdFiles = fg.sync(\"*.cmd.md\", { cwd: commandsDir, absolute: true });\n\n return {\n skills: skillFiles.map((f) => parseSkill(f, readFileSync(f, \"utf8\"))),\n cmds: cmdFiles.map((f) => parseCmd(f, readFileSync(f, \"utf8\"))),\n };\n}\n\nexport function loadProjectSkills(targetDir: string): Skill[] {\n const skillsDir = join(targetDir, \"docs\", \"skills\");\n if (!existsSync(skillsDir)) return [];\n const skillFiles = fg.sync(\"*.skill.md\", { cwd: skillsDir, absolute: true });\n return skillFiles.map((f) => parseSkill(f, readFileSync(f, \"utf8\")));\n}\n\nexport function loadOverrides(worktreeDir: string): HarnessOverrides | undefined {\n const overridesDir = join(worktreeDir, \".harness-overrides\");\n if (!existsSync(overridesDir)) return undefined;\n\n const added = loadHarness(overridesDir, {\n skillsDir: join(overridesDir, \"skills\"),\n commandsDir: join(overridesDir, \"commands\"),\n });\n\n const disablePath = join(overridesDir, \"disable.yaml\");\n let disable: string[] = [];\n if (existsSync(disablePath)) {\n try {\n const parsed = DisableYamlSchema.safeParse(parseYAML(readFileSync(disablePath, \"utf8\")));\n if (parsed.success && parsed.data.disable) {\n disable = parsed.data.disable;\n }\n } catch {\n // corrupt YAML — leave disable as []\n }\n }\n\n return { add: added, disable };\n}\n","import { readFileSync } from \"node:fs\";\nimport matter from \"gray-matter\";\nimport type { z } from \"zod\";\nimport { ParseError } from \"./schemas.js\";\n\nexport interface ParsedFile<T> {\n meta: T;\n body: string;\n sourcePath: string;\n}\n\nexport function parseWithSchema<T extends z.ZodTypeAny>(\n filePath: string,\n source: string,\n schema: T,\n): ParsedFile<z.infer<T>> {\n const parsed = matter(source);\n const result = schema.safeParse(parsed.data);\n if (!result.success) {\n throw new ParseError(filePath, result.error.issues);\n }\n return {\n meta: result.data,\n body: parsed.content.trim(),\n sourcePath: filePath,\n };\n}\n\nexport function parseFileWithSchema<T extends z.ZodTypeAny>(\n filePath: string,\n schema: T,\n): ParsedFile<z.infer<T>> {\n const source = readFileSync(filePath, \"utf8\");\n return parseWithSchema(filePath, source, schema);\n}\n","import { z } from \"zod\";\nimport { CAPABILITIES, ENGINES } from \"../types.js\";\n\nconst IdSchema = z\n .string()\n .min(1)\n .regex(/^[a-z][a-z0-9-]*$/, \"id must be kebab-case (lowercase + digits + hyphens)\");\n\nconst SkillFrontmatterSchema = z\n .object({\n id: IdSchema,\n description: z.string().min(1),\n engines: z.array(z.enum(ENGINES)).min(1).optional(),\n requires: z.array(z.enum(CAPABILITIES)).optional(),\n tags: z.array(z.string()).optional(),\n })\n .strict();\n\nexport type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;\n\nconst CmdArgEnumSchema = z\n .object({\n name: z.string().min(1),\n type: z.literal(\"enum\"),\n values: z.array(z.string()).min(1),\n default: z.string().optional(),\n /** False when the command runs without the argument. Defaults to true. */\n required: z.boolean().optional(),\n })\n .strict();\n\nconst CmdArgStringSchema = z\n .object({\n name: z.string().min(1),\n type: z.literal(\"string\"),\n default: z.string().optional(),\n /** False when the command runs without the argument. Defaults to true. */\n required: z.boolean().optional(),\n })\n .strict();\n\nconst CmdArgSchema = z.discriminatedUnion(\"type\", [CmdArgEnumSchema, CmdArgStringSchema]);\n\nexport type CmdArg = z.infer<typeof CmdArgSchema>;\n\nconst CmdFrontmatterSchema = z\n .object({\n id: IdSchema,\n trigger: z.string().regex(/^\\/[a-z][a-z0-9-]*$/, \"trigger must be /kebab-case\"),\n invokes_skill: IdSchema,\n args: z.array(CmdArgSchema).optional(),\n description: z.string().min(1),\n })\n .strict();\n\nexport type CmdFrontmatter = z.infer<typeof CmdFrontmatterSchema>;\n\nexport const INTENT_STATUSES = [\"proposed\", \"implemented\", \"deprecated\"] as const;\nexport type IntentStatus = (typeof INTENT_STATUSES)[number];\n\n// gray-matter parses a bare YAML date (`2026-11-09`) into a Date object.\nconst IntentFrontmatterSchema = z\n .object({\n title: z.string().min(1),\n status: z.enum(INTENT_STATUSES),\n actors: z.array(z.string().min(1)).min(1),\n spec: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]),\n last_reviewed: z.union([z.date(), z.string().min(1)]),\n })\n .strict();\n\nexport type IntentFrontmatter = z.infer<typeof IntentFrontmatterSchema>;\n\nexport const Schemas = {\n Skill: SkillFrontmatterSchema,\n Cmd: CmdFrontmatterSchema,\n Intent: IntentFrontmatterSchema,\n} as const;\n\nexport class ParseError extends Error {\n constructor(\n public readonly file: string,\n public readonly issues: z.ZodIssue[],\n ) {\n const messages = issues\n .map((i) => ` - ${i.path.join(\".\") || \"<root>\"}: ${i.message}`)\n .join(\"\\n\");\n super(`Frontmatter validation failed for ${file}:\\n${messages}`);\n this.name = \"ParseError\";\n }\n}\n","export const ENGINES = [\"claude-code\", \"codex-cli\", \"opencode\"] as const;\nexport type Engine = (typeof ENGINES)[number];\n\nexport const ENGINE_ROOT_DIR: Record<Engine, string> = {\n \"claude-code\": \".claude\",\n \"codex-cli\": \".codex\",\n opencode: \".opencode\",\n};\n\nexport const CAPABILITIES = [\"multi-step\", \"slash-command\", \"inline-exec\"] as const;\nexport type Capability = (typeof CAPABILITIES)[number];\n\nexport interface RenderedFile {\n path: string;\n content: string;\n}\n\nexport interface CapabilitiesMatrix {\n [engine: string]: ReadonlyArray<Capability>;\n}\n\nexport const CAPABILITIES_MATRIX: Record<Engine, ReadonlyArray<Capability>> = {\n \"claude-code\": [\"multi-step\", \"slash-command\", \"inline-exec\"],\n \"codex-cli\": [\"multi-step\", \"slash-command\", \"inline-exec\"],\n opencode: [\"multi-step\", \"slash-command\", \"inline-exec\"],\n};\n\nexport const DEGRADED_CAPABILITIES: Partial<Record<Engine, ReadonlyArray<Capability>>> = {\n \"codex-cli\": [\"multi-step\"],\n};\n\nexport function engineSupports(engine: Engine, capability: Capability): boolean {\n return CAPABILITIES_MATRIX[engine].includes(capability);\n}\n","import { parseFileWithSchema, parseWithSchema } from \"./common.js\";\nimport type { ParsedFile } from \"./common.js\";\nimport { type CmdFrontmatter, Schemas } from \"./schemas.js\";\n\nexport type Cmd = ParsedFile<CmdFrontmatter>;\n\nexport function parseCmd(filePath: string, source: string): Cmd {\n return parseWithSchema(filePath, source, Schemas.Cmd);\n}\n\nexport function parseCmdFile(filePath: string): Cmd {\n return parseFileWithSchema(filePath, Schemas.Cmd);\n}\n","import { parseFileWithSchema, parseWithSchema } from \"./common.js\";\nimport type { ParsedFile } from \"./common.js\";\nimport { Schemas, type SkillFrontmatter } from \"./schemas.js\";\n\nexport type Skill = ParsedFile<SkillFrontmatter>;\n\nexport function parseSkill(filePath: string, source: string): Skill {\n return parseWithSchema(filePath, source, Schemas.Skill);\n}\n\nexport function parseSkillFile(filePath: string): Skill {\n return parseFileWithSchema(filePath, Schemas.Skill);\n}\n","import { parse as yamlParse } from \"yaml\";\n\nexport function parseYAML(source: string): unknown {\n return yamlParse(source);\n}\n","import { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { basename, join } from \"node:path\";\nimport matter from \"gray-matter\";\nimport { INTENT_STATUSES, type IntentFrontmatter, type IntentStatus, Schemas } from \"./schemas.js\";\n\n/** The optional intents pillar (docs/spec/coding-agent-harness.md §9.1.3). */\nexport const INTENTS_DIR = \"docs/intents\";\n/** The generated index of the pillar; never an intent file. */\nexport const INTENTS_INDEX_PATH = `${INTENTS_DIR}/README.md`;\n\nexport const NODE_FIELDS = [\n \"status\",\n \"spec\",\n \"anchors\",\n \"acceptance\",\n \"requires\",\n \"creates\",\n] as const;\nexport type NodeField = (typeof NODE_FIELDS)[number];\n/** Fields only a terminal intent (a node with no sub-intent) may carry. */\nexport const TERMINAL_FIELDS: ReadonlyArray<NodeField> = [\n \"anchors\",\n \"acceptance\",\n \"requires\",\n \"creates\",\n];\n\nexport interface IntentError {\n line?: number;\n message: string;\n}\n\nexport interface IntentNode {\n title: string;\n /** Heading depth minus one: `##` is level 1. */\n level: number;\n /** 1-based line of the heading in the file. */\n line: number;\n /** Index of the parent node in `nodes`, absent for a level-1 node. */\n parent?: number;\n /** True when the node has no sub-intent: a terminal intent. */\n isTerminal: boolean;\n /** Line of each known field the node declares. */\n fieldLines: Partial<Record<NodeField, number>>;\n status?: IntentStatus;\n spec?: string;\n anchors: string[];\n acceptance: string[];\n requires: string[];\n creates: string[];\n unknownFields: Array<{ key: string; line: number }>;\n /** Nearest `status:` up the tree, else the file status. */\n effectiveStatus?: IntentStatus;\n}\n\nexport interface IntentFile {\n meta?: IntentFrontmatter;\n title: string;\n statement?: string;\n nodes: IntentNode[];\n errors: IntentError[];\n}\n\nexport interface ParsedIntentFile extends IntentFile {\n /** Path from the repo root, e.g. `docs/intents/harness-a-project.md`. */\n path: string;\n /** File name, e.g. `harness-a-project.md`. */\n file: string;\n}\n\n/** Stands for a line of fenced code: not blank, not a field, not a heading. */\nconst MASKED_LINE = \"\\u0000\";\nconst FENCE_RE = /^ {0,3}(`{3,}|~{3,})/;\nconst HEADING_RE = /^(#{1,6})[ \\t]+(.+?)(?:[ \\t]+#+)?[ \\t]*$/;\nconst FIELD_RE = /^([a-z][a-z-]*):\\s*(.*)$/;\nconst LIST_ITEM_RE = /^\\s*-\\s+(.*)$/;\n\n/** Replaces every line of fenced code (fences included), keeping line numbers. */\nexport function maskFencedCode(lines: ReadonlyArray<string>): string[] {\n let fence: string | undefined;\n return lines.map((line) => {\n const m = FENCE_RE.exec(line);\n if (fence !== undefined) {\n if (m?.[1] && m[1][0] === fence[0] && m[1].length >= fence.length) fence = undefined;\n return MASKED_LINE;\n }\n if (m?.[1]) {\n fence = m[1];\n return MASKED_LINE;\n }\n return line;\n });\n}\n\nexport function parseHeading(line: string): { depth: number; title: string } | undefined {\n const m = HEADING_RE.exec(line);\n if (!m?.[1] || !m[2]) return undefined;\n return { depth: m[1].length, title: m[2] };\n}\n\nfunction splitList(value: string): string[] {\n return value\n .split(\",\")\n .map((v) => v.trim())\n .filter(Boolean);\n}\n\n/** Index of the first body line, after the frontmatter block when there is one. */\nfunction bodyStart(lines: ReadonlyArray<string>): number {\n if (lines[0]?.trim() !== \"---\") return 0;\n for (let i = 1; i < lines.length; i++) {\n const l = lines[i]?.trim();\n if (l === \"---\" || l === \"...\") return i + 1;\n }\n return lines.length;\n}\n\nfunction parseFrontmatter(text: string, errors: IntentError[]): IntentFrontmatter | undefined {\n let data: Record<string, unknown>;\n try {\n data = matter(text).data;\n } catch (error) {\n const reason = error instanceof Error ? error.message.split(\"\\n\")[0] : String(error);\n errors.push({ line: 1, message: `invalid frontmatter YAML: ${reason}` });\n return undefined;\n }\n const result = Schemas.Intent.safeParse(data);\n if (result.success) return result.data;\n for (const issue of result.error.issues) {\n const where = issue.path.length ? ` \\`${issue.path.join(\".\")}\\`` : \"\";\n errors.push({ line: 1, message: `frontmatter${where}: ${issue.message}` });\n }\n return undefined;\n}\n\nfunction newNode(title: string, level: number, line: number): IntentNode {\n return {\n title,\n level,\n line,\n isTerminal: true,\n fieldLines: {},\n anchors: [],\n acceptance: [],\n requires: [],\n creates: [],\n unknownFields: [],\n };\n}\n\n/** Reads the field block directly under a heading, up to its first non-field line. */\nfunction parseFields(\n node: IntentNode,\n lines: ReadonlyArray<string>,\n from: number,\n to: number,\n errors: IntentError[],\n): void {\n let lastKey: string | undefined;\n for (let i = from; i < to; i++) {\n const line = lines[i] ?? \"\";\n if (line.trim() === \"\") continue;\n const lineNo = i + 1;\n const field = FIELD_RE.exec(line.trimEnd());\n if (field?.[1] !== undefined) {\n const key = field[1];\n const value = (field[2] ?? \"\").trim();\n lastKey = key;\n if (!(NODE_FIELDS as ReadonlyArray<string>).includes(key)) {\n node.unknownFields.push({ key, line: lineNo });\n continue;\n }\n const known = key as NodeField;\n node.fieldLines[known] = lineNo;\n if (known === \"status\") {\n if ((INTENT_STATUSES as ReadonlyArray<string>).includes(value)) {\n node.status = value as IntentStatus;\n } else {\n errors.push({\n line: lineNo,\n message: `invalid status \\`${value}\\` (expected ${INTENT_STATUSES.join(\" | \")})`,\n });\n }\n } else if (known === \"spec\") {\n node.spec = value;\n } else if (known === \"acceptance\") {\n if (value) node.acceptance.push(value);\n } else {\n node[known] = splitList(value);\n }\n continue;\n }\n const item = LIST_ITEM_RE.exec(line);\n if (lastKey === \"acceptance\" && item) {\n const text = (item[1] ?? \"\").trim();\n if (text) node.acceptance.push(text);\n continue;\n }\n return;\n }\n}\n\n/**\n * Parses one intent file (docs/spec/coding-agent-harness.md §9.1.3). Never\n * throws: frontmatter and node problems are collected in `errors` and the\n * nodes are parsed regardless, so a linter reports everything at once.\n */\nexport function parseIntentFile(relPath: string, text: string): IntentFile {\n const errors: IntentError[] = [];\n const meta = parseFrontmatter(text, errors);\n const lines = maskFencedCode(text.split(/\\r?\\n/));\n const start = bodyStart(lines);\n\n const headings: Array<{ index: number; depth: number; title: string }> = [];\n for (let i = start; i < lines.length; i++) {\n const h = parseHeading(lines[i] ?? \"\");\n if (h) headings.push({ index: i, ...h });\n }\n\n const h1 = headings.find((h) => h.depth === 1);\n let statement: string | undefined;\n if (h1) {\n const paragraph: string[] = [];\n for (let i = h1.index + 1; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n if (line.trim() === \"\") {\n if (paragraph.length) break;\n continue;\n }\n if (line === MASKED_LINE || parseHeading(line)) break;\n paragraph.push(line.trim());\n }\n if (paragraph.length) statement = paragraph.join(\" \");\n }\n\n const nodes: IntentNode[] = [];\n const stack: number[] = [];\n for (const [k, h] of headings.entries()) {\n if (h.depth < 2) continue;\n const node = newNode(h.title, h.depth - 1, h.index + 1);\n while (stack.length) {\n const top = nodes[stack[stack.length - 1] as number];\n if (top && top.level < node.level) break;\n stack.pop();\n }\n const parentIndex = stack[stack.length - 1];\n if (parentIndex !== undefined) {\n node.parent = parentIndex;\n const parent = nodes[parentIndex];\n if (parent) parent.isTerminal = false;\n }\n const next = headings[k + 1];\n parseFields(node, lines, h.index + 1, next ? next.index : lines.length, errors);\n const inherited =\n parentIndex !== undefined ? nodes[parentIndex]?.effectiveStatus : meta?.status;\n node.effectiveStatus = node.status ?? inherited;\n stack.push(nodes.length);\n nodes.push(node);\n }\n\n const title = meta?.title ?? h1?.title ?? basename(relPath, \".md\");\n return { ...(meta ? { meta } : {}), title, ...(statement ? { statement } : {}), nodes, errors };\n}\n\n/** Intent files: `docs/intents/*.md` minus the generated index, sorted by file name. */\nexport function listIntentFiles(targetDir: string): string[] {\n const dir = join(targetDir, INTENTS_DIR);\n if (!existsSync(dir) || !statSync(dir).isDirectory()) return [];\n return readdirSync(dir)\n .filter((f) => f.endsWith(\".md\") && f !== \"README.md\")\n .filter((f) => statSync(join(dir, f)).isFile())\n .sort();\n}\n\n/** Parses every intent file without throwing; linters read their `errors`. */\nexport function readIntentFiles(targetDir: string): ParsedIntentFile[] {\n return listIntentFiles(targetDir).map((file) => {\n const path = `${INTENTS_DIR}/${file}`;\n const text = readFileSync(join(targetDir, path), \"utf8\");\n return { path, file, ...parseIntentFile(path, text) };\n });\n}\n\n/**\n * The intent files the render needs. One that does not parse fails the\n * render, like an invalid project skill: `init`, `update` and\n * `lint:generated-fresh` report it.\n */\nexport function loadIntentFiles(targetDir: string): ParsedIntentFile[] {\n const intentFiles = readIntentFiles(targetDir);\n const problems = intentFiles.flatMap((j) =>\n j.errors.map((e) => ` - ${j.path}${e.line !== undefined ? `:${e.line}` : \"\"}: ${e.message}`),\n );\n if (problems.length) {\n throw new Error(\n `invalid intents (run \\`npx @vaubaan/harness lint --pillar intents\\`):\\n${problems.join(\"\\n\")}`,\n );\n }\n return intentFiles;\n}\n","import { stringify as yamlStringify } from \"yaml\";\nimport type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport {\n CAPABILITIES_MATRIX,\n type Capability,\n DEGRADED_CAPABILITIES,\n type Engine,\n type RenderedFile,\n} from \"../types.js\";\n\nexport interface UmbrellaExtras {\n availableSkills: ReadonlyArray<Skill>;\n availableCommands: ReadonlyArray<Cmd>;\n hasProjectSkills?: boolean;\n hasQualityDoc?: boolean;\n hasIntents?: boolean;\n}\n\nexport interface RenderResult {\n files: RenderedFile[];\n warnings: string[];\n}\n\nexport interface Renderer {\n readonly engine: Engine;\n renderSkill(skill: Skill): RenderResult;\n renderCmd(cmd: Cmd): RenderResult;\n}\n\nexport interface CapabilityCheck {\n blockingWarnings: string[];\n degradedWarnings: string[];\n}\n\nexport function checkSkillCapabilities(skill: Skill, engine: Engine): CapabilityCheck {\n const blockingWarnings: string[] = [];\n const degradedWarnings: string[] = [];\n const supported = CAPABILITIES_MATRIX[engine];\n const degraded = DEGRADED_CAPABILITIES[engine] ?? [];\n if (!skill.meta.requires) return { blockingWarnings, degradedWarnings };\n for (const cap of skill.meta.requires) {\n if (!supported.includes(cap as Capability)) {\n blockingWarnings.push(\n `skill \"${skill.meta.id}\" requires \"${cap}\" not supported by \"${engine}\" — skipped`,\n );\n } else if (degraded.includes(cap as Capability)) {\n degradedWarnings.push(\n `skill \"${skill.meta.id}\" requires \"${cap}\" — supported by \"${engine}\" with degradation`,\n );\n }\n }\n return { blockingWarnings, degradedWarnings };\n}\n\nexport function isSkillEngineAllowed(skill: Skill, engine: Engine): boolean {\n if (!skill.meta.engines) return true;\n return skill.meta.engines.includes(engine);\n}\n\nexport function yamlFrontmatter(data: Record<string, unknown>): string {\n const rendered = yamlStringify(data, { lineWidth: 0 }).trimEnd();\n return `---\\n${rendered}\\n---\\n`;\n}\n\nexport function frontmatterDataForSkill(skill: Skill): Record<string, unknown> {\n // Agent Skills spec (agentskills.io): `name` must match the directory name.\n const data: Record<string, unknown> = {\n name: skill.meta.id,\n description: skill.meta.description,\n };\n if (skill.meta.tags && skill.meta.tags.length > 0) data.tags = skill.meta.tags;\n return data;\n}\n\nexport function frontmatterDataForCmd(cmd: Cmd): Record<string, unknown> {\n const data: Record<string, unknown> = {\n id: cmd.meta.id,\n trigger: cmd.meta.trigger,\n description: cmd.meta.description,\n };\n if (cmd.meta.args && cmd.meta.args.length > 0) {\n // `required` is rendered only when false: an argument is required by default.\n data.args = cmd.meta.args.map((a) => ({\n name: a.name,\n type: a.type,\n ...(a.type === \"enum\" ? { values: a.values } : {}),\n ...(a.default !== undefined ? { default: a.default } : {}),\n ...(a.required === false ? { required: false } : {}),\n }));\n }\n return data;\n}\n\n/**\n * The engine-neutral umbrella: the one working rule the harness imposes,\n * the project map, the checks, and the doc skills the engines expose.\n * Everything project-specific lives in `README.md` and `docs/`.\n */\nexport function buildUmbrellaBody(extras: UmbrellaExtras): string {\n // One skill may be invoked by several commands: list every trigger, in\n // command order.\n const triggersBySkill = new Map<string, string[]>();\n for (const c of extras.availableCommands) {\n const triggers = triggersBySkill.get(c.meta.invokes_skill) ?? [];\n triggers.push(c.meta.trigger);\n triggersBySkill.set(c.meta.invokes_skill, triggers);\n }\n const skillLines = extras.availableSkills.map((s) => {\n const triggers = triggersBySkill.get(s.meta.id) ?? [];\n const label =\n triggers.length > 0\n ? `\\`${s.meta.id}\\` (${triggers.map((t) => `\\`${t}\\``).join(\", \")})`\n : `\\`${s.meta.id}\\``;\n return `- ${label} — ${s.meta.description.split(\"\\n\")[0]}`;\n });\n const sections: string[] = [\n \"# How we work\",\n \"\",\n \"This file describes **how to work in this project**. The **business context** (what the project does, how to run it, which subsystems it contains) lives in `README.md` and `docs/`. Read them first.\",\n \"\",\n \"## Project map\",\n \"\",\n \"- `README.md` — pitch, quick start, scripts. Entry point.\",\n \"- `docs/spec/<subsystem>.md` — *what* and *why* (tech-agnostic).\",\n \"- `docs/handbook/<feature>.md` — what the code does not say: entry points, traps, settings outside the repo, manual procedures.\",\n \"- `docs/decisions/<slug>.md` — ADRs: structural choices and rejected alternatives.\",\n \"- `docs/tests/integration-tests.md` & `e2e-tests.md` — test scope, stack, conventions, known gaps.\",\n \"- `docs/workflow/coding-workflow.md` — CI, branches, PR, release. How this team works: follow it.\",\n ...(extras.hasProjectSkills\n ? [\"- `docs/skills/*.skill.md` — the project's domain skills.\"]\n : []),\n ...(extras.hasQualityDoc\n ? [\n \"- `docs/quality/code-quality.md` — the project's code-quality rules: mechanical checks, judgment rules, accepted deviations. Read it before writing or auditing code.\",\n ]\n : []),\n ...(extras.hasIntents\n ? [\n \"- `docs/intents/<intent>.md` — user intents, one tree per level-1 intent, anchored to the code. `docs/intents/README.md` is the generated index.\",\n ]\n : []),\n \"\",\n \"## Doc-first\",\n \"\",\n \"The order is: **understand the docs → fill the gaps → code → update the docs → commit**. If the docs are silent or stale on something you change, fill the gap upfront with the doc-skill writers — not downstream, not after the fact.\",\n \"\",\n ...(extras.hasIntents\n ? [\n \"- Visible change of behavior → a `proposed` intent first (`/intent <verb + object>`), never the code first.\",\n ]\n : []),\n \"- Missing spec for a subsystem you touch → **do not code**, report the gap.\",\n \"- Implicit structural decision in your changes → an ADR (`/decision`).\",\n \"- Changed feature behavior → update the matching handbook (`/handbook`).\",\n \"- Suspected code ↔ doc drift → `/drift` before moving on.\",\n \"\",\n \"## Checks\",\n \"\",\n \"Run `npx @vaubaan/harness lint` before you commit; CI runs the same linters on every pull request. Fix what it reports with the skill it suggests.\",\n \"\",\n \"The files the harness generates (`AGENTS.md`, `CLAUDE.md`, the `.claude/`, `.agents/` and `.opencode/` folders, `.harness-manifest.json`) are committed. Never edit them by hand: change their source in `docs/` or `.harness-overrides/`, run `npx @vaubaan/harness update .`, and commit the result. The linter fails when a generated file no longer matches its render.\",\n ];\n if (skillLines.length > 0) {\n sections.push(\"\", \"## Doc-skills\", \"\", skillLines.join(\"\\n\"));\n }\n return `${sections.join(\"\\n\")}\\n`;\n}\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForCmd,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"claude-code\";\nconst BASE = \".claude\";\n\nexport const claudeCodeRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${BASE}/skills/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n renderCmd(cmd: Cmd): RenderResult {\n const content = `${yamlFrontmatter(frontmatterDataForCmd(cmd))}\\n${cmd.body}\\n`;\n return {\n files: [{ path: `${BASE}/commands/${cmd.meta.id}.md`, content }],\n warnings: [],\n };\n },\n};\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"codex-cli\";\n// Codex discovers repo skills under `.agents/skills/` only — `.codex/skills/` is not scanned.\nconst SKILLS_BASE = \".agents/skills\";\n\nexport const codexCliRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${SKILLS_BASE}/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n // Codex custom prompts are deprecated in favour of skills: nothing to render.\n renderCmd(_cmd: Cmd): RenderResult {\n return { files: [], warnings: [] };\n },\n};\n","import type { Cmd } from \"../parser/cmd.js\";\nimport type { Skill } from \"../parser/skill.js\";\nimport type { Engine } from \"../types.js\";\nimport {\n type RenderResult,\n type Renderer,\n checkSkillCapabilities,\n frontmatterDataForSkill,\n isSkillEngineAllowed,\n yamlFrontmatter,\n} from \"./common.js\";\n\nconst ENGINE: Engine = \"opencode\";\nconst BASE = \".opencode\";\n\nexport const opencodeRenderer: Renderer = {\n engine: ENGINE,\n renderSkill(skill: Skill): RenderResult {\n if (!isSkillEngineAllowed(skill, ENGINE)) {\n return {\n files: [],\n warnings: [`skill \"${skill.meta.id}\" excluded from engine \"${ENGINE}\"`],\n };\n }\n const check = checkSkillCapabilities(skill, ENGINE);\n if (check.blockingWarnings.length > 0) {\n return { files: [], warnings: check.blockingWarnings };\n }\n const content = `${yamlFrontmatter(frontmatterDataForSkill(skill))}\\n${skill.body}\\n`;\n return {\n files: [{ path: `${BASE}/skills/${skill.meta.id}/SKILL.md`, content }],\n warnings: check.degradedWarnings,\n };\n },\n renderCmd(cmd: Cmd): RenderResult {\n // OpenCode names the command after the file; only `description` is a known key.\n const content = `${yamlFrontmatter({ description: cmd.meta.description })}\\n${cmd.body}\\n`;\n return {\n files: [{ path: `${BASE}/commands/${cmd.meta.id}.md`, content }],\n warnings: [],\n };\n },\n};\n","import type { Engine } from \"../types.js\";\nimport { claudeCodeRenderer } from \"./claude-code.js\";\nimport { codexCliRenderer } from \"./codex-cli.js\";\nimport type { Renderer } from \"./common.js\";\nimport { opencodeRenderer } from \"./opencode.js\";\n\nexport const RENDERERS: Record<Engine, Renderer> = {\n \"claude-code\": claudeCodeRenderer,\n \"codex-cli\": codexCliRenderer,\n opencode: opencodeRenderer,\n};\n\nexport function getRenderer(engine: Engine): Renderer {\n return RENDERERS[engine];\n}\n\nexport type { Renderer, RenderResult } from \"./common.js\";\n","import type { ParsedIntentFile } from \"../parser/intent.js\";\n\nconst INTRO =\n \"User intents of this project, anchored to the code. Generated by `@vaubaan/harness` from `docs/intents/*.md`: edit the intents, not this file, then run `npx @vaubaan/harness update .`.\";\n\n/**\n * `docs/intents/README.md`: every intent file (sorted by file name) and its\n * whole tree, one line per node with its effective status, the actors on\n * the level-1 intent line (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport function buildIntentsIndex(intentFiles: ReadonlyArray<ParsedIntentFile>): string {\n const lines = [\"# Intents\", \"\", INTRO, \"\"];\n const sorted = [...intentFiles].sort((a, b) => (a.file < b.file ? -1 : a.file > b.file ? 1 : 0));\n for (const intentFile of sorted) {\n const status = intentFile.meta?.status ?? \"proposed\";\n const actors = intentFile.meta?.actors.join(\", \") ?? \"\";\n lines.push(`- [${intentFile.title}](./${intentFile.file}) — ${status} · ${actors}`);\n for (const node of intentFile.nodes) {\n lines.push(`${\" \".repeat(node.level)}- ${node.title} — ${node.effectiveStatus ?? status}`);\n }\n }\n return `${lines.join(\"\\n\")}\\n`;\n}\n","import type { Cmd } from \"./parser/cmd.js\";\nimport { INTENTS_INDEX_PATH, type ParsedIntentFile } from \"./parser/intent.js\";\nimport type { Skill } from \"./parser/skill.js\";\nimport { buildUmbrellaBody } from \"./renderers/common.js\";\nimport { getRenderer } from \"./renderers/index.js\";\nimport { buildIntentsIndex } from \"./renderers/intents-index.js\";\nimport type { Engine, RenderedFile } from \"./types.js\";\n\nexport interface Harness {\n skills: ReadonlyArray<Skill>;\n cmds: ReadonlyArray<Cmd>;\n}\n\nexport interface HarnessOverrides {\n add?: Partial<Harness>;\n disable?: ReadonlyArray<string>;\n}\n\nexport interface RenderInput {\n harness: Harness;\n engines: ReadonlyArray<Engine>;\n overrides?: HarnessOverrides;\n projectSkills?: ReadonlyArray<Skill>;\n /** True when the target project ships `docs/quality/code-quality.md` (optional pillar). */\n hasQualityDoc?: boolean;\n /** The project's parsed `docs/intents/*.md` (optional pillar); renders their index. */\n intentFiles?: ReadonlyArray<ParsedIntentFile>;\n}\n\nexport interface RenderOutput {\n files: RenderedFile[];\n warnings: string[];\n}\n\nexport class RenderError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"RenderError\";\n }\n}\n\nfunction mergeById<T extends { meta: { id: string } }>(\n stock: ReadonlyArray<T>,\n added: ReadonlyArray<T> | undefined,\n): T[] {\n const result = new Map<string, T>();\n for (const item of stock) result.set(item.meta.id, item);\n if (added) {\n for (const item of added) result.set(item.meta.id, item);\n }\n return Array.from(result.values());\n}\n\nfunction removeByIds<T extends { meta: { id: string } }>(\n items: ReadonlyArray<T>,\n disabled: ReadonlyArray<string>,\n): T[] {\n if (disabled.length === 0) return [...items];\n const disabledSet = new Set(disabled);\n return items.filter((item) => !disabledSet.has(item.meta.id));\n}\n\nexport function applyOverrides(harness: Harness, overrides: HarnessOverrides | undefined): Harness {\n const disabled = overrides?.disable ?? [];\n return {\n skills: removeByIds(mergeById(harness.skills, overrides?.add?.skills), disabled),\n cmds: removeByIds(mergeById(harness.cmds, overrides?.add?.cmds), disabled),\n };\n}\n\n// `@AGENTS.md` is Claude Code's import syntax: the umbrella is really loaded,\n// on every version and provider, and never read twice alongside native\n// AGENTS.md support (cf. ADR engine-native-layouts-1-0).\nconst CLAUDE_MD_STUB = \"@AGENTS.md\\n\";\n\n// OpenCode also scans `.claude/skills/` and `.agents/skills/`. It goes last so\n// its own copy of a skill is dropped when another rendered engine exposes it.\nfunction opencodeLast(engines: ReadonlyArray<Engine>): Engine[] {\n return [...engines].sort((a, b) => Number(a === \"opencode\") - Number(b === \"opencode\"));\n}\n\n/**\n * Pure transformation `(catalog, engines, overrides) → files`. The harness\n * ships no agent persona and no engine hook: only the doc skills, their\n * commands, and the engine-neutral umbrella\n * (docs/decisions/no-personas-no-code-judgment.md,\n * docs/decisions/lint-in-ci-and-pre-commit.md).\n */\nexport function render(input: RenderInput): RenderOutput {\n const { engines } = input;\n if (engines.length === 0) {\n throw new RenderError(\"at least one engine must be selected\");\n }\n const base: Harness = input.projectSkills?.length\n ? { ...input.harness, skills: mergeById(input.harness.skills, input.projectSkills) }\n : input.harness;\n const harness = applyOverrides(base, input.overrides);\n\n const files: RenderedFile[] = [];\n const warnings: string[] = [];\n\n // Track skills + commands successfully exposed on at least one engine,\n // for the engine-neutral umbrella's \"Doc-skills\" section.\n const exposedSkills = new Map<string, Skill>();\n const exposedCmds = new Map<string, Cmd>();\n\n for (const engine of opencodeLast(engines)) {\n const renderer = getRenderer(engine);\n\n const renderedSkillIds = new Set<string>();\n for (const skill of harness.skills) {\n const result = renderer.renderSkill(skill);\n warnings.push(...result.warnings);\n if (result.files.length > 0) {\n const alreadyVisible = engine === \"opencode\" && exposedSkills.has(skill.meta.id);\n if (!alreadyVisible) files.push(...result.files);\n renderedSkillIds.add(skill.meta.id);\n exposedSkills.set(skill.meta.id, skill);\n }\n }\n\n for (const cmd of harness.cmds) {\n if (!renderedSkillIds.has(cmd.meta.invokes_skill)) continue;\n const result = renderer.renderCmd(cmd);\n warnings.push(...result.warnings);\n if (result.files.length > 0) {\n files.push(...result.files);\n exposedCmds.set(cmd.meta.id, cmd);\n }\n }\n }\n\n // Engine-neutral umbrella at the root\n const umbrellaContent = buildUmbrellaBody({\n availableSkills: Array.from(exposedSkills.values()),\n availableCommands: Array.from(exposedCmds.values()),\n hasProjectSkills: (input.projectSkills?.length ?? 0) > 0,\n hasQualityDoc: input.hasQualityDoc === true,\n hasIntents: (input.intentFiles?.length ?? 0) > 0,\n });\n files.push({ path: \"AGENTS.md\", content: umbrellaContent });\n\n // CLAUDE.md stub only if claude-code is enabled (Claude Code reads it historically)\n if (engines.includes(\"claude-code\")) {\n files.push({ path: \"CLAUDE.md\", content: CLAUDE_MD_STUB });\n }\n\n // The intents index is a generated file too, rendered only while an intent file exists.\n if (input.intentFiles && input.intentFiles.length > 0) {\n files.push({ path: INTENTS_INDEX_PATH, content: buildIntentsIndex(input.intentFiles) });\n }\n\n return { files, warnings };\n}\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\n/** Local, disposable state: never in Git. */\nexport const REQUIRED_GITIGNORE_ENTRIES: ReadonlyArray<string> = [\n \".harness-overrides/\",\n \".vaubaan/\",\n];\n\n/**\n * Generated files are committed, so a clone has the whole context without\n * the harness installed (docs/decisions/generated-files-committed.md).\n */\nexport const FORBIDDEN_GITIGNORE_ENTRIES: ReadonlyArray<string> = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".claude/\",\n \".codex/\",\n \".agents/\",\n \".opencode/\",\n \".harness-manifest.json\",\n \"docs/intents/README.md\",\n];\n\n/** Non-empty, non-comment lines, with a leading `/` and a trailing `/` normalized away. */\nexport function gitignoreEntries(text: string): Set<string> {\n const entries = new Set<string>();\n for (const raw of text.split(\"\\n\")) {\n const line = raw.trim();\n if (!line || line.startsWith(\"#\")) continue;\n entries.add(line.replace(/^\\//, \"\").replace(/\\/$/, \"\"));\n }\n return entries;\n}\n\nfunction normalize(entry: string): string {\n return entry.replace(/\\/$/, \"\");\n}\n\nexport function missingGitignoreEntries(text: string): string[] {\n const lines = gitignoreEntries(text);\n return REQUIRED_GITIGNORE_ENTRIES.filter((entry) => !lines.has(normalize(entry)));\n}\n\nexport function forbiddenGitignoreEntries(text: string): string[] {\n const lines = gitignoreEntries(text);\n return FORBIDDEN_GITIGNORE_ENTRIES.filter((entry) => lines.has(normalize(entry)));\n}\n\nexport const gitignoreHarness: Linter = {\n id: \"lint:gitignore-harness\",\n pillars: [\"repo-root\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n if (!fileExists(repoRoot, \".gitignore\")) {\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: \".gitignore is missing at repo root\",\n },\n ];\n }\n const text = readText(repoRoot, \".gitignore\");\n const issues: LintIssue[] = [];\n for (const entry of missingGitignoreEntries(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: `.gitignore must contain \"${entry}\"`,\n });\n }\n for (const entry of forbiddenGitignoreEntries(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \".gitignore\",\n message: `.gitignore must not contain \"${entry}\": files the harness generates are committed`,\n });\n }\n return issues;\n },\n};\n","import { readIntentFiles } from \"../parser/intent.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { trackedPathExists } from \"./util.js\";\n\n/**\n * Every anchor of an intent matches at least one file, with the\n * resolution of `tracks:`. A `deprecated` node is skipped: its anchors may\n * already be gone (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport const intentAnchors: Linter = {\n id: \"lint:intent-anchors\",\n pillars: [\"intents\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/intent\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const intentFile of readIntentFiles(repoRoot)) {\n for (const node of intentFile.nodes) {\n if (node.effectiveStatus === \"deprecated\") continue;\n for (const anchor of node.anchors) {\n if (trackedPathExists(repoRoot, anchor)) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: intentFile.path,\n line: node.line,\n message: `\"${node.title}\": anchor matches no file: ${anchor}`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import { readIntentFiles } from \"../parser/intent.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\n\n/**\n * Across all intent files, an entity a terminal intent requires that no terminal\n * intent creates: the intent is unreachable in the doc\n * (docs/spec/coding-agent-harness.md §9.1.3).\n */\nexport const intentGraph: Linter = {\n id: \"lint:intent-graph\",\n pillars: [\"intents\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/intent\"],\n run(repoRoot: string): LintIssue[] {\n const intentFiles = readIntentFiles(repoRoot);\n const terminals = intentFiles.flatMap((intentFile) =>\n intentFile.nodes.filter((node) => node.isTerminal).map((node) => ({ intentFile, node })),\n );\n const created = new Set(terminals.flatMap(({ node }) => node.creates));\n const issues: LintIssue[] = [];\n for (const { intentFile, node } of terminals) {\n for (const entity of node.requires) {\n if (created.has(entity)) continue;\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: intentFile.path,\n line: node.line,\n message: `\"${node.title}\": entity \\`${entity}\\` is required here but no terminal intent creates it`,\n });\n }\n }\n return issues;\n },\n};\n","import { posix } from \"node:path\";\nimport type { IntentFrontmatter } from \"../parser/schemas.js\";\n\n/** The frontmatter `spec:` as a list. */\nexport function intentFileSpecs(meta: IntentFrontmatter | undefined): string[] {\n if (!meta) return [];\n return typeof meta.spec === \"string\" ? [meta.spec] : [...meta.spec];\n}\n\n/** A `spec:` path, relative to the intent file, as a path from the repo root (fragment stripped). */\nexport function resolveSpecPath(filePath: string, spec: string): string {\n const withoutFragment = spec.split(\"#\")[0] ?? \"\";\n return posix.normalize(posix.join(posix.dirname(filePath), withoutFragment));\n}\n","import { TERMINAL_FIELDS, readIntentFiles } from \"../parser/intent.js\";\nimport { intentFileSpecs, resolveSpecPath } from \"./intent-util.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\n/** Facts the code or the tree already says: never declared on a node. */\nconst DERIVABLE_FIELDS = new Set([\"uses\", \"guards\"]);\n\n/**\n * The grammar of the optional intents pillar\n * (docs/spec/coding-agent-harness.md §9.1.3). No effect when\n * `docs/intents/` is absent.\n */\nexport const intentSchema: Linter = {\n id: \"lint:intent-schema\",\n pillars: [\"intents\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/intent\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const intentFile of readIntentFiles(repoRoot)) {\n const report = (message: string, line?: number): void => {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: intentFile.path,\n ...(line !== undefined ? { line } : {}),\n message,\n });\n };\n for (const error of intentFile.errors) report(error.message, error.line);\n for (const spec of intentFileSpecs(intentFile.meta)) {\n if (!fileExists(repoRoot, resolveSpecPath(intentFile.path, spec))) {\n report(`frontmatter \\`spec\\` does not resolve: ${spec}`, 1);\n }\n }\n for (const node of intentFile.nodes) {\n const at = (message: string): void => report(`\"${node.title}\": ${message}`, node.line);\n for (const { key, line } of node.unknownFields) {\n report(\n DERIVABLE_FIELDS.has(key)\n ? `\"${node.title}\": \\`${key}:\\` is derivable, never declared`\n : `\"${node.title}\": unknown field \\`${key}:\\``,\n line,\n );\n }\n if (\n node.spec !== undefined &&\n !fileExists(repoRoot, resolveSpecPath(intentFile.path, node.spec))\n ) {\n report(`\"${node.title}\": \\`spec:\\` does not resolve: ${node.spec}`, node.fieldLines.spec);\n }\n if (!node.isTerminal) {\n for (const field of TERMINAL_FIELDS) {\n const line = node.fieldLines[field];\n if (line !== undefined) {\n report(\n `\"${node.title}\": \\`${field}:\\` is a field of a terminal intent, this node has sub-intents`,\n line,\n );\n }\n }\n continue;\n }\n if (Object.keys(node.fieldLines).length === 0) {\n at(\"a terminal intent carries at least one field\");\n continue;\n }\n if (node.effectiveStatus === \"implemented\" && node.anchors.length === 0) {\n at(\"an `implemented` intent needs `anchors:`\");\n }\n if (node.effectiveStatus === \"proposed\" && node.acceptance.length === 0) {\n at(\"a `proposed` intent needs `acceptance:` with at least one `- ` item\");\n }\n }\n }\n return issues;\n },\n};\n","import { maskFencedCode, parseHeading, readIntentFiles } from \"../parser/intent.js\";\nimport { intentFileSpecs, resolveSpecPath } from \"./intent-util.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\nconst VOCABULARY_HEADING = /^#+\\s*(\\d+(\\.\\d+)*\\.?\\s*)?(Vocabulary|Vocabulaire)\\b/i;\nconst TERM = /^\\s*[-*]\\s+\\*\\*([^*]+)\\*\\*/;\n\n/** `**Generated file**` gives `generated-file`. */\nexport function entitySlug(term: string): string {\n return term\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\n/**\n * The entities of a spec: the slugs of the bold terms opening a bullet of\n * its Vocabulary section, up to the next heading of the same or a higher\n * level. `undefined` when the spec has no Vocabulary section.\n */\nexport function vocabularyOf(specText: string): Set<string> | undefined {\n const lines = maskFencedCode(specText.split(/\\r?\\n/));\n let depth: number | undefined;\n let terms: Set<string> | undefined;\n for (const line of lines) {\n const heading = parseHeading(line);\n if (depth !== undefined) {\n if (heading && heading.depth <= depth) break;\n const term = TERM.exec(line)?.[1];\n if (term) terms?.add(entitySlug(term));\n continue;\n }\n if (heading && VOCABULARY_HEADING.test(line)) {\n depth = heading.depth;\n terms = new Set();\n }\n }\n return terms;\n}\n\n/**\n * Every entity a terminal intent requires or creates is a term of the\n * Vocabulary section of one of the file's specs. Downgraded to one\n * warning per intent file when none of its specs has a Vocabulary section.\n */\nexport const intentVocabulary: Linter = {\n id: \"lint:intent-vocabulary\",\n pillars: [\"intents\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const intentFile of readIntentFiles(repoRoot)) {\n const used = intentFile.nodes.flatMap((node) =>\n [...node.requires, ...node.creates].map((entity) => ({ entity, node })),\n );\n if (used.length === 0) continue;\n // A spec that does not resolve is lint:intent-schema's report.\n const specs = intentFileSpecs(intentFile.meta)\n .map((spec) => resolveSpecPath(intentFile.path, spec))\n .filter((path) => fileExists(repoRoot, path));\n if (specs.length === 0) continue;\n const entities = new Set<string>();\n let hasVocabulary = false;\n for (const spec of specs) {\n const terms = vocabularyOf(readText(repoRoot, spec));\n if (!terms) continue;\n hasVocabulary = true;\n for (const term of terms) entities.add(term);\n }\n if (!hasVocabulary) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: intentFile.path,\n message: `no Vocabulary section in ${specs.join(\", \")}; entities not checked`,\n });\n continue;\n }\n for (const { entity, node } of used) {\n if (entities.has(entity)) continue;\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: intentFile.path,\n line: node.line,\n message: `\"${node.title}\": entity \\`${entity}\\` is not a Vocabulary term of ${specs.join(\", \")}`,\n });\n }\n }\n return issues;\n },\n};\n","import { basename } from \"node:path\";\nimport fg from \"fast-glob\";\nimport type { LintContext, LintIssue, Linter } from \"./types.js\";\nimport { listMarkdown, readText } from \"./util.js\";\n\nexport const orphanDecisions: Linter = {\n id: \"lint:orphan-decisions\",\n pillars: [\"decisions\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/handbook\"],\n run(repoRoot: string, ctx?: LintContext): LintIssue[] {\n const extra = ctx?.config.ignore ?? [];\n const issues: LintIssue[] = [];\n const adrs = listMarkdown(repoRoot, \"docs/decisions\");\n if (adrs.length === 0) return issues;\n\n const otherDocs = fg.sync(\"**/*.md\", {\n cwd: repoRoot,\n absolute: false,\n ignore: [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \".harness-overrides/**\",\n \"docs/decisions/**\",\n \"skills/**\",\n \"agents/**\",\n \"commands/**\",\n \"templates/**\",\n ...extra,\n ],\n });\n\n const referenceCorpus = otherDocs.map((f) => readText(repoRoot, f)).join(\"\\n\");\n\n for (const adr of adrs) {\n const filename = basename(adr);\n const stem = filename.replace(/\\.md$/, \"\");\n const referenced = referenceCorpus.includes(filename) || referenceCorpus.includes(stem);\n if (!referenced) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: adr,\n message: \"ADR is not referenced by any other doc file (orphan)\",\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists, fileExists, readText } from \"./util.js\";\n\nconst QUALITY_DIR = \"docs/quality\";\nconst CARDINAL_FILE = `${QUALITY_DIR}/code-quality.md`;\n\n// English headings are canonical; the French ones are still accepted so\n// projects written before the switch to English keep passing.\nconst REQUIRED_SECTIONS: ReadonlyArray<{ label: string; pattern: RegExp }> = [\n {\n label: \"Mechanical checks\",\n pattern: /^##\\s+(Mechanical\\s+checks|V[ée]rifications\\s+m[ée]caniques)\\s*$/im,\n },\n { label: \"Project rules\", pattern: /^##\\s+(Project\\s+rules|R[èe]gles\\s+du\\s+projet)\\s*$/im },\n {\n label: \"Accepted deviations\",\n pattern: /^##\\s+(Accepted\\s+deviations|[ÉE]carts\\s+assum[ée]s)\\s*$/im,\n },\n];\n\n/**\n * `docs/quality/` is an optional pillar: absent directory = nothing to\n * report. Once the directory exists, its cardinal file and sections are\n * required.\n */\nexport const qualitySchema: Linter = {\n id: \"lint:quality-schema\",\n pillars: [\"quality\"],\n defaultSeverity: \"error\",\n run(repoRoot: string): LintIssue[] {\n if (!dirExists(repoRoot, QUALITY_DIR)) return [];\n if (!fileExists(repoRoot, CARDINAL_FILE)) {\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: CARDINAL_FILE,\n message: `missing required cardinal file: ${CARDINAL_FILE}`,\n },\n ];\n }\n const text = readText(repoRoot, CARDINAL_FILE);\n return REQUIRED_SECTIONS.filter(({ pattern }) => !pattern.test(text)).map(({ label }) => ({\n linter: this.id,\n severity: \"error\" as const,\n file: CARDINAL_FILE,\n message: `missing required section: \"${label}\"`,\n }));\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists } from \"./util.js\";\n\nexport const readmePresence: Linter = {\n id: \"lint:readme-presence\",\n pillars: [\"readme\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/readme\"],\n run(repoRoot: string): LintIssue[] {\n if (fileExists(repoRoot, \"README.md\")) return [];\n return [\n {\n linter: this.id,\n severity: \"error\",\n file: \"README.md\",\n message: \"README.md is missing at repo root\",\n },\n ];\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { fileExists, readText } from \"./util.js\";\n\nconst REQUIRED_SECTIONS = [\n /^#\\s+\\S/m,\n /^##?\\s+(What is this|Quick start)/im,\n /^##?\\s+(Quick start|Install|Getting started)/im,\n];\n\nconst REQUIRED_LABELS = [\"title (# H1)\", \"What is this / intro\", \"Quick start / Install\"];\n\nexport const readmeSections: Linter = {\n id: \"lint:readme-sections\",\n pillars: [\"readme\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/readme\"],\n run(repoRoot: string): LintIssue[] {\n if (!fileExists(repoRoot, \"README.md\")) return [];\n const text = readText(repoRoot, \"README.md\");\n const issues: LintIssue[] = [];\n for (let i = 0; i < REQUIRED_SECTIONS.length; i++) {\n const pattern = REQUIRED_SECTIONS[i];\n const label = REQUIRED_LABELS[i];\n if (pattern && !pattern.test(text)) {\n issues.push({\n linter: this.id,\n severity: \"error\",\n file: \"README.md\",\n message: `missing required section: ${label}`,\n });\n }\n }\n return issues;\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { dirExists, listMarkdown } from \"./util.js\";\n\nexport const specHasContent: Linter = {\n id: \"lint:spec-has-content\",\n pillars: [\"spec\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n if (!dirExists(repoRoot, \"docs/spec\")) return [];\n const files = listMarkdown(repoRoot, \"docs/spec\");\n if (files.length > 0) return [];\n return [\n {\n linter: this.id,\n severity: \"warning\",\n file: \"docs/spec\",\n message: \"docs/spec/ has no markdown files — write at least one spec document\",\n },\n ];\n },\n};\n","import type { LintIssue, Linter } from \"./types.js\";\nimport { findLineNumber, listMarkdown, readText } from \"./util.js\";\n\nfunction maskFencedBlocks(text: string): string {\n return text.replace(/```[\\s\\S]*?```/g, (m) => m.replace(/[^\\n]/g, \" \"));\n}\n\nconst TECH_BLOCKLIST: Array<{ pattern: RegExp; keyword: string }> = [\n { pattern: /\\bNext\\.?js\\b/i, keyword: \"Next.js\" },\n { pattern: /\\bSupabase\\b/i, keyword: \"Supabase\" },\n { pattern: /\\bVercel\\b/i, keyword: \"Vercel\" },\n { pattern: /\\bReact\\b/, keyword: \"React\" },\n { pattern: /\\bTypeScript\\b/, keyword: \"TypeScript\" },\n { pattern: /\\bDocker\\b/, keyword: \"Docker\" },\n { pattern: /\\bKubernetes\\b/i, keyword: \"Kubernetes\" },\n { pattern: /\\bPostgres(QL)?\\b/i, keyword: \"Postgres\" },\n { pattern: /\\bMySQL\\b/i, keyword: \"MySQL\" },\n { pattern: /\\bRedis\\b/i, keyword: \"Redis\" },\n { pattern: /\\bnpm\\b/, keyword: \"npm\" },\n { pattern: /\\bpnpm\\b/, keyword: \"pnpm\" },\n { pattern: /\\byarn\\b/, keyword: \"yarn\" },\n];\n\nexport const specTechAgnostic: Linter = {\n id: \"lint:spec-tech-agnostic\",\n pillars: [\"spec\"],\n defaultSeverity: \"error\",\n suggestedSkills: [\"/spec\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n const files = listMarkdown(repoRoot, \"docs/spec\");\n for (const f of files) {\n const text = maskFencedBlocks(readText(repoRoot, f));\n for (const { pattern, keyword } of TECH_BLOCKLIST) {\n if (pattern.test(text)) {\n const issue: LintIssue = {\n linter: this.id,\n severity: \"error\",\n file: f,\n message: `forbidden tech keyword \"${keyword}\" — should be in handbook/ or decisions/`,\n };\n const line = findLineNumber(text, pattern);\n if (line !== undefined) issue.line = line;\n issues.push(issue);\n }\n }\n }\n return issues;\n },\n};\n","import fg from \"fast-glob\";\nimport { parseIntentFile } from \"../parser/intent.js\";\nimport type { LintIssue, Linter } from \"./types.js\";\nimport {\n gitCommitsSince,\n gitLastCommitForPath,\n listMarkdown,\n parseFrontmatter,\n readText,\n} from \"./util.js\";\n\nconst TRACKED_DIRS = [\"docs/handbook\", \"docs/tests\", \"docs/workflow\"];\n/** An intent file declares no `tracks:`: its tracked paths are the union of its nodes' anchors. */\nconst INTENTS_DIR = \"docs/intents\";\nconst DEFAULT_DRIFT_THRESHOLD = 10;\n\nfunction expandGlob(repoRoot: string, pattern: string): string[] {\n if (pattern.includes(\"*\")) {\n return fg.sync(pattern, { cwd: repoRoot, absolute: false });\n }\n return [pattern];\n}\n\nfunction trackedPaths(dir: string, file: string, text: string, data: Record<string, unknown>) {\n if (dir === INTENTS_DIR) {\n const anchors = parseIntentFile(file, text).nodes.flatMap((node) => node.anchors);\n return anchors.length > 0 ? [...new Set(anchors)] : undefined;\n }\n return Array.isArray(data.tracks) ? (data.tracks as unknown[]) : undefined;\n}\n\nexport const tracksDrift: Linter = {\n id: \"lint:tracks-drift\",\n pillars: [\"handbook\", \"tests\", \"workflow\", \"intents\"],\n defaultSeverity: \"warning\",\n suggestedSkills: [\"/drift\", \"/handbook\"],\n run(repoRoot: string): LintIssue[] {\n const issues: LintIssue[] = [];\n for (const dir of [...TRACKED_DIRS, INTENTS_DIR]) {\n const files = listMarkdown(repoRoot, dir);\n for (const f of files) {\n const text = readText(repoRoot, f);\n const { data } = parseFrontmatter(text);\n const tracks = trackedPaths(dir, f, text, data);\n if (!tracks) continue;\n const docCommit = gitLastCommitForPath(repoRoot, f);\n if (!docCommit) continue;\n const threshold =\n typeof data.driftThreshold === \"number\" && data.driftThreshold > 0\n ? data.driftThreshold\n : DEFAULT_DRIFT_THRESHOLD;\n let driftCount = 0;\n for (const tracked of tracks) {\n if (typeof tracked !== \"string\") continue;\n const targets = expandGlob(repoRoot, tracked);\n for (const t of targets.length > 0 ? targets : [tracked]) {\n driftCount += gitCommitsSince(repoRoot, t, docCommit.hash);\n }\n }\n if (driftCount > threshold) {\n issues.push({\n linter: this.id,\n severity: \"warning\",\n file: f,\n message: `tracked files changed in ${driftCount} commits since doc last edit (threshold ${threshold})`,\n });\n }\n }\n }\n return issues;\n },\n};\n","import { adrNoTracks } from \"./adr-no-tracks.js\";\nimport { cardinalFiles } from \"./cardinal-files.js\";\nimport { loadLintConfig } from \"./config.js\";\nimport { crossLinks } from \"./cross-links.js\";\nimport { decisionSchema } from \"./decision-schema.js\";\nimport { docLayout } from \"./doc-layout.js\";\nimport { frontmatterTracks } from \"./frontmatter-tracks.js\";\nimport { generatedFresh } from \"./generated-fresh.js\";\nimport { gitignoreHarness } from \"./gitignore-harness.js\";\nimport { intentAnchors } from \"./intent-anchors.js\";\nimport { intentGraph } from \"./intent-graph.js\";\nimport { intentSchema } from \"./intent-schema.js\";\nimport { intentVocabulary } from \"./intent-vocabulary.js\";\nimport { orphanDecisions } from \"./orphan-decisions.js\";\nimport { qualitySchema } from \"./quality-schema.js\";\nimport { readmePresence } from \"./readme-presence.js\";\nimport { readmeSections } from \"./readme-sections.js\";\nimport { specHasContent } from \"./spec-has-content.js\";\nimport { specTechAgnostic } from \"./spec-tech-agnostic.js\";\nimport { tracksDrift } from \"./tracks-drift.js\";\nimport type { LintContext, LintIssue, LintReport, Linter } from \"./types.js\";\n\nexport const ALL_LINTERS: ReadonlyArray<Linter> = [\n readmePresence,\n readmeSections,\n docLayout,\n cardinalFiles,\n decisionSchema,\n adrNoTracks,\n frontmatterTracks,\n tracksDrift,\n specTechAgnostic,\n specHasContent,\n crossLinks,\n orphanDecisions,\n gitignoreHarness,\n qualitySchema,\n intentSchema,\n intentAnchors,\n intentVocabulary,\n intentGraph,\n generatedFresh,\n];\n\nexport interface RunOptions {\n pillar?: string;\n only?: ReadonlyArray<string>;\n}\n\nexport function runLinters(repoRoot: string, opts: RunOptions = {}): LintReport {\n const config = loadLintConfig(repoRoot);\n const ctx: LintContext = { repoRoot, config };\n const filtered = ALL_LINTERS.filter((l) => {\n if (opts.only && !opts.only.includes(l.id)) return false;\n if (opts.pillar && !l.pillars.includes(opts.pillar) && !l.pillars.includes(\"all\")) return false;\n return true;\n });\n const issues: LintIssue[] = [];\n for (const linter of filtered) {\n try {\n issues.push(...linter.run(repoRoot, ctx));\n } catch (err) {\n issues.push({\n linter: linter.id,\n severity: \"error\",\n file: \"<internal>\",\n message: `linter crashed: ${err instanceof Error ? err.message : String(err)}`,\n });\n }\n }\n const errors = issues.filter((i) => i.severity === \"error\").length;\n const warnings = issues.filter((i) => i.severity === \"warning\").length;\n return {\n version: 1,\n summary: { errors, warnings, pass: errors === 0 },\n issues,\n };\n}\n\nfunction suggestedSkillsFor(linterId: string): ReadonlyArray<string> {\n const linter = ALL_LINTERS.find((l) => l.id === linterId);\n return linter?.suggestedSkills ?? [];\n}\n\nexport function formatReportText(report: LintReport): string {\n const lines: string[] = [];\n for (const issue of report.issues) {\n const location = issue.line !== undefined ? `:${issue.line}` : \"\";\n lines.push(`${issue.file}${location}: ${issue.severity}[${issue.linter}]\\n ${issue.message}`);\n const hints = suggestedSkillsFor(issue.linter);\n if (hints.length > 0) {\n lines.push(` → Try: ${hints.join(\", \")}`);\n }\n }\n const { errors, warnings, pass } = report.summary;\n lines.push(\"\");\n lines.push(\n `${errors} ${errors === 1 ? \"error\" : \"errors\"}, ${warnings} ${warnings === 1 ? \"warning\" : \"warnings\"}. ${pass ? \"✔ CI passes.\" : \"✘ CI fails.\"}`,\n );\n return lines.join(\"\\n\");\n}\n\nexport type { HarnessLintConfig } from \"./config.js\";\nexport { loadLintConfig } from \"./config.js\";\nexport type { LintContext, Linter, LintIssue, LintReport, Severity } from \"./types.js\";\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,cAAc,gBAAgB;AACnD,SAAS,MAAM,gBAAgB;AAC/B,OAAO,QAAQ;AACf,OAAO,YAAY;AAEZ,SAAS,WAAW,UAAkB,cAA+B;AAC1E,SAAO,WAAW,KAAK,UAAU,YAAY,CAAC;AAChD;AAEO,SAAS,SAAS,UAAkB,cAA8B;AACvE,SAAO,aAAa,KAAK,UAAU,YAAY,GAAG,MAAM;AAC1D;AAMO,SAAS,kBAAkB,UAAkB,SAA0B;AAC5E,MAAI,QAAQ,SAAS,GAAG,GAAG;AACzB,WAAO,GAAG,KAAK,SAAS,EAAE,KAAK,UAAU,UAAU,MAAM,CAAC,EAAE,SAAS;AAAA,EACvE;AACA,SAAO,WAAW,KAAK,UAAU,OAAO,CAAC;AAC3C;AAEO,SAAS,aAAa,UAAkB,KAAuB;AACpE,QAAM,MAAM,KAAK,UAAU,GAAG;AAC9B,MAAI,CAAC,WAAW,GAAG,EAAG,QAAO,CAAC;AAC9B,SAAO,GACJ,KAAK,WAAW,EAAE,KAAK,UAAU,OAAO,QAAQ,CAAC,sBAAsB,YAAY,EAAE,CAAC,EACtF,OAAO,CAAC,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AAW,OAAO,OAAO,CAAC,MAAM,EAAE,aAAa,SAAS,EAAE;AAChE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS,EAAE,QAAQ,UAAU,MAAM,WAAW,EAAE;AAAA,IAChD;AAAA,EACF;AACF;AAEA,SAAS,mBAAmB,UAAyC;AACnE,QAAM,SAAS,YAAY,KAAK,CAAC,MAAM,EAAE,OAAO,QAAQ;AACxD,SAAO,QAAQ,mBAAmB,CAAC;AACrC;AAEO,SAAS,iBAAiB,QAA4B;AAC3D,QAAM,QAAkB,CAAC;AACzB,aAAW,SAAS,OAAO,QAAQ;AACjC,UAAM,WAAW,MAAM,SAAS,SAAY,IAAI,MAAM,IAAI,KAAK;AAC/D,UAAM,KAAK,GAAG,MAAM,IAAI,GAAG,QAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,MAAM;AAAA,IAAQ,MAAM,OAAO,EAAE;AAC7F,UAAM,QAAQ,mBAAmB,MAAM,MAAM;AAC7C,QAAI,MAAM,SAAS,GAAG;AACpB,YAAM,KAAK,iBAAY,MAAM,KAAK,IAAI,CAAC,EAAE;AAAA,IAC3C;AAAA,EACF;AACA,QAAM,EAAE,QAAQ,UAAU,KAAK,IAAI,OAAO;AAC1C,QAAM,KAAK,EAAE;AACb,QAAM;AAAA,IACJ,GAAG,MAAM,IAAI,WAAW,IAAI,UAAU,QAAQ,KAAK,QAAQ,IAAI,aAAa,IAAI,YAAY,UAAU,KAAK,OAAO,sBAAiB,kBAAa;AAAA,EAClJ;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["existsSync","join","fg","join","fg","existsSync","existsSync","readFileSync","join","resolve","statSync","dirname","isAbsolute","join","resolve","resolve","dirname","statSync","join","isAbsolute","existsSync","readFileSync","join","join","existsSync","readFileSync","existsSync","dirname","join","resolve","existsSync","readFileSync","join","fg","z","readFileSync","matter","z","z","matter","z","join","fg","readFileSync","existsSync","existsSync","readFileSync","statSync","basename","join","matter","parseFrontmatter","matter","basename","join","existsSync","statSync","readFileSync","ENGINE","ENGINE","BASE","dirname","existsSync","join","resolve","resolve","existsSync","join","readFileSync","basename","fg","fg","basename","REQUIRED_SECTIONS","REQUIRED_SECTIONS","fg","TRACKED_DIRS","INTENTS_DIR","fg"]}
|