@descent-vtt/spec-harness 0.18.0 → 0.20.0

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.
Files changed (51) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +372 -0
  4. package/README.md +78 -11
  5. package/dist/briefs.d.ts +45 -0
  6. package/dist/briefs.js +73 -0
  7. package/dist/briefs.js.map +1 -1
  8. package/dist/cli.d.ts +1 -1
  9. package/dist/cli.js +384 -84
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands.js +7 -2
  12. package/dist/commands.js.map +1 -1
  13. package/dist/config.d.ts +15 -1
  14. package/dist/config.js +16 -3
  15. package/dist/config.js.map +1 -1
  16. package/dist/configure.d.ts +142 -32
  17. package/dist/configure.js +316 -89
  18. package/dist/configure.js.map +1 -1
  19. package/dist/fs.d.ts +150 -3
  20. package/dist/fs.js +459 -17
  21. package/dist/fs.js.map +1 -1
  22. package/dist/git.d.ts +85 -9
  23. package/dist/git.js +140 -16
  24. package/dist/git.js.map +1 -1
  25. package/dist/hooks.d.ts +111 -0
  26. package/dist/hooks.js +172 -16
  27. package/dist/hooks.js.map +1 -1
  28. package/dist/round.d.ts +8 -0
  29. package/dist/round.js +32 -9
  30. package/dist/round.js.map +1 -1
  31. package/dist/sandbox.js +4 -3
  32. package/dist/sandbox.js.map +1 -1
  33. package/dist/server.d.ts +25 -1
  34. package/dist/server.js +194 -27
  35. package/dist/server.js.map +1 -1
  36. package/dist/setup.d.ts +6 -3
  37. package/dist/setup.js +74 -23
  38. package/dist/setup.js.map +1 -1
  39. package/dist/siblings.d.ts +42 -7
  40. package/dist/siblings.js +135 -30
  41. package/dist/siblings.js.map +1 -1
  42. package/dist/types.d.ts +5 -0
  43. package/dist/types.js.map +1 -1
  44. package/dist/usage.d.ts +66 -12
  45. package/dist/usage.js +134 -21
  46. package/dist/usage.js.map +1 -1
  47. package/dist/workspace.d.ts +80 -1
  48. package/dist/workspace.js +188 -8
  49. package/dist/workspace.js.map +1 -1
  50. package/hooks/hooks.json +16 -0
  51. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4C5C,MAAM,CAAC,MAAM,QAAQ,GAA2B,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,gBAAgB;IAChB,mBAAmB;IACnB,0BAA0B;IAC1B,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,CAAC;IACtE,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,yBAAyB,EAAE;IAC1E,YAAY,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE;IAC9C,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;IAC3B,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAsB,EAAE,UAAU,EAAE,eAAe,CAAC,EAAE;IAC/E,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE;IACjC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE;CACtE,CAAC;AAEF,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KA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,CAAC,EAAE,GAAG,IAAI,oBAAoB,CAAC;SACnH,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAkD,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC;IACzF,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,WAAW,CAAC,GAAG,IAAI,6BAA6B,CAAC,CAAC;QAClF,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,WAAW,CAAC,CAAC;QAC/C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI;gBAAE,SAAS;YACxD,8DAA8D;YAC9D,uDAAuD;YACvD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBAChF,iEAAiE;gBACjE,0DAA0D;gBAC1D,MAAM,IAAI,WAAW,CAAC,GAAG,IAAI,YAAY,IAAI,8EAA8E,IAAI,QAAQ,IAAI,gBAAgB,CAAC,CAAC;YAC/J,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACnG,CAAC","sourcesContent":["/**\n * What `.spec-harness.json` may say, the defaults, and validation.\n *\n * Every key has a default, so a repository without the file works; a file\n * that says something this version does not understand stops the run with\n * exit 2, because a guard that silently ignored a misspelt key would be\n * guarding something other than what its owner wrote.\n */\n\nimport { templateError } from './branch.js';\n\nexport type OutOfScope = 'warn' | 'ask' | 'deny';\n\nexport interface HarnessConfig {\n /** Branch-name templates that carry the active brief's id (ADR-0004). */\n readonly branches: readonly string[];\n /** What a write outside the brief's `affectedFiles` gets: a warning, a question to the person, or a refusal. */\n readonly outOfScope: OutOfScope;\n /** The branch rounds merge into, which audits and rulings are measured against. `null`: the remote's default branch. */\n readonly base: string | null;\n readonly rulings: {\n /** The brief section whose table holds the rulings. */\n readonly section: string;\n /** The allowed-signers file, read from the base branch, never from the round's own tree. */\n readonly allowedSigners: string;\n };\n readonly dependencies: {\n /** Manifest file names whose added dependencies an audit reports. */\n readonly manifests: readonly string[];\n };\n readonly context: {\n /** The most a context packet may hold, in characters. Cited documents fill what the rest leaves; those that do not fit are named by path. */\n readonly budget: number;\n };\n readonly assertions: {\n /**\n * Brief sections whose assertions state what was true before the round -\n * the defect, measured - and are expected to stop holding when it ends.\n * Every other assertion in a brief is a goal.\n */\n readonly premises: readonly string[];\n };\n readonly probes: {\n /** How many times a probe runs; every run must agree. */\n readonly runs: number;\n /** Seconds one run may take. */\n readonly timeout: number;\n };\n /** The command for each sibling tool, or `null` to find it (ADR-0002). */\n readonly tools: Readonly<Record<SiblingName, readonly string[] | null>>;\n}\n\nexport type SiblingName = 'spec-brief' | 'spec-graph' | 'spec-guard';\nexport const SIBLINGS: readonly SiblingName[] = ['spec-brief', 'spec-graph', 'spec-guard'];\n\nexport const CONFIG_FILE = '.spec-harness.json';\n\nexport const DEFAULT_MANIFESTS: readonly string[] = [\n 'package.json',\n 'Cargo.toml',\n 'go.mod',\n 'pyproject.toml',\n 'requirements*.txt',\n 'Directory.Packages.props',\n '*.csproj',\n '*.fsproj',\n '*.vbproj',\n 'Gemfile',\n];\n\nexport const DEFAULT_CONFIG: HarnessConfig = {\n branches: ['brief/{id}', 'brief-{id}', '*/brief/{id}', '*/brief-{id}'],\n outOfScope: 'warn',\n base: null,\n rulings: { section: 'Rulings', allowedSigners: '.github/allowed_signers' },\n dependencies: { manifests: DEFAULT_MANIFESTS },\n context: { budget: 60_000 },\n assertions: { premises: ['The Defect, Measured', 'Premises', 'Preconditions'] },\n probes: { runs: 2, timeout: 600 },\n tools: { 'spec-brief': null, 'spec-graph': null, 'spec-guard': null },\n};\n\nexport class ConfigError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ConfigError';\n }\n}\n\ntype Json = Record<string, unknown>;\n\nfunction isObject(value: unknown): value is Json {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isStringList(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n\nfunction checkKeys(value: Json, allowed: readonly string[], where: string): void {\n for (const key of Object.keys(value)) {\n if (!allowed.includes(key)) {\n throw new ConfigError(`${where}: unknown key \"${key}\"; the keys are ${allowed.join(', ')}`);\n }\n }\n}\n\nfunction positive(value: unknown, where: string): number {\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 1) {\n throw new ConfigError(`${where} must be a whole number of at least 1`);\n }\n return value;\n}\n\nfunction nonEmpty(value: unknown, where: string): string {\n if (typeof value !== 'string' || value.trim() === '') throw new ConfigError(`${where} must be a non-empty string`);\n return value;\n}\n\n/** Validates a parsed configuration and fills in every default. */\nexport function parseConfig(raw: unknown, file = CONFIG_FILE): HarnessConfig {\n if (!isObject(raw)) throw new ConfigError(`${file} must hold a JSON object`);\n checkKeys(raw, ['$schema', 'branches', 'outOfScope', 'base', 'rulings', 'dependencies', 'context', 'assertions', 'probes', 'tools'], file);\n\n let branches = DEFAULT_CONFIG.branches;\n if (raw['branches'] !== undefined) {\n if (!isStringList(raw['branches']) || raw['branches'].length === 0) {\n throw new ConfigError(`${file}: \"branches\" must be a non-empty list of templates`);\n }\n for (const template of raw['branches']) {\n const error = templateError(template);\n if (error !== null) throw new ConfigError(`${file}: \"branches\": ${error}`);\n }\n branches = raw['branches'];\n }\n\n let outOfScope = DEFAULT_CONFIG.outOfScope;\n if (raw['outOfScope'] !== undefined) {\n if (raw['outOfScope'] !== 'warn' && raw['outOfScope'] !== 'ask' && raw['outOfScope'] !== 'deny') {\n throw new ConfigError(`${file}: \"outOfScope\" must be \"warn\", \"ask\" or \"deny\"`);\n }\n outOfScope = raw['outOfScope'];\n }\n\n let base = DEFAULT_CONFIG.base;\n if (raw['base'] !== undefined && raw['base'] !== null) base = nonEmpty(raw['base'], `${file}: \"base\"`);\n\n let rulings = DEFAULT_CONFIG.rulings;\n if (raw['rulings'] !== undefined) {\n const value = raw['rulings'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"rulings\" must be an object`);\n checkKeys(value, ['section', 'allowedSigners'], `${file}: \"rulings\"`);\n rulings = {\n section: value['section'] === undefined ? rulings.section : nonEmpty(value['section'], `${file}: \"rulings.section\"`),\n allowedSigners:\n value['allowedSigners'] === undefined\n ? rulings.allowedSigners\n : nonEmpty(value['allowedSigners'], `${file}: \"rulings.allowedSigners\"`),\n };\n }\n\n let dependencies = DEFAULT_CONFIG.dependencies;\n if (raw['dependencies'] !== undefined) {\n const value = raw['dependencies'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"dependencies\" must be an object`);\n checkKeys(value, ['manifests'], `${file}: \"dependencies\"`);\n if (value['manifests'] !== undefined) {\n if (!isStringList(value['manifests'])) throw new ConfigError(`${file}: \"dependencies.manifests\" must be a list of file names`);\n dependencies = { manifests: value['manifests'] };\n }\n }\n\n let context = DEFAULT_CONFIG.context;\n if (raw['context'] !== undefined) {\n const value = raw['context'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"context\" must be an object`);\n checkKeys(value, ['budget'], `${file}: \"context\"`);\n if (value['budget'] !== undefined) context = { budget: positive(value['budget'], `${file}: \"context.budget\"`) };\n }\n\n let assertions = DEFAULT_CONFIG.assertions;\n if (raw['assertions'] !== undefined) {\n const value = raw['assertions'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"assertions\" must be an object`);\n checkKeys(value, ['premises'], `${file}: \"assertions\"`);\n if (value['premises'] !== undefined) {\n if (!isStringList(value['premises'])) throw new ConfigError(`${file}: \"assertions.premises\" must be a list of section names`);\n assertions = { premises: value['premises'] };\n }\n }\n\n let probes = DEFAULT_CONFIG.probes;\n if (raw['probes'] !== undefined) {\n const value = raw['probes'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"probes\" must be an object`);\n checkKeys(value, ['runs', 'timeout'], `${file}: \"probes\"`);\n probes = {\n runs: value['runs'] === undefined ? probes.runs : positive(value['runs'], `${file}: \"probes.runs\"`),\n timeout: value['timeout'] === undefined ? probes.timeout : positive(value['timeout'], `${file}: \"probes.timeout\"`),\n };\n }\n\n const tools: Record<SiblingName, readonly string[] | null> = { ...DEFAULT_CONFIG.tools };\n if (raw['tools'] !== undefined) {\n const value = raw['tools'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"tools\" must be an object`);\n checkKeys(value, SIBLINGS, `${file}: \"tools\"`);\n for (const name of SIBLINGS) {\n const command = value[name];\n if (command === undefined || command === null) continue;\n // A list that is not empty has a first entry: the `?.` is the\n // compiler's, and the mutant without it is equivalent.\n if (!isStringList(command) || command.length === 0 || command[0]?.trim() === '') {\n // A sibling runs without a shell, so the example is node and the\n // script: npx is a shim Windows cannot start without one.\n throw new ConfigError(`${file}: \"tools.${name}\" must be a command as a list, such as [\"node\", \"node_modules/@descent-vtt/${name}/bin/${name}.js\"], or null`);\n }\n tools[name] = command;\n }\n }\n\n return { branches, outOfScope, base, rulings, dependencies, context, assertions, probes, tools };\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkD5C,MAAM,CAAC,MAAM,QAAQ,GAA2B,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,WAAW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.json` may say, the defaults, and validation.\n *\n * Every key has a default, so a repository without the file works; a file\n * that says something this version does not understand stops the run with\n * exit 2, because a guard that silently ignored a misspelt key would be\n * guarding something other than what its owner wrote.\n */\n\nimport { templateError } from './branch.js';\n\nexport type OutOfScope = 'warn' | 'ask' | 'deny';\n\nexport interface HarnessConfig {\n /** Branch-name templates that carry the active brief's id (ADR-0004). */\n readonly branches: readonly string[];\n /** What a write outside the brief's `affectedFiles` gets: a warning, a question to the person, or a refusal. */\n readonly outOfScope: OutOfScope;\n /** The branch rounds merge into, which audits and rulings are measured against. `null`: the remote's default branch. */\n readonly base: string | null;\n readonly rulings: {\n /** The brief section whose table holds the rulings. */\n readonly section: string;\n /** The allowed-signers file, read from the base branch, never from the round's own tree. */\n readonly allowedSigners: string;\n };\n readonly dependencies: {\n /** Manifest file names whose added dependencies an audit reports. */\n readonly manifests: readonly string[];\n };\n readonly context: {\n /** The most a context packet may hold, in characters. Cited documents fill what the rest leaves; those that do not fit are named by path. */\n readonly budget: number;\n };\n readonly assertions: {\n /**\n * Brief sections whose assertions state what was true before the round -\n * the defect, measured - and are expected to stop holding when it ends.\n * Every other assertion in a brief is a goal.\n */\n readonly premises: readonly string[];\n };\n readonly probes: {\n /** How many times a probe runs; every run must agree. */\n readonly runs: number;\n /** Seconds one run may take. */\n readonly timeout: number;\n };\n /** The command for each sibling tool, or `null` to find it (ADR-0002). */\n readonly tools: Readonly<Record<SiblingName, readonly string[] | null>>;\n /**\n * Whether Claude Code's hook reports, at the end of each turn, the changed\n * paths the brief protects or that are outside its scope; off by default,\n * and `init` writes the entry that runs it only where it is on (ADR-0005).\n */\n readonly turnReport: boolean;\n}\n\nexport type SiblingName = 'spec-brief' | 'spec-graph' | 'spec-guard';\nexport const SIBLINGS: readonly SiblingName[] = ['spec-brief', 'spec-graph', 'spec-guard'];\n\nexport const CONFIG_FILE = '.spec-harness.json';\n\n/** spec-brief's configuration files, in the order spec-brief looks for them in a directory. */\nexport const SPEC_BRIEF_CONFIGS: readonly string[] = ['.spec-brief.json', 'spec-brief.json'];\n\nexport const DEFAULT_MANIFESTS: readonly string[] = [\n 'package.json',\n 'Cargo.toml',\n 'go.mod',\n 'pyproject.toml',\n 'requirements*.txt',\n 'Directory.Packages.props',\n '*.csproj',\n '*.fsproj',\n '*.vbproj',\n 'Gemfile',\n];\n\nexport const DEFAULT_CONFIG: HarnessConfig = {\n branches: ['brief/{id}', 'brief-{id}', '*/brief/{id}', '*/brief-{id}'],\n outOfScope: 'warn',\n base: null,\n rulings: { section: 'Rulings', allowedSigners: '.github/allowed_signers' },\n dependencies: { manifests: DEFAULT_MANIFESTS },\n context: { budget: 60_000 },\n assertions: { premises: ['The Defect, Measured', 'Premises', 'Preconditions'] },\n probes: { runs: 2, timeout: 600 },\n tools: { 'spec-brief': null, 'spec-graph': null, 'spec-guard': null },\n turnReport: false,\n};\n\nexport class ConfigError extends Error {\n /**\n * The configuration file that did not load, where one stands at its path:\n * the one file a write may still reach while it does not (ADR-0005).\n * `null` for a configuration that was not read from a file.\n */\n readonly file: string | null;\n\n constructor(message: string, file: string | null = null) {\n super(message);\n this.name = 'ConfigError';\n this.file = file;\n }\n}\n\ntype Json = Record<string, unknown>;\n\nfunction isObject(value: unknown): value is Json {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isStringList(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n\nfunction checkKeys(value: Json, allowed: readonly string[], where: string): void {\n for (const key of Object.keys(value)) {\n if (!allowed.includes(key)) {\n throw new ConfigError(`${where}: unknown key \"${key}\"; the keys are ${allowed.join(', ')}`);\n }\n }\n}\n\nfunction positive(value: unknown, where: string): number {\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 1) {\n throw new ConfigError(`${where} must be a whole number of at least 1`);\n }\n return value;\n}\n\nfunction nonEmpty(value: unknown, where: string): string {\n if (typeof value !== 'string' || value.trim() === '') throw new ConfigError(`${where} must be a non-empty string`);\n return value;\n}\n\n/** Validates a parsed configuration and fills in every default. */\nexport function parseConfig(raw: unknown, file = CONFIG_FILE): HarnessConfig {\n if (!isObject(raw)) throw new ConfigError(`${file} must hold a JSON object`);\n checkKeys(raw, ['$schema', 'branches', 'outOfScope', 'base', 'rulings', 'dependencies', 'context', 'assertions', 'probes', 'tools', 'turnReport'], file);\n\n let branches = DEFAULT_CONFIG.branches;\n if (raw['branches'] !== undefined) {\n if (!isStringList(raw['branches']) || raw['branches'].length === 0) {\n throw new ConfigError(`${file}: \"branches\" must be a non-empty list of templates`);\n }\n for (const template of raw['branches']) {\n const error = templateError(template);\n if (error !== null) throw new ConfigError(`${file}: \"branches\": ${error}`);\n }\n branches = raw['branches'];\n }\n\n let outOfScope = DEFAULT_CONFIG.outOfScope;\n if (raw['outOfScope'] !== undefined) {\n if (raw['outOfScope'] !== 'warn' && raw['outOfScope'] !== 'ask' && raw['outOfScope'] !== 'deny') {\n throw new ConfigError(`${file}: \"outOfScope\" must be \"warn\", \"ask\" or \"deny\"`);\n }\n outOfScope = raw['outOfScope'];\n }\n\n let base = DEFAULT_CONFIG.base;\n if (raw['base'] !== undefined && raw['base'] !== null) base = nonEmpty(raw['base'], `${file}: \"base\"`);\n\n let rulings = DEFAULT_CONFIG.rulings;\n if (raw['rulings'] !== undefined) {\n const value = raw['rulings'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"rulings\" must be an object`);\n checkKeys(value, ['section', 'allowedSigners'], `${file}: \"rulings\"`);\n rulings = {\n section: value['section'] === undefined ? rulings.section : nonEmpty(value['section'], `${file}: \"rulings.section\"`),\n allowedSigners:\n value['allowedSigners'] === undefined\n ? rulings.allowedSigners\n : nonEmpty(value['allowedSigners'], `${file}: \"rulings.allowedSigners\"`),\n };\n }\n\n let dependencies = DEFAULT_CONFIG.dependencies;\n if (raw['dependencies'] !== undefined) {\n const value = raw['dependencies'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"dependencies\" must be an object`);\n checkKeys(value, ['manifests'], `${file}: \"dependencies\"`);\n if (value['manifests'] !== undefined) {\n if (!isStringList(value['manifests'])) throw new ConfigError(`${file}: \"dependencies.manifests\" must be a list of file names`);\n dependencies = { manifests: value['manifests'] };\n }\n }\n\n let context = DEFAULT_CONFIG.context;\n if (raw['context'] !== undefined) {\n const value = raw['context'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"context\" must be an object`);\n checkKeys(value, ['budget'], `${file}: \"context\"`);\n if (value['budget'] !== undefined) context = { budget: positive(value['budget'], `${file}: \"context.budget\"`) };\n }\n\n let assertions = DEFAULT_CONFIG.assertions;\n if (raw['assertions'] !== undefined) {\n const value = raw['assertions'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"assertions\" must be an object`);\n checkKeys(value, ['premises'], `${file}: \"assertions\"`);\n if (value['premises'] !== undefined) {\n if (!isStringList(value['premises'])) throw new ConfigError(`${file}: \"assertions.premises\" must be a list of section names`);\n assertions = { premises: value['premises'] };\n }\n }\n\n let probes = DEFAULT_CONFIG.probes;\n if (raw['probes'] !== undefined) {\n const value = raw['probes'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"probes\" must be an object`);\n checkKeys(value, ['runs', 'timeout'], `${file}: \"probes\"`);\n probes = {\n runs: value['runs'] === undefined ? probes.runs : positive(value['runs'], `${file}: \"probes.runs\"`),\n timeout: value['timeout'] === undefined ? probes.timeout : positive(value['timeout'], `${file}: \"probes.timeout\"`),\n };\n }\n\n const tools: Record<SiblingName, readonly string[] | null> = { ...DEFAULT_CONFIG.tools };\n if (raw['tools'] !== undefined) {\n const value = raw['tools'];\n if (!isObject(value)) throw new ConfigError(`${file}: \"tools\" must be an object`);\n checkKeys(value, SIBLINGS, `${file}: \"tools\"`);\n for (const name of SIBLINGS) {\n const command = value[name];\n if (command === undefined || command === null) continue;\n // A list that is not empty has a first entry: the `?.` is the\n // compiler's, and the mutant without it is equivalent.\n if (!isStringList(command) || command.length === 0 || command[0]?.trim() === '') {\n // A sibling runs without a shell, so the example is node and the\n // script: npx is a shim Windows cannot start without one.\n throw new ConfigError(`${file}: \"tools.${name}\" must be a command as a list, such as [\"node\", \"node_modules/@descent-vtt/${name}/bin/${name}.js\"], or null`);\n }\n tools[name] = command;\n }\n }\n\n const turnReport = raw['turnReport'] ?? DEFAULT_CONFIG.turnReport;\n if (typeof turnReport !== 'boolean') throw new ConfigError(`${file}: \"turnReport\" must be true or false`);\n\n return { branches, outOfScope, base, rulings, dependencies, context, assertions, probes, tools, turnReport };\n}\n"]}
@@ -8,6 +8,7 @@
8
8
  * nothing to add.
9
9
  */
10
10
  import type { AllowedSigner } from './signers.js';
11
+ import type { LocalBranch } from './types.js';
11
12
  import { type HookLine } from './usage.js';
12
13
  import { type ClaudeCodeCheck } from './versions.js';
13
14
  type Json = Record<string, unknown>;
@@ -24,6 +25,16 @@ export declare const PROJECT_DIR_OR_HERE = "${CLAUDE_PROJECT_DIR:-.}";
24
25
  * path is one argument whatever it holds, and no shell is involved.
25
26
  */
26
27
  export declare const GUARD_HOOK: Readonly<Json>;
28
+ /**
29
+ * The hook's entry at the end of a turn: the guard's line, run in the
30
+ * background. Claude Code waits on no part of it, so the turn ends as it
31
+ * would, and it hands the hook's `systemMessage` to Claude as the next
32
+ * turn begins, where from an entry it waits on it shows the person the
33
+ * message instead (the hooks reference,
34
+ * https://code.claude.com/docs/en/hooks, *Run hooks in the background* and
35
+ * *JSON output*, read 2026-10-19).
36
+ */
37
+ export declare const TURN_HOOK: Readonly<Json>;
27
38
  /**
28
39
  * The release of Claude Code from which a comma in a matcher separates
29
40
  * names as a `|` does. Its page on debugging a configuration (Check hooks,
@@ -34,25 +45,34 @@ export declare const GUARD_HOOK: Readonly<Json>;
34
45
  */
35
46
  export declare const COMMA_SINCE = "2.1.191";
36
47
  /**
37
- * How the Claude Code that runs the hooks reads a comma in a matcher of
38
- * names: as a separator, from {@link COMMA_SINCE} on; as part of a pattern,
39
- * in the release named, which is older; or it cannot be told, where the
40
- * release cannot.
48
+ * The release of Claude Code from which a hyphenated name in a matcher of
49
+ * names is matched exactly. Its changelog
50
+ * (https://code.claude.com/docs/en/changelog, 2.1.195, read 2026-10-18) has,
51
+ * among its fixes, hook matchers with hyphenated identifiers that matched as
52
+ * substrings, and match exactly from this release on; it does not say how
53
+ * the rest of such a matcher was read.
54
+ */
55
+ export declare const HYPHEN_SINCE = "2.1.195";
56
+ /**
57
+ * How the Claude Code that runs the hooks reads a matcher of names: as every
58
+ * release from {@link HYPHEN_SINCE} on, and the hooks reference today; as
59
+ * the release named, which is older; or it cannot be told, where the release
60
+ * cannot.
41
61
  */
42
- export type Commas = {
43
- readonly as: 'separator';
62
+ export type Matching = {
63
+ readonly as: 'today';
44
64
  } | {
45
- readonly as: 'pattern';
65
+ readonly as: 'older';
46
66
  readonly release: string;
47
67
  } | {
48
68
  readonly as: 'untold';
49
69
  };
50
70
  /**
51
- * How the Claude Code doctor asked its release reads a comma. A release that
52
- * was not asked, or could not be told, leaves the reading untold: asked or
53
- * not, nothing says which it is.
71
+ * How the Claude Code doctor asked its release reads a matcher of names. A
72
+ * release that was not asked, or could not be told, leaves the reading
73
+ * untold: asked or not, nothing says which it is.
54
74
  */
55
- export declare function commasUnder(release: ClaudeCodeCheck | null): Commas;
75
+ export declare function matchingUnder(release: ClaudeCodeCheck | null): Matching;
56
76
  /** What reads a matcher that is a pattern: the writing tools it matches, or `null` where that cannot be told. */
57
77
  export type PatternReader = (source: string) => readonly string[] | null;
58
78
  /**
@@ -86,12 +106,68 @@ export declare function patternReader(read?: PatternReader): PatternReader;
86
106
  *
87
107
  * `pattern` reads a matcher that is a pattern: the run's own reader, where
88
108
  * the run has read the file's matchers already ({@link patternReader}).
89
- * `commas` is how the Claude Code here reads a comma in a matcher of names,
90
- * where the run asked its release ({@link commasUnder}): a line that
109
+ * `matching` is how the Claude Code here reads a matcher of names, where
110
+ * the run asked its release ({@link matchingUnder}): a line that
91
111
  * release starts for no write is no guard, and init's own is written beside
92
112
  * it.
93
113
  */
94
- export declare function mergeClaudeSettings(current: Json, isHook?: (words: readonly string[]) => boolean, pattern?: PatternReader, commas?: Commas): Json | null;
114
+ export declare function mergeClaudeSettings(current: Json, isHook?: (words: readonly string[]) => boolean, pattern?: PatternReader, matching?: Matching): Json | null;
115
+ /**
116
+ * Settings with init's entry under `SessionStart` added beside its two, or
117
+ * `null` where it is not to be: where init's own line does not stand
118
+ * under both `PreToolUse` and `PostToolUse`, a file init writes no hook
119
+ * into or one it has yet to complete; and where a line of the hook stands
120
+ * under `SessionStart` already, init's or one `isHook` knows, which would
121
+ * say the same twice (ADR-0012).
122
+ */
123
+ export declare function withSessionStart(settings: Json, isHook: (words: readonly string[]) => boolean): Json | null;
124
+ /**
125
+ * Settings with `onFailure: "block"` on each of init's own entries, under
126
+ * the three events it writes them under, or `null` where each has it
127
+ * already: `init --block-on-failure`. Claude Code's hooks reference
128
+ * (https://code.claude.com/docs/en/hooks, Block the action when a hook
129
+ * fails, read 2026-10-19) has the field read by Claude Code 2.1.295 and
130
+ * later, and a failure under it, a hook that cannot start or that reaches
131
+ * its timeout among them, do what exit 2 does on its event: before a write,
132
+ * hold it. What a release before 2.1.295 does with the key is on no page, so
133
+ * init writes it only where it is asked to (ADR-0012). An entry a person
134
+ * wrote is theirs, and is left as it is.
135
+ */
136
+ export declare function withOnFailure(settings: Json): Json | null;
137
+ /**
138
+ * Whether settings have Claude Code start the hook as a session starts: an
139
+ * entry under `SessionStart` whose line is init's, or one `isHook` knows
140
+ * as the hook's. Its matcher is not read: one that names some of the ways a
141
+ * session starts has the check made for those.
142
+ */
143
+ export declare function startsSessions(settings: unknown, isHook: (words: readonly string[]) => boolean): boolean;
144
+ /**
145
+ * Settings with init's entry under `Stop` added, or `null` where a line
146
+ * of the hook stands there already, init's or one `isHook` knows, which
147
+ * would report the turn twice (ADR-0012).
148
+ */
149
+ export declare function withTurnReport(settings: Json, isHook: (words: readonly string[]) => boolean): Json | null;
150
+ /** Whether settings have Claude Code start the hook as a turn ends: an entry under `Stop` whose line is init's, or one `isHook` knows as the hook's. */
151
+ export declare function reportsTurns(settings: unknown, isHook: (words: readonly string[]) => boolean): boolean;
152
+ /**
153
+ * What doctor notes where settings hold the guard hooks and none under
154
+ * `SessionStart`: what would hold every write is said at the first write,
155
+ * which it holds, and not as the session starts.
156
+ */
157
+ export declare const NO_SESSION_START = "note: no settings file has Claude Code start the hook as a session starts, so a configuration that does not load, or a brief named that spec-brief does not list, is said only at the first write, which it holds: spec-harness init --write adds the entry beside the two it wrote";
158
+ /**
159
+ * What doctor notes, run in a linked worktree, of the spec-harness the
160
+ * hook's line runs: the one installed where `${CLAUDE_PROJECT_DIR}` points,
161
+ * which is this work tree in a session started in it, and the main
162
+ * checkout in a worktree session of the desktop app's, where Claude Code
163
+ * reads the hooks from the main checkout's root and points the placeholder
164
+ * at it (its worktrees page, What worktrees share with the main checkout,
165
+ * read 2026-10-19). Said where the two are not one release, `null` for
166
+ * none, and `null` where they are. A note: from 0.19.0 on either decides a
167
+ * write by the work tree that holds it, so it says which release answers,
168
+ * not where a write is decided.
169
+ */
170
+ export declare function describeInstalls(main: string, there: string | null, here: string | null): string | null;
95
171
  /** The server's entry, reading the project at `projectDir`: {@link PROJECT_DIR} for the plugin, {@link PROJECT_DIR_OR_HERE} for a project. */
96
172
  export declare function mcpServer(projectDir: string): Json;
97
173
  /**
@@ -166,6 +242,14 @@ export interface HookReport {
166
242
  /** What `onFailure` changes, where the entry sets it to `"block"`. */
167
243
  readonly note: string | null;
168
244
  }
245
+ /**
246
+ * The release of Claude Code that reads `onFailure` on a hook's entry, by its
247
+ * hooks reference (https://code.claude.com/docs/en/hooks, Command hook
248
+ * fields, read 2026-10-19) and its changelog, which adds the field under it.
249
+ */
250
+ export declare const ON_FAILURE_SINCE = "2.1.295";
251
+ /** Whether the Claude Code doctor asked its release reads `onFailure`: one that was told, at {@link ON_FAILURE_SINCE} or later. */
252
+ export declare function readsOnFailure(release: ClaudeCodeCheck | null): boolean;
169
253
  /** An array that stands for a matcher where it unloads a settings file's hooks: the event it stands under, and the array as written. */
170
254
  export interface ArrayMatcher {
171
255
  readonly event: string;
@@ -210,17 +294,17 @@ export declare function handedLines(sources: readonly ClaudeSettings[], project:
210
294
  *
211
295
  * `pattern` reads a matcher that is a pattern, once for every entry under
212
296
  * it in every file: the run's own reader, where something else in the run
213
- * reads the same files ({@link patternReader}). `commas` is how the Claude
214
- * Code here reads a comma in a matcher of names, where its release was
215
- * asked ({@link commasUnder}); a caller that asks none reads a comma as
216
- * every release from {@link COMMA_SINCE} on does.
297
+ * reads the same files ({@link patternReader}). `matching` is how the
298
+ * Claude Code here reads a matcher of names, where its release was asked
299
+ * ({@link matchingUnder}); a caller that asks none reads one as every
300
+ * release from {@link HYPHEN_SINCE} on does.
217
301
  *
218
302
  * A file that holds an array for a matcher under `PreToolUse` or
219
303
  * `PermissionRequest` has none of its hooks loaded ({@link arrayMatcher}):
220
304
  * each line of the hook there is started for no write, and one that stood
221
305
  * to be started for a write is a guard that is off.
222
306
  */
223
- export declare function reportHooks(sources: readonly ClaudeSettings[], project: string, read: (words: readonly string[]) => HookLine | null, pattern?: PatternReader, commas?: Commas): HookReport[];
307
+ export declare function reportHooks(sources: readonly ClaudeSettings[], project: string, read: (words: readonly string[]) => HookLine | null, pattern?: PatternReader, matching?: Matching, onFailureHere?: boolean): HookReport[];
224
308
  /** Whether a project's `.mcp.json` registers a server under the harness's name, however it runs it. */
225
309
  export declare function registersServer(mcp: unknown): boolean;
226
310
  /** A Claude Code settings file, named as a person finds it, and what reading it gave: an object, or nothing usable. */
@@ -345,17 +429,26 @@ export interface ClaudeCodeWiring {
345
429
  readonly lines: readonly HookReport[];
346
430
  /** Whether `.mcp.json` registers the server. */
347
431
  readonly server: boolean;
432
+ /** Whether a settings file has Claude Code start the hook as a session starts (startsSessions). */
433
+ readonly sessionStart: boolean;
348
434
  /**
349
435
  * The release of the Claude Code on `PATH`, where it was asked: a matcher
350
436
  * that lists names with a comma is read as that release reads it
351
- * ({@link commasUnder}). `null` where it was not asked.
437
+ * ({@link matchingUnder}). `null` where it was not asked.
352
438
  */
353
439
  readonly release: ClaudeCodeCheck | null;
440
+ /**
441
+ * An array for a matcher that keeps Claude Code from loading the hooks of
442
+ * the project's settings file, the file init writes its hooks into, or
443
+ * `null`: init writes none there while it stands ({@link arrayMatcher}).
444
+ */
445
+ readonly unloaded: ArrayMatcher | null;
354
446
  }
355
447
  export type WiringState = 'plugin' | 'init' | 'both' | 'none';
356
- /** The wiring as its descriptions read it: what a caller knows of the plugin's presence, which one that does not ask leaves out. */
448
+ /** The wiring as its descriptions read it: what a caller knows of the plugin's presence, and of an array in the project's settings, which one that does not ask leaves out. */
357
449
  type Wired = Pick<ClaudeCodeWiring, 'plugin' | 'hooks' | 'server'> & {
358
450
  readonly presence?: PluginPresence | null;
451
+ readonly unloaded?: ArrayMatcher | null;
359
452
  };
360
453
  /**
361
454
  * Which of the four the wiring is. `both` is a double install, and doctor
@@ -370,6 +463,8 @@ export declare function wiringState(wiring: Wired): WiringState;
370
463
  * checks no write.
371
464
  */
372
465
  export declare function guardSwitchedOff(wiring: Wired & Pick<ClaudeCodeWiring, 'hooksOff'>): boolean;
466
+ /** Whether something brings the guard hooks: a settings file that holds them, or a plugin settings turn on that may be on this machine. */
467
+ export declare function guardWired(wiring: Wired): boolean;
373
468
  /**
374
469
  * What doctor and init say of `disableAllHooks` in `file`. `guarded` is
375
470
  * whether there are guard hooks for it to switch off; without any it is a
@@ -388,8 +483,7 @@ export declare function describePresence(wiring: Wired): string | null;
388
483
  export declare function describeClaudeCode(wiring: Wired): string;
389
484
  /** The spec-brief plugin this package ships, as spec-brief's `plugins` names it. */
390
485
  export declare const PLUGIN = "@descent-vtt/spec-harness/spec-brief-plugin";
391
- /** spec-brief's configuration files, in the order spec-brief looks for them in a directory. */
392
- export declare const SPEC_BRIEF_CONFIGS: readonly string[];
486
+ export { SPEC_BRIEF_CONFIGS } from './config.js';
393
487
  /**
394
488
  * The file a package's `exports` target names for an import, as Node's
395
489
  * PACKAGE_TARGET_RESOLVE finds it, or `null` when it names none: a string
@@ -435,10 +529,10 @@ export declare function describePlugin(state: PluginState): string;
435
529
  export interface BaseFacts {
436
530
  /** The remote's default branch as a local ref, such as `origin/main`, or `null`. */
437
531
  readonly remoteDefault: string | null;
438
- /** The branch checked out, or `null` on a detached head. */
532
+ /** The name of the branch checked out, or `null` on a detached head. */
439
533
  readonly branch: string | null;
440
- /** Every local branch. */
441
- readonly branches: readonly string[];
534
+ /** Every local branch, by its name and the ref a base names it by. */
535
+ readonly branches: readonly LocalBranch[];
442
536
  }
443
537
  /** The base `init` names, and why; `base` is `null` when none can be told. */
444
538
  export interface BaseChoice {
@@ -496,6 +590,19 @@ export type GitHookState = {
496
590
  readonly state: 'stops' | 'ignored';
497
591
  readonly file: string;
498
592
  readonly what: string;
593
+ }
594
+ /**
595
+ * A file the account may not read, `reason` being why, and `runs` whether
596
+ * git may execute it. One git may not execute it skips, with a hint, and
597
+ * commits. One it may it runs, and a script the shell cannot read either
598
+ * stops every commit there (measured with git 2.47 as an ordinary account),
599
+ * where a program runs without being read: which it is cannot be read.
600
+ */
601
+ | {
602
+ readonly state: 'unreadable';
603
+ readonly file: string;
604
+ readonly runs: boolean;
605
+ readonly reason: string;
499
606
  } | {
500
607
  readonly state: 'unknown';
501
608
  readonly reason: string;
@@ -522,13 +629,17 @@ export declare const PROTECT_RULE_FILES: string;
522
629
  export declare const GIT_HOOK_LINE = "node node_modules/@descent-vtt/spec-harness/bin/spec-harness.js hook git";
523
630
  /**
524
631
  * The hook init writes. It is a POSIX sh script on every platform, since Git
525
- * for Windows runs a hook with the sh it ships. Where the project's install
526
- * is not in the work tree - a linked worktree nobody installed into, a
632
+ * for Windows runs a hook with the sh it ships. git starts it at the top of
633
+ * the work tree it commits in, so the project's install is read from there,
634
+ * and where a linked worktree has none, from the repository's main work
635
+ * tree: the work tree whose `.git` the common directory is, where `git
636
+ * worktree add` was run and the project installed (ADR-0005). Where neither
637
+ * has the install - a worktree of a repository nobody installed into, a
527
638
  * repository that shares its hooks with one that uses the harness - node
528
- * would end on a stack trace, so the hook says what is missing and where, and
529
- * the commit waits, as it did when npx found nothing to run.
639
+ * would end on a stack trace, so the hook says what is missing and where,
640
+ * and the commit waits, as it did when npx found nothing to run.
530
641
  */
531
- export declare const PRE_COMMIT = "#!/bin/sh\n# spec-harness: refuse a commit that changes what the active brief protects.\n# git runs this at the top of the work tree it commits in, a linked worktree's\n# own, wherever the hook is kept: the project's install is read from there.\nbin=node_modules/@descent-vtt/spec-harness/bin/spec-harness.js\nif [ ! -f \"$bin\" ]; then\n printf '%s\\n' \"spec-harness: $bin is not in $PWD, the work tree git commits in: install the project's dependencies there, as with npm ci, and commit again\" >&2\n exit 2\nfi\nexec node \"$bin\" hook git\n";
642
+ export declare const PRE_COMMIT = "#!/bin/sh\n# spec-harness: refuse a commit that changes what the active brief protects.\n# git runs this at the top of the work tree it commits in, a linked worktree's\n# own, wherever the hook is kept: the project's install is read from there,\n# or, where a linked worktree has none, from the repository's main work tree.\nbin=node_modules/@descent-vtt/spec-harness/bin/spec-harness.js\nif [ ! -f \"$bin\" ]; then\n common=$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null)\n if [ \"${common##*/}\" = .git ] && [ -f \"${common%/.git}/$bin\" ]; then\n bin=${common%/.git}/$bin\n else\n printf '%s\\n' \"spec-harness: $bin is not in $PWD, the work tree git commits in, nor in its repository's main work tree: install the project's dependencies there, as with npm ci, and commit again\" >&2\n exit 2\n fi\nfi\nexec node \"$bin\" hook git\n";
532
643
  /**
533
644
  * What doctor and init add of a hook whose text runs the harness through
534
645
  * npx: the hook init wrote through 0.9.1, or the line it advised for a hook
@@ -553,4 +664,3 @@ export declare function graphReadsBriefs(config: Json, briefs: string): boolean;
553
664
  export declare function describeGraph(archiveGlob: string, briefs: string, reads: boolean, added: boolean): string;
554
665
  /** spec-graph's configuration with the archive read as history, or `null` when it already is. */
555
666
  export declare function mergeSpecGraph(current: Json, archiveGlob: string): Json | null;
556
- export {};