arkgate 4.8.22 → 4.8.24
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 +91 -0
- package/README.md +7 -5
- package/bin/ark-check-runtime.mjs +27 -78
- package/bin/ark-dashboard.mjs +56 -53
- package/bin/ark-layer-match.mjs +1117 -38
- package/bin/ark-mcp-runtime.mjs +412 -138
- package/bin/ark-mcp.mjs +68 -4
- package/bin/ark-shared.mjs +39 -0
- package/bin/ark.mjs +65 -97
- package/bin/lib/adapter-contract-types.mjs +5 -0
- package/bin/lib/adapter-contract.mjs +15 -0
- package/bin/lib/agent-projection-command.mjs +5 -1
- package/bin/lib/analysis-engine.mjs +15 -11
- package/bin/lib/architecture-scan.mjs +50 -6
- package/bin/lib/ark-order-doctor.mjs +1 -1
- package/bin/lib/ark-order-facts.mjs +410 -15
- package/bin/lib/ark-order-invariants.mjs +51 -9
- package/bin/lib/ark-order-sensors.mjs +28 -101
- package/bin/lib/ark-order-types.mjs +2 -0
- package/bin/lib/ark-run-doctor.mjs +14 -0
- package/bin/lib/ark-run-facts.mjs +434 -11
- package/bin/lib/ark-run-sensors.mjs +5 -3
- package/bin/lib/arkgate-pins.mjs +91 -0
- package/bin/lib/arkrules-sensors.mjs +50 -249
- package/bin/lib/check-args.mjs +23 -1
- package/bin/lib/ci-and-commands.mjs +16 -6
- package/bin/lib/class-source-scan.mjs +479 -0
- package/bin/lib/codex-home.mjs +4 -2
- package/bin/lib/config-contract-slices.mjs +701 -0
- package/bin/lib/config-contract.mjs +5 -2
- package/bin/lib/config-warnings.mjs +32 -0
- package/bin/lib/dashboard-cli.mjs +62 -0
- package/bin/lib/design-delta.mjs +1 -1
- package/bin/lib/diagnostic-catalog.mjs +45 -6
- package/bin/lib/doctor-advisories.mjs +84 -1
- package/bin/lib/doctor-next-actions.mjs +17 -2
- package/bin/lib/doctor-plan.mjs +7 -9
- package/bin/lib/effective-contract-load.mjs +121 -59
- package/bin/lib/enforcement-honesty.mjs +22 -0
- package/bin/lib/enforcement-profiles.mjs +40 -4
- package/bin/lib/first-run-help.mjs +3 -2
- package/bin/lib/flat-parent-importers.mjs +137 -0
- package/bin/lib/flat-parent-pilot.mjs +192 -0
- package/bin/lib/gate-files.mjs +29 -2
- package/bin/lib/git-change-scope.mjs +109 -0
- package/bin/lib/github-enforcement.mjs +1 -1
- package/bin/lib/hook-templates.mjs +18 -16
- package/bin/lib/host-support-matrix.mjs +3 -1
- package/bin/lib/html-report-advisories.mjs +2 -0
- package/bin/lib/html-report-depth.mjs +3 -1
- package/bin/lib/import-resolve.mjs +13 -1
- package/bin/lib/install-migrate.mjs +50 -73
- package/bin/lib/invariant-coverage.mjs +59 -11
- package/bin/lib/mcp-adoption.mjs +9 -1
- package/bin/lib/mcp-hook-payload.mjs +401 -61
- package/bin/lib/package-manager.mjs +59 -1
- package/bin/lib/passthrough-commands.mjs +83 -0
- package/bin/lib/persistence-write-hint.mjs +81 -0
- package/bin/lib/physical-cohesion.mjs +16 -18
- package/bin/lib/pilot-loop.mjs +21 -8
- package/bin/lib/pin-dependent-gates.mjs +117 -0
- package/bin/lib/policy-delta-io.mjs +168 -10
- package/bin/lib/prepare-change.mjs +120 -6
- package/bin/lib/prepare-write.mjs +1 -0
- package/bin/lib/presets.mjs +3 -5
- package/bin/lib/remediation.mjs +23 -4
- package/bin/lib/resolved-candidate-facts.mjs +315 -55
- package/bin/lib/rules-inventory.mjs +22 -3
- package/bin/lib/rules-under-contract.mjs +179 -5
- package/bin/lib/scan-files.mjs +32 -0
- package/bin/lib/snippet-analysis.mjs +140 -6
- package/bin/lib/source-policy.mjs +34 -0
- package/bin/lib/stable-hash.mjs +90 -0
- package/bin/lib/start-install-recovery.mjs +71 -1
- package/bin/lib/start-preview.mjs +30 -0
- package/bin/lib/status-command.mjs +33 -4
- package/bin/lib/status-manifest.mjs +32 -4
- package/bin/lib/team-parliament-io.mjs +79 -75
- package/bin/lib/team-parliament.mjs +6 -1
- package/bin/lib/write-path-capabilities.mjs +4 -2
- package/dist/chunk-A5EIY3HI.cjs +5 -0
- package/dist/chunk-MBXCFLO4.js +16 -0
- package/dist/chunk-RNQHRDCQ.cjs +16 -0
- package/dist/chunk-SVSQVGFJ.js +5 -0
- package/dist/{configTypes-CTELo87-.d.ts → configTypes-BJbaeoj4.d.cts} +53 -4
- package/dist/configTypes-BJbaeoj4.d.ts +246 -0
- package/dist/eslint/index.cjs +17 -4
- package/dist/eslint/index.d.cts +359 -0
- package/dist/eslint/index.d.ts +178 -158
- package/dist/eslint/index.js +10 -4
- package/dist/index.cjs +38 -37
- package/dist/index.d.cts +5475 -0
- package/dist/index.d.ts +3408 -296
- package/dist/index.js +38 -37
- package/dist/inspectorListen-6DQVJ4DC.js +1 -0
- package/dist/inspectorListen-KGMIQ2TF.cjs +1 -0
- package/dist/nestjs/index.cjs +1 -18
- package/dist/nestjs/index.d.cts +22 -0
- package/dist/nestjs/index.d.ts +1 -3
- package/dist/nestjs/index.js +1 -18
- package/dist/order/index.cjs +1 -1
- package/dist/order/index.d.cts +155 -0
- package/dist/order/index.d.ts +15 -3
- package/dist/order/index.js +1 -1
- package/dist/runtime/index.cjs +13 -30
- package/dist/{diagnosticCatalog-WD2TPSwZ.d.ts → runtime/index.d.cts} +814 -290
- package/dist/runtime/index.d.ts +2678 -108
- package/dist/runtime/index.js +13 -30
- package/dist/{types-yDNEQ603.d.ts → types-DRinG-vT.d.cts} +576 -140
- package/dist/types-DRinG-vT.d.ts +1792 -0
- package/docs/README.md +3 -1
- package/docs/agent-guide.md +92 -15
- package/docs/ai-gates.md +160 -26
- package/docs/arkorder.md +32 -15
- package/docs/brownfield-adoption.md +5 -1
- package/docs/configuration.md +273 -12
- package/docs/develop.md +2 -1
- package/docs/diagnostics.md +122 -13
- package/docs/package-surface.md +31 -8
- package/docs/product-voice.md +1 -1
- package/package.json +59 -18
- package/schemas/ark.analysis-result.schema.json +15 -0
- package/schemas/ark.config.schema.json +163 -4
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/schemas/ark.status-manifest.schema.json +22 -0
- package/server.json +3 -9
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +4 -1
- package/templates/agent-skills/ark-order/SKILL.md +4 -2
- package/templates/agent-skills/ark-runtime/SKILL.md +6 -1
- package/templates/arkrules/PersistenceAdapters.json +1 -1
- package/templates/arkrules/PresentationAdapters.json +1 -1
- package/templates/skills/ark-adopt.md +4 -1
- package/templates/skills/ark-order.md +4 -2
- package/templates/skills/ark-runtime.md +6 -1
- package/dist/types-fQ9-KrBj.d.ts +0 -183
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type vocabulary for the ark.config.json contract (U02 pilot 1).
|
|
3
|
+
*
|
|
4
|
+
* Pure declarations only — no runtime values. The loader/validator logic and the
|
|
5
|
+
* published JSON Schema live in ./configContract.ts. Extra defaulting lives in
|
|
6
|
+
* ./configExtras.ts (generated sibling `config-extras.mjs`). Type-only imports
|
|
7
|
+
* from this file are erased on transpile.
|
|
8
|
+
*/
|
|
9
|
+
type ArkConfigSchemaVersion = '1.0' | '1.1' | '1.2' | '1.3';
|
|
10
|
+
type ArkConfigCyclePolicy = 'strict' | 'soft' | 'framework-soft' | 'off';
|
|
11
|
+
type ArkConfigLayerCapabilities = {
|
|
12
|
+
deny?: string[];
|
|
13
|
+
};
|
|
14
|
+
/** Who this folder is for. Metadata — not import-rule teeth. Absence is silent. */
|
|
15
|
+
type ArkConfigLayerTrustBoundary = 'public' | 'auth' | 'admin' | 'internal';
|
|
16
|
+
type ArkConfigLayer = {
|
|
17
|
+
name: string;
|
|
18
|
+
patterns: string[];
|
|
19
|
+
exclude?: string[];
|
|
20
|
+
intentPrefixes?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* App-context caption for this layer.
|
|
23
|
+
* Metadata — excluded from policy hash. Absence is silent.
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Who this folder is for: public | auth | admin | internal.
|
|
28
|
+
* Metadata — excluded from policy hash. Absence is silent. Not host/CI TLS.
|
|
29
|
+
*/
|
|
30
|
+
trustBoundary?: ArkConfigLayerTrustBoundary;
|
|
31
|
+
/**
|
|
32
|
+
* Who owns this house: GitHub handles or emails (same identity as stewards).
|
|
33
|
+
* Metadata — excluded from policy hash. Absence is silent unless
|
|
34
|
+
* `requireLayerOwners` is true. Not import-rule teeth.
|
|
35
|
+
*/
|
|
36
|
+
owners?: string[];
|
|
37
|
+
forbiddenGlobals?: string[];
|
|
38
|
+
/** ADR 0009 D2 — opt-in effect-capability walls; absence changes no verdict. */
|
|
39
|
+
capabilities?: ArkConfigLayerCapabilities;
|
|
40
|
+
/** Dual-depth sugar: `pure: true` denies all seven capabilities. */
|
|
41
|
+
pure?: boolean;
|
|
42
|
+
mayImportInfrastructure?: boolean;
|
|
43
|
+
optional?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Future house: empty globs are expected. `--strict-config` must not fail.
|
|
46
|
+
* Typo warning (`CONFIG_LAYER_PATTERN_NO_MATCHES`) is skipped.
|
|
47
|
+
*/
|
|
48
|
+
reserved?: boolean;
|
|
49
|
+
/** Alias of reserved — empty pattern matches are allowed. */
|
|
50
|
+
allowEmpty?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** How a starred `sliceFolders` prefix is named. Absent equals `path`. */
|
|
53
|
+
type ArkConfigSliceIdentity = 'path' | 'stars';
|
|
54
|
+
type ArkConfigRule = {
|
|
55
|
+
from: string;
|
|
56
|
+
to: string;
|
|
57
|
+
allowed: boolean;
|
|
58
|
+
message?: string;
|
|
59
|
+
peerIsolation?: boolean;
|
|
60
|
+
sliceFolders?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* How a starred `sliceFolders` prefix is named.
|
|
63
|
+
* Absent and `path` keep today's ids. `stars` is the last literal plus every
|
|
64
|
+
* star binding (a star before the last literal is kept too).
|
|
65
|
+
*/
|
|
66
|
+
sliceIdentity?: ArkConfigSliceIdentity;
|
|
67
|
+
/** Roots the repo declares shared on purpose — evidence, not unclassifiable. */
|
|
68
|
+
sharedRoots?: string[];
|
|
69
|
+
/** Directed slice→slice edges the repo declares on purpose. */
|
|
70
|
+
allowedCrossSlice?: ArkConfigCrossSliceEdge[];
|
|
71
|
+
/**
|
|
72
|
+
* `"deny"` blocks a shared root from importing a slice.
|
|
73
|
+
* `"deny-cross-parent"` leaves that hop allowed and asks the whole-graph
|
|
74
|
+
* check to report a slice that reaches another universe through shared.
|
|
75
|
+
* The object form carries `stopAt`: composition roots the walk never
|
|
76
|
+
* passes through.
|
|
77
|
+
*/
|
|
78
|
+
sharedImportsSlice?: ArkConfigSharedImportsSlice;
|
|
79
|
+
/**
|
|
80
|
+
* Optional inner wall. Absent keeps today's universe-wall output.
|
|
81
|
+
* `siblings` defaults to deny. An object keeps that default and lists enforced subtrees.
|
|
82
|
+
* `parentMayImportChild` defaults to false.
|
|
83
|
+
*/
|
|
84
|
+
childSlices?: ArkConfigChildSlices;
|
|
85
|
+
};
|
|
86
|
+
type ArkConfigSharedImportsSlice = 'deny' | 'deny-cross-parent' | {
|
|
87
|
+
mode: 'deny-cross-parent';
|
|
88
|
+
stopAt: string[];
|
|
89
|
+
};
|
|
90
|
+
type ArkConfigChildSlices = {
|
|
91
|
+
sliceFolders: string[];
|
|
92
|
+
sliceIdentity?: ArkConfigSliceIdentity;
|
|
93
|
+
commonFolders?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* `ratchet` on the object form: absent turns the anti-growth ratchet on only
|
|
96
|
+
* when the baseline already records an advisory crossing of this rule;
|
|
97
|
+
* `true` always; `false` measures only.
|
|
98
|
+
*/
|
|
99
|
+
siblings?: 'deny' | 'advisory' | {
|
|
100
|
+
default: 'deny' | 'advisory';
|
|
101
|
+
enforce?: string[];
|
|
102
|
+
ratchet?: boolean;
|
|
103
|
+
};
|
|
104
|
+
parentMayImportChild?: boolean;
|
|
105
|
+
/** Text for inner-wall findings (sibling, common → child). Absent: ArkGate default, never the rule message. */
|
|
106
|
+
message?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Directed child-slice allowances. `*` is one whole path segment.
|
|
109
|
+
* Clears a sibling crossing only. The universe `allowedCrossSlice` does not read this list.
|
|
110
|
+
*/
|
|
111
|
+
allowedCrossSlice?: ArkConfigCrossSliceEdge[];
|
|
112
|
+
/**
|
|
113
|
+
* Files outside the slice trees, borrowed onto a child id until they move.
|
|
114
|
+
* `to` is the universe id plus one child segment.
|
|
115
|
+
*/
|
|
116
|
+
sliceAliases?: ArkConfigSliceAlias[];
|
|
117
|
+
};
|
|
118
|
+
type ArkConfigSliceAlias = {
|
|
119
|
+
from: string;
|
|
120
|
+
to: string;
|
|
121
|
+
};
|
|
122
|
+
type ArkConfigCrossSliceEdge = {
|
|
123
|
+
from: string;
|
|
124
|
+
to: string;
|
|
125
|
+
};
|
|
126
|
+
type ArkConfigSafety = {
|
|
127
|
+
maxTsSuppressions?: number;
|
|
128
|
+
maxAnyCasts?: number;
|
|
129
|
+
allowInMemory?: boolean;
|
|
130
|
+
allowDisabledPeerIsolation?: boolean;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Optional invariant-coverage scan controls. Absence keeps the built-in
|
|
134
|
+
* defaults (test-name heuristic, 400-file budget) and changes no verdict.
|
|
135
|
+
*/
|
|
136
|
+
type ArkConfigCoverage = {
|
|
137
|
+
/** Globs that decide which files count as tests (replaces the name heuristic). */
|
|
138
|
+
testGlobs?: string[];
|
|
139
|
+
/** Max files loaded as coverage evidence before the budget is exhausted. */
|
|
140
|
+
maxFiles?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Path prefixes where this project declares its test runner actually executes
|
|
143
|
+
* tests. ArkGate never runs anything: this is a second declaration to compare
|
|
144
|
+
* the coverage scan against, so a covering test found outside them is reported
|
|
145
|
+
* (INVARIANT_COVERAGE_OUTSIDE_ROOTS) instead of silently certifying the
|
|
146
|
+
* invariant. Absence is silent unless any catalogued invariant is enforced —
|
|
147
|
+
* then missing roots fail closed (INVARIANT_COVERAGE_ROOTS_MISSING).
|
|
148
|
+
*/
|
|
149
|
+
coverageRoots?: string[];
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* ADR 0012 — optional map of layer name → project-relative ArkRules file path.
|
|
153
|
+
* Absence changes no inter-layer verdict.
|
|
154
|
+
*/
|
|
155
|
+
type ArkConfigArkRulesRefs = Record<string, string>;
|
|
156
|
+
/** ADR 0020 — advisory never adds merge teeth; enforced is the extra's merge plane. */
|
|
157
|
+
type ArkConfigArkRunMode = 'advisory' | 'enforced';
|
|
158
|
+
/**
|
|
159
|
+
* ADR 0020 — optional inline ArkRun extra (schema 1.2+). Absence is silent.
|
|
160
|
+
* Present objects are fully defaulted by the loader.
|
|
161
|
+
*/
|
|
162
|
+
type ArkConfigArkRun = {
|
|
163
|
+
mode: ArkConfigArkRunMode;
|
|
164
|
+
compositionRoots: string[];
|
|
165
|
+
kernelRoots?: string[];
|
|
166
|
+
managedLayers: string[];
|
|
167
|
+
requireDeclarations: boolean;
|
|
168
|
+
ignoreDirectNewForErrors?: boolean;
|
|
169
|
+
};
|
|
170
|
+
/** ADR 0027 — advisory never adds merge teeth; enforced is the extra's merge plane. */
|
|
171
|
+
type ArkConfigArkOrderMode = 'advisory' | 'enforced';
|
|
172
|
+
/**
|
|
173
|
+
* ADR 0027 — optional inline ArkOrder extra (schema 1.3+). Absence is silent.
|
|
174
|
+
* Present objects are fully defaulted by the loader.
|
|
175
|
+
*/
|
|
176
|
+
type ArkConfigArkOrder = {
|
|
177
|
+
mode: ArkConfigArkOrderMode;
|
|
178
|
+
planeRoots: string[];
|
|
179
|
+
managedLayers: string[];
|
|
180
|
+
/**
|
|
181
|
+
* Haken cap on one `release()` / `assertXiKeyCap` (default 7).
|
|
182
|
+
* Not a cap on the `xiKeys` watchlist length.
|
|
183
|
+
*/
|
|
184
|
+
maxXiKeys: number;
|
|
185
|
+
/**
|
|
186
|
+
* Slow product keys the team can already name (plan, cost code, protocol).
|
|
187
|
+
* Optional. Empty → `ARKORDER_XI_FIELD_WRITE` stays silent.
|
|
188
|
+
* Repo-wide watchlist — not compared to `maxXiKeys`.
|
|
189
|
+
*/
|
|
190
|
+
xiKeys: string[];
|
|
191
|
+
/**
|
|
192
|
+
* Optional globs that narrow ξ field-write observation inside `managedLayers`.
|
|
193
|
+
* Same glob engine as `layers[].patterns`. Absence or empty → every file in
|
|
194
|
+
* those layers. Non-empty → emit only when the layer is managed AND the file
|
|
195
|
+
* matches at least one glob.
|
|
196
|
+
*/
|
|
197
|
+
appliesTo?: string[];
|
|
198
|
+
};
|
|
199
|
+
type ArkConfig = {
|
|
200
|
+
$schema: string;
|
|
201
|
+
schemaVersion: ArkConfigSchemaVersion;
|
|
202
|
+
name?: string;
|
|
203
|
+
include: string[];
|
|
204
|
+
exclude?: string[];
|
|
205
|
+
excludeGenerated?: boolean;
|
|
206
|
+
frameworkOverlay?: string;
|
|
207
|
+
layers: ArkConfigLayer[];
|
|
208
|
+
rules: ArkConfigRule[];
|
|
209
|
+
cyclePolicy?: ArkConfigCyclePolicy;
|
|
210
|
+
dynamicImportAllowlist?: string[];
|
|
211
|
+
safety?: ArkConfigSafety;
|
|
212
|
+
/**
|
|
213
|
+
* Invariant-coverage scan controls (test globs + file budget).
|
|
214
|
+
* Absence keeps the defaults; it never turns coverage on by itself.
|
|
215
|
+
*/
|
|
216
|
+
coverage?: ArkConfigCoverage;
|
|
217
|
+
/** ADR 0012 — modular ArkRules references (schema 1.1+). */
|
|
218
|
+
arkRules?: ArkConfigArkRulesRefs;
|
|
219
|
+
/** ADR 0020 — optional ArkRun extra (schema 1.2+). Absence changes no Layers/ArkRules verdict. */
|
|
220
|
+
arkRun?: ArkConfigArkRun;
|
|
221
|
+
/** ADR 0027 — optional ArkOrder extra (schema 1.3+). Absence changes no Layers/ArkRules/ArkRun verdict. */
|
|
222
|
+
arkOrder?: ArkConfigArkOrder;
|
|
223
|
+
/**
|
|
224
|
+
* Optional GitHub handles or emails who may loosen the contract or grow the baseline.
|
|
225
|
+
* Metadata — excluded from policy hash. Absence means no steward lock (policy-ack still applies).
|
|
226
|
+
*/
|
|
227
|
+
stewards?: string[];
|
|
228
|
+
/**
|
|
229
|
+
* When true, every non-reserved layer must name `owners`. Absence/false is
|
|
230
|
+
* silent. This flag is policy teeth (stays in policyHash). Owners themselves
|
|
231
|
+
* stay metadata.
|
|
232
|
+
*/
|
|
233
|
+
requireLayerOwners?: boolean;
|
|
234
|
+
};
|
|
235
|
+
type ArkConfigIssue = {
|
|
236
|
+
path: string;
|
|
237
|
+
message: string;
|
|
238
|
+
};
|
|
239
|
+
/** Original input version when the loader rewrote schemaVersion toward current. */
|
|
240
|
+
type ArkConfigMigratedFrom = 'unversioned' | '1.0' | '1.1' | '1.2' | null;
|
|
241
|
+
type ArkConfigLoadResult = {
|
|
242
|
+
config: ArkConfig;
|
|
243
|
+
migratedFrom: ArkConfigMigratedFrom;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export type { ArkConfig as A, ArkConfigRule as a, ArkConfigSchemaVersion as b, ArkConfigLoadResult as c, ArkConfigLayer as d, ArkConfigIssue as e, ArkConfigArkRun as f, ArkConfigArkOrder as g };
|