@webpieces/rules-config 0.4.910 → 0.4.911

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 (95) hide show
  1. package/package.json +7 -6
  2. package/src/aged-tree-sweep.d.ts +2 -2
  3. package/src/aged-tree-sweep.js +2 -2
  4. package/src/aged-tree-sweep.js.map +1 -1
  5. package/src/build-log-doc.d.ts +1 -1
  6. package/src/build-log-doc.js +3 -3
  7. package/src/build-log-doc.js.map +1 -1
  8. package/src/builds-log.d.ts +2 -2
  9. package/src/builds-log.js +2 -2
  10. package/src/builds-log.js.map +1 -1
  11. package/src/checklist-override.d.ts +1 -1
  12. package/src/checklist-override.js +1 -1
  13. package/src/checklist-override.js.map +1 -1
  14. package/src/config-error-banner.js +1 -1
  15. package/src/config-error-banner.js.map +1 -1
  16. package/src/config-repair-bootstrap-source.d.ts +1 -1
  17. package/src/config-repair-bootstrap-source.js +1 -1
  18. package/src/config-repair-bootstrap-source.js.map +1 -1
  19. package/src/config-repair-probe.js +3 -3
  20. package/src/config-repair-probe.js.map +1 -1
  21. package/src/constants.js +3 -3
  22. package/src/constants.js.map +1 -1
  23. package/src/exclude-hook-paths.d.ts +5 -5
  24. package/src/exclude-hook-paths.js +5 -5
  25. package/src/exclude-hook-paths.js.map +1 -1
  26. package/src/exclude-paths.d.ts +1 -1
  27. package/src/exclude-paths.js +1 -1
  28. package/src/exclude-paths.js.map +1 -1
  29. package/src/hook-fault-codes.js.map +1 -1
  30. package/src/index.js +5 -5
  31. package/src/index.js.map +1 -1
  32. package/src/instruct-ai-docs.d.ts +3 -3
  33. package/src/instruct-ai-docs.js +3 -3
  34. package/src/instruct-ai-docs.js.map +1 -1
  35. package/src/legacy-config-upgrade.js +2 -2
  36. package/src/legacy-config-upgrade.js.map +1 -1
  37. package/src/load-config.js +3 -0
  38. package/src/load-config.js.map +1 -1
  39. package/src/load-template.d.ts +1 -1
  40. package/src/load-template.js +2 -2
  41. package/src/load-template.js.map +1 -1
  42. package/src/merge-process-doc.d.ts +1 -1
  43. package/src/merge-process-doc.js +2 -2
  44. package/src/merge-process-doc.js.map +1 -1
  45. package/src/migrate-dirs-cli.d.ts +4 -0
  46. package/src/migrate-dirs-cli.js +32 -0
  47. package/src/migrate-dirs-cli.js.map +1 -0
  48. package/src/orphan-dir-archive.d.ts +4 -4
  49. package/src/orphan-dir-archive.js +4 -4
  50. package/src/orphan-dir-archive.js.map +1 -1
  51. package/src/orphan-dir-scan.d.ts +1 -1
  52. package/src/orphan-dir-scan.js +1 -1
  53. package/src/orphan-dir-scan.js.map +1 -1
  54. package/src/orphan-dir-sweep.js +1 -1
  55. package/src/orphan-dir-sweep.js.map +1 -1
  56. package/src/pack-policy-files.js +4 -3
  57. package/src/pack-policy-files.js.map +1 -1
  58. package/src/policy-tracking.d.ts +7 -0
  59. package/src/policy-tracking.js +68 -0
  60. package/src/policy-tracking.js.map +1 -0
  61. package/src/pr-gate-config.d.ts +1 -1
  62. package/src/pr-gate-config.js +1 -1
  63. package/src/pr-gate-config.js.map +1 -1
  64. package/src/repo-root.d.ts +7 -7
  65. package/src/repo-root.js +8 -8
  66. package/src/repo-root.js.map +1 -1
  67. package/src/repo-scratch-dirs.d.ts +3 -3
  68. package/src/repo-scratch-dirs.js +5 -5
  69. package/src/repo-scratch-dirs.js.map +1 -1
  70. package/src/review-json-data.js +2 -2
  71. package/src/review-json-data.js.map +1 -1
  72. package/src/review-json.js +1 -1
  73. package/src/review-json.js.map +1 -1
  74. package/src/reviewer-instructions.d.ts +1 -1
  75. package/src/reviewer-instructions.js +1 -1
  76. package/src/reviewer-instructions.js.map +1 -1
  77. package/src/rule-pack-artifacts.d.ts +2 -2
  78. package/src/rule-pack-artifacts.js +2 -2
  79. package/src/rule-pack-artifacts.js.map +1 -1
  80. package/src/rule-pack-sync.js +5 -4
  81. package/src/rule-pack-sync.js.map +1 -1
  82. package/src/stale-bin-sweep.js +1 -1
  83. package/src/stale-bin-sweep.js.map +1 -1
  84. package/src/subagent-provenance.d.ts +6 -6
  85. package/src/subagent-provenance.js +6 -6
  86. package/src/subagent-provenance.js.map +1 -1
  87. package/src/sync-flow-guidance.js +1 -1
  88. package/src/sync-flow-guidance.js.map +1 -1
  89. package/templates/webpieces.branch-state-matrix.md +2 -2
  90. package/templates/webpieces.buildlog.md +3 -3
  91. package/templates/webpieces.ci-gate-setup.md +2 -2
  92. package/templates/webpieces.git-workflow.md +9 -9
  93. package/templates/webpieces.guard-matrix.md +6 -5
  94. package/templates/webpieces.location-matrix.md +9 -9
  95. package/templates/webpieces.review-checklists.md +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"config-repair-bootstrap-source.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/config-repair-bootstrap-source.ts"],"names":[],"mappings":";;;AAAA,0FAA0F;AAC1F,oIAAoI;AACvH,QAAA,8BAA8B,GAAG,0qJAA0qJ,CAAC","sourcesContent":["/** Generated from ConfigRepairProbe by pnpm guards:generate; never edit this artifact. */\n// webpieces-disable no-unmanaged-exceptions -- serialized bootstrap catches malformed external declarations without package imports\nexport const CONFIG_REPAIR_BOOTSTRAP_SOURCE = \"/** Self-contained Node probe: serialized into the POSIX shim so repairs work with missing packages. */\\nclass ConfigRepairProbe {\\n rootFor(cwd) {\\n const fs = require('node:fs'), path = require('node:path');\\n let directory = path.resolve(cwd);\\n while (!fs.existsSync(path.join(directory, 'webpieces.config.json'))) {\\n const parent = path.dirname(directory);\\n if (parent === directory)\\n return cwd;\\n directory = parent;\\n }\\n return directory;\\n }\\n isRepairPatch(root, patch) {\\n const lines = patch.trim().split('\\\\n');\\n if (lines[0] !== '*** Begin Patch' || lines.at(-1) !== '*** End Patch')\\n return false;\\n let targets = 0;\\n for (const line of lines.slice(1, -1)) {\\n if (!line.startsWith('*** '))\\n continue;\\n const match = /^\\\\*\\\\*\\\\* (?:Add|Update) File: (.+)$/.exec(line);\\n if (!match || !this.isRepairFile(root, match[1]))\\n return false;\\n targets += 1;\\n }\\n return targets > 0;\\n }\\n isRepairFile(root, filename) {\\n const toError = this.error;\\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- bootstrap cannot trust package imports or malformed declarations\\n try {\\n const fs = require('node:fs'), path = require('node:path');\\n const target = this.canonical(root, path.resolve(root, filename));\\n const rootFile = this.canonical(root, path.join(root, 'webpieces.config.json'));\\n if (target === rootFile)\\n return true;\\n // webpieces-disable no-any-unknown -- only validated declaration strings grant repair access\\n const raw = JSON.parse(fs.readFileSync(rootFile, 'utf8'));\\n if (!raw ||\\n typeof raw !== 'object' ||\\n !('rulePacks' in raw) ||\\n !Array.isArray(raw.rulePacks) ||\\n !raw.rulePacks.length)\\n return false;\\n const files = new Set(), packages = new Set();\\n const lock = this.canonical(root, path.join(root, '.webpieces/rules.lock.json'));\\n for (const declaration of raw.rulePacks) {\\n if (!declaration ||\\n typeof declaration !== 'object' ||\\n Array.isArray(declaration) ||\\n typeof declaration.package !== 'string' ||\\n !declaration.package ||\\n typeof declaration.config !== 'string' ||\\n !declaration.config.endsWith('.json') ||\\n path.isAbsolute(declaration.config) ||\\n Object.keys(declaration).some((key) => !['package', 'config'].includes(key)))\\n return false;\\n const file = this.canonical(root, path.join(root, declaration.config));\\n if (file === rootFile ||\\n file === lock ||\\n files.has(file) ||\\n packages.has(declaration.package))\\n return false;\\n files.add(file);\\n packages.add(declaration.package);\\n }\\n files.add(lock);\\n files.add(this.canonical(root, path.join(root, '.webpieces/instruct-ai/rules-catalog.md')));\\n return files.has(target);\\n // webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution\\n }\\n catch (err) {\\n const error = toError(err);\\n void error;\\n return false;\\n }\\n }\\n canonical(root, filename) {\\n const fs = require('node:fs'), path = require('node:path');\\n const pending = [];\\n let ancestor = filename;\\n while (!fs.lstatSync(ancestor, { throwIfNoEntry: false })) {\\n pending.unshift(path.basename(ancestor));\\n const parent = path.dirname(ancestor);\\n if (parent === ancestor)\\n throw new Error('Cannot resolve config repair path.');\\n ancestor = parent;\\n }\\n const canonical = path.resolve(fs.realpathSync(ancestor), ...pending), relative = path.relative(fs.realpathSync(root), canonical);\\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\\n throw new Error('Config repair path escapes the repository.');\\n return canonical;\\n }\\n // webpieces-disable no-any-unknown -- the bootstrap adapter must remain self-contained when node_modules is corrupt\\n error(err) {\\n return err instanceof Error ? err : new Error(String(err));\\n }\\n}\\n\";\n"]}
