arkgate 4.8.14 → 4.8.16
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 +172 -0
- package/README.md +17 -7
- package/bin/ark-check-runtime.mjs +17 -49
- package/bin/ark-mcp-runtime.mjs +111 -2
- package/bin/ark-shared.mjs +142 -11
- package/bin/ark.mjs +24 -33
- package/bin/lib/adr-presence.mjs +97 -0
- package/bin/lib/agent-skills-package.mjs +179 -1
- package/bin/lib/analysis-completeness.mjs +38 -2
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/architecture-scan.mjs +43 -4
- package/bin/lib/ark-run-doctor.mjs +6 -0
- package/bin/lib/ark-run-report.mjs +6 -2
- package/bin/lib/arkrules-sensors.mjs +81 -0
- package/bin/lib/baseline-key.mjs +6 -1
- package/bin/lib/check-args.mjs +52 -2
- package/bin/lib/config-contract.mjs +65 -2
- package/bin/lib/diagnostic-catalog.mjs +5 -1
- package/bin/lib/doctor-advisories.mjs +120 -10
- package/bin/lib/doctor-green-cite.mjs +139 -0
- package/bin/lib/doctor-human.mjs +115 -67
- package/bin/lib/doctor-next-actions.mjs +23 -0
- package/bin/lib/doctor-plan.mjs +35 -2
- package/bin/lib/enforcement-honesty.mjs +47 -2
- package/bin/lib/field-install.mjs +47 -7
- package/bin/lib/first-run-help.mjs +9 -1
- package/bin/lib/host-support-matrix.mjs +9 -1
- package/bin/lib/html-report-depth.mjs +2 -0
- package/bin/lib/html-report.mjs +13 -2
- package/bin/lib/import-resolve.mjs +74 -13
- package/bin/lib/improvement-compass-doctor.mjs +8 -1
- package/bin/lib/improvement-compass-map.mjs +5 -1
- package/bin/lib/invariant-coverage.mjs +121 -0
- package/bin/lib/invariant-tests-path.mjs +212 -0
- package/bin/lib/layer-description.mjs +90 -8
- package/bin/lib/mcp-hook-payload.mjs +56 -0
- package/bin/lib/no-domain-frontend.mjs +91 -0
- package/bin/lib/package-manager.mjs +8 -0
- package/bin/lib/presets.mjs +3 -4
- package/bin/lib/product-copy.mjs +15 -0
- package/bin/lib/projected-governed-coverage.mjs +114 -0
- package/bin/lib/prototype-shortcuts.mjs +224 -0
- package/bin/lib/recommend-cli.mjs +54 -0
- package/bin/lib/remediation.mjs +15 -0
- package/bin/lib/resolved-candidate-facts.mjs +83 -66
- package/bin/lib/rules-under-contract.mjs +117 -2
- package/bin/lib/snippet-analysis.mjs +14 -8
- package/bin/lib/start-preview.mjs +24 -2
- package/bin/lib/states-transitions-presence.mjs +212 -0
- package/bin/lib/status-command.mjs +2 -0
- package/bin/lib/status-transition-catalog.mjs +410 -0
- package/bin/lib/team-parliament-io.mjs +10 -0
- package/bin/lib/violations.mjs +13 -1
- package/bin/lib/write-path-capabilities.mjs +20 -5
- package/bin/lib/write-path-detect.mjs +27 -2
- package/dist/{configTypes-j7so8B4O.d.ts → configTypes-VD0qcubY.d.ts} +21 -1
- package/dist/{diagnosticCatalog-DVx_2RmF.d.ts → diagnosticCatalog-KWvGLI1U.d.ts} +24 -3
- package/dist/eslint/index.cjs +4 -4
- package/dist/eslint/index.d.ts +1 -1
- package/dist/eslint/index.js +4 -4
- package/dist/index.cjs +34 -34
- package/dist/index.d.ts +71 -10
- package/dist/index.js +34 -34
- package/dist/nestjs/index.cjs +5 -5
- package/dist/nestjs/index.d.ts +3 -3
- package/dist/nestjs/index.js +5 -5
- package/dist/runtime/index.cjs +15 -15
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +15 -15
- package/dist/{types-tGhZUiGX.d.ts → types-BSzRy2X1.d.ts} +1 -1
- package/dist/{types-Djbs3KjE.d.ts → types-D5GT5ZT8.d.ts} +3 -1
- package/docs/README.md +1 -1
- package/docs/agent-guide.md +8 -4
- package/docs/ai-gates.md +10 -3
- package/docs/brownfield-adoption.md +4 -1
- package/docs/configuration.md +66 -10
- package/docs/develop.md +4 -1
- package/docs/diagnostics.md +48 -4
- package/docs/enthusiast/how-to-agent-gates.md +5 -0
- package/docs/enthusiast/how-to-pick-shape.md +1 -1
- package/docs/package-surface.md +7 -5
- package/docs/use.md +10 -3
- package/package.json +1 -1
- package/schemas/ark.config.schema.json +24 -3
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +97 -1
- package/templates/agent-skills/ark-autopilot/SKILL.md +12 -3
- package/templates/agent-skills/ark-coverage/SKILL.md +2 -2
- package/templates/agent-skills/ark-explain/SKILL.md +6 -3
- package/templates/agent-skills/ark-explore/SKILL.md +33 -1
- package/templates/agent-skills/ark-place/SKILL.md +42 -3
- package/templates/agent-skills/ark-runtime/SKILL.md +4 -2
- package/templates/agent-skills/ark-upgrade/SKILL.md +1 -1
- package/templates/arkrules/DomainModel.json +14 -1
- package/templates/skills/ark-adopt.md +97 -1
- package/templates/skills/ark-autopilot.md +12 -3
- package/templates/skills/ark-coverage.md +2 -2
- package/templates/skills/ark-explain.md +6 -3
- package/templates/skills/ark-explore.md +33 -1
- package/templates/skills/ark-place.md +42 -3
- package/templates/skills/ark-runtime.md +4 -2
- package/templates/skills/ark-upgrade.md +1 -1
|
@@ -60,8 +60,15 @@ export const EMPTY_ANALYSIS_RULE_ID = 'ANALYSIS_COVERS_NO_FILES';
|
|
|
60
60
|
* `countUngovernedSourceFiles` in scan-files.mjs. Feeding it a count that honours
|
|
61
61
|
* `config.exclude` reopens the false green through `exclude: ["**"]`.
|
|
62
62
|
*
|
|
63
|
+
* `classifiedFileCount` is optional. When omitted, included files are treated as
|
|
64
|
+
* classified (the historical meaning of `governedFileCount`). When provided and
|
|
65
|
+
* zero while include still matched files, this is the same vacuous green: import
|
|
66
|
+
* rules cannot run on unclassified source. Omit the count when `layers` is empty
|
|
67
|
+
* so `CONFIG_NO_LAYERS` stays the next step. Partial unclassified stays a warning.
|
|
68
|
+
*
|
|
63
69
|
* @param {{
|
|
64
70
|
* governedFileCount?: number,
|
|
71
|
+
* classifiedFileCount?: number,
|
|
65
72
|
* ungovernedSourceCount?: number,
|
|
66
73
|
* ungovernedSourceCap?: number,
|
|
67
74
|
* root?: string,
|
|
@@ -72,8 +79,29 @@ export const EMPTY_ANALYSIS_RULE_ID = 'ANALYSIS_COVERS_NO_FILES';
|
|
|
72
79
|
* @returns {{ ruleId: string, message: string, nextAction: string } | null}
|
|
73
80
|
*/
|
|
74
81
|
export function emptyAnalysisRefusal(input = {}) {
|
|
75
|
-
const
|
|
76
|
-
if (!Number.isFinite(
|
|
82
|
+
const included = Number(input.governedFileCount);
|
|
83
|
+
if (!Number.isFinite(included)) return null;
|
|
84
|
+
|
|
85
|
+
const classifiedRaw = input.classifiedFileCount;
|
|
86
|
+
const classifiedProvided =
|
|
87
|
+
classifiedRaw !== undefined && classifiedRaw !== null && Number.isFinite(Number(classifiedRaw));
|
|
88
|
+
const classified = classifiedProvided ? Number(classifiedRaw) : included;
|
|
89
|
+
|
|
90
|
+
if (included > 0 && classified === 0) {
|
|
91
|
+
const root = String(input.root ?? '');
|
|
92
|
+
const configPath = String(input.configPath ?? '');
|
|
93
|
+
const message =
|
|
94
|
+
`Analysis covered 0 files: ${included} included file(s) exist under ${root} but none ` +
|
|
95
|
+
`matched a layer pattern in ${configPath}. Every rule is vacuously satisfied on an empty ` +
|
|
96
|
+
'set, so a pass here would certify nothing.';
|
|
97
|
+
const nextAction =
|
|
98
|
+
`Extend layer patterns or narrow include in ${configPath} so every included file has a ` +
|
|
99
|
+
'layer. `npx arkgate-check --root . --coverage` lists unclassified files, and `/ark-place` ' +
|
|
100
|
+
'picks a folder. `--plan` and `--doctor` report this without refusing.';
|
|
101
|
+
return { ruleId: EMPTY_ANALYSIS_RULE_ID, message, nextAction };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (included !== 0) return null;
|
|
77
105
|
|
|
78
106
|
const ungoverned = Math.max(0, Number(input.ungovernedSourceCount) || 0);
|
|
79
107
|
const cap = Math.max(0, Number(input.ungovernedSourceCap) || 0);
|
|
@@ -112,3 +140,11 @@ export function emptyAnalysisRefusal(input = {}) {
|
|
|
112
140
|
|
|
113
141
|
return { ruleId: EMPTY_ANALYSIS_RULE_ID, message, nextAction };
|
|
114
142
|
}
|
|
143
|
+
|
|
144
|
+
/** Path-only classified count. `undefined` when no layers — caller keeps the include-only meaning. */
|
|
145
|
+
export function classifiedCountFromFiles(files, layers, layerForFile, root) {
|
|
146
|
+
if (!Array.isArray(layers) || layers.length === 0 || typeof layerForFile !== 'function') {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
return files.filter((abs) => layerForFile(root, abs, layers)).length;
|
|
150
|
+
}
|