arkgate 4.8.2 → 4.8.4
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 +257 -3
- package/README.md +47 -9
- package/bin/ark-check-runtime.mjs +340 -5
- package/bin/ark-layer-match.mjs +170 -13
- package/bin/ark-mcp-runtime.mjs +9 -2
- package/bin/lib/analysis-completeness.mjs +86 -0
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/architecture-scan.mjs +2 -0
- package/bin/lib/ark-order-facts.mjs +59 -0
- package/bin/lib/ark-order-sensors.mjs +31 -2
- package/bin/lib/arkrule-file-hints.mjs +6 -2
- package/bin/lib/arkrules-contract.mjs +9 -1
- package/bin/lib/arkrules-sensors.mjs +22 -2
- package/bin/lib/check-args.mjs +66 -0
- package/bin/lib/config-contract.mjs +26 -0
- package/bin/lib/config-extras.mjs +2 -0
- package/bin/lib/design-smells.mjs +85 -0
- package/bin/lib/diagnostic-catalog.mjs +8 -2
- package/bin/lib/first-run-help.mjs +12 -0
- package/bin/lib/invariant-coverage-io.mjs +175 -19
- package/bin/lib/invariant-coverage.mjs +110 -7
- package/bin/lib/literal-path-drift-io.mjs +569 -0
- package/bin/lib/literal-path-drift.mjs +761 -0
- package/bin/lib/policy-delta-io.mjs +5 -0
- package/bin/lib/remediation.mjs +24 -1
- package/bin/lib/resolved-candidate-facts.mjs +31 -0
- package/bin/lib/rules-under-contract.mjs +5 -0
- package/bin/lib/scan-files.mjs +54 -0
- package/bin/lib/sensor-promote-cli.mjs +372 -0
- package/bin/lib/sensor-promote-io.mjs +246 -0
- package/bin/lib/sensor-promotion.mjs +363 -0
- package/dist/{configTypes-BdCe_gvv.d.ts → configTypes-dy5PfTqS.d.ts} +36 -0
- package/dist/{diagnosticCatalog-CPzH-MLN.d.ts → diagnosticCatalog-DgTs0abp.d.ts} +169 -11
- package/dist/eslint/index.cjs +5 -5
- package/dist/eslint/index.d.ts +34 -1
- package/dist/eslint/index.js +5 -5
- package/dist/index.cjs +31 -31
- package/dist/index.d.ts +85 -7
- package/dist/index.js +31 -31
- 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 +13 -13
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.js +13 -13
- package/dist/{types-DCSlrRnV.d.ts → types-BuM8WNqe.d.ts} +1 -1
- package/dist/{types-C9KApBzX.d.ts → types-D95drJ3_.d.ts} +1 -1
- package/docs/README.md +4 -4
- package/docs/agent-guide.md +182 -0
- package/docs/configuration.md +89 -9
- package/docs/develop.md +24 -2
- package/docs/diagnostics.md +79 -1
- package/docs/enthusiast/README.md +6 -4
- package/docs/package-surface.md +36 -4
- package/docs/product-voice.md +15 -5
- package/docs/use.md +8 -5
- package/package.json +2 -2
- package/schemas/ark.arkrules.schema.json +1 -0
- package/schemas/ark.config.schema.json +72 -0
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/server.json +3 -3
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +13 -3
- package/templates/agent-skills/ark-autopilot/SKILL.md +1 -1
- package/templates/agent-skills/ark-contract/SKILL.md +4 -0
- package/templates/agent-skills/ark-coverage/SKILL.md +1 -0
- package/templates/agent-skills/ark-place/SKILL.md +6 -2
- package/templates/arkrules/ApplicationOrchestration.json +6 -0
- package/templates/skills/ark-adopt.md +13 -3
- package/templates/skills/ark-autopilot.md +1 -1
- package/templates/skills/ark-contract.md +4 -0
- package/templates/skills/ark-coverage.md +1 -0
- package/templates/skills/ark-place.md +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as ArkRulesFile, E as EffectiveArkRules, R as ResolvedArkRunKernelCallKind, a as ResolvedArkRunDeclarationFact, b as ResolvedArkRunKernelCallFact, c as ResolvedArkRunManagedNewFact, d as ResolvedDependencyFact, e as ResolvedArkRunCompositionRootHitFact, f as ResolvedFactsReason, g as ResolvedArkOrderPlaneCallFact, h as ResolvedArkOrderGenericUpdateFact, i as ResolvedArkOrderRootHitFact } from './diagnosticCatalog-
|
|
2
|
-
export {
|
|
3
|
-
export { A as ArchitectureLayer, a as ArchitectureLayerConfig, b as ArchitectureProfile, c as ArchitectureRule, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, e as CreateArchitectureProfileOptions, f as CreateElevenLayerArkConfigOptions } from './types-
|
|
4
|
-
import { a as ArkConfigRule, b as ArkConfigSchemaVersion, c as ArkConfigLoadResult, A as ArkConfig, d as ArkConfigIssue, e as ArkConfigArkRun, f as ArkConfigLayer, g as ArkConfigArkOrder } from './configTypes-
|
|
1
|
+
import { A as ArkRulesFile, E as EffectiveArkRules, R as ResolvedArkRunKernelCallKind, a as ResolvedArkRunDeclarationFact, b as ResolvedArkRunKernelCallFact, c as ResolvedArkRunManagedNewFact, d as ResolvedDependencyFact, e as ResolvedArkRunCompositionRootHitFact, f as ResolvedFactsReason, g as ResolvedArkOrderPlaneCallFact, h as ResolvedArkOrderGenericUpdateFact, i as ResolvedArkOrderRootHitFact, j as ResolvedArkOrderXiFieldWriteFact, k as ResolvedArkOrderIngestWriteFact } from './diagnosticCatalog-DgTs0abp.js';
|
|
2
|
+
export { l as ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH, m as AICodeGate, n as AICodeGateContext, o as AICodeGateOptions, p as AICodeGateResult, q as AICodeGateViolation, r as AIGateExtension, s as ANALYSIS_IR_SCHEMA_VERSION, t as ARK_ANALYSIS_RESULT_SCHEMA, u as ARK_ANALYSIS_RESULT_SCHEMA_VERSION, v as ARK_DESIGN_DELTA_SCHEMA_VERSION, w as ARK_ENFORCEMENT_STATE_SCHEMA_VERSION, x as AdapterCompletenessReason, y as AdapterDiagnostic, z as AdapterResult, B as AdapterSeverity, C as AdapterViolationInput, D as AnalysisCapabilityUse, F as AnalysisCompilerOptions, G as AnalysisCompleteness, H as AnalysisContract, I as AnalysisEvidence, J as AnalysisFile, K as AnalysisFileChange, L as AnalysisFileInput, M as AnalysisImportEdge, N as AnalysisIr, O as AnalysisMode, P as AnalysisResult, Q as AnalysisViolation, S as AnalyzeArchitectureConvergenceInput, T as AnalyzeChangeInput, U as AnalyzePolicyDeltaInput, V as AnalyzeProjectInput, W as AnalyzeResolvedProjectInput, X as ArchitectureActualChange, Y as ArchitectureChangeMap, Z as ArchitectureChangeMapContract, _ as ArchitectureChangeMapDependency, $ as ArchitectureChangeMapFile, a0 as ArchitectureChangeOperation, a1 as ArchitectureConvergenceClassification, a2 as ArchitectureConvergenceFinding, a3 as ArchitectureConvergenceResult, a4 as ArchitectureDependency, a5 as ArchitectureEngineEdge, a6 as ArchitectureEngineResult, a7 as ArchitectureEngineViolation, a8 as ArkDesignDeltaResult, a9 as ArkEnforcementHost, aa as ArkEnforcementState, ab as ArkRuleSensorViolation, ac as ChangePreflightResult, ad as ClassShapeFact, ae as CollectAnalysisConfigWarningsInput, af as DIAGNOSTIC_CATALOG, ag as DIAGNOSTIC_CATALOG_SCHEMA_VERSION, ah as DIAGNOSTIC_DOCS_RELATIVE_PATH, ai as DIAGNOSTIC_RULE_IDS, aj as DesignDeltaChange, ak as DesignDeltaEnforcementScope, al as DesignDeltaIdentity, am as DesignSmellEvidence, an as DesignSmellFinding, ao as DesignSmellId, ap as DiagnosticCatalogEntry, aq as DiagnosticCategory, ar as EnforcementBoundaryState, as as EnforcementEvidence, at as EnforcementEvidenceField, au as EnforcementVerification, av as EvaluateArchitectureGraphInput, aw as ForbiddenCapabilityUse, ax as InvariantCoverageEvidence, ay as POLICY_DELTA_SCHEMA_VERSION, az as PolicyDelta, aA as PolicyDeltaAcknowledgement, aB as PolicyDeltaAnalysis, aC as PolicyDeltaClassification, aD as PolicyDeltaFinding, aE as PreflightResolvedChangeInput, aF as PreparedChangeFile, aG as RESOLVED_CANDIDATE_FACTS_SCHEMA, aH as RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION, aI as ResolvedAmbientFact, aJ as ResolvedAnalysisFile, aK as ResolvedAnalysisIr, aL as ResolvedAnalysisResult, aM as ResolvedCandidateFacts, aN as ResolvedCandidateFactsInput, aO as ResolvedCapability, aP as ResolvedCapabilityFact, aQ as ResolvedChangePreflightResult, aR as ResolvedDependencyKind, aS as ResolvedDependencyState, aT as ResolvedFactsCompleteness, aU as ResolvedFileFact, aV as ResolvedIntentReferenceFact, aW as ResolvedPublishFact, aX as ResolvedSafetyFact, aY as ResolvedSafetyKind, aZ as ResolvedSafetyReport, a_ as SemanticDependency, a$ as SemanticDependencyKind, b0 as adapterDocsCodePath, b1 as adapterFindingOccurrenceTargetKeys, b2 as adapterFindingRefFromTargetKey, b3 as adapterFindingTargetKey, b4 as analyzeArchitectureConvergence, b5 as analyzeChange, b6 as analyzePolicyDelta, b7 as analyzeProject, b8 as analyzeResolvedProject, b9 as buildArkRuleFileHints, ba as canPromoteInvariant, bb as catalogFixForRuleId, bc as catalogWhyForRuleId, bd as classifyArkPolicyDelta, be as collectAnalysisConfigWarnings, bf as collectEmptyAppliesToFindings, bg as collectForbiddenCapabilityUses, bh as createAICodeGate, bi as createAdapterResult, bj as createArchitectureProfile, bk as createArchitectureProfileFromArkConfig, bl as createElevenLayerArkConfig, bm as createResolvedCandidateFacts, bn as deriveArkRuleFileHints, bo as detectArchitectureCycles, bp as deterministicHash, bq as diagnosticDocsFragment, br as diagnosticDocsPath, bs as elevenLayerProfile, bt as evaluateArchitectureGraph, bu as evaluateArkRuleSensors, bv as evaluateInvariantCoverage, bw as explainViolation, bx as extractClassShapesFromSource, by as extractSemanticDependencies, bz as getDiagnosticCatalogEntry, bA as isCataloguedOrArkRuleFamily, bB as isKnownDiagnosticCode, bC as loadContract, bD as loadResolvedCandidateFacts, bE as policyDeltaAcknowledgementMatches, bF as preflightChange, bG as preflightResolvedChange, bH as resolvedFactsEvidenceRequirementsHash, bI as serializeDiagnosticCatalog, bJ as stableSerialize, bK as toAdapterDiagnostic, bL as version } from './diagnosticCatalog-DgTs0abp.js';
|
|
3
|
+
export { A as ArchitectureLayer, a as ArchitectureLayerConfig, b as ArchitectureProfile, c as ArchitectureRule, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, e as CreateArchitectureProfileOptions, f as CreateElevenLayerArkConfigOptions } from './types-BuM8WNqe.js';
|
|
4
|
+
import { a as ArkConfigRule, b as ArkConfigSchemaVersion, c as ArkConfigLoadResult, A as ArkConfig, d as ArkConfigIssue, e as ArkConfigArkRun, f as ArkConfigLayer, g as ArkConfigArkOrder } from './configTypes-dy5PfTqS.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Canonical, pure contract for ark.config.json.
|
|
@@ -101,6 +101,10 @@ declare const ARK_CONFIG_SCHEMA: {
|
|
|
101
101
|
readonly allowDisabledPeerIsolation: false;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
+
/** Invariant-coverage scan controls (test globs + file budget). Absence keeps defaults. */
|
|
105
|
+
readonly coverage: {
|
|
106
|
+
readonly $ref: "#/$defs/coverage";
|
|
107
|
+
};
|
|
104
108
|
/** ADR 0012 — layer name → relative path to arkrules/<Layer>.json */
|
|
105
109
|
readonly arkRules: {
|
|
106
110
|
readonly type: "object";
|
|
@@ -239,6 +243,34 @@ declare const ARK_CONFIG_SCHEMA: {
|
|
|
239
243
|
};
|
|
240
244
|
readonly uniqueItems: true;
|
|
241
245
|
};
|
|
246
|
+
readonly sharedRoots: {
|
|
247
|
+
readonly minItems: 1;
|
|
248
|
+
readonly type: "array";
|
|
249
|
+
readonly items: {
|
|
250
|
+
readonly type: "string";
|
|
251
|
+
readonly minLength: 1;
|
|
252
|
+
};
|
|
253
|
+
readonly uniqueItems: true;
|
|
254
|
+
};
|
|
255
|
+
readonly allowedCrossSlice: {
|
|
256
|
+
readonly type: "array";
|
|
257
|
+
readonly minItems: 1;
|
|
258
|
+
readonly items: {
|
|
259
|
+
readonly type: "object";
|
|
260
|
+
readonly additionalProperties: false;
|
|
261
|
+
readonly required: readonly ["from", "to"];
|
|
262
|
+
readonly properties: {
|
|
263
|
+
readonly from: {
|
|
264
|
+
readonly type: "string";
|
|
265
|
+
readonly minLength: 1;
|
|
266
|
+
};
|
|
267
|
+
readonly to: {
|
|
268
|
+
readonly type: "string";
|
|
269
|
+
readonly minLength: 1;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
};
|
|
242
274
|
};
|
|
243
275
|
};
|
|
244
276
|
readonly safety: {
|
|
@@ -265,6 +297,35 @@ declare const ARK_CONFIG_SCHEMA: {
|
|
|
265
297
|
};
|
|
266
298
|
};
|
|
267
299
|
};
|
|
300
|
+
readonly coverage: {
|
|
301
|
+
readonly type: "object";
|
|
302
|
+
readonly additionalProperties: false;
|
|
303
|
+
readonly description: "Invariant coverage scan controls. testGlobs replaces the built-in test-name heuristic; maxFiles raises or lowers the evidence file budget; coverageRoots declares where the project runs its tests, so a covering test found outside them is reported instead of silently certifying an invariant.";
|
|
304
|
+
readonly properties: {
|
|
305
|
+
readonly testGlobs: {
|
|
306
|
+
readonly minItems: 1;
|
|
307
|
+
readonly type: "array";
|
|
308
|
+
readonly items: {
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
readonly minLength: 1;
|
|
311
|
+
};
|
|
312
|
+
readonly uniqueItems: true;
|
|
313
|
+
};
|
|
314
|
+
readonly maxFiles: {
|
|
315
|
+
readonly type: "integer";
|
|
316
|
+
readonly minimum: 1;
|
|
317
|
+
};
|
|
318
|
+
readonly coverageRoots: {
|
|
319
|
+
readonly minItems: 1;
|
|
320
|
+
readonly type: "array";
|
|
321
|
+
readonly items: {
|
|
322
|
+
readonly type: "string";
|
|
323
|
+
readonly minLength: 1;
|
|
324
|
+
};
|
|
325
|
+
readonly uniqueItems: true;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
};
|
|
268
329
|
readonly arkRun: {
|
|
269
330
|
readonly type: "object";
|
|
270
331
|
readonly additionalProperties: false;
|
|
@@ -342,6 +403,15 @@ declare const ARK_CONFIG_SCHEMA: {
|
|
|
342
403
|
readonly minimum: 1;
|
|
343
404
|
readonly default: 7;
|
|
344
405
|
};
|
|
406
|
+
readonly xiKeys: {
|
|
407
|
+
readonly default: readonly [];
|
|
408
|
+
readonly type: "array";
|
|
409
|
+
readonly items: {
|
|
410
|
+
readonly type: "string";
|
|
411
|
+
readonly minLength: 1;
|
|
412
|
+
};
|
|
413
|
+
readonly uniqueItems: true;
|
|
414
|
+
};
|
|
345
415
|
};
|
|
346
416
|
};
|
|
347
417
|
};
|
|
@@ -533,7 +603,7 @@ declare function createProjectIdentity(input: Omit<ProjectIdentity, 'schemaVersi
|
|
|
533
603
|
|
|
534
604
|
declare const ARK_RULES_SCHEMA_VERSION: "1.0";
|
|
535
605
|
/** Closed sensor vocabulary — keep in lockstep with arkRulesTypes.ARK_RULE_SENSOR_IDS. */
|
|
536
|
-
declare const ARK_RULE_SENSORS: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "no-anemic-model", "invariant-coverage"];
|
|
606
|
+
declare const ARK_RULE_SENSORS: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "writes-via-aggregate", "no-anemic-model", "invariant-coverage"];
|
|
537
607
|
declare const ARK_RULES_SCHEMA: {
|
|
538
608
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
539
609
|
readonly $id: "https://unpkg.com/arkgate/schemas/ark.arkrules.schema.json";
|
|
@@ -584,7 +654,7 @@ declare const ARK_RULES_SCHEMA: {
|
|
|
584
654
|
};
|
|
585
655
|
readonly sensor: {
|
|
586
656
|
readonly type: "string";
|
|
587
|
-
readonly enum: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "no-anemic-model", "invariant-coverage"];
|
|
657
|
+
readonly enum: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "writes-via-aggregate", "no-anemic-model", "invariant-coverage"];
|
|
588
658
|
};
|
|
589
659
|
readonly mode: {
|
|
590
660
|
readonly type: "string";
|
|
@@ -987,7 +1057,7 @@ declare function evaluateArkRunEditorSensorsFromSource(input: {
|
|
|
987
1057
|
* Pure ArkOrder tier-1 sensors (ADR 0027 / 0029). Absence of arkOrder emits nothing.
|
|
988
1058
|
*/
|
|
989
1059
|
|
|
990
|
-
declare const ARKORDER_TIER1_SENSOR_IDS: readonly ["arkorder-missing-plane", "arkorder-kernel-in-domain", "arkorder-generic-update", "arkorder-too-many-params", "arkorder-ingest-writes-xi"];
|
|
1060
|
+
declare const ARKORDER_TIER1_SENSOR_IDS: readonly ["arkorder-missing-plane", "arkorder-kernel-in-domain", "arkorder-generic-update", "arkorder-too-many-params", "arkorder-ingest-writes-xi", "arkorder-xi-field-write"];
|
|
991
1061
|
type ArkOrderTier1SensorId = (typeof ARKORDER_TIER1_SENSOR_IDS)[number];
|
|
992
1062
|
declare const ARKORDER_RULE_IDS: {
|
|
993
1063
|
readonly 'arkorder-missing-plane': "ARKORDER_MISSING_PLANE";
|
|
@@ -995,6 +1065,7 @@ declare const ARKORDER_RULE_IDS: {
|
|
|
995
1065
|
readonly 'arkorder-generic-update': "ARKORDER_GENERIC_UPDATE";
|
|
996
1066
|
readonly 'arkorder-too-many-params': "ARKORDER_TOO_MANY_PARAMS";
|
|
997
1067
|
readonly 'arkorder-ingest-writes-xi': "ARKORDER_INGEST_WRITES_XI";
|
|
1068
|
+
readonly 'arkorder-xi-field-write': "ARKORDER_XI_FIELD_WRITE";
|
|
998
1069
|
};
|
|
999
1070
|
type ArkOrderRuleId = (typeof ARKORDER_RULE_IDS)[ArkOrderTier1SensorId];
|
|
1000
1071
|
type ArkOrderSensorFinding = {
|
|
@@ -1015,6 +1086,13 @@ type EvaluateArkOrderSensorsInput = {
|
|
|
1015
1086
|
planeCalls: readonly ResolvedArkOrderPlaneCallFact[];
|
|
1016
1087
|
genericUpdates: readonly ResolvedArkOrderGenericUpdateFact[];
|
|
1017
1088
|
planeRootHits: readonly ResolvedArkOrderRootHitFact[];
|
|
1089
|
+
xiFieldWrites?: readonly ResolvedArkOrderXiFieldWriteFact[];
|
|
1090
|
+
ingestWritesXi?: readonly ResolvedArkOrderIngestWriteFact[];
|
|
1091
|
+
releaseKeyCounts?: readonly {
|
|
1092
|
+
file: string;
|
|
1093
|
+
line: number;
|
|
1094
|
+
keyCount: number;
|
|
1095
|
+
}[];
|
|
1018
1096
|
dependencies: readonly ResolvedDependencyFact[];
|
|
1019
1097
|
layerForFile: (path: string) => string | null | undefined;
|
|
1020
1098
|
classification?: ExtraMergeTeethClassification;
|