arkgate 4.8.6 → 4.8.8

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 (45) hide show
  1. package/CHANGELOG.md +55 -4
  2. package/README.md +37 -4
  3. package/bin/ark-dashboard.mjs +423 -0
  4. package/bin/ark-mcp-runtime.mjs +8 -2
  5. package/bin/ark.mjs +51 -3
  6. package/bin/lib/analysis-engine.mjs +5 -5
  7. package/bin/lib/doctor-human.mjs +9 -0
  8. package/bin/lib/doctor-plan.mjs +5 -1
  9. package/bin/lib/html-report.mjs +4 -2
  10. package/bin/lib/layer-description.mjs +27 -0
  11. package/bin/lib/prepare-write.mjs +7 -1
  12. package/dist/{configTypes-dy5PfTqS.d.ts → configTypes-0eHpocR3.d.ts} +4 -0
  13. package/dist/{diagnosticCatalog-D_DI7qrZ.d.ts → diagnosticCatalog-DxKCTBbp.d.ts} +3 -3
  14. package/dist/eslint/index.d.ts +1 -1
  15. package/dist/index.cjs +19 -19
  16. package/dist/index.d.ts +5 -4
  17. package/dist/index.js +20 -20
  18. package/dist/nestjs/index.cjs +5 -5
  19. package/dist/nestjs/index.d.ts +3 -3
  20. package/dist/nestjs/index.js +5 -5
  21. package/dist/runtime/index.cjs +15 -15
  22. package/dist/runtime/index.d.ts +6 -6
  23. package/dist/runtime/index.js +15 -15
  24. package/dist/{types-BuM8WNqe.d.ts → types-BK47clMl.d.ts} +1 -1
  25. package/dist/{types-DrqsOiTY.d.ts → types-DxvmJO-D.d.ts} +106 -2
  26. package/docs/README.md +12 -4
  27. package/docs/agent-guide.md +36 -1
  28. package/docs/ai-gates.md +13 -1
  29. package/docs/arkorder.md +11 -1
  30. package/docs/configuration.md +25 -3
  31. package/docs/develop.md +13 -6
  32. package/docs/enthusiast/README.md +13 -2
  33. package/docs/package-surface.md +21 -5
  34. package/docs/product-voice.md +25 -2
  35. package/docs/use.md +11 -3
  36. package/package.json +3 -1
  37. package/server.json +2 -2
  38. package/templates/agent-skills/ark-adopt/SKILL.md +19 -1
  39. package/templates/agent-skills/ark-autopilot/SKILL.md +1 -1
  40. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  41. package/templates/agent-skills/ark-place/SKILL.md +18 -4
  42. package/templates/skills/ark-adopt.md +19 -1
  43. package/templates/skills/ark-autopilot.md +1 -1
  44. package/templates/skills/ark-contract.md +1 -1
  45. package/templates/skills/ark-place.md +18 -4
@@ -118,6 +118,9 @@ export function printDoctorCompactHuman(view) {
118
118
  ? ok
119
119
  : warn;
120
120
  line(govMark, `Governed: ${cov.governed.percent}% (${cov.governed.classifiedFiles}/${cov.governed.totalFiles} files)`);
121
+ for (const row of cov.layers ?? []) {
122
+ if (row.description) line(' ', `${row.name} — ${row.description}`);
123
+ }
121
124
 
122
125
  const hostRed =
123
126
  gatesMissing.length > 0 ||
@@ -230,6 +233,12 @@ export function printDoctorDetailsHuman(view) {
230
233
  );
231
234
  }
232
235
  if (cov.suggestions.length === 0 && cov.emptyLayers.length === 0) line(ok, 'Every layer classifies files; no empty layers');
236
+ const captioned = (cov.layers ?? []).filter((row) => row.description);
237
+ if (captioned.length > 0) {
238
+ console.log('');
239
+ console.log(color.bold('Layers'));
240
+ for (const row of captioned) line(' ', `${row.name} — ${row.description}`);
241
+ }
233
242
 
