@neurcode-ai/cli 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/.telemetry-bundle/dist/__tests__/harvest-verify.test.d.ts +1 -0
  2. package/.telemetry-bundle/dist/__tests__/harvest-verify.test.js +86 -0
  3. package/.telemetry-bundle/dist/contracts.d.ts +58 -0
  4. package/.telemetry-bundle/dist/contracts.js +8 -0
  5. package/.telemetry-bundle/dist/harvest-verify.d.ts +9 -0
  6. package/.telemetry-bundle/dist/harvest-verify.js +128 -0
  7. package/.telemetry-bundle/dist/index.d.ts +10 -0
  8. package/.telemetry-bundle/dist/index.js +22 -0
  9. package/.telemetry-bundle/dist/precision/leaderboards.d.ts +20 -0
  10. package/.telemetry-bundle/dist/precision/leaderboards.js +72 -0
  11. package/.telemetry-bundle/dist/reader.d.ts +5 -0
  12. package/.telemetry-bundle/dist/reader.js +46 -0
  13. package/.telemetry-bundle/dist/stable-json.d.ts +5 -0
  14. package/.telemetry-bundle/dist/stable-json.js +24 -0
  15. package/.telemetry-bundle/dist/store.d.ts +10 -0
  16. package/.telemetry-bundle/dist/store.js +52 -0
  17. package/.telemetry-bundle/dist/trust-scoring.d.ts +20 -0
  18. package/.telemetry-bundle/dist/trust-scoring.js +58 -0
  19. package/.telemetry-bundle/package.json +8 -0
  20. package/README.md +74 -25
  21. package/dist/commands/remediate-export.js +1 -1
  22. package/dist/commands/replay.d.ts.map +1 -1
  23. package/dist/commands/replay.js +36 -0
  24. package/dist/commands/replay.js.map +1 -1
  25. package/dist/commands/verify-output.d.ts.map +1 -1
  26. package/dist/commands/verify-output.js +66 -4
  27. package/dist/commands/verify-output.js.map +1 -1
  28. package/dist/commands/verify.d.ts +22 -1
  29. package/dist/commands/verify.d.ts.map +1 -1
  30. package/dist/commands/verify.js +446 -34
  31. package/dist/commands/verify.js.map +1 -1
  32. package/dist/daemon/server.d.ts.map +1 -1
  33. package/dist/daemon/server.js +4 -0
  34. package/dist/daemon/server.js.map +1 -1
  35. package/dist/governance/intent/drift-detector.d.ts +100 -0
  36. package/dist/governance/intent/drift-detector.d.ts.map +1 -0
  37. package/dist/governance/intent/drift-detector.js +275 -0
  38. package/dist/governance/intent/drift-detector.js.map +1 -0
  39. package/dist/governance/intent/glob-match.d.ts +43 -0
  40. package/dist/governance/intent/glob-match.d.ts.map +1 -0
  41. package/dist/governance/intent/glob-match.js +108 -0
  42. package/dist/governance/intent/glob-match.js.map +1 -0
  43. package/dist/governance/intent/import-graph.d.ts +56 -0
  44. package/dist/governance/intent/import-graph.d.ts.map +1 -0
  45. package/dist/governance/intent/import-graph.js +133 -0
  46. package/dist/governance/intent/import-graph.js.map +1 -0
  47. package/dist/governance/intent/index.d.ts +23 -0
  48. package/dist/governance/intent/index.d.ts.map +1 -0
  49. package/dist/governance/intent/index.js +48 -0
  50. package/dist/governance/intent/index.js.map +1 -0
  51. package/dist/governance/intent/intelligence-boundaries.d.ts +69 -0
  52. package/dist/governance/intent/intelligence-boundaries.d.ts.map +1 -0
  53. package/dist/governance/intent/intelligence-boundaries.js +163 -0
  54. package/dist/governance/intent/intelligence-boundaries.js.map +1 -0
  55. package/dist/governance/intent/intent-contract.d.ts +76 -0
  56. package/dist/governance/intent/intent-contract.d.ts.map +1 -0
  57. package/dist/governance/intent/intent-contract.js +397 -0
  58. package/dist/governance/intent/intent-contract.js.map +1 -0
  59. package/dist/governance/intent/intent-graph.d.ts +135 -0
  60. package/dist/governance/intent/intent-graph.d.ts.map +1 -0
  61. package/dist/governance/intent/intent-graph.js +67 -0
  62. package/dist/governance/intent/intent-graph.js.map +1 -0
  63. package/dist/governance/pipeline/computation-trace.d.ts +52 -0
  64. package/dist/governance/pipeline/computation-trace.d.ts.map +1 -0
  65. package/dist/governance/pipeline/computation-trace.js +79 -0
  66. package/dist/governance/pipeline/computation-trace.js.map +1 -0
  67. package/dist/governance/pipeline/envelope-assembly.d.ts +132 -0
  68. package/dist/governance/pipeline/envelope-assembly.d.ts.map +1 -0
  69. package/dist/governance/pipeline/envelope-assembly.js +140 -0
  70. package/dist/governance/pipeline/envelope-assembly.js.map +1 -0
  71. package/dist/governance/pipeline/fingerprint.d.ts +34 -0
  72. package/dist/governance/pipeline/fingerprint.d.ts.map +1 -0
  73. package/dist/governance/pipeline/fingerprint.js +78 -0
  74. package/dist/governance/pipeline/fingerprint.js.map +1 -0
  75. package/dist/governance/pipeline/helpers.d.ts +74 -0
  76. package/dist/governance/pipeline/helpers.d.ts.map +1 -0
  77. package/dist/governance/pipeline/helpers.js +112 -0
  78. package/dist/governance/pipeline/helpers.js.map +1 -0
  79. package/dist/governance/pipeline/index.d.ts +27 -0
  80. package/dist/governance/pipeline/index.d.ts.map +1 -0
  81. package/dist/governance/pipeline/index.js +63 -0
  82. package/dist/governance/pipeline/index.js.map +1 -0
  83. package/dist/governance/pipeline/lineage.d.ts +26 -0
  84. package/dist/governance/pipeline/lineage.d.ts.map +1 -0
  85. package/dist/governance/pipeline/lineage.js +51 -0
  86. package/dist/governance/pipeline/lineage.js.map +1 -0
  87. package/dist/governance/pipeline/orchestration/advisory-mode-contract.d.ts +15 -0
  88. package/dist/governance/pipeline/orchestration/advisory-mode-contract.d.ts.map +1 -0
  89. package/dist/governance/pipeline/orchestration/advisory-mode-contract.js +44 -0
  90. package/dist/governance/pipeline/orchestration/advisory-mode-contract.js.map +1 -0
  91. package/dist/governance/pipeline/orchestration/advisory-mode.d.ts +102 -0
  92. package/dist/governance/pipeline/orchestration/advisory-mode.d.ts.map +1 -0
  93. package/dist/governance/pipeline/orchestration/advisory-mode.js +170 -0
  94. package/dist/governance/pipeline/orchestration/advisory-mode.js.map +1 -0
  95. package/dist/governance/pipeline/orchestration/evidence-lifecycle.d.ts +133 -0
  96. package/dist/governance/pipeline/orchestration/evidence-lifecycle.d.ts.map +1 -0
  97. package/dist/governance/pipeline/orchestration/evidence-lifecycle.js +125 -0
  98. package/dist/governance/pipeline/orchestration/evidence-lifecycle.js.map +1 -0
  99. package/dist/governance/pipeline/orchestration/index.d.ts +16 -0
  100. package/dist/governance/pipeline/orchestration/index.d.ts.map +1 -0
  101. package/dist/governance/pipeline/orchestration/index.js +30 -0
  102. package/dist/governance/pipeline/orchestration/index.js.map +1 -0
  103. package/dist/governance/pipeline/orchestration/intent-drift-orchestration.d.ts +65 -0
  104. package/dist/governance/pipeline/orchestration/intent-drift-orchestration.d.ts.map +1 -0
  105. package/dist/governance/pipeline/orchestration/intent-drift-orchestration.js +102 -0
  106. package/dist/governance/pipeline/orchestration/intent-drift-orchestration.js.map +1 -0
  107. package/dist/governance/pipeline/orchestration/plan-structural-analysis.d.ts +41 -0
  108. package/dist/governance/pipeline/orchestration/plan-structural-analysis.d.ts.map +1 -0
  109. package/dist/governance/pipeline/orchestration/plan-structural-analysis.js +74 -0
  110. package/dist/governance/pipeline/orchestration/plan-structural-analysis.js.map +1 -0
  111. package/dist/governance/pipeline/orchestration/policy-evaluation-summaries.d.ts +165 -0
  112. package/dist/governance/pipeline/orchestration/policy-evaluation-summaries.d.ts.map +1 -0
  113. package/dist/governance/pipeline/orchestration/policy-evaluation-summaries.js +160 -0
  114. package/dist/governance/pipeline/orchestration/policy-evaluation-summaries.js.map +1 -0
  115. package/dist/governance/pipeline/orchestration/scope-guard-orchestration.d.ts +152 -0
  116. package/dist/governance/pipeline/orchestration/scope-guard-orchestration.d.ts.map +1 -0
  117. package/dist/governance/pipeline/orchestration/scope-guard-orchestration.js +188 -0
  118. package/dist/governance/pipeline/orchestration/scope-guard-orchestration.js.map +1 -0
  119. package/dist/governance/pipeline/runtime.d.ts +70 -0
  120. package/dist/governance/pipeline/runtime.d.ts.map +1 -0
  121. package/dist/governance/pipeline/runtime.js +223 -0
  122. package/dist/governance/pipeline/runtime.js.map +1 -0
  123. package/dist/governance/pipeline/shared-types.d.ts +7 -0
  124. package/dist/governance/pipeline/shared-types.d.ts.map +1 -0
  125. package/dist/governance/pipeline/shared-types.js +7 -0
  126. package/dist/governance/pipeline/shared-types.js.map +1 -0
  127. package/dist/governance/pipeline/stages/compiled-policy-stage.d.ts +28 -0
  128. package/dist/governance/pipeline/stages/compiled-policy-stage.d.ts.map +1 -0
  129. package/dist/governance/pipeline/stages/compiled-policy-stage.js +53 -0
  130. package/dist/governance/pipeline/stages/compiled-policy-stage.js.map +1 -0
  131. package/dist/governance/pipeline/stages/diff-normalization-stage.d.ts +63 -0
  132. package/dist/governance/pipeline/stages/diff-normalization-stage.d.ts.map +1 -0
  133. package/dist/governance/pipeline/stages/diff-normalization-stage.js +140 -0
  134. package/dist/governance/pipeline/stages/diff-normalization-stage.js.map +1 -0
  135. package/dist/governance/pipeline/stages/governance-synthesis-stage.d.ts +53 -0
  136. package/dist/governance/pipeline/stages/governance-synthesis-stage.d.ts.map +1 -0
  137. package/dist/governance/pipeline/stages/governance-synthesis-stage.js +129 -0
  138. package/dist/governance/pipeline/stages/governance-synthesis-stage.js.map +1 -0
  139. package/dist/governance/pipeline/stages/index.d.ts +29 -0
  140. package/dist/governance/pipeline/stages/index.d.ts.map +1 -0
  141. package/dist/governance/pipeline/stages/index.js +40 -0
  142. package/dist/governance/pipeline/stages/index.js.map +1 -0
  143. package/dist/governance/pipeline/stages/policy-lock-stage.d.ts +31 -0
  144. package/dist/governance/pipeline/stages/policy-lock-stage.d.ts.map +1 -0
  145. package/dist/governance/pipeline/stages/policy-lock-stage.js +71 -0
  146. package/dist/governance/pipeline/stages/policy-lock-stage.js.map +1 -0
  147. package/dist/governance/pipeline/stages/runtime-guard-stage.d.ts +29 -0
  148. package/dist/governance/pipeline/stages/runtime-guard-stage.d.ts.map +1 -0
  149. package/dist/governance/pipeline/stages/runtime-guard-stage.js +65 -0
  150. package/dist/governance/pipeline/stages/runtime-guard-stage.js.map +1 -0
  151. package/dist/governance/pipeline/stages/structural-analysis-stage.d.ts +24 -0
  152. package/dist/governance/pipeline/stages/structural-analysis-stage.d.ts.map +1 -0
  153. package/dist/governance/pipeline/stages/structural-analysis-stage.js +58 -0
  154. package/dist/governance/pipeline/stages/structural-analysis-stage.js.map +1 -0
  155. package/dist/governance/pipeline/summary.d.ts +14 -0
  156. package/dist/governance/pipeline/summary.d.ts.map +1 -0
  157. package/dist/governance/pipeline/summary.js +50 -0
  158. package/dist/governance/pipeline/summary.js.map +1 -0
  159. package/dist/governance/pipeline/types.d.ts +69 -0
  160. package/dist/governance/pipeline/types.d.ts.map +1 -0
  161. package/dist/governance/pipeline/types.js +30 -0
  162. package/dist/governance/pipeline/types.js.map +1 -0
  163. package/dist/index.js +29 -0
  164. package/dist/index.js.map +1 -1
  165. package/dist/utils/active-engineering-context.d.ts +16 -0
  166. package/dist/utils/active-engineering-context.d.ts.map +1 -1
  167. package/dist/utils/active-engineering-context.js +302 -0
  168. package/dist/utils/active-engineering-context.js.map +1 -1
  169. package/dist/utils/import-edge-classifier.d.ts +76 -0
  170. package/dist/utils/import-edge-classifier.d.ts.map +1 -0
  171. package/dist/utils/import-edge-classifier.js +308 -0
  172. package/dist/utils/import-edge-classifier.js.map +1 -0
  173. package/dist/utils/import-edge-extractor.d.ts +52 -0
  174. package/dist/utils/import-edge-extractor.d.ts.map +1 -0
  175. package/dist/utils/import-edge-extractor.js +223 -0
  176. package/dist/utils/import-edge-extractor.js.map +1 -0
  177. package/dist/utils/import-edge-governance.d.ts +37 -0
  178. package/dist/utils/import-edge-governance.d.ts.map +1 -0
  179. package/dist/utils/import-edge-governance.js +56 -0
  180. package/dist/utils/import-edge-governance.js.map +1 -0
  181. package/dist/utils/path-boundary-classifier.d.ts +42 -0
  182. package/dist/utils/path-boundary-classifier.d.ts.map +1 -0
  183. package/dist/utils/path-boundary-classifier.js +143 -0
  184. package/dist/utils/path-boundary-classifier.js.map +1 -0
  185. package/dist/utils/replay-html-report.d.ts +29 -0
  186. package/dist/utils/replay-html-report.d.ts.map +1 -0
  187. package/dist/utils/replay-html-report.js +309 -0
  188. package/dist/utils/replay-html-report.js.map +1 -0
  189. package/package.json +6 -5
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Intent-Aware Governance — public surface.
3
+ *
4
+ * Phase 1 capabilities:
5
+ * - Declarative intent contract (`.neurcode/intent.json`) → typed IntentGraph
6
+ * - Deterministic import-graph extraction from a diff
7
+ * - Deterministic architectural drift detection (layer rules)
8
+ * - Explicit intelligence-boundary classification
9
+ *
10
+ * What this module is NOT:
11
+ * - A graph database
12
+ * - An AI-driven architecture inferrer
13
+ * - A replacement for change-contract or the intent-engine (NL coverage)
14
+ *
15
+ * See individual modules for the principles each surface adheres to.
16
+ */
17
+ export { EMPTY_INTENT_GRAPH, INTENT_GRAPH_SCHEMA_VERSION, isEmptyIntentGraph, intentGraphHasEnforcement, type IntentEdge, type IntentGraph, type IntentLayer, type IntentModule, type IntentTrustBoundary, } from './intent-graph';
18
+ export { INTENT_CONTRACT_FILENAME, INTENT_CONTRACT_RELATIVE_PATH, buildIntentGraphFromRaw, loadIntentContract, resolveIntentContractPath, type IntentContractLoadResult, } from './intent-contract';
19
+ export { compileGlob, firstMatchingGlob, matchesAnyGlob, matchesGlob, normalizePathForGlob, } from './glob-match';
20
+ export { extractImportEdgesFromDiff, groupImportEdgesByFile, type ImportEdge, } from './import-graph';
21
+ export { intentGraphIsEnforceable, runDriftDetection, type ClassifiedFile, type DriftDetectorInput, type DriftReport, type DriftViolation, } from './drift-detector';
22
+ export { activeIntelligenceClasses, getIntelligenceClassificationMap, hasNonDeterministicSurface, PHASE_1_SURFACES, type IntelligenceClass, type IntelligenceSurface, } from './intelligence-boundaries';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/governance/intent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,0BAA0B,EAC1B,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Intent-Aware Governance — public surface.
4
+ *
5
+ * Phase 1 capabilities:
6
+ * - Declarative intent contract (`.neurcode/intent.json`) → typed IntentGraph
7
+ * - Deterministic import-graph extraction from a diff
8
+ * - Deterministic architectural drift detection (layer rules)
9
+ * - Explicit intelligence-boundary classification
10
+ *
11
+ * What this module is NOT:
12
+ * - A graph database
13
+ * - An AI-driven architecture inferrer
14
+ * - A replacement for change-contract or the intent-engine (NL coverage)
15
+ *
16
+ * See individual modules for the principles each surface adheres to.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.PHASE_1_SURFACES = exports.hasNonDeterministicSurface = exports.getIntelligenceClassificationMap = exports.activeIntelligenceClasses = exports.runDriftDetection = exports.intentGraphIsEnforceable = exports.groupImportEdgesByFile = exports.extractImportEdgesFromDiff = exports.normalizePathForGlob = exports.matchesGlob = exports.matchesAnyGlob = exports.firstMatchingGlob = exports.compileGlob = exports.resolveIntentContractPath = exports.loadIntentContract = exports.buildIntentGraphFromRaw = exports.INTENT_CONTRACT_RELATIVE_PATH = exports.INTENT_CONTRACT_FILENAME = exports.intentGraphHasEnforcement = exports.isEmptyIntentGraph = exports.INTENT_GRAPH_SCHEMA_VERSION = exports.EMPTY_INTENT_GRAPH = void 0;
20
+ var intent_graph_1 = require("./intent-graph");
21
+ Object.defineProperty(exports, "EMPTY_INTENT_GRAPH", { enumerable: true, get: function () { return intent_graph_1.EMPTY_INTENT_GRAPH; } });
22
+ Object.defineProperty(exports, "INTENT_GRAPH_SCHEMA_VERSION", { enumerable: true, get: function () { return intent_graph_1.INTENT_GRAPH_SCHEMA_VERSION; } });
23
+ Object.defineProperty(exports, "isEmptyIntentGraph", { enumerable: true, get: function () { return intent_graph_1.isEmptyIntentGraph; } });
24
+ Object.defineProperty(exports, "intentGraphHasEnforcement", { enumerable: true, get: function () { return intent_graph_1.intentGraphHasEnforcement; } });
25
+ var intent_contract_1 = require("./intent-contract");
26
+ Object.defineProperty(exports, "INTENT_CONTRACT_FILENAME", { enumerable: true, get: function () { return intent_contract_1.INTENT_CONTRACT_FILENAME; } });
27
+ Object.defineProperty(exports, "INTENT_CONTRACT_RELATIVE_PATH", { enumerable: true, get: function () { return intent_contract_1.INTENT_CONTRACT_RELATIVE_PATH; } });
28
+ Object.defineProperty(exports, "buildIntentGraphFromRaw", { enumerable: true, get: function () { return intent_contract_1.buildIntentGraphFromRaw; } });
29
+ Object.defineProperty(exports, "loadIntentContract", { enumerable: true, get: function () { return intent_contract_1.loadIntentContract; } });
30
+ Object.defineProperty(exports, "resolveIntentContractPath", { enumerable: true, get: function () { return intent_contract_1.resolveIntentContractPath; } });
31
+ var glob_match_1 = require("./glob-match");
32
+ Object.defineProperty(exports, "compileGlob", { enumerable: true, get: function () { return glob_match_1.compileGlob; } });
33
+ Object.defineProperty(exports, "firstMatchingGlob", { enumerable: true, get: function () { return glob_match_1.firstMatchingGlob; } });
34
+ Object.defineProperty(exports, "matchesAnyGlob", { enumerable: true, get: function () { return glob_match_1.matchesAnyGlob; } });
35
+ Object.defineProperty(exports, "matchesGlob", { enumerable: true, get: function () { return glob_match_1.matchesGlob; } });
36
+ Object.defineProperty(exports, "normalizePathForGlob", { enumerable: true, get: function () { return glob_match_1.normalizePathForGlob; } });
37
+ var import_graph_1 = require("./import-graph");
38
+ Object.defineProperty(exports, "extractImportEdgesFromDiff", { enumerable: true, get: function () { return import_graph_1.extractImportEdgesFromDiff; } });
39
+ Object.defineProperty(exports, "groupImportEdgesByFile", { enumerable: true, get: function () { return import_graph_1.groupImportEdgesByFile; } });
40
+ var drift_detector_1 = require("./drift-detector");
41
+ Object.defineProperty(exports, "intentGraphIsEnforceable", { enumerable: true, get: function () { return drift_detector_1.intentGraphIsEnforceable; } });
42
+ Object.defineProperty(exports, "runDriftDetection", { enumerable: true, get: function () { return drift_detector_1.runDriftDetection; } });
43
+ var intelligence_boundaries_1 = require("./intelligence-boundaries");
44
+ Object.defineProperty(exports, "activeIntelligenceClasses", { enumerable: true, get: function () { return intelligence_boundaries_1.activeIntelligenceClasses; } });
45
+ Object.defineProperty(exports, "getIntelligenceClassificationMap", { enumerable: true, get: function () { return intelligence_boundaries_1.getIntelligenceClassificationMap; } });
46
+ Object.defineProperty(exports, "hasNonDeterministicSurface", { enumerable: true, get: function () { return intelligence_boundaries_1.hasNonDeterministicSurface; } });
47
+ Object.defineProperty(exports, "PHASE_1_SURFACES", { enumerable: true, get: function () { return intelligence_boundaries_1.PHASE_1_SURFACES; } });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/governance/intent/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,+CAUwB;AATtB,kHAAA,kBAAkB,OAAA;AAClB,2HAAA,2BAA2B,OAAA;AAC3B,kHAAA,kBAAkB,OAAA;AAClB,yHAAA,yBAAyB,OAAA;AAQ3B,qDAO2B;AANzB,2HAAA,wBAAwB,OAAA;AACxB,gIAAA,6BAA6B,OAAA;AAC7B,0HAAA,uBAAuB,OAAA;AACvB,qHAAA,kBAAkB,OAAA;AAClB,4HAAA,yBAAyB,OAAA;AAI3B,2CAMsB;AALpB,yGAAA,WAAW,OAAA;AACX,+GAAA,iBAAiB,OAAA;AACjB,4GAAA,cAAc,OAAA;AACd,yGAAA,WAAW,OAAA;AACX,kHAAA,oBAAoB,OAAA;AAGtB,+CAIwB;AAHtB,0HAAA,0BAA0B,OAAA;AAC1B,sHAAA,sBAAsB,OAAA;AAIxB,mDAO0B;AANxB,0HAAA,wBAAwB,OAAA;AACxB,mHAAA,iBAAiB,OAAA;AAOnB,qEAOmC;AANjC,oIAAA,yBAAyB,OAAA;AACzB,2IAAA,gCAAgC,OAAA;AAChC,qIAAA,0BAA0B,OAAA;AAC1B,2HAAA,gBAAgB,OAAA"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Intelligence Boundaries — explicit classification of every governance-intelligence
3
+ * surface in the intent module.
4
+ *
5
+ * NEURCODE'S NON-NEGOTIABLE PRINCIPLE:
6
+ *
7
+ * Governance findings must be **explainable**, **deterministic-first**, and
8
+ * **bounded**. A finding's source must be inspectable. AI augmentation, when
9
+ * it exists, must be optional, advisory, and clearly labelled. Opaque AI
10
+ * governance theater is BANNED.
11
+ *
12
+ * This file enumerates every function/surface in `governance/intent/*` and
13
+ * assigns one of four classifications:
14
+ *
15
+ * - `deterministic` : Same input → same output, no randomness, no I/O,
16
+ * no probabilistic models. Findings are direct
17
+ * consequences of declared rules.
18
+ *
19
+ * - `heuristic` : Pattern-based reasoning with bounded confidence.
20
+ * May have false positives/negatives. Used for
21
+ * fallback classification, never for blocking decisions.
22
+ *
23
+ * - `ai_augmented` : Uses an LLM or external model. Output is advisory-only.
24
+ * Must include the model output AND the deterministic
25
+ * findings side-by-side so reviewers can compare.
26
+ *
27
+ * - `banned` : Forbidden patterns. Used as a guard against accidental
28
+ * introduction of opaque AI paths.
29
+ *
30
+ * Phase 1 INVARIANT: Every surface in the intent module is `deterministic` or
31
+ * `banned`. There are NO heuristic or AI-augmented surfaces yet. Future phases
32
+ * may introduce them, but only with explicit board-review and a corresponding
33
+ * entry here.
34
+ *
35
+ * Testing: `intent-governance.test.ts` enforces that the classification map is
36
+ * complete and contains no AI-augmented entries in Phase 1.
37
+ */
38
+ export type IntelligenceClass = 'deterministic' | 'heuristic' | 'ai_augmented' | 'banned';
39
+ export interface IntelligenceSurface {
40
+ /** Module path + exported symbol, e.g. `governance/intent/drift-detector#runDriftDetection`. */
41
+ surface: string;
42
+ classification: IntelligenceClass;
43
+ /** Brief justification, shown in audit reports. */
44
+ rationale: string;
45
+ }
46
+ /**
47
+ * The canonical Phase 1 classification map. This is the SOURCE OF TRUTH for
48
+ * how every intent-module surface is classified. Tests assert that:
49
+ * - No surface is `ai_augmented` in Phase 1.
50
+ * - Every public export of the intent module appears here.
51
+ * - No `banned` patterns are reachable from the public API.
52
+ */
53
+ export declare const PHASE_1_SURFACES: IntelligenceSurface[];
54
+ /**
55
+ * Returns the classification map. Use this in audit/replay payloads to record
56
+ * which intelligence classes were active for this verify run.
57
+ */
58
+ export declare function getIntelligenceClassificationMap(): IntelligenceSurface[];
59
+ /**
60
+ * Returns the unique set of classifications present in the map.
61
+ * Useful for assertions like "this build has no AI-augmented surfaces".
62
+ */
63
+ export declare function activeIntelligenceClasses(): IntelligenceClass[];
64
+ /**
65
+ * Returns true if any surface is classified as `ai_augmented` or `heuristic`.
66
+ * In Phase 1 this MUST return false. The CI test asserts this invariant.
67
+ */
68
+ export declare function hasNonDeterministicSurface(): boolean;
69
+ //# sourceMappingURL=intelligence-boundaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence-boundaries.d.ts","sourceRoot":"","sources":["../../../src/governance/intent/intelligence-boundaries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAIH,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,WAAW,GACX,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,WAAW,mBAAmB;IAClC,gGAAgG;IAChG,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,iBAAiB,CAAC;IAClC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;CACnB;AAID;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,mBAAmB,EAsFjD,CAAC;AAIF;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,mBAAmB,EAAE,CAGxE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,iBAAiB,EAAE,CAI/D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAOpD"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ /**
3
+ * Intelligence Boundaries — explicit classification of every governance-intelligence
4
+ * surface in the intent module.
5
+ *
6
+ * NEURCODE'S NON-NEGOTIABLE PRINCIPLE:
7
+ *
8
+ * Governance findings must be **explainable**, **deterministic-first**, and
9
+ * **bounded**. A finding's source must be inspectable. AI augmentation, when
10
+ * it exists, must be optional, advisory, and clearly labelled. Opaque AI
11
+ * governance theater is BANNED.
12
+ *
13
+ * This file enumerates every function/surface in `governance/intent/*` and
14
+ * assigns one of four classifications:
15
+ *
16
+ * - `deterministic` : Same input → same output, no randomness, no I/O,
17
+ * no probabilistic models. Findings are direct
18
+ * consequences of declared rules.
19
+ *
20
+ * - `heuristic` : Pattern-based reasoning with bounded confidence.
21
+ * May have false positives/negatives. Used for
22
+ * fallback classification, never for blocking decisions.
23
+ *
24
+ * - `ai_augmented` : Uses an LLM or external model. Output is advisory-only.
25
+ * Must include the model output AND the deterministic
26
+ * findings side-by-side so reviewers can compare.
27
+ *
28
+ * - `banned` : Forbidden patterns. Used as a guard against accidental
29
+ * introduction of opaque AI paths.
30
+ *
31
+ * Phase 1 INVARIANT: Every surface in the intent module is `deterministic` or
32
+ * `banned`. There are NO heuristic or AI-augmented surfaces yet. Future phases
33
+ * may introduce them, but only with explicit board-review and a corresponding
34
+ * entry here.
35
+ *
36
+ * Testing: `intent-governance.test.ts` enforces that the classification map is
37
+ * complete and contains no AI-augmented entries in Phase 1.
38
+ */
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.PHASE_1_SURFACES = void 0;
41
+ exports.getIntelligenceClassificationMap = getIntelligenceClassificationMap;
42
+ exports.activeIntelligenceClasses = activeIntelligenceClasses;
43
+ exports.hasNonDeterministicSurface = hasNonDeterministicSurface;
44
+ // ── Phase 1 surface map ──────────────────────────────────────────────────────
45
+ /**
46
+ * The canonical Phase 1 classification map. This is the SOURCE OF TRUTH for
47
+ * how every intent-module surface is classified. Tests assert that:
48
+ * - No surface is `ai_augmented` in Phase 1.
49
+ * - Every public export of the intent module appears here.
50
+ * - No `banned` patterns are reachable from the public API.
51
+ */
52
+ exports.PHASE_1_SURFACES = [
53
+ // intent-graph.ts
54
+ {
55
+ surface: 'governance/intent/intent-graph#IntentGraph',
56
+ classification: 'deterministic',
57
+ rationale: 'Pure TypeScript type. Carries no runtime behaviour.',
58
+ },
59
+ {
60
+ surface: 'governance/intent/intent-graph#isEmptyIntentGraph',
61
+ classification: 'deterministic',
62
+ rationale: 'Pure predicate over graph shape.',
63
+ },
64
+ {
65
+ surface: 'governance/intent/intent-graph#intentGraphHasEnforcement',
66
+ classification: 'deterministic',
67
+ rationale: 'Pure predicate over graph shape.',
68
+ },
69
+ // intent-contract.ts
70
+ {
71
+ surface: 'governance/intent/intent-contract#loadIntentContract',
72
+ classification: 'deterministic',
73
+ rationale: 'Reads a JSON file from disk. Same file bytes → same graph. ' +
74
+ 'No network, no clock, no randomness. Filesystem read is the only I/O.',
75
+ },
76
+ {
77
+ surface: 'governance/intent/intent-contract#buildIntentGraphFromRaw',
78
+ classification: 'deterministic',
79
+ rationale: 'Pure parser/validator. No I/O.',
80
+ },
81
+ {
82
+ surface: 'governance/intent/intent-contract#resolveIntentContractPath',
83
+ classification: 'deterministic',
84
+ rationale: 'Path arithmetic only.',
85
+ },
86
+ // glob-match.ts
87
+ {
88
+ surface: 'governance/intent/glob-match#compileGlob',
89
+ classification: 'deterministic',
90
+ rationale: 'Pure pattern compilation to RegExp.',
91
+ },
92
+ {
93
+ surface: 'governance/intent/glob-match#matchesGlob',
94
+ classification: 'deterministic',
95
+ rationale: 'Pure regex test.',
96
+ },
97
+ {
98
+ surface: 'governance/intent/glob-match#matchesAnyGlob',
99
+ classification: 'deterministic',
100
+ rationale: 'Pure regex test over an array.',
101
+ },
102
+ {
103
+ surface: 'governance/intent/glob-match#firstMatchingGlob',
104
+ classification: 'deterministic',
105
+ rationale: 'Pure regex test; returns first matching pattern.',
106
+ },
107
+ // import-graph.ts
108
+ {
109
+ surface: 'governance/intent/import-graph#extractImportEdgesFromDiff',
110
+ classification: 'deterministic',
111
+ rationale: 'Regex-based extraction from the added lines of a parsed diff. Output is a ' +
112
+ 'pure function of the input diff. No project-level AST, no filesystem access.',
113
+ },
114
+ {
115
+ surface: 'governance/intent/import-graph#groupImportEdgesByFile',
116
+ classification: 'deterministic',
117
+ rationale: 'Pure grouping of edges by `fromFile`.',
118
+ },
119
+ // drift-detector.ts
120
+ {
121
+ surface: 'governance/intent/drift-detector#runDriftDetection',
122
+ classification: 'deterministic',
123
+ rationale: 'Pure function of (graph, diffFiles). Same inputs → same DriftReport, ' +
124
+ 'including identical violation ordering (sorted by file/line/specifier).',
125
+ },
126
+ {
127
+ surface: 'governance/intent/drift-detector#intentGraphIsEnforceable',
128
+ classification: 'deterministic',
129
+ rationale: 'Pure predicate.',
130
+ },
131
+ ];
132
+ // ── Public predicates ────────────────────────────────────────────────────────
133
+ /**
134
+ * Returns the classification map. Use this in audit/replay payloads to record
135
+ * which intelligence classes were active for this verify run.
136
+ */
137
+ function getIntelligenceClassificationMap() {
138
+ // Return a shallow copy so callers cannot mutate the canonical map.
139
+ return exports.PHASE_1_SURFACES.slice();
140
+ }
141
+ /**
142
+ * Returns the unique set of classifications present in the map.
143
+ * Useful for assertions like "this build has no AI-augmented surfaces".
144
+ */
145
+ function activeIntelligenceClasses() {
146
+ const set = new Set();
147
+ for (const s of exports.PHASE_1_SURFACES)
148
+ set.add(s.classification);
149
+ return [...set].sort();
150
+ }
151
+ /**
152
+ * Returns true if any surface is classified as `ai_augmented` or `heuristic`.
153
+ * In Phase 1 this MUST return false. The CI test asserts this invariant.
154
+ */
155
+ function hasNonDeterministicSurface() {
156
+ for (const s of exports.PHASE_1_SURFACES) {
157
+ if (s.classification === 'ai_augmented' || s.classification === 'heuristic') {
158
+ return true;
159
+ }
160
+ }
161
+ return false;
162
+ }
163
+ //# sourceMappingURL=intelligence-boundaries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence-boundaries.js","sourceRoot":"","sources":["../../../src/governance/intent/intelligence-boundaries.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAyHH,4EAGC;AAMD,8DAIC;AAMD,gEAOC;AAjID,gFAAgF;AAEhF;;;;;;GAMG;AACU,QAAA,gBAAgB,GAA0B;IACrD,kBAAkB;IAClB;QACE,OAAO,EAAE,4CAA4C;QACrD,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,qDAAqD;KACjE;IACD;QACE,OAAO,EAAE,mDAAmD;QAC5D,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,kCAAkC;KAC9C;IACD;QACE,OAAO,EAAE,0DAA0D;QACnE,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,kCAAkC;KAC9C;IAED,qBAAqB;IACrB;QACE,OAAO,EAAE,sDAAsD;QAC/D,cAAc,EAAE,eAAe;QAC/B,SAAS,EACP,6DAA6D;YAC7D,uEAAuE;KAC1E;IACD;QACE,OAAO,EAAE,2DAA2D;QACpE,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,gCAAgC;KAC5C;IACD;QACE,OAAO,EAAE,6DAA6D;QACtE,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,uBAAuB;KACnC;IAED,gBAAgB;IAChB;QACE,OAAO,EAAE,0CAA0C;QACnD,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,qCAAqC;KACjD;IACD;QACE,OAAO,EAAE,0CAA0C;QACnD,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,kBAAkB;KAC9B;IACD;QACE,OAAO,EAAE,6CAA6C;QACtD,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,gCAAgC;KAC5C;IACD;QACE,OAAO,EAAE,gDAAgD;QACzD,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,kDAAkD;KAC9D;IAED,kBAAkB;IAClB;QACE,OAAO,EAAE,2DAA2D;QACpE,cAAc,EAAE,eAAe;QAC/B,SAAS,EACP,4EAA4E;YAC5E,8EAA8E;KACjF;IACD;QACE,OAAO,EAAE,uDAAuD;QAChE,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,uCAAuC;KACnD;IAED,oBAAoB;IACpB;QACE,OAAO,EAAE,oDAAoD;QAC7D,cAAc,EAAE,eAAe;QAC/B,SAAS,EACP,uEAAuE;YACvE,yEAAyE;KAC5E;IACD;QACE,OAAO,EAAE,2DAA2D;QACpE,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,iBAAiB;KAC7B;CACF,CAAC;AAEF,gFAAgF;AAEhF;;;GAGG;AACH,SAAgB,gCAAgC;IAC9C,oEAAoE;IACpE,OAAO,wBAAgB,CAAC,KAAK,EAAE,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,SAAgB,yBAAyB;IACvC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAqB,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,wBAAgB;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B;IACxC,KAAK,MAAM,CAAC,IAAI,wBAAgB,EAAE,CAAC;QACjC,IAAI,CAAC,CAAC,cAAc,KAAK,cAAc,IAAI,CAAC,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;YAC5E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Intent Contract — declarative architectural intent.
3
+ *
4
+ * Canonical path: `.neurcode/intent.json` (project-relative).
5
+ *
6
+ * The contract is the *human-authored* form. The loader validates it and
7
+ * converts it into a typed `IntentGraph` for the drift engine.
8
+ *
9
+ * Canonical form is JSON for two reasons:
10
+ * 1. Replay determinism — JSON parsing is locale-free and YAML has historical
11
+ * ambiguities ("yes" → bool, leading zeros, multiline). The contract is a
12
+ * replay-relevant artifact, so we lock it to JSON.
13
+ * 2. Zero extra dependencies — adding a YAML parser to the CLI is unjustified
14
+ * for a configuration file the team writes once.
15
+ *
16
+ * Contract example:
17
+ *
18
+ * {
19
+ * "schemaVersion": 1,
20
+ * "layers": [
21
+ * { "id": "controller", "glob": ["src/commands/**", "src/handlers/**"] },
22
+ * { "id": "service", "glob": ["src/services/**"] },
23
+ * { "id": "persistence","glob": ["src/repositories/**", "src/db/**"] }
24
+ * ],
25
+ * "allowedEdges": [
26
+ * { "from": "controller", "to": "service" },
27
+ * { "from": "service", "to": "persistence" }
28
+ * ],
29
+ * "forbiddenEdges": [
30
+ * { "from": "controller", "to": "persistence",
31
+ * "reason": "Controllers must access data via service layer" }
32
+ * ]
33
+ * }
34
+ *
35
+ * Intelligence classification: DETERMINISTIC.
36
+ */
37
+ import { type IntentGraph } from './intent-graph';
38
+ export declare const INTENT_CONTRACT_FILENAME = "intent.json";
39
+ export declare const INTENT_CONTRACT_RELATIVE_PATH = ".neurcode/intent.json";
40
+ export interface IntentContractLoadResult {
41
+ /** Absolute path the loader probed. */
42
+ path: string;
43
+ /** True if a contract file exists at `path`. */
44
+ exists: boolean;
45
+ /** Parsed graph, or `EMPTY_INTENT_GRAPH` when absent / invalid. */
46
+ graph: IntentGraph;
47
+ /** Validation errors encountered while loading. Empty array on success. */
48
+ errors: string[];
49
+ /** Soft warnings — e.g. unknown fields, zero-glob layer. */
50
+ warnings: string[];
51
+ }
52
+ /**
53
+ * Resolve the canonical contract path for a project. Does not check existence.
54
+ */
55
+ export declare function resolveIntentContractPath(projectRoot: string, override?: string): string;
56
+ /**
57
+ * Load and validate the intent contract for a project.
58
+ *
59
+ * Behaviour:
60
+ * - If the file does not exist → `exists: false`, graph is empty, no errors.
61
+ * - If the file is malformed JSON → `exists: true`, graph is empty, `errors`
62
+ * contains the parser error.
63
+ * - If the schema is wrong → `exists: true`, graph is empty, `errors` lists
64
+ * every validation failure.
65
+ * - On success → `exists: true`, graph is populated, errors is empty.
66
+ *
67
+ * The loader never throws. Drift detection is opt-in; an unparseable contract
68
+ * must not break verification.
69
+ */
70
+ export declare function loadIntentContract(projectRoot: string, override?: string): IntentContractLoadResult;
71
+ /**
72
+ * Parse + validate a raw contract value (already-parsed JSON) and build the graph.
73
+ * Exposed for tests so we don't need to touch the filesystem.
74
+ */
75
+ export declare function buildIntentGraphFromRaw(raw: unknown): IntentContractLoadResult;
76
+ //# sourceMappingURL=intent-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-contract.d.ts","sourceRoot":"","sources":["../../../src/governance/intent/intent-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,EAIL,KAAK,WAAW,EAIjB,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,6BAA6B,0BAA0C,CAAC;AAIrF,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,KAAK,EAAE,WAAW,CAAC;IACnB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAID;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAKxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,wBAAwB,CA0C1B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,wBAAwB,CAE9E"}