arkgate 4.8.10 → 4.8.13
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 +74 -2
- package/README.md +23 -32
- package/bin/ark-check-runtime.mjs +8 -0
- package/bin/ark-check.mjs +3 -0
- package/bin/lib/adapter-contract-types.mjs +137 -0
- package/bin/lib/adapter-contract.mjs +4 -180
- package/bin/lib/adapter-finding-refs.mjs +63 -0
- package/bin/lib/agent-projection-formatters.mjs +151 -0
- package/bin/lib/agent-projection-merge.mjs +148 -0
- package/bin/lib/agent-projection-types.mjs +42 -0
- package/bin/lib/agent-projection.mjs +3 -309
- package/bin/lib/analysis-engine.mjs +4 -4
- package/bin/lib/ark-order-doctor.mjs +154 -0
- package/bin/lib/ark-order-report.mjs +64 -0
- package/bin/lib/ark-order-sensors.mjs +1 -1
- package/bin/lib/diagnostic-catalog.mjs +2 -2
- package/bin/lib/doctor-advisories.mjs +91 -18
- package/bin/lib/doctor-human.mjs +2 -10
- package/bin/lib/doctor-plan.mjs +4 -3
- package/bin/lib/extra-merge-teeth.mjs +32 -4
- package/bin/lib/html-report-advisories.mjs +2 -0
- package/bin/lib/html-report-depth.mjs +8 -18
- package/bin/lib/html-report.mjs +16 -0
- package/bin/lib/project-root.mjs +70 -4
- package/bin/lib/remediation.mjs +5 -5
- package/bin/lib/rules-under-contract.mjs +14 -0
- package/bin/lib/start-preview.mjs +1 -0
- package/bin/lib/status-command.mjs +28 -0
- package/bin/lib/status-manifest.mjs +23 -0
- package/bin/lib/violations.mjs +10 -1
- package/dist/{diagnosticCatalog-biferT4R.d.ts → diagnosticCatalog-DA565Lja.d.ts} +22 -39
- package/dist/eslint/index.cjs +4 -4
- package/dist/eslint/index.js +4 -4
- package/dist/index.cjs +31 -31
- package/dist/index.d.ts +116 -12
- package/dist/index.js +31 -31
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/runtime/index.cjs +15 -15
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +15 -15
- package/docs/README.md +5 -4
- package/docs/agent-guide.md +2 -1
- package/docs/arkorder.md +28 -10
- package/docs/package-surface.md +3 -1
- package/docs/product-voice.md +9 -8
- package/docs/use.md +1 -1
- package/package.json +3 -2
- package/schemas/ark.status-manifest.schema.json +47 -0
- package/server.json +2 -2
package/bin/lib/project-root.mjs
CHANGED
|
@@ -88,10 +88,64 @@ export function resolveConfigPathWithinRoot(projectRoot, configPathOrName) {
|
|
|
88
88
|
return { ok: true, configPath };
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function isFile(absPath) {
|
|
92
|
+
try {
|
|
93
|
+
return Boolean(fs.statSync(absPath, { throwIfNoEntry: false })?.isFile());
|
|
94
|
+
} catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** True when --config is a path (nested or absolute), not a basename to walk. */
|
|
100
|
+
export function configNameIsPath(configName) {
|
|
101
|
+
return (
|
|
102
|
+
typeof configName === 'string' &&
|
|
103
|
+
(path.isAbsolute(configName) || /[\\/]/.test(configName))
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function isInsideRoot(root, target) {
|
|
108
|
+
const rel = path.relative(root, target);
|
|
109
|
+
return rel === '' || (!rel.startsWith(`..${path.sep}`) && rel !== '..' && !path.isAbsolute(rel));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Resolve a nested/absolute --config path without walking parents.
|
|
114
|
+
* `--root examples/app --config examples/app/ark.config.json` must load the nested
|
|
115
|
+
* contract, not latch onto a parent basename walk.
|
|
116
|
+
*
|
|
117
|
+
* @param {string} startDir
|
|
118
|
+
* @param {string} configName
|
|
119
|
+
* @returns {string | null} absolute config file path
|
|
120
|
+
*/
|
|
121
|
+
export function resolveConfigPathCandidate(startDir, configName) {
|
|
122
|
+
if (typeof configName !== 'string' || configName.trim() === '') return null;
|
|
123
|
+
const start = path.resolve(startDir || process.cwd());
|
|
124
|
+
if (path.isAbsolute(configName)) return isFile(configName) ? path.resolve(configName) : null;
|
|
125
|
+
|
|
126
|
+
const fromStart = path.resolve(start, configName);
|
|
127
|
+
if (isFile(fromStart)) return fromStart;
|
|
128
|
+
|
|
129
|
+
const base = path.basename(configName);
|
|
130
|
+
const relDir = path.dirname(configName);
|
|
131
|
+
if (relDir && relDir !== '.') {
|
|
132
|
+
const namedLeaf = path.basename(relDir);
|
|
133
|
+
if (namedLeaf && namedLeaf === path.basename(start)) {
|
|
134
|
+
const stripped = path.join(start, base);
|
|
135
|
+
if (isFile(stripped)) return stripped;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const fromCwd = path.resolve(process.cwd(), configName);
|
|
140
|
+
if (fromCwd !== fromStart && isFile(fromCwd)) return fromCwd;
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
|
|
91
144
|
/**
|
|
92
145
|
* Walk parents from startDir looking for configName (default ark.config.json).
|
|
93
146
|
* Bounds: filesystem root, max depth, git root, workspaces package root.
|
|
94
147
|
* Config found at a bound root is accepted; walking above a bound is refused.
|
|
148
|
+
* Nested relative --config (`examples/app/ark.config.json`) is a file path, never a walk-up name.
|
|
95
149
|
*
|
|
96
150
|
* @param {string} startDir
|
|
97
151
|
* @param {string} [configName='ark.config.json']
|
|
@@ -104,17 +158,29 @@ export function findNearestArkConfig(startDir, configName = 'ark.config.json', o
|
|
|
104
158
|
const boundAtWorkspaces = opts.boundAtWorkspacesRoot !== false;
|
|
105
159
|
|
|
106
160
|
if (typeof configName === 'string' && path.isAbsolute(configName)) {
|
|
107
|
-
if (
|
|
161
|
+
if (isFile(configName)) {
|
|
108
162
|
const root = path.dirname(configName);
|
|
109
163
|
const start = path.resolve(startDir || process.cwd());
|
|
110
|
-
return { root, configPath: configName, walkedUp: path.resolve(root) !== start };
|
|
164
|
+
return { root, configPath: path.resolve(configName), walkedUp: path.resolve(root) !== start };
|
|
111
165
|
}
|
|
112
166
|
return null;
|
|
113
167
|
}
|
|
114
168
|
|
|
169
|
+
const name = configName || 'ark.config.json';
|
|
170
|
+
if (configNameIsPath(name)) {
|
|
171
|
+
const resolved = resolveConfigPathCandidate(startDir, name);
|
|
172
|
+
if (!resolved) return null;
|
|
173
|
+
const start = path.resolve(startDir || process.cwd());
|
|
174
|
+
const inside = isInsideRoot(start, resolved);
|
|
175
|
+
return {
|
|
176
|
+
root: inside ? start : path.dirname(resolved),
|
|
177
|
+
configPath: resolved,
|
|
178
|
+
walkedUp: !inside,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
115
182
|
let dir = path.resolve(startDir || process.cwd());
|
|
116
183
|
const start = dir;
|
|
117
|
-
const name = configName || 'ark.config.json';
|
|
118
184
|
let depth = 0;
|
|
119
185
|
for (;;) {
|
|
120
186
|
const candidate = path.join(dir, name);
|
|
@@ -231,7 +297,7 @@ export function resolveEffectiveProjectRoot(startRoot, opts = {}) {
|
|
|
231
297
|
config: configName,
|
|
232
298
|
configPath: found.configPath,
|
|
233
299
|
configRoot: found.root,
|
|
234
|
-
walkedUp:
|
|
300
|
+
walkedUp: found.walkedUp,
|
|
235
301
|
configFound: true,
|
|
236
302
|
writeRootFollowedConfig: adoptWalkedRoot && found.walkedUp,
|
|
237
303
|
};
|
package/bin/lib/remediation.mjs
CHANGED
|
@@ -239,15 +239,15 @@ export function deterministicNextAction(violation) {
|
|
|
239
239
|
case 'ARKORDER_KERNEL_IN_DOMAIN':
|
|
240
240
|
return 'Move the arkgate/order import out of the Domain-role layer into a plane root or adapter, then preflight again. Never mechanical-safe.';
|
|
241
241
|
case 'ARKORDER_GENERIC_UPDATE':
|
|
242
|
-
return '
|
|
242
|
+
return 'Don\'t use a generic update. First freeze with release(). Later, propose the change, then apply it.';
|
|
243
243
|
case 'ARKORDER_TOO_MANY_PARAMS':
|
|
244
244
|
return 'Cut ξ to the slow keys that actually slave the rest, then preflight again. Never mechanical-safe.';
|
|
245
245
|
case 'ARKORDER_INGEST_WRITES_XI':
|
|
246
246
|
return 'Keep ingest results as absorb/escalate_up/hold only. Change ξ with proposeRelease then apply(ProposeResult). Never mechanical-safe.';
|
|
247
247
|
case 'ARKORDER_XI_FIELD_WRITE':
|
|
248
248
|
return typeof violation.target === 'string' && violation.target.length > 0
|
|
249
|
-
? `
|
|
250
|
-
: '
|
|
249
|
+
? `Don't write ${violation.target} from a use-case. Take the event in, or change that choice through the valve (proposeRelease then apply), not a generic update.`
|
|
250
|
+
: "Don't write a named product choice from a use-case. Take the event in, or change that choice through the valve (proposeRelease then apply), not a generic update.";
|
|
251
251
|
case 'ARKORDER_UNVALVED_RELEASE':
|
|
252
252
|
return 'Change ξ with proposeRelease then apply(ProposeResult). release() is only the first freeze. Never mechanical-safe.';
|
|
253
253
|
default:
|
|
@@ -528,7 +528,7 @@ export function enrichViolationWithFixClass(violation) {
|
|
|
528
528
|
enriched.effort = 'medium';
|
|
529
529
|
enriched.enthusiastHint =
|
|
530
530
|
violation.ruleId === 'ARKORDER_GENERIC_UPDATE'
|
|
531
|
-
? '
|
|
531
|
+
? 'Don\'t PATCH the billing plan. First freeze with release(), or propose the change then apply it.'
|
|
532
532
|
: violation.ruleId === 'ARKORDER_KERNEL_IN_DOMAIN'
|
|
533
533
|
? 'Domain stays plane-free. Import arkgate/order only from a listed plane root.'
|
|
534
534
|
: violation.ruleId === 'ARKORDER_TOO_MANY_PARAMS'
|
|
@@ -536,7 +536,7 @@ export function enrichViolationWithFixClass(violation) {
|
|
|
536
536
|
: violation.ruleId === 'ARKORDER_INGEST_WRITES_XI'
|
|
537
537
|
? 'ingest can absorb or escalate. It never writes a new house.'
|
|
538
538
|
: violation.ruleId === 'ARKORDER_XI_FIELD_WRITE'
|
|
539
|
-
? 'Name the
|
|
539
|
+
? 'Name the few big choices in arkOrder.xiKeys. Invoices and seats still flow; changing the plan goes through the valve, not a generic update.'
|
|
540
540
|
: violation.ruleId === 'ARKORDER_INFORMATION_BUDGET'
|
|
541
541
|
? 'A scale may not observe a denied kind. Cut it from the projector or from cannotObserve.'
|
|
542
542
|
: violation.ruleId === 'ARKORDER_XI_TTL'
|
|
@@ -62,6 +62,18 @@ function arkRunMergeInput(config, residualCount = 0) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
function arkOrderMergeInput(config, residualCount = 0) {
|
|
66
|
+
const extra = config?.arkOrder;
|
|
67
|
+
if (!extra || typeof extra !== 'object') {
|
|
68
|
+
return { present: false, mode: null, residualCount: 0 };
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
present: true,
|
|
72
|
+
mode: extra.mode === 'enforced' || extra.mode === 'advisory' ? extra.mode : null,
|
|
73
|
+
residualCount: Number(residualCount) || 0,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
65
77
|
export function summarizeRulesUnderContract(root, config, facts, classification) {
|
|
66
78
|
if (!config?.arkRules || Object.keys(config.arkRules).length === 0) {
|
|
67
79
|
return {
|
|
@@ -74,6 +86,7 @@ export function summarizeRulesUnderContract(root, config, facts, classification)
|
|
|
74
86
|
classification,
|
|
75
87
|
arkRules: { active: false },
|
|
76
88
|
arkRun: arkRunMergeInput(config),
|
|
89
|
+
arkOrder: arkOrderMergeInput(config),
|
|
77
90
|
}),
|
|
78
91
|
notAScore: true,
|
|
79
92
|
note: 'No arkRules map — intra-layer ArkRules are opt-in.',
|
|
@@ -187,6 +200,7 @@ export function summarizeRulesUnderContract(root, config, facts, classification)
|
|
|
187
200
|
uncovered: uncoveredInvariants,
|
|
188
201
|
},
|
|
189
202
|
arkRun: arkRunMergeInput(config),
|
|
203
|
+
arkOrder: arkOrderMergeInput(config),
|
|
190
204
|
});
|
|
191
205
|
|
|
192
206
|
return {
|
|
@@ -162,6 +162,7 @@ export function renderStartPreview(preview, options = {}) {
|
|
|
162
162
|
if (!applying) {
|
|
163
163
|
console.log('Setup: install package + host gates (see --json).');
|
|
164
164
|
console.log('Preview does not write. Apply installs CI.');
|
|
165
|
+
console.log('Optional extras stay off. This start is layers only — they stop bad imports.');
|
|
165
166
|
}
|
|
166
167
|
if (preview.runtimeActivation) {
|
|
167
168
|
console.log('Host: Codex is configured but not verified yet. Restart the host, then confirm this project.');
|
|
@@ -26,6 +26,7 @@ import { readBaseline } from './violations.mjs';
|
|
|
26
26
|
import { reportsDir, readJsonSafe } from './html-report.mjs';
|
|
27
27
|
import { summarizeRulesUnderContract } from './rules-under-contract.mjs';
|
|
28
28
|
import { projectStatusArkRun } from './ark-run-doctor.mjs';
|
|
29
|
+
import { projectStatusArkOrder } from './ark-order-doctor.mjs';
|
|
29
30
|
import { collectVsBaseFacts, discoverTeamBaseRef } from './team-parliament-io.mjs';
|
|
30
31
|
import { classifyAdopted, readAdoptionStance } from './adoption-stance.mjs';
|
|
31
32
|
|
|
@@ -354,6 +355,19 @@ export function collectStatusFacts(options = {}) {
|
|
|
354
355
|
return projectStatusArkRun({ present: true, mode, extraMergeTeeth, residual });
|
|
355
356
|
})();
|
|
356
357
|
|
|
358
|
+
const arkOrder = (() => {
|
|
359
|
+
const extra = config?.arkOrder;
|
|
360
|
+
if (!extra || typeof extra !== 'object') {
|
|
361
|
+
return projectStatusArkOrder({ present: false, residual: 0 });
|
|
362
|
+
}
|
|
363
|
+
const snap = latest?.arkOrder && typeof latest.arkOrder === 'object' ? latest.arkOrder : null;
|
|
364
|
+
const mode = extra.mode === 'enforced' || extra.mode === 'advisory' ? extra.mode : null;
|
|
365
|
+
const extraMergeTeeth =
|
|
366
|
+
snap && typeof snap.extraMergeTeeth === 'boolean' ? snap.extraMergeTeeth === true : false;
|
|
367
|
+
const residual = typeof snap?.residual === 'number' ? snap.residual : null;
|
|
368
|
+
return projectStatusArkOrder({ present: true, mode, extraMergeTeeth, residual });
|
|
369
|
+
})();
|
|
370
|
+
|
|
357
371
|
// DF02 — always project compass with honesty mode (never invent green residual).
|
|
358
372
|
// Prefer explicit override (tests/MCP inject doctor-facts); else report snapshot.
|
|
359
373
|
let improvementCompass = null;
|
|
@@ -403,6 +417,7 @@ export function collectStatusFacts(options = {}) {
|
|
|
403
417
|
latest?.designFitness?.designWeak === true ||
|
|
404
418
|
latest?.doctor?.designFitness?.designWeak === true,
|
|
405
419
|
arkRun: options.arkRun ?? arkRun,
|
|
420
|
+
arkOrder: options.arkOrder ?? arkOrder,
|
|
406
421
|
adopted:
|
|
407
422
|
options.adopted ??
|
|
408
423
|
classifyAdopted({
|
|
@@ -534,6 +549,19 @@ export function runStatusCommand(args = {}) {
|
|
|
534
549
|
' · not a score'
|
|
535
550
|
);
|
|
536
551
|
}
|
|
552
|
+
const arkOrderLine = manifest.arkOrder;
|
|
553
|
+
if (arkOrderLine && arkOrderLine.notAScore === true) {
|
|
554
|
+
const residual =
|
|
555
|
+
arkOrderLine.residual == null ? 'unknown' : String(arkOrderLine.residual);
|
|
556
|
+
write(
|
|
557
|
+
` arkOrder: ${arkOrderLine.present ? arkOrderLine.mode || 'on' : 'absent'}` +
|
|
558
|
+
` · residual=${residual}` +
|
|
559
|
+
(arkOrderLine.present
|
|
560
|
+
? ` · extraMergeTeeth=${arkOrderLine.extraMergeTeeth === true}`
|
|
561
|
+
: '') +
|
|
562
|
+
' · not a score'
|
|
563
|
+
);
|
|
564
|
+
}
|
|
537
565
|
write(` next: [${manifest.nextAction.id}] ${manifest.nextAction.summary}`);
|
|
538
566
|
}
|
|
539
567
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { projectStatusArkRun } from './ark-run-doctor.mjs';
|
|
12
|
+
import { projectStatusArkOrder } from './ark-order-doctor.mjs';
|
|
12
13
|
export const ARK_STATUS_MANIFEST_SCHEMA_VERSION = '1.0';
|
|
13
14
|
export const ARK_STATUS_MANIFEST_SCHEMA_URL = 'https://unpkg.com/arkgate@4/schemas/ark.status-manifest.schema.json';
|
|
14
15
|
/**
|
|
@@ -249,6 +250,12 @@ export function resolveStatusNextAction(facts, binding, activation, lastCheck, r
|
|
|
249
250
|
summary: 'ArkRun residual remains — wire kernel usage or declarations through arkgate/runtime. Not a score.',
|
|
250
251
|
};
|
|
251
252
|
}
|
|
253
|
+
if (facts.arkOrder?.present === true && (facts.arkOrder.residual ?? 0) > 0) {
|
|
254
|
+
return {
|
|
255
|
+
id: 'review-arkorder-residual',
|
|
256
|
+
summary: 'ArkOrder leftover remains — change that product choice through the valve (proposeRelease then apply), not a generic update. Not a score.',
|
|
257
|
+
};
|
|
258
|
+
}
|
|
252
259
|
if (facts.adopted === 'required-merge' || facts.adopted === 'advisory-only-acked') {
|
|
253
260
|
return {
|
|
254
261
|
id: 'stay-enforced',
|
|
@@ -336,6 +343,9 @@ export function buildStatusManifest(facts) {
|
|
|
336
343
|
if (facts.arkRun && typeof facts.arkRun === 'object') {
|
|
337
344
|
status.arkRun = projectStatusArkRun(facts.arkRun);
|
|
338
345
|
}
|
|
346
|
+
if (facts.arkOrder && typeof facts.arkOrder === 'object') {
|
|
347
|
+
status.arkOrder = projectStatusArkOrder(facts.arkOrder);
|
|
348
|
+
}
|
|
339
349
|
return status;
|
|
340
350
|
}
|
|
341
351
|
const STATUS_COMPASS_MODE_SET = new Set(STATUS_COMPASS_MODES);
|
|
@@ -628,5 +638,18 @@ export const ARK_STATUS_MANIFEST_SCHEMA = {
|
|
|
628
638
|
residual: { anyOf: [{ type: 'integer', minimum: 0 }, { type: 'null' }] },
|
|
629
639
|
},
|
|
630
640
|
},
|
|
641
|
+
arkOrder: {
|
|
642
|
+
type: 'object',
|
|
643
|
+
description: 'ArkOrder extra residual (notAScore). present/mode from config; residual is a finding-id count (null = unknown, not green). extraMergeTeeth is honesty, never a score.',
|
|
644
|
+
additionalProperties: false,
|
|
645
|
+
required: ['notAScore', 'present', 'mode', 'extraMergeTeeth', 'residual'],
|
|
646
|
+
properties: {
|
|
647
|
+
notAScore: { const: true },
|
|
648
|
+
present: { type: 'boolean' },
|
|
649
|
+
mode: { anyOf: [{ enum: ['advisory', 'enforced'] }, { type: 'null' }] },
|
|
650
|
+
extraMergeTeeth: { type: 'boolean' },
|
|
651
|
+
residual: { anyOf: [{ type: 'integer', minimum: 0 }, { type: 'null' }] },
|
|
652
|
+
},
|
|
653
|
+
},
|
|
631
654
|
},
|
|
632
655
|
};
|
package/bin/lib/violations.mjs
CHANGED
|
@@ -59,9 +59,18 @@ export const FIX_HINTS = {
|
|
|
59
59
|
'Break the cycle: extract the shared code into a module both sides import, invert one edge behind a port/interface, or merge the files if they are really one unit.',
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
/** Extra-plane label so a slow-key deny reads as clearly as a bad import. */
|
|
63
|
+
export function violationPlaneLabel(ruleId) {
|
|
64
|
+
if (typeof ruleId !== 'string') return '';
|
|
65
|
+
if (ruleId.startsWith('ARKORDER_')) return '[ArkOrder] ';
|
|
66
|
+
if (ruleId.startsWith('ARKRUN_')) return '[ArkRun] ';
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
export function printViolation(violation) {
|
|
63
71
|
const location = `${violation.file}:${violation.line}`;
|
|
64
|
-
|
|
72
|
+
const plane = violationPlaneLabel(violation.ruleId);
|
|
73
|
+
console.error(`${color.red('✖')} ${color.bold(`${plane}${violation.ruleId}`)} ${location}`);
|
|
65
74
|
if (violation.fromLayer && violation.toLayer) {
|
|
66
75
|
const target = violation.target ? ` ${color.dim(`(${violation.target})`)}` : '';
|
|
67
76
|
console.error(` ${violation.fromLayer} → ${violation.toLayer}${target}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as CreateArchitectureProfileOptions, b as ArchitectureProfile, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, f as CreateElevenLayerArkConfigOptions, i as Policy, j as IntentCreator, I as IntentName } from './types-Djbs3KjE.js';
|
|
2
2
|
import { A as ArkConfig, c as ArkConfigLoadResult } from './configTypes-j7so8B4O.js';
|
|
3
3
|
|
|
4
|
-
/** Versioned public result contract
|
|
4
|
+
/** Versioned public result contract types + JSON Schema (adapter envelope). */
|
|
5
5
|
/**
|
|
6
6
|
* 1.5 adds stable finding refs on every factory-emitted diagnostic (ACS06):
|
|
7
7
|
* `findingRef`, `targetKey` (baseline-compatible), `docsCodePath`.
|
|
@@ -144,42 +144,6 @@ type CurrentAdapterResult = (CurrentAdapterResultBase & Partial<ResolvedAdapterE
|
|
|
144
144
|
completeness: 'unavailable';
|
|
145
145
|
});
|
|
146
146
|
type AdapterResult = LegacyAdapterResult | Version12AdapterResult | CurrentAdapterResult;
|
|
147
|
-
/**
|
|
148
|
-
* Baseline-compatible target key for a violation input.
|
|
149
|
-
* Field order and empty-string fallbacks **must** match `baselineKey` in
|
|
150
|
-
* `baselineKey.ts` — parity tests guard this so finding refs never orphan freezes.
|
|
151
|
-
*
|
|
152
|
-
* Note: uses raw ruleId/file strings (including empty) the same way baseline does;
|
|
153
|
-
* display `ruleId` / `location.file` may still normalize to ARK_UNKNOWN / `<unknown>`.
|
|
154
|
-
*/
|
|
155
|
-
declare function adapterFindingTargetKey(violation: AdapterViolationInput): string;
|
|
156
|
-
/**
|
|
157
|
-
* Occurrence-aware target keys for a violation list (parity with baselineOccurrenceKeys).
|
|
158
|
-
* First occurrence keeps the historical base key; duplicates get `#N`.
|
|
159
|
-
*/
|
|
160
|
-
declare function adapterFindingOccurrenceTargetKeys(violations: readonly AdapterViolationInput[]): string[];
|
|
161
|
-
/** FNV-1a finding ref from a baseline-compatible targetKey (not a security hash). */
|
|
162
|
-
declare function adapterFindingRefFromTargetKey(targetKey: string): string;
|
|
163
|
-
/** Package-relative docs path with fragment for a public ruleId. */
|
|
164
|
-
declare function adapterDocsCodePath(ruleId: string): string;
|
|
165
|
-
declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity,
|
|
166
|
-
/**
|
|
167
|
-
* Optional precomputed baseline-compatible targetKey (e.g. occurrence-aware from
|
|
168
|
-
* `adapterFindingOccurrenceTargetKeys`). When omitted, uses the first-occurrence key.
|
|
169
|
-
*/
|
|
170
|
-
targetKeyOverride?: string): AdapterDiagnostic;
|
|
171
|
-
declare function createAdapterResult(input: {
|
|
172
|
-
valid: boolean;
|
|
173
|
-
completeness?: AnalysisCompleteness;
|
|
174
|
-
mode?: AnalysisMode;
|
|
175
|
-
policyHash?: unknown;
|
|
176
|
-
resolverIdentity?: unknown;
|
|
177
|
-
factsHash?: unknown;
|
|
178
|
-
candidateTreeHash?: unknown;
|
|
179
|
-
completenessReasons?: readonly AdapterCompletenessReason[];
|
|
180
|
-
violations?: readonly AdapterViolationInput[];
|
|
181
|
-
warnings?: readonly AdapterViolationInput[];
|
|
182
|
-
}): CurrentAdapterResult;
|
|
183
147
|
declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
184
148
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
185
149
|
readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.analysis-result.schema.json";
|
|
@@ -408,8 +372,27 @@ declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
|
408
372
|
};
|
|
409
373
|
};
|
|
410
374
|
|
|
375
|
+
declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity,
|
|
376
|
+
/**
|
|
377
|
+
* Optional precomputed baseline-compatible targetKey (e.g. occurrence-aware from
|
|
378
|
+
* `adapterFindingOccurrenceTargetKeys`). When omitted, uses the first-occurrence key.
|
|
379
|
+
*/
|
|
380
|
+
targetKeyOverride?: string): AdapterDiagnostic;
|
|
381
|
+
declare function createAdapterResult(input: {
|
|
382
|
+
valid: boolean;
|
|
383
|
+
completeness?: AnalysisCompleteness;
|
|
384
|
+
mode?: AnalysisMode;
|
|
385
|
+
policyHash?: unknown;
|
|
386
|
+
resolverIdentity?: unknown;
|
|
387
|
+
factsHash?: unknown;
|
|
388
|
+
candidateTreeHash?: unknown;
|
|
389
|
+
completenessReasons?: readonly AdapterCompletenessReason[];
|
|
390
|
+
violations?: readonly AdapterViolationInput[];
|
|
391
|
+
warnings?: readonly AdapterViolationInput[];
|
|
392
|
+
}): CurrentAdapterResult;
|
|
393
|
+
|
|
411
394
|
/** ArkGate library version — single source of truth. */
|
|
412
|
-
declare const version = "4.8.
|
|
395
|
+
declare const version = "4.8.13";
|
|
413
396
|
|
|
414
397
|
/**
|
|
415
398
|
* AI Code Gate (basic).
|
|
@@ -2474,4 +2457,4 @@ declare function catalogFixForRuleId(ruleId: string | null | undefined): string
|
|
|
2474
2457
|
*/
|
|
2475
2458
|
declare function catalogWhyForRuleId(ruleId: string | null | undefined): string | undefined;
|
|
2476
2459
|
|
|
2477
|
-
export { type ArchitectureChangeMapFile as $, type
|
|
2460
|
+
export { type ArchitectureChangeMapFile as $, type AdapterViolationInput as A, type AdapterResult as B, type AdapterSeverity as C, type AnalysisCapabilityUse as D, type EffectiveArkRules as E, type AnalysisCompilerOptions as F, type AnalysisCompleteness as G, type AnalysisContract as H, type AnalysisEvidence as I, type AnalysisFile as J, type AnalysisFileChange as K, type AnalysisFileInput as L, type AnalysisImportEdge as M, type AnalysisIr as N, type AnalysisMode as O, type AnalysisResult as P, type AnalysisViolation as Q, type ResolvedArkRunKernelCallKind as R, type AnalyzeArchitectureConvergenceInput as S, type AnalyzeChangeInput as T, type AnalyzePolicyDeltaInput as U, type AnalyzeProjectInput as V, type AnalyzeResolvedProjectInput as W, type ArchitectureActualChange as X, type ArchitectureChangeMap as Y, type ArchitectureChangeMapContract as Z, type ArchitectureChangeMapDependency as _, type ArkRulesFile as a, type SemanticDependencyKind as a$, type ArchitectureChangeOperation as a0, type ArchitectureConvergenceClassification as a1, type ArchitectureConvergenceFinding as a2, type ArchitectureConvergenceResult as a3, type ArchitectureDependency as a4, type ArchitectureEngineEdge as a5, type ArchitectureEngineResult as a6, type ArchitectureEngineViolation as a7, type ArkDesignDeltaResult as a8, type ArkEnforcementHost as a9, type PolicyDeltaAcknowledgement as aA, type PolicyDeltaAnalysis as aB, type PolicyDeltaClassification as aC, type PolicyDeltaFinding as aD, type PreflightResolvedChangeInput as aE, type PreparedChangeFile as aF, RESOLVED_CANDIDATE_FACTS_SCHEMA as aG, RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION as aH, type ResolvedAmbientFact as aI, type ResolvedAnalysisFile as aJ, type ResolvedAnalysisIr as aK, type ResolvedAnalysisResult as aL, type ResolvedCandidateFacts as aM, type ResolvedCandidateFactsInput as aN, type ResolvedCapability as aO, type ResolvedCapabilityFact as aP, type ResolvedChangePreflightResult as aQ, type ResolvedDependencyKind as aR, type ResolvedDependencyState as aS, type ResolvedFactsCompleteness as aT, type ResolvedFileFact as aU, type ResolvedIntentReferenceFact as aV, type ResolvedPublishFact as aW, type ResolvedSafetyFact as aX, type ResolvedSafetyKind as aY, type ResolvedSafetyReport as aZ, type SemanticDependency as a_, type ArkEnforcementState as aa, type ArkRuleSensorViolation as ab, type ChangePreflightResult as ac, type ClassShapeFact as ad, type CollectAnalysisConfigWarningsInput as ae, DIAGNOSTIC_CATALOG as af, DIAGNOSTIC_CATALOG_SCHEMA_VERSION as ag, DIAGNOSTIC_DOCS_RELATIVE_PATH as ah, DIAGNOSTIC_RULE_IDS as ai, type DesignDeltaChange as aj, type DesignDeltaEnforcementScope as ak, type DesignDeltaIdentity as al, type DesignSmellEvidence as am, type DesignSmellFinding as an, type DesignSmellId as ao, type DiagnosticCatalogEntry as ap, type DiagnosticCategory as aq, type EnforcementBoundaryState as ar, type EnforcementEvidence as as, type EnforcementEvidenceField as at, type EnforcementVerification as au, type EvaluateArchitectureGraphInput as av, type ForbiddenCapabilityUse as aw, type InvariantCoverageEvidence as ax, POLICY_DELTA_SCHEMA_VERSION as ay, type PolicyDelta as az, type ResolvedArkRunDeclarationFact as b, analyzeArchitectureConvergence as b0, analyzeChange as b1, analyzePolicyDelta as b2, analyzeProject as b3, analyzeResolvedProject as b4, buildArkRuleFileHints as b5, canPromoteInvariant as b6, catalogFixForRuleId as b7, catalogWhyForRuleId as b8, classifyArkPolicyDelta as b9, policyDeltaAcknowledgementMatches as bA, preflightChange as bB, preflightResolvedChange as bC, resolvedFactsEvidenceRequirementsHash as bD, serializeDiagnosticCatalog as bE, stableSerialize as bF, toAdapterDiagnostic as bG, version as bH, collectAnalysisConfigWarnings as ba, collectEmptyAppliesToFindings as bb, collectForbiddenCapabilityUses as bc, createAICodeGate as bd, createAdapterResult as be, createArchitectureProfile as bf, createArchitectureProfileFromArkConfig as bg, createElevenLayerArkConfig as bh, createResolvedCandidateFacts as bi, deriveArkRuleFileHints as bj, detectArchitectureCycles as bk, deterministicHash as bl, diagnosticDocsFragment as bm, diagnosticDocsPath as bn, elevenLayerProfile as bo, evaluateArchitectureGraph as bp, evaluateArkRuleSensors as bq, evaluateInvariantCoverage as br, explainViolation as bs, extractClassShapesFromSource as bt, extractSemanticDependencies as bu, getDiagnosticCatalogEntry as bv, isCataloguedOrArkRuleFamily as bw, isKnownDiagnosticCode as bx, loadContract as by, loadResolvedCandidateFacts as bz, type ResolvedArkRunKernelCallFact as c, type ResolvedArkRunManagedNewFact as d, type ResolvedDependencyFact as e, type ResolvedArkRunCompositionRootHitFact as f, type ResolvedFactsReason as g, type ResolvedArkOrderPlaneCallFact as h, type ResolvedArkOrderGenericUpdateFact as i, type ResolvedArkOrderRootHitFact as j, type ResolvedArkOrderXiFieldWriteFact as k, type ResolvedArkOrderIngestWriteFact as l, ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH as m, type AICodeGate as n, type AICodeGateContext as o, type AICodeGateOptions as p, type AICodeGateResult as q, type AICodeGateViolation as r, type AIGateExtension as s, ANALYSIS_IR_SCHEMA_VERSION as t, ARK_ANALYSIS_RESULT_SCHEMA as u, ARK_ANALYSIS_RESULT_SCHEMA_VERSION as v, ARK_DESIGN_DELTA_SCHEMA_VERSION as w, ARK_ENFORCEMENT_STATE_SCHEMA_VERSION as x, type AdapterCompletenessReason as y, type AdapterDiagnostic as z };
|