arkgate 3.8.0 → 3.8.2
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 +65 -0
- package/README.md +4 -4
- package/bin/ark-layer-match.mjs +9 -4
- package/bin/lib/agent-gates.mjs +3 -0
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/doctor-plan.mjs +38 -5
- package/bin/lib/enforcement-state.mjs +1 -1
- package/bin/lib/golden-pattern.mjs +27 -0
- package/bin/lib/html-report.mjs +27 -4
- package/bin/lib/managed-upgrade.mjs +58 -16
- package/bin/lib/skill-install.mjs +115 -17
- package/bin/lib/upgrade-command.mjs +21 -5
- package/bin/lib/write-path-detect.mjs +45 -0
- package/dist/eslint/index.cjs +1 -1
- package/dist/eslint/index.d.ts +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +97 -69
- package/dist/index.js +6 -6
- package/docs/agent-guide.md +4 -4
- package/docs/configuration.md +3 -0
- package/docs/enthusiast/reference-commands.md +3 -3
- package/docs/package-surface.md +2 -2
- package/docs/typescript-support.md +11 -12
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -234,7 +234,7 @@ declare function loadArkConfigContract(input: unknown, source?: string): ArkConf
|
|
|
234
234
|
declare function parseArkConfigJson(json: string, source?: string): ArkConfigLoadResult;
|
|
235
235
|
|
|
236
236
|
/** ArkGate library version — single source of truth. */
|
|
237
|
-
declare const version = "3.8.
|
|
237
|
+
declare const version = "3.8.2";
|
|
238
238
|
|
|
239
239
|
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
240
240
|
declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.3";
|
|
@@ -864,13 +864,21 @@ interface AICodeGateOptions<Context = AICodeGateContext> {
|
|
|
864
864
|
declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
|
|
865
865
|
|
|
866
866
|
/**
|
|
867
|
-
*
|
|
867
|
+
* Portable identity/fingerprint primitives for pure Domain contracts.
|
|
868
868
|
*
|
|
869
|
-
*
|
|
870
|
-
* contains only the versioned data contract and deterministic hash primitives.
|
|
869
|
+
* FNV-1a is intentional: no Node crypto dependency for CLI/MCP/browserless consumers.
|
|
871
870
|
*/
|
|
871
|
+
/** Stable FNV-1a hash. Identity/fingerprint only — not a security primitive. */
|
|
872
|
+
declare function deterministicHash(value: string): string;
|
|
873
|
+
/** Serialize JSON-like values with sorted object keys for reproducible hashes. */
|
|
874
|
+
declare function stableSerialize(value: unknown): string;
|
|
872
875
|
|
|
873
|
-
|
|
876
|
+
/**
|
|
877
|
+
* Versioned type vocabulary for resolved candidate facts (schema 1.0).
|
|
878
|
+
*
|
|
879
|
+
* Pure declarations + schema version identity. Create/load live in
|
|
880
|
+
* resolvedCandidateFacts.ts; JSON Schema lives in resolvedCandidateFactsSchema.ts.
|
|
881
|
+
*/
|
|
874
882
|
declare const RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION: "1.0";
|
|
875
883
|
type ResolvedFactsCompleteness = 'complete' | 'partial' | 'unavailable';
|
|
876
884
|
type ResolvedDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
@@ -968,76 +976,19 @@ type ResolvedCandidateFacts = Omit<ResolvedCandidateFactsInput, 'candidateTreeHa
|
|
|
968
976
|
safetyUses: ResolvedSafetyFact[];
|
|
969
977
|
factsHash: string;
|
|
970
978
|
};
|
|
971
|
-
|
|
972
|
-
path: string;
|
|
973
|
-
content: string;
|
|
974
|
-
};
|
|
975
|
-
type AnalysisFileChange = {
|
|
976
|
-
path: string;
|
|
977
|
-
content: string;
|
|
978
|
-
} | {
|
|
979
|
-
path: string;
|
|
980
|
-
delete: true;
|
|
981
|
-
};
|
|
982
|
-
type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
|
|
983
|
-
type AnalysisFile = AnalysisFileInput & {
|
|
984
|
-
contentHash: string;
|
|
985
|
-
layer: string | null;
|
|
986
|
-
};
|
|
987
|
-
type AnalysisImportEdge = {
|
|
988
|
-
from: string;
|
|
989
|
-
specifier: string;
|
|
990
|
-
to: string | null;
|
|
991
|
-
resolution: 'resolved' | 'unresolved';
|
|
992
|
-
fromLayer: string | null;
|
|
993
|
-
toLayer: string | null;
|
|
994
|
-
evidence: AnalysisEvidence;
|
|
995
|
-
};
|
|
996
|
-
/** A capability use is reserved for C04's symbol-aware implementation. */
|
|
997
|
-
type AnalysisCapabilityUse = {
|
|
998
|
-
file: string;
|
|
999
|
-
symbol: string;
|
|
1000
|
-
capability: string;
|
|
1001
|
-
evidence: AnalysisEvidence;
|
|
1002
|
-
};
|
|
1003
|
-
type AnalysisEvidence = {
|
|
1004
|
-
kind: 'import' | 'policy';
|
|
1005
|
-
file: string;
|
|
1006
|
-
line: number;
|
|
1007
|
-
excerpt: string;
|
|
1008
|
-
};
|
|
1009
|
-
type AnalysisViolation = {
|
|
1010
|
-
ruleId: string;
|
|
1011
|
-
message: string;
|
|
1012
|
-
edge?: AnalysisImportEdge;
|
|
1013
|
-
/** U04 (additive): present on CAPABILITY_VIOLATION — the denied capability id. */
|
|
1014
|
-
capability?: string;
|
|
1015
|
-
/** U04 (additive): the matched module specifier or ambient path. */
|
|
1016
|
-
symbol?: string;
|
|
1017
|
-
evidence: AnalysisEvidence;
|
|
1018
|
-
};
|
|
1019
|
-
type AnalysisIr = {
|
|
1020
|
-
schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
|
|
1021
|
-
policyHash: string;
|
|
1022
|
-
compilerOptionsHash: string;
|
|
1023
|
-
files: AnalysisFile[];
|
|
1024
|
-
layers: string[];
|
|
1025
|
-
edges: AnalysisImportEdge[];
|
|
1026
|
-
capabilityUses: AnalysisCapabilityUse[];
|
|
1027
|
-
violations: AnalysisViolation[];
|
|
1028
|
-
};
|
|
979
|
+
|
|
1029
980
|
/**
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
981
|
+
* Canonical create/load for versioned resolved candidate facts.
|
|
982
|
+
*
|
|
983
|
+
* Types: resolvedCandidateFactsTypes.ts · Schema: resolvedCandidateFactsSchema.ts ·
|
|
984
|
+
* Hash: stableHash.ts. Plan-B god-module pilot cluster (pattern-b:god-module).
|
|
1033
985
|
*/
|
|
1034
|
-
|
|
1035
|
-
/** Serialize JSON-like values with sorted object keys for reproducible hashes. */
|
|
1036
|
-
declare function stableSerialize(value: unknown): string;
|
|
986
|
+
|
|
1037
987
|
/** Identity of the policy-controlled evidence a resolver must attempt to collect. */
|
|
1038
988
|
declare function resolvedFactsEvidenceRequirementsHash(config: ArkConfig): string;
|
|
1039
989
|
declare function createResolvedCandidateFacts(input: ResolvedCandidateFactsInput): ResolvedCandidateFacts;
|
|
1040
990
|
declare function loadResolvedCandidateFacts(input: unknown): ResolvedCandidateFacts;
|
|
991
|
+
|
|
1041
992
|
declare const RESOLVED_CANDIDATE_FACTS_SCHEMA: {
|
|
1042
993
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
1043
994
|
readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json";
|
|
@@ -1459,6 +1410,83 @@ declare const RESOLVED_CANDIDATE_FACTS_SCHEMA: {
|
|
|
1459
1410
|
}];
|
|
1460
1411
|
};
|
|
1461
1412
|
|
|
1413
|
+
/**
|
|
1414
|
+
* Stable, pure vocabulary for ArkGate's importable analysis engine.
|
|
1415
|
+
*
|
|
1416
|
+
* This module owns the Analysis IR types and re-exports the resolved-candidate-facts
|
|
1417
|
+
* pilot cluster (plan-B / pattern-b:god-module). Parsing and filesystem discovery
|
|
1418
|
+
* belong to adapters.
|
|
1419
|
+
*
|
|
1420
|
+
* Cluster:
|
|
1421
|
+
* - `stableHash` — identity/fingerprint primitives
|
|
1422
|
+
* - `resolvedCandidateFactsTypes` — versioned fact types
|
|
1423
|
+
* - `resolvedCandidateFacts` — create/load/canonicalize
|
|
1424
|
+
* - `resolvedCandidateFactsSchema` — published JSON Schema
|
|
1425
|
+
*
|
|
1426
|
+
* Consumer import paths through this facade remain stable (same pattern as Kernel
|
|
1427
|
+
* `analysis.ts` after U02).
|
|
1428
|
+
*/
|
|
1429
|
+
|
|
1430
|
+
declare const ANALYSIS_IR_SCHEMA_VERSION: "1.0";
|
|
1431
|
+
type AnalysisFileInput = {
|
|
1432
|
+
path: string;
|
|
1433
|
+
content: string;
|
|
1434
|
+
};
|
|
1435
|
+
type AnalysisFileChange = {
|
|
1436
|
+
path: string;
|
|
1437
|
+
content: string;
|
|
1438
|
+
} | {
|
|
1439
|
+
path: string;
|
|
1440
|
+
delete: true;
|
|
1441
|
+
};
|
|
1442
|
+
type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
|
|
1443
|
+
type AnalysisFile = AnalysisFileInput & {
|
|
1444
|
+
contentHash: string;
|
|
1445
|
+
layer: string | null;
|
|
1446
|
+
};
|
|
1447
|
+
type AnalysisImportEdge = {
|
|
1448
|
+
from: string;
|
|
1449
|
+
specifier: string;
|
|
1450
|
+
to: string | null;
|
|
1451
|
+
resolution: 'resolved' | 'unresolved';
|
|
1452
|
+
fromLayer: string | null;
|
|
1453
|
+
toLayer: string | null;
|
|
1454
|
+
evidence: AnalysisEvidence;
|
|
1455
|
+
};
|
|
1456
|
+
/** A capability use is reserved for C04's symbol-aware implementation. */
|
|
1457
|
+
type AnalysisCapabilityUse = {
|
|
1458
|
+
file: string;
|
|
1459
|
+
symbol: string;
|
|
1460
|
+
capability: string;
|
|
1461
|
+
evidence: AnalysisEvidence;
|
|
1462
|
+
};
|
|
1463
|
+
type AnalysisEvidence = {
|
|
1464
|
+
kind: 'import' | 'policy';
|
|
1465
|
+
file: string;
|
|
1466
|
+
line: number;
|
|
1467
|
+
excerpt: string;
|
|
1468
|
+
};
|
|
1469
|
+
type AnalysisViolation = {
|
|
1470
|
+
ruleId: string;
|
|
1471
|
+
message: string;
|
|
1472
|
+
edge?: AnalysisImportEdge;
|
|
1473
|
+
/** U04 (additive): present on CAPABILITY_VIOLATION — the denied capability id. */
|
|
1474
|
+
capability?: string;
|
|
1475
|
+
/** U04 (additive): the matched module specifier or ambient path. */
|
|
1476
|
+
symbol?: string;
|
|
1477
|
+
evidence: AnalysisEvidence;
|
|
1478
|
+
};
|
|
1479
|
+
type AnalysisIr = {
|
|
1480
|
+
schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
|
|
1481
|
+
policyHash: string;
|
|
1482
|
+
compilerOptionsHash: string;
|
|
1483
|
+
files: AnalysisFile[];
|
|
1484
|
+
layers: string[];
|
|
1485
|
+
edges: AnalysisImportEdge[];
|
|
1486
|
+
capabilityUses: AnalysisCapabilityUse[];
|
|
1487
|
+
violations: AnalysisViolation[];
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1462
1490
|
declare const ARK_CHANGE_MAP_SCHEMA_VERSION: "1.0";
|
|
1463
1491
|
type ArchitectureChangeOperation = 'create' | 'update' | 'delete';
|
|
1464
1492
|
type ArchitectureChangeMapFile = {
|