arkgate 4.8.6 → 4.8.7
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.
- package/CHANGELOG.md +27 -4
- package/README.md +4 -3
- package/bin/ark-mcp-runtime.mjs +8 -2
- package/bin/lib/analysis-engine.mjs +5 -5
- package/bin/lib/doctor-human.mjs +9 -0
- package/bin/lib/doctor-plan.mjs +5 -1
- package/bin/lib/html-report.mjs +4 -2
- package/bin/lib/layer-description.mjs +27 -0
- package/bin/lib/prepare-write.mjs +7 -1
- package/dist/{configTypes-dy5PfTqS.d.ts → configTypes-0eHpocR3.d.ts} +4 -0
- package/dist/{diagnosticCatalog-D_DI7qrZ.d.ts → diagnosticCatalog-wDAH08gH.d.ts} +3 -3
- package/dist/eslint/index.d.ts +1 -1
- package/dist/index.cjs +19 -19
- package/dist/index.d.ts +5 -4
- package/dist/index.js +20 -20
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.d.ts +3 -3
- package/dist/nestjs/index.js +1 -1
- package/dist/runtime/index.cjs +10 -10
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +10 -10
- package/dist/{types-BuM8WNqe.d.ts → types-BK47clMl.d.ts} +1 -1
- package/dist/{types-DrqsOiTY.d.ts → types-CwZ_oz1N.d.ts} +1 -1
- package/docs/README.md +4 -4
- package/docs/configuration.md +23 -2
- package/docs/package-surface.md +6 -3
- package/package.json +1 -1
- package/server.json +2 -2
- package/templates/agent-skills/ark-adopt/SKILL.md +18 -1
- package/templates/agent-skills/ark-place/SKILL.md +17 -4
- package/templates/skills/ark-adopt.md +18 -1
- package/templates/skills/ark-place.md +17 -4
package/bin/lib/doctor-human.mjs
CHANGED
|
@@ -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('');
|
package/bin/lib/doctor-plan.mjs
CHANGED
|
@@ -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
|
-
|
|
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,
|
package/bin/lib/html-report.mjs
CHANGED
|
@@ -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
|
|
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>${
|
|
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
|
|
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-
|
|
2
|
-
import { A as ArkConfig, c as ArkConfigLoadResult } from './configTypes-
|
|
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.
|
|
412
|
+
declare const version = "4.8.7";
|
|
413
413
|
|
|
414
414
|
/**
|
|
415
415
|
* AI Code Gate (basic).
|
package/dist/eslint/index.d.ts
CHANGED