arkgate 4.6.6 → 4.7.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.
- package/CHANGELOG.md +139 -2
- package/README.md +22 -10
- package/SECURITY.md +1 -1
- package/bin/ark-check-runtime.mjs +21 -341
- package/bin/ark-mcp-runtime.mjs +71 -325
- package/bin/ark-shared.mjs +24 -158
- package/bin/lib/adapter-contract.mjs +17 -36
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/ark-run-doctor.mjs +144 -0
- package/bin/lib/ark-run-facts.mjs +472 -0
- package/bin/lib/ark-run-report.mjs +57 -0
- package/bin/lib/ark-run-sensors.mjs +309 -0
- package/bin/lib/check-args.mjs +173 -0
- package/bin/lib/check-config-detect.mjs +101 -0
- package/bin/lib/check-watch.mjs +80 -0
- package/bin/lib/config-contract.mjs +86 -11
- package/bin/lib/deep-module-coach.mjs +3 -0
- package/bin/lib/diagnostic-catalog.mjs +8 -0
- package/bin/lib/doctor-advisories.mjs +45 -8
- package/bin/lib/doctor-human.mjs +519 -0
- package/bin/lib/doctor-plan.mjs +62 -445
- package/bin/lib/extra-merge-teeth.mjs +187 -0
- package/bin/lib/github-enforcement.mjs +22 -9
- package/bin/lib/html-report-advisories.mjs +2 -0
- package/bin/lib/html-report-depth.mjs +22 -2
- package/bin/lib/html-report.mjs +40 -7
- package/bin/lib/mcp-hook-payload.mjs +328 -0
- package/bin/lib/package-manager.mjs +174 -0
- package/bin/lib/policy-delta-io.mjs +4 -0
- package/bin/lib/remediation.mjs +132 -0
- package/bin/lib/resolved-candidate-facts.mjs +67 -2
- package/bin/lib/rules-under-contract.mjs +37 -89
- package/bin/lib/snippet-analysis.mjs +43 -2
- package/bin/lib/status-command.mjs +28 -0
- package/bin/lib/status-manifest.mjs +23 -0
- package/bin/lib/team-parliament-io.mjs +4 -0
- package/dist/{configTypes-l6XiwiC1.d.ts → configTypes-CgJimx9o.d.ts} +17 -3
- package/dist/eslint/index.cjs +6 -2
- package/dist/eslint/index.d.ts +70 -2
- package/dist/eslint/index.js +6 -2
- package/dist/index.cjs +35 -35
- package/dist/index.d.ts +787 -272
- package/dist/index.js +35 -35
- package/docs/README.md +4 -3
- package/docs/agent-guide.md +21 -15
- package/docs/ai-gates.md +13 -0
- package/docs/configuration.md +24 -11
- package/docs/develop.md +12 -3
- package/docs/diagnostics.md +75 -0
- package/docs/enthusiast/README.md +4 -3
- package/docs/package-surface.md +17 -13
- package/docs/product-voice.md +6 -3
- package/docs/threat-model.md +1 -1
- package/docs/use.md +5 -4
- package/package.json +1 -1
- package/schemas/ark.config.schema.json +41 -2
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/schemas/ark.status-manifest.schema.json +47 -0
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +23 -2
- package/templates/agent-skills/ark-place/SKILL.md +26 -2
- package/templates/agent-skills/ark-runtime/SKILL.md +66 -24
- package/templates/skills/ark-adopt.md +23 -2
- package/templates/skills/ark-place.md +26 -2
- package/templates/skills/ark-runtime.md +66 -24
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Pure CLI helper (bin/lib/adapter-contract.mjs). Zero Node I/O.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { deterministicNextAction } from './remediation.mjs';
|
|
12
12
|
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
13
13
|
/**
|
|
14
14
|
* 1.5 adds stable finding refs on every factory-emitted diagnostic (ACS06):
|
|
@@ -77,41 +77,22 @@ export function adapterDocsCodePath(ruleId) {
|
|
|
77
77
|
return `${ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH}#${ruleId}`;
|
|
78
78
|
}
|
|
79
79
|
function nextActionForDiagnostic(ruleId, evidence, violation) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
if (ruleId === 'CAPABILITY_VIOLATION') {
|
|
97
|
-
return `Define a ${text(violation.capability) ?? 'capability'} port in ${evidence.fromLayer ?? 'the walled layer'}, bind the implementation outside it, test at the public interface, then preflight again.`;
|
|
98
|
-
}
|
|
99
|
-
if (ruleId === 'CIRCULAR_DEPENDENCY') {
|
|
100
|
-
return 'Extract the shared dependency into a third module, test at the public interface, then preflight again.';
|
|
101
|
-
}
|
|
102
|
-
if (ruleId === 'RAW_EVENT_PUBLISH')
|
|
103
|
-
return 'Publish through a registered intent creator, then run Ark again.';
|
|
104
|
-
if (ruleId === 'PUBLISH_MISSING_SOURCE')
|
|
105
|
-
return 'Add metadata.source to the publish call, then run Ark again.';
|
|
106
|
-
if (ruleId === 'ARKRULE_STRUCTURE' ||
|
|
107
|
-
ruleId === 'ARKRULE_INVARIANT' ||
|
|
108
|
-
ruleId === 'INVARIANT_UNCOVERED' ||
|
|
109
|
-
ruleId.startsWith('ARKRULE_')) {
|
|
110
|
-
const source = evidence.arkruleSource ?? 'arkrules/<Layer>.json';
|
|
111
|
-
const id = evidence.arkruleId ?? 'the ArkRule';
|
|
112
|
-
return `Fix the structure or invariant for ${id} (declared in ${source}), then preflight again. Do not demote the rule without a hash-bound policy acknowledgement.`;
|
|
113
|
-
}
|
|
114
|
-
return `Resolve ${ruleId} without weakening ark.config.json, then run Ark again.`;
|
|
80
|
+
return deterministicNextAction({
|
|
81
|
+
ruleId,
|
|
82
|
+
target: text(evidence.target) ?? text(violation.target) ?? undefined,
|
|
83
|
+
fromLayer: text(evidence.fromLayer) ?? undefined,
|
|
84
|
+
toLayer: text(evidence.toLayer) ?? undefined,
|
|
85
|
+
typeOnly: evidence.typeOnly === true,
|
|
86
|
+
targetTypeOnlyExports: evidence.targetTypeOnlyExports === true,
|
|
87
|
+
namedBindingsTypeOnly: evidence.namedBindingsTypeOnly === true,
|
|
88
|
+
portProofEligible: evidence.portProofEligible === true,
|
|
89
|
+
peerIsolation: evidence.peerIsolation === true,
|
|
90
|
+
sourcePureTypeModule: evidence.sourcePureTypeModule === true,
|
|
91
|
+
edgeKind: text(evidence.edgeKind) ?? undefined,
|
|
92
|
+
capability: text(evidence.capability) ?? text(violation.capability) ?? undefined,
|
|
93
|
+
arkruleId: text(evidence.arkruleId) ?? undefined,
|
|
94
|
+
arkruleSource: text(evidence.arkruleSource) ?? undefined,
|
|
95
|
+
});
|
|
115
96
|
}
|
|
116
97
|
export function toAdapterDiagnostic(violation, fallbackSeverity = 'error',
|
|
117
98
|
/**
|