1
+ {"version":3,"file":"config-repair-bootstrap-source.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/config-repair-bootstrap-source.ts"],"names":[],"mappings":";;;AAAA,0FAA0F;AAC1F,oIAAoI;AACvH,QAAA,8BAA8B,GAAG,8uJAA8uJ,CAAC","sourcesContent":["/** Generated from ConfigRepairProbe by pnpm guards:generate; never edit this artifact. */\n// webpieces-disable no-unmanaged-exceptions -- serialized bootstrap catches malformed external declarations without package imports\nexport const CONFIG_REPAIR_BOOTSTRAP_SOURCE = \"/** Self-contained Node probe: serialized into the POSIX shim so repairs work with missing packages. */\\nclass ConfigRepairProbe {\\n rootFor(cwd) {\\n const fs = require('node:fs'), path = require('node:path');\\n let directory = path.resolve(cwd);\\n while (!fs.existsSync(path.join(directory, 'webpieces.config.json'))) {\\n const parent = path.dirname(directory);\\n if (parent === directory)\\n return cwd;\\n directory = parent;\\n }\\n return directory;\\n }\\n isRepairPatch(root, patch) {\\n const lines = patch.trim().split('\\\\n');\\n if (lines[0] !== '*** Begin Patch' || lines.at(-1) !== '*** End Patch')\\n return false;\\n let targets = 0;\\n for (const line of lines.slice(1, -1)) {\\n if (!line.startsWith('*** '))\\n continue;\\n const match = /^\\\\*\\\\*\\\\* (?:Add|Update) File: (.+)$/.exec(line);\\n if (!match || !this.isRepairFile(root, match[1]))\\n return false;\\n targets += 1;\\n }\\n return targets > 0;\\n }\\n isRepairFile(root, filename) {\\n const toError = this.error;\\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- bootstrap cannot trust package imports or malformed declarations\\n try {\\n const fs = require('node:fs'), path = require('node:path');\\n const target = this.canonical(root, path.resolve(root, filename));\\n const rootFile = this.canonical(root, path.join(root, 'webpieces.config.json'));\\n if (target === rootFile || target === this.canonical(root, path.join(root, '.gitignore')))\\n return true;\\n // webpieces-disable no-any-unknown -- only validated declaration strings grant repair access\\n const raw = JSON.parse(fs.readFileSync(rootFile, 'utf8'));\\n if (!raw ||\\n typeof raw !== 'object' ||\\n !('rulePacks' in raw) ||\\n !Array.isArray(raw.rulePacks) ||\\n !raw.rulePacks.length)\\n return false;\\n const files = new Set(), packages = new Set();\\n const lock = this.canonical(root, path.join(root, '.webpieces-config/rules.lock.json'));\\n for (const declaration of raw.rulePacks) {\\n if (!declaration ||\\n typeof declaration !== 'object' ||\\n Array.isArray(declaration) ||\\n typeof declaration.package !== 'string' ||\\n !declaration.package ||\\n typeof declaration.config !== 'string' ||\\n !declaration.config.endsWith('.json') ||\\n path.isAbsolute(declaration.config) ||\\n Object.keys(declaration).some((key) => !['package', 'config'].includes(key)))\\n return false;\\n const file = this.canonical(root, path.join(root, declaration.config));\\n if (file === rootFile ||\\n file === lock ||\\n files.has(file) ||\\n packages.has(declaration.package))\\n return false;\\n files.add(file);\\n packages.add(declaration.package);\\n }\\n files.add(lock);\\n files.add(this.canonical(root, path.join(root, '.webpieces-config/rules-catalog.md')));\\n return files.has(target);\\n // webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution\\n }\\n catch (err) {\\n const error = toError(err);\\n void error;\\n return false;\\n }\\n }\\n canonical(root, filename) {\\n const fs = require('node:fs'), path = require('node:path');\\n const pending = [];\\n let ancestor = filename;\\n while (!fs.lstatSync(ancestor, { throwIfNoEntry: false })) {\\n pending.unshift(path.basename(ancestor));\\n const parent = path.dirname(ancestor);\\n if (parent === ancestor)\\n throw new Error('Cannot resolve config repair path.');\\n ancestor = parent;\\n }\\n const canonical = path.resolve(fs.realpathSync(ancestor), ...pending), relative = path.relative(fs.realpathSync(root), canonical);\\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\\n throw new Error('Config repair path escapes the repository.');\\n return canonical;\\n }\\n // webpieces-disable no-any-unknown -- the bootstrap adapter must remain self-contained when node_modules is corrupt\\n error(err) {\\n return err instanceof Error ? err : new Error(String(err));\\n }\\n}\\n\";\n"]}
@@ -37,7 +37,7 @@ class ConfigRepairProbe {
37
37
  const fs = require('node:fs'), path = require('node:path');
38
38
  const target = this.canonical(root, path.resolve(root, filename));
39
39
  const rootFile = this.canonical(root, path.join(root, 'webpieces.config.json'));
40
- if (target === rootFile)
40
+ if (target === rootFile || target === this.canonical(root, path.join(root, '.gitignore')))
41
41
  return true;
42
42
  // webpieces-disable no-any-unknown -- only validated declaration strings grant repair access
43
43
  const raw = JSON.parse(fs.readFileSync(rootFile, 'utf8'));
@@ -48,7 +48,7 @@ class ConfigRepairProbe {
48
48
  !raw.rulePacks.length)
49
49
  return false;
50
50
  const files = new Set(), packages = new Set();
51
- const lock = this.canonical(root, path.join(root, '.webpieces/rules.lock.json'));
51
+ const lock = this.canonical(root, path.join(root, '.webpieces-config/rules.lock.json'));
52
52
  for (const declaration of raw.rulePacks) {
53
53
  if (!declaration ||
54
54
  typeof declaration !== 'object' ||
@@ -70,7 +70,7 @@ class ConfigRepairProbe {
70
70
  packages.add(declaration.package);
71
71
  }
72
72
  files.add(lock);
73
- files.add(this.canonical(root, path.join(root, '.webpieces/instruct-ai/rules-catalog.md')));
73
+ files.add(this.canonical(root, path.join(root, '.webpieces-config/rules-catalog.md')));
74
74
  return files.has(target);
75
75
  // webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config-repair-probe.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/config-repair-probe.ts"],"names":[],"mappings":";;;AAAA,qFAAkF;AAElF,uGAAuG;AACvG,MAAa,iBAAiB;IAC1B,OAAO,CAAC,GAAW;QACf,M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AAC,CAAC;IAC/D,CAAC;CACJ;AA7GD,8CA6GC;AAED,iGAAiG;AACjG,MAAa,qBAAqB;IAC9B,MAAM;QACF,OAAO,GAAG,+DAA8B,qGAAqG,CAAC;IAClJ,CAAC;IAED,UAAU;QACN,OAAO,GAAG,+DAA8B,ghBAAghB,CAAC;IAC7jB,CAAC;CACJ;AARD,sDAQC","sourcesContent":["import { CONFIG_REPAIR_BOOTSTRAP_SOURCE } from './config-repair-bootstrap-source';\n\n/** Self-contained Node probe: serialized into the POSIX shim so repairs work with missing packages. */\nexport class ConfigRepairProbe {\n rootFor(cwd: string): string {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n let directory = path.resolve(cwd);\n while (!fs.existsSync(path.join(directory, 'webpieces.config.json'))) {\n const parent = path.dirname(directory);\n if (parent === directory) return cwd;\n directory = parent;\n }\n return directory;\n }\n\n isRepairPatch(root: string, patch: string): boolean {\n const lines = patch.trim().split('\\n');\n if (lines[0] !== '*** Begin Patch' || lines.at(-1) !== '*** End Patch') return false;\n let targets = 0;\n for (const line of lines.slice(1, -1)) {\n if (!line.startsWith('*** ')) continue;\n const match = /^\\*\\*\\* (?:Add|Update) File: (.+)$/.exec(line);\n if (!match || !this.isRepairFile(root, match[1])) return false;\n targets += 1;\n }\n return targets > 0;\n }\n\n isRepairFile(root: string, filename: string): boolean {\n const toError = this.error;\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- bootstrap cannot trust package imports or malformed declarations\n try {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n const target = this.canonical(root, path.resolve(root, filename));\n const rootFile = this.canonical(root, path.join(root, 'webpieces.config.json'));\n if (target === rootFile) return true;\n // webpieces-disable no-any-unknown -- only validated declaration strings grant repair access\n const raw: unknown = JSON.parse(fs.readFileSync(rootFile, 'utf8'));\n if (\n !raw ||\n typeof raw !== 'object' ||\n !('rulePacks' in raw) ||\n !Array.isArray(raw.rulePacks) ||\n !raw.rulePacks.length\n )\n return false;\n const files = new Set<string>(),\n packages = new Set<string>();\n const lock = this.canonical(root, path.join(root, '.webpieces/rules.lock.json'));\n for (const declaration of raw.rulePacks) {\n if (\n !declaration ||\n typeof declaration !== 'object' ||\n Array.isArray(declaration) ||\n typeof declaration.package !== 'string' ||\n !declaration.package ||\n typeof declaration.config !== 'string' ||\n !declaration.config.endsWith('.json') ||\n path.isAbsolute(declaration.config) ||\n Object.keys(declaration).some(\n (key: string) => !['package', 'config'].includes(key),\n )\n )\n return false;\n const file = this.canonical(root, path.join(root, declaration.config));\n if (\n file === rootFile ||\n file === lock ||\n files.has(file) ||\n packages.has(declaration.package)\n )\n return false;\n files.add(file);\n packages.add(declaration.package);\n }\n files.add(lock);\n files.add(\n this.canonical(root, path.join(root, '.webpieces/instruct-ai/rules-catalog.md')),\n );\n return files.has(target);\n // webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution\n } catch (err: unknown) {\n const error = toError(err);\n void error;\n return false;\n }\n }\n\n private canonical(root: string, filename: string): string {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n const pending: string[] = [];\n let ancestor = filename;\n while (!fs.lstatSync(ancestor, { throwIfNoEntry: false })) {\n pending.unshift(path.basename(ancestor));\n const parent = path.dirname(ancestor);\n if (parent === ancestor) throw new Error('Cannot resolve config repair path.');\n ancestor = parent;\n }\n const canonical = path.resolve(fs.realpathSync(ancestor), ...pending),\n relative = path.relative(fs.realpathSync(root), canonical);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error('Config repair path escapes the repository.');\n return canonical;\n }\n\n // webpieces-disable no-any-unknown -- the bootstrap adapter must remain self-contained when node_modules is corrupt\n private error(err: unknown): Error {\n return err instanceof Error ? err : new Error(String(err));\n }\n}\n\n/** Emits the same compiled probe class; the shell has no separate declaration/path algorithm. */\nexport class ConfigRepairBootstrap {\n script(): string {\n return `${CONFIG_REPAIR_BOOTSTRAP_SOURCE} if (!new ConfigRepairProbe().isRepairFile(process.argv[1], process.argv[2])) process.exitCode = 1;`;\n }\n\n callScript(): string {\n return `${CONFIG_REPAIR_BOOTSTRAP_SOURCE} const probe = new ConfigRepairProbe(); const root = probe.rootFor(process.argv[1]); const payload = JSON.parse(require('node:fs').readFileSync(0, 'utf8')); const input = payload.tool_input; const tool = payload.tool_name; const allowed = ['Write','Edit','MultiEdit'].includes(tool) && input && typeof input.file_path === 'string' ? probe.isRepairFile(root, input.file_path) : tool === 'apply_patch' && input && typeof input.command === 'string' && probe.isRepairPatch(root, input.command); if (!allowed) process.exitCode = 1;`;\n }\n}\n"]}
1
+ {"version":3,"file":"config-repair-probe.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/config-repair-probe.ts"],"names":[],"mappings":";;;AAAA,qFAAkF;AAElF,uGAAuG;AACvG,MAAa,iBAAiB;IAC1B,OAAO,CAAC,GAAW;QACf,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAA6B,EACrD,IAAI,GAAG,OAAO,CAAC,WAAW,CAA+B,CAAC;QAC9D,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC;YACnE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACvC,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,GAAG,CAAC;YACrC,SAAS,GAAG,MAAM,CAAC;QACvB,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,KAAa;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,iBAAiB,IAAI,KAA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;gBAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC/E,QAAQ,GAAG,MAAM,CAAC;QACtB,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,EACjE,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;QAC/D,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YACtF,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAClE,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,oHAAoH;IAC5G,KAAK,CAAC,GAAY;QACtB,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;CACJ;AA7GD,8CA6GC;AAED,iGAAiG;AACjG,MAAa,qBAAqB;IAC9B,MAAM;QACF,OAAO,GAAG,+DAA8B,qGAAqG,CAAC;IAClJ,CAAC;IAED,UAAU;QACN,OAAO,GAAG,+DAA8B,ghBAAghB,CAAC;IAC7jB,CAAC;CACJ;AARD,sDAQC","sourcesContent":["import { CONFIG_REPAIR_BOOTSTRAP_SOURCE } from './config-repair-bootstrap-source';\n\n/** Self-contained Node probe: serialized into the POSIX shim so repairs work with missing packages. */\nexport class ConfigRepairProbe {\n rootFor(cwd: string): string {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n let directory = path.resolve(cwd);\n while (!fs.existsSync(path.join(directory, 'webpieces.config.json'))) {\n const parent = path.dirname(directory);\n if (parent === directory) return cwd;\n directory = parent;\n }\n return directory;\n }\n\n isRepairPatch(root: string, patch: string): boolean {\n const lines = patch.trim().split('\\n');\n if (lines[0] !== '*** Begin Patch' || lines.at(-1) !== '*** End Patch') return false;\n let targets = 0;\n for (const line of lines.slice(1, -1)) {\n if (!line.startsWith('*** ')) continue;\n const match = /^\\*\\*\\* (?:Add|Update) File: (.+)$/.exec(line);\n if (!match || !this.isRepairFile(root, match[1])) return false;\n targets += 1;\n }\n return targets > 0;\n }\n\n isRepairFile(root: string, filename: string): boolean {\n const toError = this.error;\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- bootstrap cannot trust package imports or malformed declarations\n try {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n const target = this.canonical(root, path.resolve(root, filename));\n const rootFile = this.canonical(root, path.join(root, 'webpieces.config.json'));\n if (target === rootFile || target === this.canonical(root, path.join(root, '.gitignore'))) return true;\n // webpieces-disable no-any-unknown -- only validated declaration strings grant repair access\n const raw: unknown = JSON.parse(fs.readFileSync(rootFile, 'utf8'));\n if (\n !raw ||\n typeof raw !== 'object' ||\n !('rulePacks' in raw) ||\n !Array.isArray(raw.rulePacks) ||\n !raw.rulePacks.length\n )\n return false;\n const files = new Set<string>(),\n packages = new Set<string>();\n const lock = this.canonical(root, path.join(root, '.webpieces-config/rules.lock.json'));\n for (const declaration of raw.rulePacks) {\n if (\n !declaration ||\n typeof declaration !== 'object' ||\n Array.isArray(declaration) ||\n typeof declaration.package !== 'string' ||\n !declaration.package ||\n typeof declaration.config !== 'string' ||\n !declaration.config.endsWith('.json') ||\n path.isAbsolute(declaration.config) ||\n Object.keys(declaration).some(\n (key: string) => !['package', 'config'].includes(key),\n )\n )\n return false;\n const file = this.canonical(root, path.join(root, declaration.config));\n if (\n file === rootFile ||\n file === lock ||\n files.has(file) ||\n packages.has(declaration.package)\n )\n return false;\n files.add(file);\n packages.add(declaration.package);\n }\n files.add(lock);\n files.add(\n this.canonical(root, path.join(root, '.webpieces-config/rules-catalog.md')),\n );\n return files.has(target);\n // webpieces-disable no-any-unknown -- external JSON or runtime exports are validated before policy execution\n } catch (err: unknown) {\n const error = toError(err);\n void error;\n return false;\n }\n }\n\n private canonical(root: string, filename: string): string {\n const fs = require('node:fs') as typeof import('node:fs'),\n path = require('node:path') as typeof import('node:path');\n const pending: string[] = [];\n let ancestor = filename;\n while (!fs.lstatSync(ancestor, { throwIfNoEntry: false })) {\n pending.unshift(path.basename(ancestor));\n const parent = path.dirname(ancestor);\n if (parent === ancestor) throw new Error('Cannot resolve config repair path.');\n ancestor = parent;\n }\n const canonical = path.resolve(fs.realpathSync(ancestor), ...pending),\n relative = path.relative(fs.realpathSync(root), canonical);\n if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n throw new Error('Config repair path escapes the repository.');\n return canonical;\n }\n\n // webpieces-disable no-any-unknown -- the bootstrap adapter must remain self-contained when node_modules is corrupt\n private error(err: unknown): Error {\n return err instanceof Error ? err : new Error(String(err));\n }\n}\n\n/** Emits the same compiled probe class; the shell has no separate declaration/path algorithm. */\nexport class ConfigRepairBootstrap {\n script(): string {\n return `${CONFIG_REPAIR_BOOTSTRAP_SOURCE} if (!new ConfigRepairProbe().isRepairFile(process.argv[1], process.argv[2])) process.exitCode = 1;`;\n }\n\n callScript(): string {\n return `${CONFIG_REPAIR_BOOTSTRAP_SOURCE} const probe = new ConfigRepairProbe(); const root = probe.rootFor(process.argv[1]); const payload = JSON.parse(require('node:fs').readFileSync(0, 'utf8')); const input = payload.tool_input; const tool = payload.tool_name; const allowed = ['Write','Edit','MultiEdit'].includes(tool) && input && typeof input.file_path === 'string' ? probe.isRepairFile(root, input.file_path) : tool === 'apply_patch' && input && typeof input.command === 'string' && probe.isRepairPatch(root, input.command); if (!allowed) process.exitCode = 1;`;\n }\n}\n"]}
package/src/constants.js CHANGED
@@ -18,11 +18,11 @@ exports.WEBPIECES_DISABLE = 'webpieces-disable';
18
18
  // to block commit/push/PR until the merge is validated). Kept here so neither package
19
19
  // depends on the other — they only share this vocabulary.
20
20
  //
21
- // `.webpieces/` is the single working dir for all webpieces tooling: ai-hook-rules
21
+ // `.webpieces-logs/` is the single working dir for all webpieces tooling: ai-hook-rules
22
22
  // bootstrap/cache, the instruct-ai docs, and the workflow state. To keep the top level
23
23
  // quiet, per-feature workflow dirs are nested one level down under `merge-info/<feature>`
24
24
  // and `pr-review/<feature>` rather than scattered as top-level `merge-<feature>`/`pr-<feature>`.
25
- // `.webpieces/` is gitignored; only the per-feature subdirs under those two homes are subject
25
+ // `.webpieces-logs/` is gitignored; only the per-feature subdirs under those two homes are subject
26
26
  // to 30-day cleanup (the homes themselves, like hooks/ and instruct-ai/, are permanent).
27
27
  // The DIRECTORY NAME only. Never join it onto a root yourself — go through `DotWebpieces.shared()`
28
28
  // (repo-wide state), `DotWebpieces.local()` (this worktree's own tooling-written state) or
@@ -39,7 +39,7 @@ exports.MERGE_IN_PROGRESS_FILE = 'merge-in-progress.json';
39
39
  // pr-gate commands WRITE it and things outside pr-gate READ it to decide whether a resolve is
40
40
  // half-finished, and neither side may depend on the other.
41
41
  //
42
- // It lives directly under `.webpieces/` local state (NOT under merge-info/), because a dev-deploy
42
+ // It lives directly under `.webpieces-logs/` local state (NOT under merge-info/), because a dev-deploy
43
43
  // resolve is not a 3-point merge: it never touches the feature branch, never produces merge-info
44
44
  // context, and must NOT be picked up by merge-in-progress-guard's marker scan — that guard's remedy
45
45
  // is `pnpm wp-finish-upsert-pr`, which is the wrong command here and would strand the tmp branch.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/constants.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,sEAAsE;AACtE,EAAE;AACF,yFAAyF;AACzF,qFAAqF;AACrF,kFAAkF;;;AA6ElF,gCAEC;AA7EY,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,kFAAkF;AAClF,uFAAuF;AACvF,uEAAuE;AACvE,sFAAsF;AAGtF,wFAAwF;AACxF,0FAA0F;AAC1F,sFAAsF;AACtF,0DAA0D;AAC1D,EAAE;AACF,mFAAmF;AACnF,uFAAuF;AACvF,0FAA0F;AAC1F,iGAAiG;AACjG,8FAA8F;AAC9F,yFAAyF;AACzF,mGAAmG;AACnG,2FAA2F;AAC3F,kGAAkG;AAClG,mGAAmG;AACnG,4DAA4D;AAC/C,QAAA,cAAc,GAAG,YAAY,CAAC;AAC3C,kGAAkG;AAClG,qGAAqG;AACrG,iCAAiC;AACpB,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,uFAAuF;AACvF,qGAAqG;AACrG,8FAA8F;AAC9F,2DAA2D;AAC3D,EAAE;AACF,kGAAkG;AAClG,iGAAiG;AACjG,oGAAoG;AACpG,kGAAkG;AACrF,QAAA,mBAAmB,GAAG,2BAA2B,CAAC;AAE/D,2FAA2F;AAC3F,mFAAmF;AACnF,uFAAuF;AACvF,uGAAuG;AACvG,kGAAkG;AAClG,kGAAkG;AAClG,iDAAiD;AACpC,QAAA,sBAAsB,GAAG,sBAAsB,CAAC;AAE7D;;;;;;;;;GASG;AACU,QAAA,qBAAqB,GAAG,8BAA8B,CAAC;AAEpE;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAY,EAAE,QAAgB;IACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE,CAAC","sourcesContent":["// Single source of truth for the disable-comment token and rule-name identifiers\n// shared across rules-config, ai-hook-rules, code-rules, and pr-gate.\n//\n// There is exactly ONE disable form: `// webpieces-disable <rule>[, <rule2>] -- reason`.\n// The legacy `ai-hook-disable` alias and the `-file`/`-next`/`-all` variants and the\n// `*`/bare (no-rule) wildcard have been removed — every disable MUST name a rule.\n\nexport const WEBPIECES_DISABLE = 'webpieces-disable';\n\n// Rule-name tokens as they appear AFTER `webpieces-disable` in a disable comment.\n// Values must match existing comments exactly — changing a value silently breaks every\n// disable that names that rule. Note MAX_LINES_MODIFIED is a prefix of\n// MAX_LINES_MODIFIED_FILES (a historical substring-match quirk preserved on purpose).\n\n\n// Merge-state convention shared by the pr-gate scripts (which WRITE the marker during a\n// conflicted 3-point merge) and the ai-hook-rules merge-in-progress-guard (which READS it\n// to block commit/push/PR until the merge is validated). Kept here so neither package\n// depends on the other — they only share this vocabulary.\n//\n// `.webpieces/` is the single working dir for all webpieces tooling: ai-hook-rules\n// bootstrap/cache, the instruct-ai docs, and the workflow state. To keep the top level\n// quiet, per-feature workflow dirs are nested one level down under `merge-info/<feature>`\n// and `pr-review/<feature>` rather than scattered as top-level `merge-<feature>`/`pr-<feature>`.\n// `.webpieces/` is gitignored; only the per-feature subdirs under those two homes are subject\n// to 30-day cleanup (the homes themselves, like hooks/ and instruct-ai/, are permanent).\n// The DIRECTORY NAME only. Never join it onto a root yourself — go through `DotWebpieces.shared()`\n// (repo-wide state), `DotWebpieces.local()` (this worktree's own tooling-written state) or\n// `DotWebpieces.aiWritable()` (this worktree's state that a CODING AGENT writes) so the call site\n// declares its scope. In a linked worktree the three resolve to different places, and getting that\n// silently wrong is the bug those methods exist to prevent.\nexport const MERGE_INFO_DIR = 'merge-info';\n// The PR working home. Renamed from the legacy `pr-info` to `pr-review` for clarity (it holds the\n// AI's PR review + rendered body). Old `pr-info/` dirs are gitignored local state and self-clear via\n// cleanTmp's legacy `pr-` sweep.\nexport const MERGE_IN_PROGRESS_FILE = 'merge-in-progress.json';\n\n// The dev-deploy resolve state file, written by `wp-push-dev --resolve` and cleared by\n// `wp-finish-push-dev` (or `--abort`). Named here for the same reason MERGE_IN_PROGRESS_FILE is: the\n// pr-gate commands WRITE it and things outside pr-gate READ it to decide whether a resolve is\n// half-finished, and neither side may depend on the other.\n//\n// It lives directly under `.webpieces/` local state (NOT under merge-info/), because a dev-deploy\n// resolve is not a 3-point merge: it never touches the feature branch, never produces merge-info\n// context, and must NOT be picked up by merge-in-progress-guard's marker scan — that guard's remedy\n// is `pnpm wp-finish-upsert-pr`, which is the wrong command here and would strand the tmp branch.\nexport const PUSH_DEV_STATE_FILE = 'push-dev-in-progress.json';\n\n// Proof-of-work the AI must produce for every conflicted file it resolves during a 3-point\n// merge: a short explanation written NEXT TO that file's 3-point context (the same\n// `updatemain-<safe_path>/` dir that holds A-forkpoint.txt / B-A.diff / C-A.diff). The\n// wp-finish-upsert-pr gate requires a non-empty file of this name per conflicted file before passing —\n// it is the only check on the part of the process the AI actually owns (resolving files). Using a\n// sidecar file (rather than an in-source comment) works for any file type, including comment-less\n// ones like JSON and files resolved by deletion.\nexport const MERGE_EXPLANATION_FILE = 'merge-explanation.md';\n\n/**\n * The command that MECHANICALLY strips every unknown key from webpieces.config.json.\n *\n * An unknown key controls nothing, so deleting it is the cure — but \"delete it\" is a judgement call made\n * while the guard denies every Bash call, which is exactly when a reader is least able to make one. This\n * command turns that judgement into one keystroke, and every message that reports an unknown key names it.\n *\n * Lives in this leaf module (no imports) so both the banner and the validators can name it without\n * importing the pruner and re-creating an import cycle.\n */\nexport const PRUNE_UNKNOWN_COMMAND = 'pnpm wp-prune-unknown-config';\n\n/**\n * The command that rewrites every webpieces-owned file a repo commits — the L0 hook shim and the generic\n * reviewer agent (`.claude/agents/webpieces-reviewer.md`). Named here, in the leaf module, so the config\n * validator that finds that agent missing can print the cure without importing ai-hook-rules.\n */\nexport const UPGRADE_SHIM_COMMAND = 'pnpm wp-upgrade-shim';\n\n/**\n * Fast predicate: does this text carry a webpieces-disable for the given rule?\n * Line-agnostic — the caller decides which line(s) or block of text to feed it.\n * This is the cheap substring form used by code-rules detection and pr-gate's\n * dashboard grep/count. (ai-hook-rules uses a richer line-mapping parser.)\n */\nexport function hasDisable(text: string, ruleName: string): boolean {\n return text.includes(WEBPIECES_DISABLE) && text.includes(ruleName);\n}\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/constants.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,sEAAsE;AACtE,EAAE;AACF,yFAAyF;AACzF,qFAAqF;AACrF,kFAAkF;;;AA6ElF,gCAEC;AA7EY,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,kFAAkF;AAClF,uFAAuF;AACvF,uEAAuE;AACvE,sFAAsF;AAGtF,wFAAwF;AACxF,0FAA0F;AAC1F,sFAAsF;AACtF,0DAA0D;AAC1D,EAAE;AACF,wFAAwF;AACxF,uFAAuF;AACvF,0FAA0F;AAC1F,iGAAiG;AACjG,mGAAmG;AACnG,yFAAyF;AACzF,mGAAmG;AACnG,2FAA2F;AAC3F,kGAAkG;AAClG,mGAAmG;AACnG,4DAA4D;AAC/C,QAAA,cAAc,GAAG,YAAY,CAAC;AAC3C,kGAAkG;AAClG,qGAAqG;AACrG,iCAAiC;AACpB,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,uFAAuF;AACvF,qGAAqG;AACrG,8FAA8F;AAC9F,2DAA2D;AAC3D,EAAE;AACF,uGAAuG;AACvG,iGAAiG;AACjG,oGAAoG;AACpG,kGAAkG;AACrF,QAAA,mBAAmB,GAAG,2BAA2B,CAAC;AAE/D,2FAA2F;AAC3F,mFAAmF;AACnF,uFAAuF;AACvF,uGAAuG;AACvG,kGAAkG;AAClG,kGAAkG;AAClG,iDAAiD;AACpC,QAAA,sBAAsB,GAAG,sBAAsB,CAAC;AAE7D;;;;;;;;;GASG;AACU,QAAA,qBAAqB,GAAG,8BAA8B,CAAC;AAEpE;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAY,EAAE,QAAgB;IACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,yBAAiB,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE,CAAC","sourcesContent":["// Single source of truth for the disable-comment token and rule-name identifiers\n// shared across rules-config, ai-hook-rules, code-rules, and pr-gate.\n//\n// There is exactly ONE disable form: `// webpieces-disable <rule>[, <rule2>] -- reason`.\n// The legacy `ai-hook-disable` alias and the `-file`/`-next`/`-all` variants and the\n// `*`/bare (no-rule) wildcard have been removed — every disable MUST name a rule.\n\nexport const WEBPIECES_DISABLE = 'webpieces-disable';\n\n// Rule-name tokens as they appear AFTER `webpieces-disable` in a disable comment.\n// Values must match existing comments exactly — changing a value silently breaks every\n// disable that names that rule. Note MAX_LINES_MODIFIED is a prefix of\n// MAX_LINES_MODIFIED_FILES (a historical substring-match quirk preserved on purpose).\n\n\n// Merge-state convention shared by the pr-gate scripts (which WRITE the marker during a\n// conflicted 3-point merge) and the ai-hook-rules merge-in-progress-guard (which READS it\n// to block commit/push/PR until the merge is validated). Kept here so neither package\n// depends on the other — they only share this vocabulary.\n//\n// `.webpieces-logs/` is the single working dir for all webpieces tooling: ai-hook-rules\n// bootstrap/cache, the instruct-ai docs, and the workflow state. To keep the top level\n// quiet, per-feature workflow dirs are nested one level down under `merge-info/<feature>`\n// and `pr-review/<feature>` rather than scattered as top-level `merge-<feature>`/`pr-<feature>`.\n// `.webpieces-logs/` is gitignored; only the per-feature subdirs under those two homes are subject\n// to 30-day cleanup (the homes themselves, like hooks/ and instruct-ai/, are permanent).\n// The DIRECTORY NAME only. Never join it onto a root yourself — go through `DotWebpieces.shared()`\n// (repo-wide state), `DotWebpieces.local()` (this worktree's own tooling-written state) or\n// `DotWebpieces.aiWritable()` (this worktree's state that a CODING AGENT writes) so the call site\n// declares its scope. In a linked worktree the three resolve to different places, and getting that\n// silently wrong is the bug those methods exist to prevent.\nexport const MERGE_INFO_DIR = 'merge-info';\n// The PR working home. Renamed from the legacy `pr-info` to `pr-review` for clarity (it holds the\n// AI's PR review + rendered body). Old `pr-info/` dirs are gitignored local state and self-clear via\n// cleanTmp's legacy `pr-` sweep.\nexport const MERGE_IN_PROGRESS_FILE = 'merge-in-progress.json';\n\n// The dev-deploy resolve state file, written by `wp-push-dev --resolve` and cleared by\n// `wp-finish-push-dev` (or `--abort`). Named here for the same reason MERGE_IN_PROGRESS_FILE is: the\n// pr-gate commands WRITE it and things outside pr-gate READ it to decide whether a resolve is\n// half-finished, and neither side may depend on the other.\n//\n// It lives directly under `.webpieces-logs/` local state (NOT under merge-info/), because a dev-deploy\n// resolve is not a 3-point merge: it never touches the feature branch, never produces merge-info\n// context, and must NOT be picked up by merge-in-progress-guard's marker scan — that guard's remedy\n// is `pnpm wp-finish-upsert-pr`, which is the wrong command here and would strand the tmp branch.\nexport const PUSH_DEV_STATE_FILE = 'push-dev-in-progress.json';\n\n// Proof-of-work the AI must produce for every conflicted file it resolves during a 3-point\n// merge: a short explanation written NEXT TO that file's 3-point context (the same\n// `updatemain-<safe_path>/` dir that holds A-forkpoint.txt / B-A.diff / C-A.diff). The\n// wp-finish-upsert-pr gate requires a non-empty file of this name per conflicted file before passing —\n// it is the only check on the part of the process the AI actually owns (resolving files). Using a\n// sidecar file (rather than an in-source comment) works for any file type, including comment-less\n// ones like JSON and files resolved by deletion.\nexport const MERGE_EXPLANATION_FILE = 'merge-explanation.md';\n\n/**\n * The command that MECHANICALLY strips every unknown key from webpieces.config.json.\n *\n * An unknown key controls nothing, so deleting it is the cure — but \"delete it\" is a judgement call made\n * while the guard denies every Bash call, which is exactly when a reader is least able to make one. This\n * command turns that judgement into one keystroke, and every message that reports an unknown key names it.\n *\n * Lives in this leaf module (no imports) so both the banner and the validators can name it without\n * importing the pruner and re-creating an import cycle.\n */\nexport const PRUNE_UNKNOWN_COMMAND = 'pnpm wp-prune-unknown-config';\n\n/**\n * The command that rewrites every webpieces-owned file a repo commits — the L0 hook shim and the generic\n * reviewer agent (`.claude/agents/webpieces-reviewer.md`). Named here, in the leaf module, so the config\n * validator that finds that agent missing can print the cure without importing ai-hook-rules.\n */\nexport const UPGRADE_SHIM_COMMAND = 'pnpm wp-upgrade-shim';\n\n/**\n * Fast predicate: does this text carry a webpieces-disable for the given rule?\n * Line-agnostic — the caller decides which line(s) or block of text to feed it.\n * This is the cheap substring form used by code-rules detection and pr-gate's\n * dashboard grep/count. (ai-hook-rules uses a richer line-mapping parser.)\n */\nexport function hasDisable(text: string, ruleName: string): boolean {\n return text.includes(WEBPIECES_DISABLE) && text.includes(ruleName);\n}\n"]}
@@ -5,20 +5,20 @@ export declare class ExcludePaths {
5
5
  /**
6
6
  * webpieces' OWN state directory is NEVER governed, whatever `excludePaths` says.
7
7
  *
8
- * `.webpieces/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,
8
+ * `.webpieces-logs/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,
9
9
  * be reverted, or be lost to a checkout — every justification the branch-state guard prints about
10
10
  * protecting `main` is vacuous there. Leaving that to config made the exemption OPTIONAL, and the
11
11
  * tooling writes into the directory itself: `wp-review-upsert-pr` asks a reviewer subagent to write its
12
- * verdict to `<primary>/.webpieces/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard
12
+ * verdict to `<primary>/.webpieces-logs/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard
13
13
  * resolved that write to the PRIMARY clone and judged the primary's live branch — a tree the subagent
14
14
  * is not standing in — so the reviewer was blocked with "You should not be working on main" whenever an
15
15
  * unrelated session happened to leave the primary there. Hard-coding the skip makes that whole class
16
16
  * unreachable, and fixes existing consumer repos the moment they upgrade the pin.
17
17
  *
18
- * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces/**` glob seeded into
18
+ * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces-logs/**` glob seeded into
19
19
  * `excludePaths` — a config entry that changed nothing would be a second spelling of a decision that
20
- * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces/**`
21
- * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces` that this
20
+ * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces-logs/**`
21
+ * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces-logs` that this
22
22
  * predicate matches. A consumer reading such a glob would also conclude the exemption is config-driven
23
23
  * and therefore removable, which is exactly the belief this predicate exists to destroy.
24
24
  *
@@ -27,20 +27,20 @@ exports.ExcludePaths = ExcludePaths;
27
27
  /**
28
28
  * webpieces' OWN state directory is NEVER governed, whatever `excludePaths` says.
29
29
  *
30
- * `.webpieces/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,
30
+ * `.webpieces-logs/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,
31
31
  * be reverted, or be lost to a checkout — every justification the branch-state guard prints about
32
32
  * protecting `main` is vacuous there. Leaving that to config made the exemption OPTIONAL, and the
33
33
  * tooling writes into the directory itself: `wp-review-upsert-pr` asks a reviewer subagent to write its
34
- * verdict to `<primary>/.webpieces/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard
34
+ * verdict to `<primary>/.webpieces-logs/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard
35
35
  * resolved that write to the PRIMARY clone and judged the primary's live branch — a tree the subagent
36
36
  * is not standing in — so the reviewer was blocked with "You should not be working on main" whenever an
37
37
  * unrelated session happened to leave the primary there. Hard-coding the skip makes that whole class
38
38
  * unreachable, and fixes existing consumer repos the moment they upgrade the pin.
39
39
  *
40
- * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces/**` glob seeded into
40
+ * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces-logs/**` glob seeded into
41
41
  * `excludePaths` — a config entry that changed nothing would be a second spelling of a decision that
42
- * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces/**`
43
- * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces` that this
42
+ * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces-logs/**`
43
+ * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces-logs` that this
44
44
  * predicate matches. A consumer reading such a glob would also conclude the exemption is config-driven
45
45
  * and therefore removable, which is exactly the belief this predicate exists to destroy.
46
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"exclude-hook-paths.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/exclude-hook-paths.ts"],"names":[],"mappings":";;;AA6CA,kDAEC;AA/CD,8DAA8D;AAE9D,gGAAgG;AAChG,sGAAsG;AACtG,4EAA4E;AAC5E,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,qGAAqG;AACrG,gGAAgG;AAChG,mEAAmE;AACnE,EAAE;AACF,wGAAwG;AACxG,wGAAwG;AACxG,wGAAwG;AACxG,+FAA+F;AAC/F,MAAa,YAAY;IACA;IAArB,YAAqB,KAAe;QAAf,UAAK,GAAL,KAAK,CAAU;IAAG,CAAC;CAC3C;AAFD,oCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oKAAoK;AACpK,SAAgB,mBAAmB,CAAC,YAAoB;IACpD,OAAO,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,kCAAiB,CAAC;AAChF,CAAC","sourcesContent":["import { WEBPIECES_TMP_DIR } from '@webpieces/tooling-common';\n\n// Top-level `excludePaths` block from webpieces.config.json: ONE glob list that suppresses hook\n// enforcement for matching files (matched against the workspace-relative path). A path listed here is\n// hands-off for everything — code-style rules AND file-scoped guards alike.\n//\n// It used to be TWO independently-varying lists, `rules` and `guards`. The split never earned its\n// keep: every consumer set both to the same value, and the one case that would need them to differ\n// (exclude a generated tree from style rules but keep the git guards on it) is already served better\n// one level down, by a rule's OWN `excludePaths` inside its config block. A path is governed by\n// webpieces or it is not, so the top-level block is a single list.\n//\n// The object form `{ \"rules\": [...], \"guards\": [...] }` is RETIRED, not accepted — validateExcludePaths\n// rejects it with the union instruction. It was tolerated once, which is precisely why consumer configs\n// (this repo's included) stayed on it: an accepted shape is never migrated. See retired-config-keys.ts.\n// Data-only (per CLAUDE.md, classes for data). Built once by loadAndValidate after validation.\nexport class ExcludePaths {\n constructor(readonly paths: string[]) {}\n}\n\n/**\n * webpieces' OWN state directory is NEVER governed, whatever `excludePaths` says.\n *\n * `.webpieces/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,\n * be reverted, or be lost to a checkout — every justification the branch-state guard prints about\n * protecting `main` is vacuous there. Leaving that to config made the exemption OPTIONAL, and the\n * tooling writes into the directory itself: `wp-review-upsert-pr` asks a reviewer subagent to write its\n * verdict to `<primary>/.webpieces/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard\n * resolved that write to the PRIMARY clone and judged the primary's live branch — a tree the subagent\n * is not standing in — so the reviewer was blocked with \"You should not be working on main\" whenever an\n * unrelated session happened to leave the primary there. Hard-coding the skip makes that whole class\n * unreachable, and fixes existing consumer repos the moment they upgrade the pin.\n *\n * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces/**` glob seeded into\n * `excludePaths` — a config entry that changed nothing would be a second spelling of a decision that\n * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces/**`\n * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces` that this\n * predicate matches. A consumer reading such a glob would also conclude the exemption is config-driven\n * and therefore removable, which is exactly the belief this predicate exists to destroy.\n *\n * FIRST SEGMENT ONLY, deliberately: this is the tooling's own directory at the workspace root, not any\n * path that merely contains the name. A `relativePath` that escapes the workspace ('../x'), or that is\n * '' (the Bash path with no `cd`), has a first segment of '..'/'' and does not match.\n */\n// webpieces-disable no-function-outside-class -- leaf predicate over one path string, beside the constant it tests; a class here would be a namespace with no state\nexport function isWebpiecesStateDir(relativePath: string): boolean {\n return relativePath.replace(/\\\\/g, '/').split('/')[0] === WEBPIECES_TMP_DIR;\n}\n"]}
1
+ {"version":3,"file":"exclude-hook-paths.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/exclude-hook-paths.ts"],"names":[],"mappings":";;;AA6CA,kDAEC;AA/CD,8DAA8D;AAE9D,gGAAgG;AAChG,sGAAsG;AACtG,4EAA4E;AAC5E,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,qGAAqG;AACrG,gGAAgG;AAChG,mEAAmE;AACnE,EAAE;AACF,wGAAwG;AACxG,wGAAwG;AACxG,wGAAwG;AACxG,+FAA+F;AAC/F,MAAa,YAAY;IACA;IAArB,YAAqB,KAAe;QAAf,UAAK,GAAL,KAAK,CAAU;IAAG,CAAC;CAC3C;AAFD,oCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oKAAoK;AACpK,SAAgB,mBAAmB,CAAC,YAAoB;IACpD,OAAO,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,kCAAiB,CAAC;AAChF,CAAC","sourcesContent":["import { WEBPIECES_TMP_DIR } from '@webpieces/tooling-common';\n\n// Top-level `excludePaths` block from webpieces.config.json: ONE glob list that suppresses hook\n// enforcement for matching files (matched against the workspace-relative path). A path listed here is\n// hands-off for everything — code-style rules AND file-scoped guards alike.\n//\n// It used to be TWO independently-varying lists, `rules` and `guards`. The split never earned its\n// keep: every consumer set both to the same value, and the one case that would need them to differ\n// (exclude a generated tree from style rules but keep the git guards on it) is already served better\n// one level down, by a rule's OWN `excludePaths` inside its config block. A path is governed by\n// webpieces or it is not, so the top-level block is a single list.\n//\n// The object form `{ \"rules\": [...], \"guards\": [...] }` is RETIRED, not accepted — validateExcludePaths\n// rejects it with the union instruction. It was tolerated once, which is precisely why consumer configs\n// (this repo's included) stayed on it: an accepted shape is never migrated. See retired-config-keys.ts.\n// Data-only (per CLAUDE.md, classes for data). Built once by loadAndValidate after validation.\nexport class ExcludePaths {\n constructor(readonly paths: string[]) {}\n}\n\n/**\n * webpieces' OWN state directory is NEVER governed, whatever `excludePaths` says.\n *\n * `.webpieces-logs/` is gitignored in every consumer, so nothing under it can reach a branch, be reviewed,\n * be reverted, or be lost to a checkout — every justification the branch-state guard prints about\n * protecting `main` is vacuous there. Leaving that to config made the exemption OPTIONAL, and the\n * tooling writes into the directory itself: `wp-review-upsert-pr` asks a reviewer subagent to write its\n * verdict to `<primary>/.webpieces-logs/worktrees/agent-<id>/pr-review/<branch>/`, feature-branch-guard\n * resolved that write to the PRIMARY clone and judged the primary's live branch — a tree the subagent\n * is not standing in — so the reviewer was blocked with \"You should not be working on main\" whenever an\n * unrelated session happened to leave the primary there. Hard-coding the skip makes that whole class\n * unreachable, and fixes existing consumer repos the moment they upgrade the pin.\n *\n * THIS IS THE ONLY SPELLING. There is deliberately no companion `.webpieces-logs/**` glob seeded into\n * `excludePaths` — a config entry that changed nothing would be a second spelling of a decision that\n * already has one, and a strictly WEAKER one at that: the repo's glob matcher compiles `.webpieces-logs/**`\n * to an anchored regex whose `/` is literal, so it misses the bare directory `.webpieces-logs` that this\n * predicate matches. A consumer reading such a glob would also conclude the exemption is config-driven\n * and therefore removable, which is exactly the belief this predicate exists to destroy.\n *\n * FIRST SEGMENT ONLY, deliberately: this is the tooling's own directory at the workspace root, not any\n * path that merely contains the name. A `relativePath` that escapes the workspace ('../x'), or that is\n * '' (the Bash path with no `cd`), has a first segment of '..'/'' and does not match.\n */\n// webpieces-disable no-function-outside-class -- leaf predicate over one path string, beside the constant it tests; a class here would be a namespace with no state\nexport function isWebpiecesStateDir(relativePath: string): boolean {\n return relativePath.replace(/\\\\/g, '/').split('/')[0] === WEBPIECES_TMP_DIR;\n}\n"]}
@@ -32,7 +32,7 @@ export declare function isPathExcluded(relPath: string, excludePaths: readonly s
32
32
  * DOTFILE PATHS COUNT (`{ dot: true }`). minimatch's default hides any path segment starting with `.`
33
33
  * from a wildcard, so `**` does not match `.github/workflows/deploy.yml` and `.claude/**` does not match
34
34
  * `.claude/agents/x.md`. For a repo-path classifier that default is simply wrong: `.github/`, `.claude/`
35
- * and `.webpieces/` are ordinary, frequently-changed directories here, and a pattern author writing
35
+ * and `.webpieces-logs/` are ordinary, frequently-changed directories here, and a pattern author writing
36
36
  * `**` means all of it. Shell-style dot-hiding protects against globbing up `.` and `..`, which is not a
37
37
  * hazard any caller here has.
38
38
  *
@@ -51,7 +51,7 @@ function isPathExcluded(relPath, excludePaths) {
51
51
  * DOTFILE PATHS COUNT (`{ dot: true }`). minimatch's default hides any path segment starting with `.`
52
52
  * from a wildcard, so `**` does not match `.github/workflows/deploy.yml` and `.claude/**` does not match
53
53
  * `.claude/agents/x.md`. For a repo-path classifier that default is simply wrong: `.github/`, `.claude/`
54
- * and `.webpieces/` are ordinary, frequently-changed directories here, and a pattern author writing
54
+ * and `.webpieces-logs/` are ordinary, frequently-changed directories here, and a pattern author writing
55
55
  * `**` means all of it. Shell-style dot-hiding protects against globbing up `.` and `..`, which is not a
56
56
  * hazard any caller here has.
57
57
  *
@@ -1 +1 @@
1
- {"version":3,"file":"exclude-paths.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/exclude-paths.ts"],"names":[],"mappings":";;AAsBA,wCASC;AA6BD,wCAOC;AAnED,iGAAiG;AACjG,iGAAiG;AACjG,2DAAgD;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,cAAc,CAAC,OAAe,EAAE,YAA+B;IAC3E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1C,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,GAAG,OAAO,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IACtD,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,sGAAsG;AACtG,SAAgB,cAAc,CAAC,OAAe,EAAE,QAA2B;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QACzD,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,GAAG,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;IACrE,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["// Interop-resolved (issue #747) — NEVER `import { minimatch } from 'minimatch'` here; that named\n// export does not exist on minimatch v3, which is what a hoisted-linker consumer can resolve to.\nimport { minimatch } from './minimatch-interop';\n\n/**\n * Holistic exclusion check shared by validate-ts-in-src (Layer 1 + Layer 2)\n * and the file-location AI-hook rule, so the two implementations can never\n * drift apart again.\n *\n * `relPath` is a workspace-relative path (e.g.\n * \"libraries/foo/codegen.ts\"). An entry in `excludePaths` matches when ANY\n * of the following hold:\n *\n * 1. Bare directory/segment name appearing anywhere in the path. This is\n * the historical behavior and keeps entries like \"node_modules\",\n * \"dist\", \"scripts\", \"architecture\" working at any depth.\n * 2. A glob matched against the full relative path, e.g. \"**\\/*.d.ts\" or\n * \"**\\/codegen.ts\".\n * 3. A directory-prefix glob, e.g. \"libraries/apis\" -> \"libraries/apis/**\".\n *\n * Paths are normalized to forward slashes so Windows backslashes match too.\n */\nexport function isPathExcluded(relPath: string, excludePaths: readonly string[]): boolean {\n const norm = relPath.replace(/\\\\/g, '/');\n const segments = norm.split('/');\n for (const pattern of excludePaths) {\n if (segments.includes(pattern)) return true;\n if (minimatch(norm, pattern)) return true;\n if (minimatch(norm, `${pattern}/**`)) return true;\n }\n return false;\n}\n\n/**\n * Does `relPath` match any of `patterns`, as a glob or as a directory prefix?\n *\n * The strict sibling of {@link isPathExcluded}: it drops rule 1 (bare segment name matching anywhere\n * in the path), which is right for an opt-out exclusion list but wrong for anything that CLASSIFIES\n * a path — a pattern like \"external\" would otherwise claim every path containing that segment at any\n * depth. Used for config lists that positively identify a set of projects (e.g.\n * `runtime-architecture.externalApiPaths`).\n *\n * Paths are normalized to forward slashes so Windows backslashes match too. Empty `patterns` matches\n * nothing, so an unconfigured list is inert rather than universal.\n *\n * DOTFILE PATHS COUNT (`{ dot: true }`). minimatch's default hides any path segment starting with `.`\n * from a wildcard, so `**` does not match `.github/workflows/deploy.yml` and `.claude/**` does not match\n * `.claude/agents/x.md`. For a repo-path classifier that default is simply wrong: `.github/`, `.claude/`\n * and `.webpieces/` are ordinary, frequently-changed directories here, and a pattern author writing\n * `**` means all of it. Shell-style dot-hiding protects against globbing up `.` and `..`, which is not a\n * hazard any caller here has.\n *\n * The three consumers are named here on purpose, because the widening is silent for them:\n * `build-artifact-gate` (stale generated artifacts), `api-scanner.externalApiPaths` (project\n * classification) and `no-custom-css-scope.allowGlobs` (an EXEMPTION list, so wider = more exempt).\n * None configures a dot-path today, and for all three \"the pattern author meant the whole subtree\" is\n * the reading they already assume — but a future dot-path entry now matches where it silently did not,\n * and that is a deliberate decision recorded here rather than an accident.\n */\n// webpieces-disable no-function-outside-class -- pure path predicate, sibling of isPathExcluded above\nexport function matchesAnyGlob(relPath: string, patterns: readonly string[]): boolean {\n const norm = relPath.replace(/\\\\/g, '/');\n for (const pattern of patterns) {\n if (minimatch(norm, pattern, { dot: true })) return true;\n if (minimatch(norm, `${pattern}/**`, { dot: true })) return true;\n }\n return false;\n}\n"]}
1
+ {"version":3,"file":"exclude-paths.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/exclude-paths.ts"],"names":[],"mappings":";;AAsBA,wCASC;AA6BD,wCAOC;AAnED,iGAAiG;AACjG,iGAAiG;AACjG,2DAAgD;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,cAAc,CAAC,OAAe,EAAE,YAA+B;IAC3E,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1C,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,GAAG,OAAO,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IACtD,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,sGAAsG;AACtG,SAAgB,cAAc,CAAC,OAAe,EAAE,QAA2B;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QACzD,IAAI,IAAA,6BAAS,EAAC,IAAI,EAAE,GAAG,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;IACrE,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["// Interop-resolved (issue #747) — NEVER `import { minimatch } from 'minimatch'` here; that named\n// export does not exist on minimatch v3, which is what a hoisted-linker consumer can resolve to.\nimport { minimatch } from './minimatch-interop';\n\n/**\n * Holistic exclusion check shared by validate-ts-in-src (Layer 1 + Layer 2)\n * and the file-location AI-hook rule, so the two implementations can never\n * drift apart again.\n *\n * `relPath` is a workspace-relative path (e.g.\n * \"libraries/foo/codegen.ts\"). An entry in `excludePaths` matches when ANY\n * of the following hold:\n *\n * 1. Bare directory/segment name appearing anywhere in the path. This is\n * the historical behavior and keeps entries like \"node_modules\",\n * \"dist\", \"scripts\", \"architecture\" working at any depth.\n * 2. A glob matched against the full relative path, e.g. \"**\\/*.d.ts\" or\n * \"**\\/codegen.ts\".\n * 3. A directory-prefix glob, e.g. \"libraries/apis\" -> \"libraries/apis/**\".\n *\n * Paths are normalized to forward slashes so Windows backslashes match too.\n */\nexport function isPathExcluded(relPath: string, excludePaths: readonly string[]): boolean {\n const norm = relPath.replace(/\\\\/g, '/');\n const segments = norm.split('/');\n for (const pattern of excludePaths) {\n if (segments.includes(pattern)) return true;\n if (minimatch(norm, pattern)) return true;\n if (minimatch(norm, `${pattern}/**`)) return true;\n }\n return false;\n}\n\n/**\n * Does `relPath` match any of `patterns`, as a glob or as a directory prefix?\n *\n * The strict sibling of {@link isPathExcluded}: it drops rule 1 (bare segment name matching anywhere\n * in the path), which is right for an opt-out exclusion list but wrong for anything that CLASSIFIES\n * a path — a pattern like \"external\" would otherwise claim every path containing that segment at any\n * depth. Used for config lists that positively identify a set of projects (e.g.\n * `runtime-architecture.externalApiPaths`).\n *\n * Paths are normalized to forward slashes so Windows backslashes match too. Empty `patterns` matches\n * nothing, so an unconfigured list is inert rather than universal.\n *\n * DOTFILE PATHS COUNT (`{ dot: true }`). minimatch's default hides any path segment starting with `.`\n * from a wildcard, so `**` does not match `.github/workflows/deploy.yml` and `.claude/**` does not match\n * `.claude/agents/x.md`. For a repo-path classifier that default is simply wrong: `.github/`, `.claude/`\n * and `.webpieces-logs/` are ordinary, frequently-changed directories here, and a pattern author writing\n * `**` means all of it. Shell-style dot-hiding protects against globbing up `.` and `..`, which is not a\n * hazard any caller here has.\n *\n * The three consumers are named here on purpose, because the widening is silent for them:\n * `build-artifact-gate` (stale generated artifacts), `api-scanner.externalApiPaths` (project\n * classification) and `no-custom-css-scope.allowGlobs` (an EXEMPTION list, so wider = more exempt).\n * None configures a dot-path today, and for all three \"the pattern author meant the whole subtree\" is\n * the reading they already assume — but a future dot-path entry now matches where it silently did not,\n * and that is a deliberate decision recorded here rather than an accident.\n */\n// webpieces-disable no-function-outside-class -- pure path predicate, sibling of isPathExcluded above\nexport function matchesAnyGlob(relPath: string, patterns: readonly string[]): boolean {\n const norm = relPath.replace(/\\\\/g, '/');\n for (const pattern of patterns) {\n if (minimatch(norm, pattern, { dot: true })) return true;\n if (minimatch(norm, `${pattern}/**`, { dot: true })) return true;\n }\n return false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"hook-fault-codes.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/hook-fault-codes.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,oGAAoG;AACpG,gGAAgG;AAChG,sGAAsG;AACtG,uGAAuG;AACvG,qGAAqG;AACrG,2DAA2D;AAC3D,EAAE;AACF,sGAAsG;AACtG,6FAA6F;AAC7F,uFAAuF;AACvF,EAAE;AACF,mGAAmG;AACnG,wGAAwG;AACxG,uGAAuG;AACvG,oGAAoG;AACpG,eAAe;AACf,8EAA8E;;;AAgI9E,sCAEC;AAOD,4CAEC;AAzID,gGAAgG;AACnF,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC,oGAAoG;AACvF,QAAA,oBAAoB,GAAG,GAAG,CAAC;AAExC,iGAAiG;AACpF,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,oFAAoF;AACvE,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,uGAAuG;AAC1F,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,2EAA2E;AAC9D,QAAA,uBAAuB,GAAG,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KAAK,sDAAsD,CAAC;AACrQ,CAAC","sourcesContent":["// ---------------------------------------------------------------------------\n// THE L0 FAULT CODEBOOK — one letter per fault, declared HERE and nowhere else.\n//\n// Both halves of L0 stamp `fault=<code>` onto their audit lines: the POSIX `sh` shim writes D/X/U/K\n// (shim-audit-log.ts), and the guard bin writes S/C/Y in JS (decision-log.ts, via runner.ts and\n// hook-core.ts). The whole value of that field is that ONE grep — `grep 'fault=S'` — spans the entire\n// trail, and that the faults actually observed can be diffed against `L0_FAULTS`. Both properties hold\n// only while every emitter spells the letters the SAME way, and a hand-retyped 'S' in one emitter is\n// exactly the drift this module exists to make impossible.\n//\n// It used to be retyped: the shim assigned `WP_FAULT=X` as a literal, SHIM_LOG_FAULTS listed the four\n// sh-side letters again, and L0_FAULTS listed all seven a third time. Three spellings of one\n// vocabulary, held together by a unit test that could only notice AFTER they diverged.\n//\n// This module is a LEAF — no imports at all — on purpose. `l0-matrix.ts` (core) builds `L0_FAULTS`\n// from these constants and `shim-audit-log.ts` / `shim.ts` (bin) render them into the shim; parking the\n// constants in either of those two would make the other one a core↔bin import cycle. It also keeps the\n// shim renderer dependency-light, which it must be: it has to work on a tree too broken to load the\n// rule engine.\n// ---------------------------------------------------------------------------\n\n/** `D` — version drift: the root package.json pin != the installed version. Decided in `sh`. */\nexport const L0_FAULT_DRIFT = 'D';\n\n/** `X` — the guard bin is missing (fresh clone, new worktree, package removed). Decided in `sh`. */\nexport const L0_FAULT_BIN_MISSING = 'X';\n\n/** `U` — the bin is missing AND nothing declares the package, so an install is a no-op. `sh`. */\nexport const L0_FAULT_UNDECLARED = 'U';\n\n/** `K` — the bin is present but CRASHED (corrupt node_modules). Decided in `sh`. */\nexport const L0_FAULT_BIN_BROKEN = 'K';\n\n/** `S` — the committed `.claude/webpieces/ai-hook.sh` != `renderShim()`. Decided in the bin, in JS. */\nexport const L0_FAULT_SHIM_STALE = 'S';\n\n/** `C` — `webpieces.config.json` is missing. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_MISSING = 'C';\n\n/** `Y` — a loaded rule has no `webpieces.config.json` key. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_OUT_OF_SYNC = 'Y';\n\n/**\n * No fault AT THIS LAYER — the value every audit line carries when nothing fired.\n *\n * Never a claim that nothing was wrong: a `fault=-` line from the `sh` shim only says the sh half found\n * nothing, and the bin it then exec'd may still have blocked on S/C/Y and stamped its own line.\n */\nexport const L0_FAULT_NONE = '-';\n\n/**\n * The faults decided in POSIX `sh`, BEFORE the bin runs — a stale, missing or broken validator cannot\n * be trusted to validate itself. In first-match-wins order.\n */\nexport const L0_SH_FAULT_CODES = [\n L0_FAULT_DRIFT, L0_FAULT_BIN_MISSING, L0_FAULT_UNDECLARED, L0_FAULT_BIN_BROKEN,\n] as const;\n\n/**\n * The faults decided INSIDE the guard bin, in JS. These reached the audit trail with no fault label at\n * all until the JS emitters started stamping them: an `S` storm that blocked an agent for ~20 tool\n * calls left two lines in the `rejections/` stream, both attributed to a downstream rule, and nothing\n * anywhere identifying L0.\n */\nexport const L0_JS_FAULT_CODES = [\n L0_FAULT_SHIM_STALE, L0_FAULT_CONFIG_MISSING, L0_FAULT_CONFIG_OUT_OF_SYNC,\n] as const;\n\n// ---------------------------------------------------------------------------\n// THE JOIN KEYS — the three artifacts that describe one L0 event, and the coordinates that line them up.\n//\n// There are three, and until now they could not be grepped together:\n// 1. THE DENY the agent reads in the moment (shim-deny-reason.ts for S; DENY_REASON_SH for D/X/U/K)\n// 2. THE AUDIT LINE (`.webpieces/logs/**`), which carries `layer=` `row=` `fault=`\n// 3. THE MATRIX DOC (webpieces.guard-matrix.md, rendered from L0_FAULTS + L0_ALLOWLIST)\n//\n// The deny had NONE of them: no fault letter, no row, and — the highest-value omission — no guard NAME,\n// while every L1/L2 deny opens `[<rule-name>] (N violations)`. So a transcript could not be debugged\n// against the log after the fact, and a reader could not find the matrix row by eye.\n//\n// These constants are that vocabulary, declared HERE for the same reason the letters are: this module is\n// a LEAF with no imports, so `core/l0-matrix.ts` (the doc), `bin/shim*.ts` (the denies) and\n// `core/decision-log.ts` (the log) can all reach it without an import cycle. Retyping a name in any one\n// of them is the drift this file exists to make impossible.\n// ---------------------------------------------------------------------------\n\n/**\n * EVERY L0 fault code, as a type. The two arrays above are the halves; this is their union, and it is\n * what makes `L0_FAULT_NAMES` TOTAL — a `Record<string, …>` would have forced a `?? 'unknown'` fallback\n * at every read, which is shim shape #4 (a runtime default standing in for a type that could have\n * expressed the invariant). With the union, a new fault added without a name is a COMPILE error, and\n * neither reader needs a defensive branch.\n */\nexport type L0FaultCode = typeof L0_SH_FAULT_CODES[number] | typeof L0_JS_FAULT_CODES[number];\n\n/**\n * The stable, human-readable GUARD NAME per fault code — what goes in the deny's `[…]` header, in the\n * matrix doc's own `guard` column, and nowhere else in a second spelling.\n *\n * L1 prints `[stale-main-bash-guard] (1 violation)` and L0 printed nothing comparable; the names below\n * are deliberately in that same kebab shape so the two layers read as one system. They are IDENTITY, not\n * prose: renaming one silently breaks a grep that spans all three artifacts, exactly as renumbering an\n * L1 row would (see L1_ROWS' header).\n */\nexport const L0_FAULT_NAMES: Readonly<Record<L0FaultCode, string>> = {\n [L0_FAULT_DRIFT]: 'version-drift',\n [L0_FAULT_BIN_MISSING]: 'guard-bin-missing',\n [L0_FAULT_UNDECLARED]: 'guard-pkg-undeclared',\n [L0_FAULT_BIN_BROKEN]: 'guard-bin-crashed',\n [L0_FAULT_SHIM_STALE]: 'managed-hook-surface',\n [L0_FAULT_CONFIG_MISSING]: 'config-missing',\n [L0_FAULT_CONFIG_OUT_OF_SYNC]: 'config-out-of-sync',\n};\n\n/**\n * The LAYER token — the other half of every join key, spelled once. The deny header, the matrix\n * citation, the sh audit line and guards/L0-tooling.md all read it from here, so `grep layer=L0` cannot\n * miss an artifact that typed the token itself.\n */\nexport const L0_LAYER = 'L0';\n\n/**\n * The three rows of L0's decision matrix, by number — the numbers `renderGuardMatrixDoc` prints, the\n * numbers the audit line's `row=` carries, and the numbers a deny cites. L0's matrix has no genuine\n * second dimension: every branch reduces to `fault present?` x `on the allowlist?`.\n *\n * All three are named because all three are LOGGED: the sh half writes a line for the healthy hand-down\n * too (`PASS-BIN-ALLOW`), which is the line that tells \"the guard ran and found nothing\" apart from\n * \"the guard never ran\".\n */\nexport const L0_ROW_HANDED_DOWN = '1';\n\n/** Row 2: a fault is present but the call is on the L0 allowlist — a cure, a Read, or the config edit. */\nexport const L0_ROW_ALLOWLISTED = '2';\n\n/** Row 3: a fault is present and the call is NOT on the allowlist. The one row that ever BLOCKS. */\nexport const L0_ROW_BLOCKED = '3';\n\n/**\n * The `[guard-name] (layer=L0 fault=<code> row=<n>)` header every L0 deny opens with, after the ❌ line.\n *\n * ONE builder, called by the JS denies directly and interpolated into the POSIX-sh denies at render\n * time by renderShim() — so the sh half cannot spell the coordinates differently from the JS half even\n * though it cannot import anything at runtime. `detail` is the per-fault count that mirrors\n * formatReport's `(N violations)`.\n */\n// webpieces-disable no-function-outside-class -- pure string builder over this leaf module's own constants; it must stay importable by the dependency-free shim renderer.\nexport function l0GuardHeader(fault: L0FaultCode, detail: string): string {\n return `[${L0_FAULT_NAMES[fault]}] (layer=${L0_LAYER} fault=${fault} row=${L0_ROW_BLOCKED}, ${detail})`;\n}\n\n/**\n * The one-line citation of WHICH matrix row was taken and on what dimension values — L1's pattern\n * (its deny cites \"`w` / `n` / `n` - row 8\"), in L0's own two columns.\n */\n// webpieces-disable no-function-outside-class -- sibling of l0GuardHeader in this leaf codebook module.\nexport function l0MatrixCitation(fault: L0FaultCode): string {\n return `matrix row ${L0_ROW_BLOCKED}: fault=${fault} present / on the allowlist? no -> BLOCK. Those are the same coordinates the audit line carries (layer=${L0_LAYER} row=${L0_ROW_BLOCKED} fault=${fault}) and the same row webpieces.guard-matrix.md prints.`;\n}\n"]}
1
+ {"version":3,"file":"hook-fault-codes.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/hook-fault-codes.ts"],"names":[],"mappings":";AAAA,8EA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AC3C,CAAC,mCAA2B,CAAC,EAAE,oBAAoB;CACtD,CAAC;AAEF;;;;GAIG;AACU,QAAA,QAAQ,GAAG,IAAI,CAAC;AAE7B;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,GAAG,CAAC;AAEtC,0GAA0G;AAC7F,QAAA,kBAAkB,GAAG,GAAG,CAAC;AAEtC,oGAAoG;AACvF,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;;;;GAOG;AACH,0KAA0K;AAC1K,SAAgB,aAAa,CAAC,KAAkB,EAAE,MAAc;IAC5D,OAAO,IAAI,sBAAc,CAAC,KAAK,CAAC,YAAY,gBAAQ,UAAU,KAAK,QAAQ,sBAAc,KAAK,MAAM,GAAG,CAAC;AAC5G,CAAC;AAED;;;GAGG;AACH,wGAAwG;AACxG,SAAgB,gBAAgB,CAAC,KAAkB;IAC/C,OAAO,cAAc,sBAAc,WAAW,KAAK,0GAA0G,gBAAQ,QAAQ,sBAAc,UAAU,KAAK,sDAAsD,CAAC;AACrQ,CAAC","sourcesContent":["// ---------------------------------------------------------------------------\n// THE L0 FAULT CODEBOOK — one letter per fault, declared HERE and nowhere else.\n//\n// Both halves of L0 stamp `fault=<code>` onto their audit lines: the POSIX `sh` shim writes D/X/U/K\n// (shim-audit-log.ts), and the guard bin writes S/C/Y in JS (decision-log.ts, via runner.ts and\n// hook-core.ts). The whole value of that field is that ONE grep — `grep 'fault=S'` — spans the entire\n// trail, and that the faults actually observed can be diffed against `L0_FAULTS`. Both properties hold\n// only while every emitter spells the letters the SAME way, and a hand-retyped 'S' in one emitter is\n// exactly the drift this module exists to make impossible.\n//\n// It used to be retyped: the shim assigned `WP_FAULT=X` as a literal, SHIM_LOG_FAULTS listed the four\n// sh-side letters again, and L0_FAULTS listed all seven a third time. Three spellings of one\n// vocabulary, held together by a unit test that could only notice AFTER they diverged.\n//\n// This module is a LEAF — no imports at all — on purpose. `l0-matrix.ts` (core) builds `L0_FAULTS`\n// from these constants and `shim-audit-log.ts` / `shim.ts` (bin) render them into the shim; parking the\n// constants in either of those two would make the other one a core↔bin import cycle. It also keeps the\n// shim renderer dependency-light, which it must be: it has to work on a tree too broken to load the\n// rule engine.\n// ---------------------------------------------------------------------------\n\n/** `D` — version drift: the root package.json pin != the installed version. Decided in `sh`. */\nexport const L0_FAULT_DRIFT = 'D';\n\n/** `X` — the guard bin is missing (fresh clone, new worktree, package removed). Decided in `sh`. */\nexport const L0_FAULT_BIN_MISSING = 'X';\n\n/** `U` — the bin is missing AND nothing declares the package, so an install is a no-op. `sh`. */\nexport const L0_FAULT_UNDECLARED = 'U';\n\n/** `K` — the bin is present but CRASHED (corrupt node_modules). Decided in `sh`. */\nexport const L0_FAULT_BIN_BROKEN = 'K';\n\n/** `S` — the committed `.claude/webpieces/ai-hook.sh` != `renderShim()`. Decided in the bin, in JS. */\nexport const L0_FAULT_SHIM_STALE = 'S';\n\n/** `C` — `webpieces.config.json` is missing. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_MISSING = 'C';\n\n/** `Y` — a loaded rule has no `webpieces.config.json` key. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_OUT_OF_SYNC = 'Y';\n\n/**\n * No fault AT THIS LAYER — the value every audit line carries when nothing fired.\n *\n * Never a claim that nothing was wrong: a `fault=-` line from the `sh` shim only says the sh half found\n * nothing, and the bin it then exec'd may still have blocked on S/C/Y and stamped its own line.\n */\nexport const L0_FAULT_NONE = '-';\n\n/**\n * The faults decided in POSIX `sh`, BEFORE the bin runs — a stale, missing or broken validator cannot\n * be trusted to validate itself. In first-match-wins order.\n */\nexport const L0_SH_FAULT_CODES = [\n L0_FAULT_DRIFT, L0_FAULT_BIN_MISSING, L0_FAULT_UNDECLARED, L0_FAULT_BIN_BROKEN,\n] as const;\n\n/**\n * The faults decided INSIDE the guard bin, in JS. These reached the audit trail with no fault label at\n * all until the JS emitters started stamping them: an `S` storm that blocked an agent for ~20 tool\n * calls left two lines in the `rejections/` stream, both attributed to a downstream rule, and nothing\n * anywhere identifying L0.\n */\nexport const L0_JS_FAULT_CODES = [\n L0_FAULT_SHIM_STALE, L0_FAULT_CONFIG_MISSING, L0_FAULT_CONFIG_OUT_OF_SYNC,\n] as const;\n\n// ---------------------------------------------------------------------------\n// THE JOIN KEYS — the three artifacts that describe one L0 event, and the coordinates that line them up.\n//\n// There are three, and until now they could not be grepped together:\n// 1. THE DENY the agent reads in the moment (shim-deny-reason.ts for S; DENY_REASON_SH for D/X/U/K)\n// 2. THE AUDIT LINE (`.webpieces-logs/logs/**`), which carries `layer=` `row=` `fault=`\n// 3. THE MATRIX DOC (webpieces.guard-matrix.md, rendered from L0_FAULTS + L0_ALLOWLIST)\n//\n// The deny had NONE of them: no fault letter, no row, and — the highest-value omission — no guard NAME,\n// while every L1/L2 deny opens `[<rule-name>] (N violations)`. So a transcript could not be debugged\n// against the log after the fact, and a reader could not find the matrix row by eye.\n//\n// These constants are that vocabulary, declared HERE for the same reason the letters are: this module is\n// a LEAF with no imports, so `core/l0-matrix.ts` (the doc), `bin/shim*.ts` (the denies) and\n// `core/decision-log.ts` (the log) can all reach it without an import cycle. Retyping a name in any one\n// of them is the drift this file exists to make impossible.\n// ---------------------------------------------------------------------------\n\n/**\n * EVERY L0 fault code, as a type. The two arrays above are the halves; this is their union, and it is\n * what makes `L0_FAULT_NAMES` TOTAL — a `Record<string, …>` would have forced a `?? 'unknown'` fallback\n * at every read, which is shim shape #4 (a runtime default standing in for a type that could have\n * expressed the invariant). With the union, a new fault added without a name is a COMPILE error, and\n * neither reader needs a defensive branch.\n */\nexport type L0FaultCode = typeof L0_SH_FAULT_CODES[number] | typeof L0_JS_FAULT_CODES[number];\n\n/**\n * The stable, human-readable GUARD NAME per fault code — what goes in the deny's `[…]` header, in the\n * matrix doc's own `guard` column, and nowhere else in a second spelling.\n *\n * L1 prints `[stale-main-bash-guard] (1 violation)` and L0 printed nothing comparable; the names below\n * are deliberately in that same kebab shape so the two layers read as one system. They are IDENTITY, not\n * prose: renaming one silently breaks a grep that spans all three artifacts, exactly as renumbering an\n * L1 row would (see L1_ROWS' header).\n */\nexport const L0_FAULT_NAMES: Readonly<Record<L0FaultCode, string>> = {\n [L0_FAULT_DRIFT]: 'version-drift',\n [L0_FAULT_BIN_MISSING]: 'guard-bin-missing',\n [L0_FAULT_UNDECLARED]: 'guard-pkg-undeclared',\n [L0_FAULT_BIN_BROKEN]: 'guard-bin-crashed',\n [L0_FAULT_SHIM_STALE]: 'managed-hook-surface',\n [L0_FAULT_CONFIG_MISSING]: 'config-missing',\n [L0_FAULT_CONFIG_OUT_OF_SYNC]: 'config-out-of-sync',\n};\n\n/**\n * The LAYER token — the other half of every join key, spelled once. The deny header, the matrix\n * citation, the sh audit line and guards/L0-tooling.md all read it from here, so `grep layer=L0` cannot\n * miss an artifact that typed the token itself.\n */\nexport const L0_LAYER = 'L0';\n\n/**\n * The three rows of L0's decision matrix, by number — the numbers `renderGuardMatrixDoc` prints, the\n * numbers the audit line's `row=` carries, and the numbers a deny cites. L0's matrix has no genuine\n * second dimension: every branch reduces to `fault present?` x `on the allowlist?`.\n *\n * All three are named because all three are LOGGED: the sh half writes a line for the healthy hand-down\n * too (`PASS-BIN-ALLOW`), which is the line that tells \"the guard ran and found nothing\" apart from\n * \"the guard never ran\".\n */\nexport const L0_ROW_HANDED_DOWN = '1';\n\n/** Row 2: a fault is present but the call is on the L0 allowlist — a cure, a Read, or the config edit. */\nexport const L0_ROW_ALLOWLISTED = '2';\n\n/** Row 3: a fault is present and the call is NOT on the allowlist. The one row that ever BLOCKS. */\nexport const L0_ROW_BLOCKED = '3';\n\n/**\n * The `[guard-name] (layer=L0 fault=<code> row=<n>)` header every L0 deny opens with, after the ❌ line.\n *\n * ONE builder, called by the JS denies directly and interpolated into the POSIX-sh denies at render\n * time by renderShim() — so the sh half cannot spell the coordinates differently from the JS half even\n * though it cannot import anything at runtime. `detail` is the per-fault count that mirrors\n * formatReport's `(N violations)`.\n */\n// webpieces-disable no-function-outside-class -- pure string builder over this leaf module's own constants; it must stay importable by the dependency-free shim renderer.\nexport function l0GuardHeader(fault: L0FaultCode, detail: string): string {\n return `[${L0_FAULT_NAMES[fault]}] (layer=${L0_LAYER} fault=${fault} row=${L0_ROW_BLOCKED}, ${detail})`;\n}\n\n/**\n * The one-line citation of WHICH matrix row was taken and on what dimension values — L1's pattern\n * (its deny cites \"`w` / `n` / `n` - row 8\"), in L0's own two columns.\n */\n// webpieces-disable no-function-outside-class -- sibling of l0GuardHeader in this leaf codebook module.\nexport function l0MatrixCitation(fault: L0FaultCode): string {\n return `matrix row ${L0_ROW_BLOCKED}: fault=${fault} present / on the allowlist? no -> BLOCK. Those are the same coordinates the audit line carries (layer=${L0_LAYER} row=${L0_ROW_BLOCKED} fault=${fault}) and the same row webpieces.guard-matrix.md prints.`;\n}\n"]}
package/src/index.js CHANGED
@@ -55,12 +55,12 @@ var repo_root_1 = require("./repo-root");
55
55
  Object.defineProperty(exports, "RepoRootFinder", { enumerable: true, get: function () { return repo_root_1.RepoRootFinder; } });
56
56
  Object.defineProperty(exports, "INSTRUCT_AI_DIR", { enumerable: true, get: function () { return repo_root_1.INSTRUCT_AI_DIR; } });
57
57
  Object.defineProperty(exports, "INSTRUCT_AI_LEAF", { enumerable: true, get: function () { return repo_root_1.INSTRUCT_AI_LEAF; } });
58
- // The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two
58
+ // The scoped `.webpieces-logs` resolver. EVERY reader/writer of `.webpieces-logs/...` goes through one of its two
59
59
  // named methods so the call site declares whether the state is repo-wide or worktree-private.
60
60
  // There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the
61
61
  // `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the
62
- // gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a
63
- // webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See
62
+ // gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces-logs` path a
63
+ // webpieces tool writes is `{repo}/.webpieces-logs`, resolved through `DotWebpieces` above. See
64
64
  // `decisions/0005-the-pr-description-is-the-merge-body.md`.
65
65
  var aged_tree_sweep_1 = require("./aged-tree-sweep");
66
66
  Object.defineProperty(exports, "AgedTreeSweeper", { enumerable: true, get: function () { return aged_tree_sweep_1.AgedTreeSweeper; } });
@@ -179,11 +179,11 @@ Object.defineProperty(exports, "HOME_KEY_DOC", { enumerable: true, get: function
179
179
  Object.defineProperty(exports, "HOME_KEY_AI_DOC", { enumerable: true, get: function () { return home_config_1.HOME_KEY_AI_DOC; } });
180
180
  Object.defineProperty(exports, "DOCUMENTATION_KEYS", { enumerable: true, get: function () { return home_config_1.DOCUMENTATION_KEYS; } });
181
181
  // The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from
182
- // `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the
182
+ // `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces-logs` — the
183
183
  // argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that "how
184
184
  // many builds are burning this box's CPU" is a fact about the MACHINE, is not a cache of anything a
185
185
  // remote owns, and cannot be answered from a per-repo file because every linked worktree has its own
186
- // `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.
186
+ // `.webpieces-logs/` and would be blind to the sibling it is contending with. See builds-log.ts.
187
187
  var builds_log_1 = require("./builds-log");
188
188
  Object.defineProperty(exports, "BuildsLog", { enumerable: true, get: function () { return builds_log_1.BuildsLog; } });
189
189
  Object.defineProperty(exports, "BuildTicket", { enumerable: true, get: function () { return builds_log_1.BuildTicket; } });
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;A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OAAA;AACjB,0HAAA,oBAAoB,OAAA;AAGxB,iEAIiC;AAH7B,6HAAA,oBAAoB,OAAA;AACpB,6HAAA,oBAAoB,OAAA;AACpB,4HAAA,mBAAmB,OAAA;AAEvB,yDAK6B;AAJzB,0HAAA,qBAAqB,OAAA;AACrB,uHAAA,kBAAkB,OAAA;AAClB,0HAAA,qBAAqB,OAAA;AACrB,oHAAA,eAAe,OAAA;AAEnB,mDAAqE;AAA5D,8GAAA,YAAY,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAC1C,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,6DAA8D;AAArD,4HAAA,qBAAqB,OAAA;AAC9B,6DAK+B;AAJ3B,wHAAA,iBAAiB,OAAA;AACjB,2HAAA,oBAAoB,OAAA;AACpB,qHAAA,cAAc,OAAA;AACd,wHAAA,iBAAiB,OAAA;AAErB,+DAKgC;AAJ5B,0HAAA,kBAAkB,OAAA;AAClB,+HAAA,uBAAuB,OAAA;AACvB,mIAAA,2BAA2B,OAAA;AAC3B,gIAAA,wBAAwB,OAAA;AAG5B,uDAA8F;AAArF,kHAAA,cAAc,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,sHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope, PathScopeConfig } from './no-custom-css-scope';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport { isHookGuard, sectionForRule } from './sections';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport {\n WEBPIECES_DISABLE,\n hasDisable,\n MERGE_INFO_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\n PUSH_DEV_STATE_FILE,\n PRUNE_UNKNOWN_COMMAND,\n UPGRADE_SHIM_COMMAND,\n} from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\n\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\n\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\n\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport {\n TmpScratchSweeper,\n TMP_SCRATCH_RETENTION_DAYS,\n TMP_SCRATCH_PREFIX,\n} from './tmp-scratch-sweep';\n\nexport * from './hook-fault-codes';\nexport * from './hook-config-diagnostics';\nexport {\n RulePackRegistry,\n NodeRulePackModuleLoader,\n RulePackDiscovery,\n RulePackModuleLoader,\n} from './rule-pack-registry';\n\nexport {\n prepareLegacyUpgrade,\n LegacyConfigDocument,\n LegacyUpgradeResult,\n} from './legacy-config-upgrade';\nexport {\n PackPolicyDeclaration,\n SelectedPolicyPack,\n PackPolicyFilesResult,\n PackPolicyFiles,\n} from './pack-policy-files';\nexport { RulePackSync, RulePackSyncOptions } from './rule-pack-sync';\nexport { ConfigRepairAccess } from './config-repair-access';\nexport { ConfigRepairBootstrap } from './config-repair-probe';\nexport {\n RulePackArtifacts,\n RuleArtifactContents,\n RULE_LOCK_FILE,\n RULE_CATALOG_FILE,\n} from './rule-pack-artifacts';\nexport {\n RuleRuntimeModules,\n RuleRuntimeModuleLoader,\n NodeRuleRuntimeModuleLoader,\n RuntimeContributionGroup,\n} from './rule-runtime-modules';\n\nexport { FirstPathMatch, FirstPathMatchResult, PathMatchCandidate } from './first-path-match';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAE3C,qDAA+F;AAAtF,gHAAA,aAAa,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACnE,uGAAuG;AACvG,sFAAsF;AACtF,2CAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAAiF;AAAxE,oGAAA,QAAQ,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AAC5D,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAEhB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,iGAAiG;AACjG,sCAAsC;AACtC,6DAK+B;AAJ3B,+HAAA,wBAAwB,OAAA;AACxB,wHAAA,iBAAiB,OAAA;AACjB,yHAAA,kBAAkB,OAAA;AAClB,+HAAA,wBAAwB,OAAA;AAE5B,6CAOuB;AANnB,6GAAA,cAAc,OAAA;AACd,8GAAA,eAAe,OAAA;AACf,yGAAA,UAAU,OAAA;AACV,iHAAA,kBAAkB,OAAA;AAClB,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAE7B,sGAAsG;AACtG,yGAAyG;AACzG,6CAA8C;AAArC,4GAAA,aAAa,OAAA;AACtB,yCAAgF;AAAvE,2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A;AAC1D,yDAAwE;AAA/D,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,yDAI6B;AAHzB,sHAAA,iBAAiB,OAAA;AACjB,+HAAA,0BAA0B,OAAA;AAC1B,uHAAA,kBAAkB,OAAA;AAGtB,6DAAmC;AACnC,oEAA0C;AAC1C,2DAK8B;AAJ1B,sHAAA,gBAAgB,OAAA;AAChB,8HAAA,wBAAwB,OAAA;AACxB,uHAAA,iBAAiB,OAAA;AACjB,0HAAA,oBAAoB,OAAA;AAGxB,iEAIiC;AAH7B,6HAAA,oBAAoB,OAAA;AACpB,6HAAA,oBAAoB,OAAA;AACpB,4HAAA,mBAAmB,OAAA;AAEvB,yDAK6B;AAJzB,0HAAA,qBAAqB,OAAA;AACrB,uHAAA,kBAAkB,OAAA;AAClB,0HAAA,qBAAqB,OAAA;AACrB,oHAAA,eAAe,OAAA;AAEnB,mDAAqE;AAA5D,8GAAA,YAAY,OAAA;AAAE,qHAAA,mBAAmB,OAAA;AAC1C,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,6DAA8D;AAArD,4HAAA,qBAAqB,OAAA;AAC9B,6DAK+B;AAJ3B,wHAAA,iBAAiB,OAAA;AACjB,2HAAA,oBAAoB,OAAA;AACpB,qHAAA,cAAc,OAAA;AACd,wHAAA,iBAAiB,OAAA;AAErB,+DAKgC;AAJ5B,0HAAA,kBAAkB,OAAA;AAClB,+HAAA,uBAAuB,OAAA;AACvB,mIAAA,2BAA2B,OAAA;AAC3B,gIAAA,wBAAwB,OAAA;AAG5B,uDAA8F;AAArF,kHAAA,cAAc,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,sHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces-logs` resolver. EVERY reader/writer of `.webpieces-logs/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces-logs` path a\n// webpieces tool writes is `{repo}/.webpieces-logs`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope, PathScopeConfig } from './no-custom-css-scope';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces-logs` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces-logs/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport { isHookGuard, sectionForRule } from './sections';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport {\n WEBPIECES_DISABLE,\n hasDisable,\n MERGE_INFO_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\n PUSH_DEV_STATE_FILE,\n PRUNE_UNKNOWN_COMMAND,\n UPGRADE_SHIM_COMMAND,\n} from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\n\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\n\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\n\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport {\n TmpScratchSweeper,\n TMP_SCRATCH_RETENTION_DAYS,\n TMP_SCRATCH_PREFIX,\n} from './tmp-scratch-sweep';\n\nexport * from './hook-fault-codes';\nexport * from './hook-config-diagnostics';\nexport {\n RulePackRegistry,\n NodeRulePackModuleLoader,\n RulePackDiscovery,\n RulePackModuleLoader,\n} from './rule-pack-registry';\n\nexport {\n prepareLegacyUpgrade,\n LegacyConfigDocument,\n LegacyUpgradeResult,\n} from './legacy-config-upgrade';\nexport {\n PackPolicyDeclaration,\n SelectedPolicyPack,\n PackPolicyFilesResult,\n PackPolicyFiles,\n} from './pack-policy-files';\nexport { RulePackSync, RulePackSyncOptions } from './rule-pack-sync';\nexport { ConfigRepairAccess } from './config-repair-access';\nexport { ConfigRepairBootstrap } from './config-repair-probe';\nexport {\n RulePackArtifacts,\n RuleArtifactContents,\n RULE_LOCK_FILE,\n RULE_CATALOG_FILE,\n} from './rule-pack-artifacts';\nexport {\n RuleRuntimeModules,\n RuleRuntimeModuleLoader,\n NodeRuleRuntimeModuleLoader,\n RuntimeContributionGroup,\n} from './rule-runtime-modules';\n\nexport { FirstPathMatch, FirstPathMatchResult, PathMatchCandidate } from './first-path-match';\n"]}
@@ -13,7 +13,7 @@ export declare class InstructAiDoc {
13
13
  * written into.
14
14
  *
15
15
  * `root` is not decoration: every webpieces state path is per-tree (a linked worktree's state lives
16
- * under `<primary>/.webpieces/worktrees/<name>/`), so a doc that names one must RESOLVE it for the
16
+ * under `<primary>/.webpieces-logs/worktrees/<name>/`), so a doc that names one must RESOLVE it for the
17
17
  * tree the reader is standing in. A template that restated a relative path instead shipped a path
18
18
  * that does not exist in a worktree — see `GitWorkflowDoc`.
19
19
  */
@@ -36,12 +36,12 @@ export declare class MergeProcessDoc extends InstructAiDoc {
36
36
  render(templateText: string, root: string): string;
37
37
  seedOnly(): boolean;
38
38
  }
39
- /** The rules-config template name, and the file name it lands under in `.webpieces/instruct-ai/`. */
39
+ /** The rules-config template name, and the file name it lands under in `.webpieces-logs/instruct-ai/`. */
40
40
  export declare const GIT_WORKFLOW_DOC = "webpieces.git-workflow.md";
41
41
  /**
42
42
  * `webpieces.git-workflow.md` — the one doc that names the branch-mutation log by path.
43
43
  *
44
- * It used to restate `.webpieces/logs/branch-mutations.log` as a literal. That log is deliberately
44
+ * It used to restate `.webpieces-logs/logs/branch-mutations.log` as a literal. That log is deliberately
45
45
  * PER-WORKTREE (one appender each), so in a linked worktree the literal names a file that does not
46
46
  * exist: the reader greps nothing, and the silence reads as "no deletions were logged" — the exact
47
47
  * opposite of the truth, from the one file whose job is to prove every deletion is recoverable.
@@ -48,7 +48,7 @@ class InstructAiDoc {
48
48
  * written into.
49
49
  *
50
50
  * `root` is not decoration: every webpieces state path is per-tree (a linked worktree's state lives
51
- * under `<primary>/.webpieces/worktrees/<name>/`), so a doc that names one must RESOLVE it for the
51
+ * under `<primary>/.webpieces-logs/worktrees/<name>/`), so a doc that names one must RESOLVE it for the
52
52
  * tree the reader is standing in. A template that restated a relative path instead shipped a path
53
53
  * that does not exist in a worktree — see `GitWorkflowDoc`.
54
54
  */
@@ -85,12 +85,12 @@ class MergeProcessDoc extends InstructAiDoc {
85
85
  }
86
86
  }
87
87
  exports.MergeProcessDoc = MergeProcessDoc;
88
- /** The rules-config template name, and the file name it lands under in `.webpieces/instruct-ai/`. */
88
+ /** The rules-config template name, and the file name it lands under in `.webpieces-logs/instruct-ai/`. */
89
89
  exports.GIT_WORKFLOW_DOC = 'webpieces.git-workflow.md';
90
90
  /**
91
91
  * `webpieces.git-workflow.md` — the one doc that names the branch-mutation log by path.
92
92
  *
93
- * It used to restate `.webpieces/logs/branch-mutations.log` as a literal. That log is deliberately
93
+ * It used to restate `.webpieces-logs/logs/branch-mutations.log` as a literal. That log is deliberately
94
94
  * PER-WORKTREE (one appender each), so in a linked worktree the literal names a file that does not
95
95
  * exist: the reader greps nothing, and the silence reads as "no deletions were logged" — the exact
96
96
  * opposite of the truth, from the one file whose job is to prove every deletion is recoverable.