234
243
  if (packageVersionTruth?.dualTruth) {
235
244
  console.log('');
@@ -15,6 +15,7 @@ import { describePackageVersionDualTruth } from './field-install.mjs';
15
15
  import { detectAgentHomeGaps } from './agent-homes.mjs';
16
16
  import { collectDoctorNextActions } from './doctor-next-actions.mjs';
17
17
  import { printDoctorCompactHuman, printDoctorDetailsHuman } from './doctor-human.mjs';
18
+ import { placementDescriptionFields } from './layer-description.mjs';
18
19
  export { printDoctorCompactHuman, printDoctorDetailsHuman };
19
20
  export { summarizeRulesUnderContract };
20
21
 
@@ -117,6 +118,7 @@ export function computeCoverage(root, config, files, rules) {
117
118
  name: layer.name,
118
119
  patterns: layer.patterns ?? [],
119
120
  files: counts.get(layer.name) ?? 0,
121
+ ...placementDescriptionFields(layer),
120
122
  }));
121
123
  // A layer whose patterns match zero files is dead config — it enforces nothing, usually a
122
124
  // wrong glob (the #1 monorepo mistake). A layer with no rule edge can import anything.
@@ -171,7 +173,8 @@ export function runCoverage(root, config, files, rules, asJson) {
171
173
  console.log(` ${pad('Layer')} Files`);
172
174
  for (const row of layerRows) {
173
175
  const flag = row.files === 0 ? ' (pattern matches nothing)' : '';
174
- console.log(` ${pad(row.name)} ${String(row.files).padStart(5)}${flag}`);
176
+ const caption = row.description ? ` ${row.description}` : '';
177
+ console.log(` ${pad(row.name)} ${String(row.files).padStart(5)}${flag}${caption}`);
175
178
  }
176
179
  console.log(` ${pad('(unclassified)')} ${String(unclassified.length).padStart(5)}`);
177
180
  console.log('');
@@ -758,6 +761,7 @@ export function runDoctor(root, config, files, rules, violations, asJson, option
758
761
  productHonesty,
759
762
  governed: cov.governed,
760
763
  coverageHonesty,
764
+ layers: cov.layers,
761
765
  emptyLayers: cov.emptyLayers,
762
766
  layersWithoutRules: cov.layersWithoutRules,
763
767
  ungovernedDirs: cov.suggestions.length,
@@ -25,6 +25,7 @@ import { capabilityBadgesFor, renderAdvisorySections } from './html-report-advis
25
25
  import { renderEvolutionSection } from './html-report-evolution.mjs';
26
26
  import { arkGitignoreAppendDecision } from './ark-gitignore.mjs';
27
27
  import { captureGitSnapshot } from './report-snapshot-context.mjs';
28
+ import { layerDescriptionCaption } from './layer-description.mjs';
28
29
 
29
30
  export { arkGitignoreAppendDecision, gitignoreCoversArkState, gitignoreHasArkNegationException } from './ark-gitignore.mjs';
30
31
 
@@ -405,7 +406,7 @@ export function renderBeginnerHtmlReport({ root, config, violations, ok, version
405
406
 
406
407
  const placementRows = layers
407
408
  .map((layer) => {
408
- const purpose = layer.description || 'See ark.config.json';
409
+ const purpose = layerDescriptionCaption(layer) || 'See ark.config.json';
409
410
  const folders = (layer.patterns || []).join(', ') || '—';
410
411
  return `<tr><td><strong>${esc(layer.name)}</strong></td><td>${esc(purpose)}</td><td><code>${esc(folders)}</code></td></tr>`;
411
412
  })
@@ -762,9 +763,10 @@ export function renderHtmlReport({
762
763
  ].join(' ');
763
764
  const example = exampleByLayer?.get?.(layer.name);
764
765
  const files = counts.get(layer.name) || 0;
766
+ const caption = layerDescriptionCaption(layer);
765
767
  return `<tr>
766
768
  <td class="ln">${esc(layer.name)}<div class="tags">${tags}</div></td>
767
- <td>${layer.description ? esc(layer.description) : '<span class="dim">—</span>'}</td>
769
+ <td>${caption ? esc(caption) : '<span class="dim">—</span>'}</td>
768
770
  <td class="num">${files}</td>
769
771
  <td><code class="pat">${(layer.patterns || []).map(esc).join('<br>') || '—'}</code></td>
770
772
  <td>${example ? `<code>${esc(example)}</code>` : '<span class="dim">no files yet</span>'}</td>
@@ -0,0 +1,27 @@
1
+ /**
2
+ * App-context caption from `layers[].description`.
3
+ * Metadata only — callers project it; policyHash strips it elsewhere.
4
+ * Present non-empty string is returned; absence/empty/non-string is undefined.
5
+ *
6
+ * @param {{ description?: unknown } | null | undefined} layerOrPlacement
7
+ * @returns {string | undefined}
8
+ */
9
+ export function layerDescriptionCaption(layerOrPlacement) {
10
+ const caption =
11
+ layerOrPlacement && typeof layerOrPlacement === 'object'
12
+ ? layerOrPlacement.description
13
+ : undefined;
14
+ return typeof caption === 'string' && caption.length > 0 ? caption : undefined;
15
+ }
16
+
17
+ /**
18
+ * Project the caption onto place / prepare-write / coverage / doctor JSON.
19
+ * Absence omits the field (never empty string).
20
+ *
21
+ * @param {{ description?: unknown } | null | undefined} layerOrPlacement
22
+ * @returns {{ description: string } | {}}
23
+ */
24
+ export function placementDescriptionFields(layerOrPlacement) {
25
+ const caption = layerDescriptionCaption(layerOrPlacement);
26
+ return caption ? { description: caption } : {};
27
+ }
@@ -7,6 +7,12 @@
7
7
  import crypto from 'node:crypto';
8
8
  import { validateWithAutoPatch } from './auto-patch.mjs';
9
9
  import { classifyRemediation, enrichViolationWithFixClass } from './remediation.mjs';
10
+ import {
11
+ layerDescriptionCaption,
12
+ placementDescriptionFields,
13
+ } from './layer-description.mjs';
14
+
15
+ export { layerDescriptionCaption, placementDescriptionFields };
10
16
 
11
17
  /**
12
18
  * Stable content identity for host commit / cache keys.
@@ -114,7 +120,7 @@ export function composePrepareWrite(opts) {
114
120
  ...(placement?.suggestedLayers ? { suggestedLayers: placement.suggestedLayers } : {}),
115
121
  ...(placement?.message ? { placementMessage: placement.message } : {}),
116
122
  ...(placement?.note ? { placementNote: placement.note } : {}),
117
- ...(placement?.description ? { description: placement.description } : {}),
123
+ ...placementDescriptionFields(placement),
118
124
  // Q03: pass through golden pattern from ark_place (advisory; absent is normal).
119
125
  ...(placement?.goldenPattern ? { goldenPattern: placement.goldenPattern } : {}),
120
126
  mode: gate.mode,
@@ -16,6 +16,10 @@ type ArkConfigLayer = {
16
16
  patterns: string[];
17
17
  exclude?: string[];
18
18
  intentPrefixes?: string[];
19
+ /**
20
+ * App-context caption for this layer.
21
+ * Metadata — excluded from policy hash. Absence is silent.
22
+ */
19
23
  description?: string;
20
24
  forbiddenGlobals?: string[];
21
25
  /** ADR 0009 D2 — opt-in effect-capability walls; absence changes no verdict. */
@@ -1,5 +1,5 @@
1
- import { e as CreateArchitectureProfileOptions, b as ArchitectureProfile, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, f as CreateElevenLayerArkConfigOptions, i as Policy, j as IntentCreator, I as IntentName } from './types-BuM8WNqe.js';
2
- import { A as ArkConfig, c as ArkConfigLoadResult } from './configTypes-dy5PfTqS.js';
1
+ import { e as CreateArchitectureProfileOptions, b as ArchitectureProfile, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, f as CreateElevenLayerArkConfigOptions, i as Policy, j as IntentCreator, I as IntentName } from './types-BK47clMl.js';
2
+ import { A as ArkConfig, c as ArkConfigLoadResult } from './configTypes-0eHpocR3.js';
3
3
 
4
4
  /** Versioned public result contract shared by every ArkGate enforcement adapter. */
5
5
  /**
@@ -409,7 +409,7 @@ declare const ARK_ANALYSIS_RESULT_SCHEMA: {
409
409
  };
410
410
 
411
411
  /** ArkGate library version — single source of truth. */
412
- declare const version = "4.8.6";
412
+ declare const version = "4.8.8";
413
413
 
414
414
  /**
415
415
  * AI Code Gate (basic).
@@ -1,4 +1,4 @@
1
- import { A as ArkConfig } from '../configTypes-dy5PfTqS.js';
1
+ import { A as ArkConfig } from '../configTypes-0eHpocR3.js';
2
2
 
3
3
  type RuleContext$1 = {
4
4
  report(descriptor: Record<string, unknown>): void;