arkgate 3.7.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +113 -1145
  2. package/README.md +59 -19
  3. package/bin/ark-check-runtime.mjs +1598 -0
  4. package/bin/ark-check.mjs +32 -1565
  5. package/bin/ark-layer-match.mjs +9 -4
  6. package/bin/ark-mcp-runtime.mjs +1976 -0
  7. package/bin/ark-mcp.mjs +84 -1495
  8. package/bin/ark-shared.mjs +34 -38
  9. package/bin/ark.mjs +33 -66
  10. package/bin/lib/adapter-contract.mjs +161 -9
  11. package/bin/lib/agent-gates.mjs +1 -0
  12. package/bin/lib/analysis-completeness.mjs +28 -0
  13. package/bin/lib/analysis-engine.mjs +8 -8
  14. package/bin/lib/analysis-policy.mjs +27 -0
  15. package/bin/lib/architecture-scan.mjs +70 -357
  16. package/bin/lib/auto-patch.mjs +76 -8
  17. package/bin/lib/ci-and-commands.mjs +1 -1
  18. package/bin/lib/codex-home.mjs +43 -16
  19. package/bin/lib/design-delta.mjs +4 -0
  20. package/bin/lib/doctor-advisories.mjs +4 -3
  21. package/bin/lib/doctor-plan.mjs +40 -41
  22. package/bin/lib/enforcement-state.mjs +2 -0
  23. package/bin/lib/github-enforcement.mjs +443 -0
  24. package/bin/lib/hook-templates.mjs +12 -148
  25. package/bin/lib/html-report-advisories.mjs +1 -1
  26. package/bin/lib/html-report-depth.mjs +9 -0
  27. package/bin/lib/html-report.mjs +5 -5
  28. package/bin/lib/install-migrate.mjs +83 -79
  29. package/bin/lib/managed-upgrade.mjs +622 -0
  30. package/bin/lib/mcp-adoption.mjs +3 -1
  31. package/bin/lib/parse-health.mjs +6 -5
  32. package/bin/lib/port-proof.mjs +2 -2
  33. package/bin/lib/prepare-change.mjs +68 -38
  34. package/bin/lib/prepare-write.mjs +7 -1
  35. package/bin/lib/resident-doctor-client.mjs +55 -0
  36. package/bin/lib/resident-hook.mjs +247 -0
  37. package/bin/lib/resolved-candidate-facts.mjs +1160 -0
  38. package/bin/lib/scan-files.mjs +19 -6
  39. package/bin/lib/snippet-analysis.mjs +119 -0
  40. package/bin/lib/source-policy.mjs +24 -0
  41. package/bin/lib/typescript-host.mjs +15 -18
  42. package/bin/lib/unavailable-analysis.mjs +76 -0
  43. package/bin/lib/upgrade-command.mjs +115 -0
  44. package/bin/lib/weakest-link.mjs +21 -179
  45. package/bin/lib/write-path-capabilities.mjs +167 -16
  46. package/bin/lib/write-path-detect.mjs +3 -2
  47. package/dist/eslint/index.cjs +3 -3
  48. package/dist/eslint/index.d.ts +4 -1
  49. package/dist/eslint/index.js +3 -3
  50. package/dist/index.cjs +6 -6
  51. package/dist/index.d.ts +1111 -151
  52. package/dist/index.js +7 -7
  53. package/docs/agent-guide.md +106 -62
  54. package/docs/ai-gates.md +97 -16
  55. package/docs/configuration.md +3 -0
  56. package/docs/demos/01-write-gate-self-correction.md +2 -2
  57. package/docs/enthusiast/README.md +10 -10
  58. package/docs/enthusiast/how-to-gallery-starter.md +2 -2
  59. package/docs/enthusiast/reference-commands.md +18 -1
  60. package/docs/enthusiast/tutorial-first-project.md +2 -2
  61. package/docs/package-surface.md +98 -12
  62. package/docs/typescript-support.md +108 -37
  63. package/package.json +32 -4
  64. package/schemas/ark.analysis-result.schema.json +159 -2
  65. package/schemas/ark.design-delta.schema.json +1 -0
  66. package/schemas/ark.enforcement-state.schema.json +84 -0
  67. package/schemas/ark.resolved-candidate-facts.schema.json +1 -0
  68. package/server.json +2 -2
  69. package/templates/skills/ark-explore.md +5 -5
  70. package/templates/skills/ark-fix.md +1 -1
  71. package/templates/skills/ark-runtime.md +15 -8
  72. package/templates/skills/ark-upgrade.md +122 -182
  73. package/bin/lib/ai-velocity.mjs +0 -293
  74. package/bin/lib/graph-cycles.mjs +0 -6
  75. package/bin/lib/safety-diagnostics.mjs +0 -284
  76. package/bin/lib/ts-resolve.mjs +0 -228
  77. package/dist/configTypes-DAPvBqK6.d.cts +0 -61
  78. package/dist/eslint/index.d.cts +0 -146
  79. package/dist/index.d.cts +0 -986
@@ -191,7 +191,9 @@ function resolveSliceFolders(rule, layerName, layers) {
191
191
  * Same-layer is always allowed (historical short-circuit).
192
192
  * - `peerIsolation: true` + `allowed: false`: deny only when importer and importee
193
193
  * resolve to **different** slice ids (same or cross layer). Same-slice → allow.
194
- * Missing paths or unclassifiable slices → fail-open (do not deny).
194
+ * Missing paths, no slice folders, or unclassifiable slices → **fail-closed**
195
+ * (deny): isolation is configured, so insufficient evidence must not silently
196
+ * allow a possible cross-slice edge.
195
197
  */
196
198
  export function findDeniedEdgeRule(rules, from, to, options) {
197
199
  for (const rule of rules ?? []) {
@@ -202,15 +204,18 @@ export function findDeniedEdgeRule(rules, from, to, options) {
202
204
  if (rule.peerIsolation) {
203
205
  const fromPath = options?.fromPath;
204
206
  const toPath = options?.toPath;
207
+ // Isolation is active: without both paths we cannot prove same-slice.
205
208
  if (!fromPath || !toPath)
206
- continue;
209
+ return rule;
207
210
  const folders = resolveSliceFolders(rule, from, options?.layers);
211
+ // Configured isolation without classifiable folders cannot allow.
208
212
  if (folders.length === 0)
209
- continue;
213
+ return rule;
210
214
  const fromSlice = sliceIdForPath(fromPath, folders);
211
215
  const toSlice = sliceIdForPath(toPath, folders);
216
+ // Unclassifiable either side: cannot prove same-slice → deny.
212
217
  if (!fromSlice || !toSlice)
213
- continue;
218
+ return rule;
214
219
  if (fromSlice !== toSlice)
215
220
  return rule;
216
221
  continue; // same slice: this peerIsolation rule does not deny