@mmnto/totem 1.101.2 → 1.103.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/dist/artifacts/grounding.test.js +2 -2
- package/dist/artifacts/grounding.test.js.map +1 -1
- package/dist/artifacts/panel.d.ts +1798 -16
- package/dist/artifacts/panel.d.ts.map +1 -1
- package/dist/artifacts/schema.d.ts +3125 -69
- package/dist/artifacts/schema.d.ts.map +1 -1
- package/dist/artifacts/schema.js +244 -2
- package/dist/artifacts/schema.js.map +1 -1
- package/dist/artifacts/schema.test.js +235 -3
- package/dist/artifacts/schema.test.js.map +1 -1
- package/dist/artifacts/storage.d.ts +21 -1
- package/dist/artifacts/storage.d.ts.map +1 -1
- package/dist/artifacts/storage.js +55 -1
- package/dist/artifacts/storage.js.map +1 -1
- package/dist/artifacts/storage.test.js +96 -2
- package/dist/artifacts/storage.test.js.map +1 -1
- package/dist/artifacts/verdict.d.ts +95 -22
- package/dist/artifacts/verdict.d.ts.map +1 -1
- package/dist/artifacts/verdict.js +62 -3
- package/dist/artifacts/verdict.js.map +1 -1
- package/dist/artifacts/verdict.test.js +197 -1
- package/dist/artifacts/verdict.test.js.map +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/artifacts.js.map +1 -1
- package/dist/autoclose/index.d.ts +12 -0
- package/dist/autoclose/index.d.ts.map +1 -0
- package/dist/autoclose/index.js +9 -0
- package/dist/autoclose/index.js.map +1 -0
- package/dist/autoclose/matcher.d.ts +115 -0
- package/dist/autoclose/matcher.d.ts.map +1 -0
- package/dist/autoclose/matcher.js +164 -0
- package/dist/autoclose/matcher.js.map +1 -0
- package/dist/autoclose/matcher.test.d.ts +2 -0
- package/dist/autoclose/matcher.test.d.ts.map +1 -0
- package/dist/autoclose/matcher.test.js +133 -0
- package/dist/autoclose/matcher.test.js.map +1 -0
- package/dist/autoclose/merge-config.d.ts +73 -0
- package/dist/autoclose/merge-config.d.ts.map +1 -0
- package/dist/autoclose/merge-config.js +81 -0
- package/dist/autoclose/merge-config.js.map +1 -0
- package/dist/autoclose/merge-config.test.d.ts +2 -0
- package/dist/autoclose/merge-config.test.d.ts.map +1 -0
- package/dist/autoclose/merge-config.test.js +108 -0
- package/dist/autoclose/merge-config.test.js.map +1 -0
- package/dist/autoclose/receipt.d.ts +160 -0
- package/dist/autoclose/receipt.d.ts.map +1 -0
- package/dist/autoclose/receipt.js +296 -0
- package/dist/autoclose/receipt.js.map +1 -0
- package/dist/autoclose/receipt.test.d.ts +2 -0
- package/dist/autoclose/receipt.test.d.ts.map +1 -0
- package/dist/autoclose/receipt.test.js +248 -0
- package/dist/autoclose/receipt.test.js.map +1 -0
- package/dist/config-schema.d.ts +12 -12
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/spine/ledgers.d.ts +12 -12
- package/package.json +1 -1
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* (Tenet 4). Version tolerance within the major + the migration-on-read
|
|
15
15
|
* registry implement the F1 evolution policy from the #2100 design review.
|
|
16
16
|
*/
|
|
17
|
-
import type { RunArtifact } from './schema.js';
|
|
17
|
+
import type { InvocationFailureArtifact, RunArtifact } from './schema.js';
|
|
18
18
|
/** Absolute runs directory for a given absolute totem dir. */
|
|
19
19
|
export declare function runsDir(totemDirAbs: string): string;
|
|
20
|
+
/** Absolute terminal-invocation failure directory for a given absolute totem dir. */
|
|
21
|
+
export declare function failureRunsDir(totemDirAbs: string): string;
|
|
20
22
|
/**
|
|
21
23
|
* Content address of an artifact: deterministic hash over everything EXCEPT
|
|
22
24
|
* `createdAt` (observability, not identity — see schema docstring).
|
|
@@ -30,6 +32,16 @@ export interface SaveRunArtifactResult {
|
|
|
30
32
|
/** True when an identical logical run was already recorded (no write happened). */
|
|
31
33
|
existed: boolean;
|
|
32
34
|
}
|
|
35
|
+
/** Content address of a terminal failure artifact, excluding emission time. */
|
|
36
|
+
export declare function computeInvocationFailureArtifactContentHash(artifact: InvocationFailureArtifact): string;
|
|
37
|
+
export interface SaveInvocationFailureArtifactResult {
|
|
38
|
+
/** The content address (= filename stem). */
|
|
39
|
+
hash: string;
|
|
40
|
+
/** Absolute path of the stored artifact. */
|
|
41
|
+
path: string;
|
|
42
|
+
/** True when an identical logical failure was already recorded. */
|
|
43
|
+
existed: boolean;
|
|
44
|
+
}
|
|
33
45
|
/**
|
|
34
46
|
* Persist an artifact at its content address, write-if-absent. An existing
|
|
35
47
|
* file is NEVER rewritten: same hash ⇒ same logical content by construction,
|
|
@@ -37,10 +49,18 @@ export interface SaveRunArtifactResult {
|
|
|
37
49
|
* append-only means the FIRST write wins forever.
|
|
38
50
|
*/
|
|
39
51
|
export declare function saveRunArtifact(totemDirAbs: string, artifact: RunArtifact): SaveRunArtifactResult;
|
|
52
|
+
/**
|
|
53
|
+
* Persist a terminal invocation failure at its content address. As with
|
|
54
|
+
* successful run artifacts, atomic create-exclusive makes the ledger
|
|
55
|
+
* append-only and the first write (including its `createdAt`) wins.
|
|
56
|
+
*/
|
|
57
|
+
export declare function saveInvocationFailureArtifact(totemDirAbs: string, artifact: InvocationFailureArtifact): SaveInvocationFailureArtifactResult;
|
|
40
58
|
/**
|
|
41
59
|
* Load + validate an artifact by content address. Throws `TotemParseError`
|
|
42
60
|
* on a missing file, corrupt JSON, or schema violation (including an unknown
|
|
43
61
|
* major with no migration entry) — loud, never a silent partial.
|
|
44
62
|
*/
|
|
45
63
|
export declare function loadRunArtifact(totemDirAbs: string, hash: string): RunArtifact;
|
|
64
|
+
/** Load and validate a terminal invocation failure by content address. */
|
|
65
|
+
export declare function loadInvocationFailureArtifact(totemDirAbs: string, hash: string): InvocationFailureArtifact;
|
|
46
66
|
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/artifacts/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/artifacts/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,KAAK,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB1E,8DAA8D;AAC9D,wBAAgB,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAG3E;AAED,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,+EAA+E;AAC/E,wBAAgB,2CAA2C,CACzD,QAAQ,EAAE,yBAAyB,GAClC,MAAM,CAGR;AAED,MAAM,WAAW,mCAAmC;IAClD,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,qBAAqB,CAgCjG;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,yBAAyB,GAClC,mCAAmC,CAyBrC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CA6B9E;AAED,0EAA0E;AAC1E,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACX,yBAAyB,CAoB3B"}
|
|
@@ -19,9 +19,10 @@ import * as path from 'node:path';
|
|
|
19
19
|
import { rethrowAsParseError, TotemParseError } from '../errors.js';
|
|
20
20
|
import { readJsonSafe } from '../sys/fs.js';
|
|
21
21
|
import { calculateDeterministicHash } from './hash.js';
|
|
22
|
-
import { RunArtifactSchema } from './schema.js';
|
|
22
|
+
import { InvocationFailureArtifactSchema, RunArtifactSchema } from './schema.js';
|
|
23
23
|
/** Storage layout segments under the totem dir (exact layout = impl call, #2100). */
|
|
24
24
|
const RUNS_DIR_SEGMENTS = ['artifacts', 'runs'];
|
|
25
|
+
const FAILURE_RUNS_DIR_SEGMENTS = ['artifacts', 'runs', 'failures'];
|
|
25
26
|
/** Filename guard — the id IS a filesystem path segment, so gate it hard. */
|
|
26
27
|
const SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
27
28
|
/**
|
|
@@ -36,6 +37,10 @@ const MIGRATIONS = new Map();
|
|
|
36
37
|
export function runsDir(totemDirAbs) {
|
|
37
38
|
return path.join(totemDirAbs, ...RUNS_DIR_SEGMENTS);
|
|
38
39
|
}
|
|
40
|
+
/** Absolute terminal-invocation failure directory for a given absolute totem dir. */
|
|
41
|
+
export function failureRunsDir(totemDirAbs) {
|
|
42
|
+
return path.join(totemDirAbs, ...FAILURE_RUNS_DIR_SEGMENTS);
|
|
43
|
+
}
|
|
39
44
|
/**
|
|
40
45
|
* Content address of an artifact: deterministic hash over everything EXCEPT
|
|
41
46
|
* `createdAt` (observability, not identity — see schema docstring).
|
|
@@ -44,6 +49,11 @@ export function computeRunArtifactContentHash(artifact) {
|
|
|
44
49
|
const { createdAt: _excluded, ...identity } = artifact;
|
|
45
50
|
return calculateDeterministicHash(identity);
|
|
46
51
|
}
|
|
52
|
+
/** Content address of a terminal failure artifact, excluding emission time. */
|
|
53
|
+
export function computeInvocationFailureArtifactContentHash(artifact) {
|
|
54
|
+
const { createdAt: _excluded, ...identity } = artifact;
|
|
55
|
+
return calculateDeterministicHash(identity);
|
|
56
|
+
}
|
|
47
57
|
/**
|
|
48
58
|
* Persist an artifact at its content address, write-if-absent. An existing
|
|
49
59
|
* file is NEVER rewritten: same hash ⇒ same logical content by construction,
|
|
@@ -82,6 +92,35 @@ export function saveRunArtifact(totemDirAbs, artifact) {
|
|
|
82
92
|
}
|
|
83
93
|
return { hash, path: filePath, existed: false };
|
|
84
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Persist a terminal invocation failure at its content address. As with
|
|
97
|
+
* successful run artifacts, atomic create-exclusive makes the ledger
|
|
98
|
+
* append-only and the first write (including its `createdAt`) wins.
|
|
99
|
+
*/
|
|
100
|
+
export function saveInvocationFailureArtifact(totemDirAbs, artifact) {
|
|
101
|
+
const validated = InvocationFailureArtifactSchema.parse(artifact);
|
|
102
|
+
const hash = computeInvocationFailureArtifactContentHash(validated);
|
|
103
|
+
const dir = failureRunsDir(totemDirAbs);
|
|
104
|
+
const filePath = path.join(dir, `${hash}.json`);
|
|
105
|
+
if (fs.existsSync(filePath)) {
|
|
106
|
+
return { hash, path: filePath, existed: true };
|
|
107
|
+
}
|
|
108
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
109
|
+
try {
|
|
110
|
+
fs.writeFileSync(filePath, JSON.stringify(validated, null, 2), {
|
|
111
|
+
encoding: 'utf-8',
|
|
112
|
+
mode: 0o600,
|
|
113
|
+
flag: 'wx',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
if (err.code === 'EEXIST') {
|
|
118
|
+
return { hash, path: filePath, existed: true };
|
|
119
|
+
}
|
|
120
|
+
throw err;
|
|
121
|
+
}
|
|
122
|
+
return { hash, path: filePath, existed: false };
|
|
123
|
+
}
|
|
85
124
|
/**
|
|
86
125
|
* Load + validate an artifact by content address. Throws `TotemParseError`
|
|
87
126
|
* on a missing file, corrupt JSON, or schema violation (including an unknown
|
|
@@ -110,6 +149,21 @@ export function loadRunArtifact(totemDirAbs, hash) {
|
|
|
110
149
|
rethrowAsParseError(`Run artifact ${hash} failed schema validation`, err, 'The artifact may be corrupted or written by an incompatible totem version; re-emit it (or add the migration entry for its major).');
|
|
111
150
|
}
|
|
112
151
|
}
|
|
152
|
+
/** Load and validate a terminal invocation failure by content address. */
|
|
153
|
+
export function loadInvocationFailureArtifact(totemDirAbs, hash) {
|
|
154
|
+
if (!SHA256_HEX.test(hash)) {
|
|
155
|
+
throw new TotemParseError(`Invalid invocation-failure artifact id "${hash}" — expected a 64-char sha256 hex content address.`, 'Pass the hash exactly as reported at emission (or from the artifacts/runs/failures filename).');
|
|
156
|
+
}
|
|
157
|
+
const filePath = path.join(failureRunsDir(totemDirAbs), `${hash}.json`);
|
|
158
|
+
const raw = readJsonSafe(filePath);
|
|
159
|
+
try {
|
|
160
|
+
return InvocationFailureArtifactSchema.parse(raw);
|
|
161
|
+
// totem-context: rethrowAsParseError returns never; this catch normalizes schema failures into the public TotemParseError load contract and swallows nothing.
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
rethrowAsParseError(`Invocation failure artifact ${hash} failed schema validation`, err, 'The artifact may be corrupted or written by an incompatible totem version; re-emit it.');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
113
167
|
/** Best-effort major extraction from a raw parsed payload; undefined when absent/garbled. */
|
|
114
168
|
function readMajor(raw) {
|
|
115
169
|
if (typeof raw !== 'object' || raw === null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/artifacts/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,eAA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,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,eAAe,CACvB,2CAA2C,IAAI,oDAAoD,EACnG,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,CAAC;QACH,OAAO,+BAA+B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClD,8JAA8J;IAChK,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,mBAAmB,CACjB,+BAA+B,IAAI,2BAA2B,EAC9D,GAAG,EACH,wFAAwF,CACzF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,6FAA6F;AAC7F,SAAS,SAAS,CAAC,GAAY;IAC7B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,OAAO,GAAI,GAA+B,CAAC,eAAe,CAAC,CAAC;IAClE,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC"}
|
|
@@ -4,8 +4,20 @@ import * as path from 'node:path';
|
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
5
5
|
import { TotemParseError } from '../errors.js';
|
|
6
6
|
import { cleanTmpDir } from '../test-utils.js';
|
|
7
|
-
import { RUN_ARTIFACT_SCHEMA_VERSION } from './schema.js';
|
|
8
|
-
import { computeRunArtifactContentHash, loadRunArtifact, runsDir, saveRunArtifact, } from './storage.js';
|
|
7
|
+
import { INVOCATION_FAILURE_ARTIFACT_SCHEMA_VERSION, INVOKE_MESSAGE_EVIDENCE_LIMIT_BYTES, RUN_ARTIFACT_SCHEMA_VERSION, } from './schema.js';
|
|
8
|
+
import { computeInvocationFailureArtifactContentHash, computeRunArtifactContentHash, failureRunsDir, loadInvocationFailureArtifact, loadRunArtifact, runsDir, saveInvocationFailureArtifact, saveRunArtifact, } from './storage.js';
|
|
9
|
+
function textEvidence(text, limitBytes = 64 * 1024) {
|
|
10
|
+
const bytes = Buffer.byteLength(text, 'utf-8');
|
|
11
|
+
return {
|
|
12
|
+
encoding: 'utf-8',
|
|
13
|
+
head: text,
|
|
14
|
+
observedBytes: bytes,
|
|
15
|
+
retainedBytes: bytes,
|
|
16
|
+
limitBytes,
|
|
17
|
+
truncated: false,
|
|
18
|
+
dlp: 'masked',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
9
21
|
function artifact(overrides = {}) {
|
|
10
22
|
return {
|
|
11
23
|
schemaVersion: RUN_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -24,6 +36,46 @@ function artifact(overrides = {}) {
|
|
|
24
36
|
...overrides,
|
|
25
37
|
};
|
|
26
38
|
}
|
|
39
|
+
function failureArtifact(overrides = {}) {
|
|
40
|
+
return {
|
|
41
|
+
schemaVersion: INVOCATION_FAILURE_ARTIFACT_SCHEMA_VERSION,
|
|
42
|
+
inputBundle: { maskedPrompt: 'prompt after DLP' },
|
|
43
|
+
inputHash: 'c'.repeat(64),
|
|
44
|
+
grounding: { hash: 'd'.repeat(64), provenanceSummary: 'similarity-only' },
|
|
45
|
+
requestedBackend: {
|
|
46
|
+
provider: 'anthropic',
|
|
47
|
+
model: 'claude-sonnet-5',
|
|
48
|
+
qualifiedModel: 'anthropic:claude-sonnet-5',
|
|
49
|
+
admissionClass: 'completion_only',
|
|
50
|
+
taskProfile: 'Review',
|
|
51
|
+
},
|
|
52
|
+
attempts: [
|
|
53
|
+
{
|
|
54
|
+
sequence: 1,
|
|
55
|
+
route: 'cli-fallback',
|
|
56
|
+
provider: 'anthropic',
|
|
57
|
+
model: 'claude-sonnet-5',
|
|
58
|
+
status: 'failed',
|
|
59
|
+
durationMs: 900,
|
|
60
|
+
failureKind: 'process-exit',
|
|
61
|
+
process: {
|
|
62
|
+
exitCode: 1,
|
|
63
|
+
signal: null,
|
|
64
|
+
timedOut: false,
|
|
65
|
+
stdout: textEvidence('partial'),
|
|
66
|
+
stderr: textEvidence('rejected'),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
terminal: {
|
|
71
|
+
kind: 'process-exit',
|
|
72
|
+
attempt: 1,
|
|
73
|
+
message: textEvidence('Claude CLI exited with code 1', INVOKE_MESSAGE_EVIDENCE_LIMIT_BYTES),
|
|
74
|
+
},
|
|
75
|
+
createdAt: '2026-07-19T12:00:00.000Z',
|
|
76
|
+
...overrides,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
27
79
|
describe('run-artifact storage', () => {
|
|
28
80
|
let totemDir;
|
|
29
81
|
beforeEach(() => {
|
|
@@ -76,4 +128,46 @@ describe('run-artifact storage', () => {
|
|
|
76
128
|
expect(() => loadRunArtifact(totemDir, '../../secrets')).toThrow(/sha256/i);
|
|
77
129
|
});
|
|
78
130
|
});
|
|
131
|
+
describe('invocation-failure artifact storage', () => {
|
|
132
|
+
let totemDir;
|
|
133
|
+
beforeEach(() => {
|
|
134
|
+
totemDir = fs.mkdtempSync(path.join(os.tmpdir(), 'totem-invoke-failures-'));
|
|
135
|
+
});
|
|
136
|
+
afterEach(() => {
|
|
137
|
+
cleanTmpDir(totemDir);
|
|
138
|
+
});
|
|
139
|
+
it('stores under runs/failures, mode 0600, and loads the artifact back', () => {
|
|
140
|
+
const failure = failureArtifact();
|
|
141
|
+
const saved = saveInvocationFailureArtifact(totemDir, failure);
|
|
142
|
+
expect(saved.existed).toBe(false);
|
|
143
|
+
expect(saved.path).toBe(path.join(totemDir, 'artifacts', 'runs', 'failures', `${saved.hash}.json`));
|
|
144
|
+
expect(loadInvocationFailureArtifact(totemDir, saved.hash)).toEqual(failure);
|
|
145
|
+
if (process.platform !== 'win32') {
|
|
146
|
+
expect(fs.statSync(saved.path).mode & 0o777).toBe(0o600);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
it('excludes createdAt from identity and preserves the first write', () => {
|
|
150
|
+
const early = failureArtifact({ createdAt: '2026-07-19T12:00:00.000Z' });
|
|
151
|
+
const late = failureArtifact({ createdAt: '2026-07-20T12:00:00.000Z' });
|
|
152
|
+
expect(computeInvocationFailureArtifactContentHash(early)).toBe(computeInvocationFailureArtifactContentHash(late));
|
|
153
|
+
const first = saveInvocationFailureArtifact(totemDir, early);
|
|
154
|
+
const second = saveInvocationFailureArtifact(totemDir, late);
|
|
155
|
+
expect(second).toEqual({ ...first, existed: true });
|
|
156
|
+
expect(loadInvocationFailureArtifact(totemDir, first.hash).createdAt).toBe(early.createdAt);
|
|
157
|
+
});
|
|
158
|
+
it('changes identity when persisted diagnostic evidence changes', () => {
|
|
159
|
+
const original = failureArtifact();
|
|
160
|
+
const changed = failureArtifact({
|
|
161
|
+
terminal: {
|
|
162
|
+
...original.terminal,
|
|
163
|
+
message: textEvidence('different bounded message', INVOKE_MESSAGE_EVIDENCE_LIMIT_BYTES),
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
expect(computeInvocationFailureArtifactContentHash(original)).not.toBe(computeInvocationFailureArtifactContentHash(changed));
|
|
167
|
+
});
|
|
168
|
+
it('rejects invalid ids before reading the failure directory', () => {
|
|
169
|
+
expect(failureRunsDir(totemDir)).toBe(path.join(totemDir, 'artifacts', 'runs', 'failures'));
|
|
170
|
+
expect(() => loadInvocationFailureArtifact(totemDir, '../../secrets')).toThrow(/sha256/i);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
79
173
|
//# sourceMappingURL=storage.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.test.js","sourceRoot":"","sources":["../../src/artifacts/storage.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,
|
|
1
|
+
{"version":3,"file":"storage.test.js","sourceRoot":"","sources":["../../src/artifacts/storage.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,0CAA0C,EAC1C,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,2CAA2C,EAC3C,6BAA6B,EAC7B,cAAc,EACd,6BAA6B,EAC7B,eAAe,EACf,OAAO,EACP,6BAA6B,EAC7B,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,SAAS,YAAY,CAAC,IAAY,EAAE,UAAU,GAAG,EAAE,GAAG,IAAI;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,O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,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,eAAe,CAAC;YAC9B,QAAQ,EAAE;gBACR,GAAG,QAAQ,CAAC,QAAQ;gBACpB,OAAO,EAAE,YAAY,CAAC,2BAA2B,EAAE,mCAAmC,CAAC;aACxF;SACF,CAAC,CAAC;QACH,MAAM,CAAC,2CAA2C,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CACpE,2CAA2C,CAAC,OAAO,CAAC,CACrD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;QAC5F,MAAM,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -43,10 +43,16 @@ import type { GroundingBundle } from './schema.js';
|
|
|
43
43
|
/**
|
|
44
44
|
* The verdict schemaVersion WRITTEN by this code. Readers accept any 1.x (F1).
|
|
45
45
|
* 1.1.0 (mmnto-ai/totem#2363): additive-optional `lessonsConsulted` — the
|
|
46
|
-
* round's lesson-recall record.
|
|
47
|
-
*
|
|
46
|
+
* round's lesson-recall record.
|
|
47
|
+
* 1.2.0 (mmnto-ai/totem#2459): additive widening of {@link VERDICT_LANE_FAILURE_REASONS}
|
|
48
|
+
* with slice-B invoke-failure kinds (auth/model/spawn/exit/timeout) + the
|
|
49
|
+
* additive-optional failed-lane `failureArtifactHash`. Purely additive within the
|
|
50
|
+
* major (new enum members + an optional field), so the minor is the observable
|
|
51
|
+
* marker and the migration registry stays empty — the tolerant reader parses every
|
|
52
|
+
* prior 1.x artifact unchanged (existing `typedReason` values and absent
|
|
53
|
+
* `failureArtifactHash` remain valid).
|
|
48
54
|
*/
|
|
49
|
-
export declare const VERDICT_ARTIFACT_SCHEMA_VERSION = "1.
|
|
55
|
+
export declare const VERDICT_ARTIFACT_SCHEMA_VERSION = "1.2.0";
|
|
50
56
|
/** The major this reader understands; other majors need a migration entry. */
|
|
51
57
|
export declare const VERDICT_ARTIFACT_KNOWN_MAJOR = 1;
|
|
52
58
|
/**
|
|
@@ -70,15 +76,15 @@ export declare const VerdictDiffScopeSchema: z.ZodDiscriminatedUnion<"source", [
|
|
|
70
76
|
base: z.ZodString;
|
|
71
77
|
head: z.ZodString;
|
|
72
78
|
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
head: string;
|
|
73
80
|
source: "explicit-range";
|
|
74
81
|
diffHash: string;
|
|
75
82
|
base: string;
|
|
76
|
-
head: string;
|
|
77
83
|
}, {
|
|
84
|
+
head: string;
|
|
78
85
|
source: "explicit-range";
|
|
79
86
|
diffHash: string;
|
|
80
87
|
base: string;
|
|
81
|
-
head: string;
|
|
82
88
|
}>, z.ZodObject<{
|
|
83
89
|
source: z.ZodLiteral<"branch-vs-base">;
|
|
84
90
|
diffHash: z.ZodString;
|
|
@@ -116,8 +122,24 @@ export type VerdictDiffScope = z.infer<typeof VerdictDiffScopeSchema>;
|
|
|
116
122
|
* handed to `assemblePanelArtifact` and never stamps the cache. NOTE (Prop 302
|
|
117
123
|
* lane-blindness): these classify the FAILURE, never the runner lane — none of
|
|
118
124
|
* them names warm/cold.
|
|
125
|
+
*
|
|
126
|
+
* ── EXECUTION-PHASE INVOKE KINDS (mmnto-ai/totem#2459, slice-B A-side follow-up) ──
|
|
127
|
+
* The first block is the original coarse set. The `invoke-*` block widens it so an
|
|
128
|
+
* EXECUTION-phase lane failure records the exact slice-B category (from
|
|
129
|
+
* `OrchestratorInvokeError.kind`) instead of collapsing auth / model / spawn / exit /
|
|
130
|
+
* timeout into the single `invoke-error`. The mapping is 1:1 with `InvokeFailureKind`:
|
|
131
|
+
* `auth→invoke-auth`, `quota→quota-exhausted`, `model→invoke-model`,
|
|
132
|
+
* `process-spawn→invoke-process-spawn`, `process-exit→invoke-process-exit`,
|
|
133
|
+
* `timeout→invoke-timeout`, `unknown→invoke-error`. `quota-exhausted` and
|
|
134
|
+
* `invoke-error` predate this widening and are reused, so the change is purely
|
|
135
|
+
* additive (F1): every prior 1.x artifact's `typedReason` still validates.
|
|
136
|
+
*
|
|
137
|
+
* ADMISSION vs EXECUTION (the #2471 gate-semantics boundary): a pre-invoke ADMISSION
|
|
138
|
+
* denial is NOT a lane invoke-failure — it never reached execution, so it maps to
|
|
139
|
+
* `config-error`, never to one of these `invoke-*` kinds. Only execution-phase
|
|
140
|
+
* failures (a thrown `OrchestratorInvokeError`) reach the widened kinds.
|
|
119
141
|
*/
|
|
120
|
-
export declare const VERDICT_LANE_FAILURE_REASONS: readonly ["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error"];
|
|
142
|
+
export declare const VERDICT_LANE_FAILURE_REASONS: readonly ["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error", "invoke-auth", "invoke-model", "invoke-process-spawn", "invoke-process-exit", "invoke-timeout"];
|
|
121
143
|
export type VerdictLaneFailureReason = (typeof VERDICT_LANE_FAILURE_REASONS)[number];
|
|
122
144
|
/** A `completed` lane's own severity tally (from its extracted structured verdict). */
|
|
123
145
|
export declare const VerdictLaneSummarySchema: z.ZodObject<{
|
|
@@ -228,7 +250,7 @@ export declare const VerdictLaneSchema: z.ZodDiscriminatedUnion<"status", [z.Zod
|
|
|
228
250
|
}>, z.ZodObject<{
|
|
229
251
|
status: z.ZodLiteral<"failed">;
|
|
230
252
|
laneId: z.ZodString;
|
|
231
|
-
typedReason: z.ZodEnum<["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error"]>;
|
|
253
|
+
typedReason: z.ZodEnum<["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error", "invoke-auth", "invoke-model", "invoke-process-spawn", "invoke-process-exit", "invoke-timeout"]>;
|
|
232
254
|
/**
|
|
233
255
|
* REQUIRED (rev-6 item 3): the configured `provider:model` string the lane was
|
|
234
256
|
* created from. A failed lane can have NO `resolvedBackend` (it failed before a
|
|
@@ -247,18 +269,33 @@ export declare const VerdictLaneSchema: z.ZodDiscriminatedUnion<"status", [z.Zod
|
|
|
247
269
|
* (stable at lane creation), never to this field.
|
|
248
270
|
*/
|
|
249
271
|
resolvedBackend: z.ZodOptional<z.ZodString>;
|
|
272
|
+
/**
|
|
273
|
+
* OPTIONAL (mmnto-ai/totem#2459, additive 1.2.0): the content address of slice-B's
|
|
274
|
+
* `InvocationFailureArtifact` for this lane's terminal EXECUTION-phase invoke
|
|
275
|
+
* failure. It reaches B's bounded evidence — classified `kind`, bounded
|
|
276
|
+
* stdout/stderr, exit code / signal, timeout state — ONE HOP away, mirroring how a
|
|
277
|
+
* `completed` lane reaches its run artifact via `runArtifactHash`. Present only
|
|
278
|
+
* when the orchestrator persisted the failure evidence (an `OrchestratorInvokeError`
|
|
279
|
+
* carrying a `failureArtifactHash`); ABSENT for admission-phase / pre-invoke
|
|
280
|
+
* failures that never produced one, and honest-absent on pre-1.2 artifacts. When
|
|
281
|
+
* present it MUST resolve via `loadInvocationFailureArtifact` (the reference is a
|
|
282
|
+
* real, loadable content address — never a dangling hash).
|
|
283
|
+
*/
|
|
284
|
+
failureArtifactHash: z.ZodOptional<z.ZodString>;
|
|
250
285
|
}, "strip", z.ZodTypeAny, {
|
|
251
286
|
status: "failed";
|
|
252
287
|
laneId: string;
|
|
253
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
288
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
254
289
|
configuredLane: string;
|
|
255
290
|
resolvedBackend?: string | undefined;
|
|
291
|
+
failureArtifactHash?: string | undefined;
|
|
256
292
|
}, {
|
|
257
293
|
status: "failed";
|
|
258
294
|
laneId: string;
|
|
259
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
295
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
260
296
|
configuredLane: string;
|
|
261
297
|
resolvedBackend?: string | undefined;
|
|
298
|
+
failureArtifactHash?: string | undefined;
|
|
262
299
|
}>]>;
|
|
263
300
|
export type VerdictLane = z.infer<typeof VerdictLaneSchema>;
|
|
264
301
|
/** Severity vocabulary — aligned VERBATIM with cli `ShieldFindingSeveritySchema` (defined here so core stays cli-independent). */
|
|
@@ -441,6 +478,23 @@ export declare function deriveSettled(v: VerdictPredicateInput): boolean;
|
|
|
441
478
|
* deliberately STRICTER than cache-eligible (no CRITICALs).
|
|
442
479
|
*/
|
|
443
480
|
export declare function deriveCacheEligible(v: VerdictPredicateInput): boolean;
|
|
481
|
+
/**
|
|
482
|
+
* The exit-contract's non-pass gate (mmnto-ai/totem#2452): a fan produced ZERO
|
|
483
|
+
* `completed` verdict lanes. `completed` is the ONLY lane status that carries a
|
|
484
|
+
* usable structured verdict — an `abstained` lane invoked but its output was not
|
|
485
|
+
* extractable (sensor-down), and a `failed` lane never produced one — so neither
|
|
486
|
+
* is a verdict. A zero-completed fan is therefore NEVER a review pass (Tenets
|
|
487
|
+
* 12/13: a provider-unsettled round is honest-absent, never an external pass);
|
|
488
|
+
* the CLI writes the honest verdict, then hard-errors on this predicate BEFORE
|
|
489
|
+
* any cache stamp so `--override` can never mint a push authorization from it.
|
|
490
|
+
*
|
|
491
|
+
* Expressed over `lanes` as the SINGLE SOURCE OF TRUTH the artifact's
|
|
492
|
+
* `completedLaneCount` is validated against (`VerdictArtifactSchema` superRefine
|
|
493
|
+
* binds `completedLaneCount === #completed`), so `hasNoCompletedLane(v.lanes)`
|
|
494
|
+
* and `v.completedLaneCount === 0` are equal by construction. An empty fan
|
|
495
|
+
* (guarded upstream as a distinct pre-attempt error) trivially has none.
|
|
496
|
+
*/
|
|
497
|
+
export declare function hasNoCompletedLane(lanes: readonly VerdictLane[]): boolean;
|
|
444
498
|
/**
|
|
445
499
|
* The verdict artifact. See the module docstring for the LANE-BLINDNESS
|
|
446
500
|
* invariant (Prop 302): NO warm/cold runner-lane discriminator field exists,
|
|
@@ -468,15 +522,15 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
468
522
|
base: z.ZodString;
|
|
469
523
|
head: z.ZodString;
|
|
470
524
|
}, "strip", z.ZodTypeAny, {
|
|
525
|
+
head: string;
|
|
471
526
|
source: "explicit-range";
|
|
472
527
|
diffHash: string;
|
|
473
528
|
base: string;
|
|
474
|
-
head: string;
|
|
475
529
|
}, {
|
|
530
|
+
head: string;
|
|
476
531
|
source: "explicit-range";
|
|
477
532
|
diffHash: string;
|
|
478
533
|
base: string;
|
|
479
|
-
head: string;
|
|
480
534
|
}>, z.ZodObject<{
|
|
481
535
|
source: z.ZodLiteral<"branch-vs-base">;
|
|
482
536
|
diffHash: z.ZodString;
|
|
@@ -569,7 +623,7 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
569
623
|
}>, z.ZodObject<{
|
|
570
624
|
status: z.ZodLiteral<"failed">;
|
|
571
625
|
laneId: z.ZodString;
|
|
572
|
-
typedReason: z.ZodEnum<["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error"]>;
|
|
626
|
+
typedReason: z.ZodEnum<["invoke-error", "quota-exhausted", "missing-artifact-emission", "config-error", "invoke-auth", "invoke-model", "invoke-process-spawn", "invoke-process-exit", "invoke-timeout"]>;
|
|
573
627
|
/**
|
|
574
628
|
* REQUIRED (rev-6 item 3): the configured `provider:model` string the lane was
|
|
575
629
|
* created from. A failed lane can have NO `resolvedBackend` (it failed before a
|
|
@@ -588,18 +642,33 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
588
642
|
* (stable at lane creation), never to this field.
|
|
589
643
|
*/
|
|
590
644
|
resolvedBackend: z.ZodOptional<z.ZodString>;
|
|
645
|
+
/**
|
|
646
|
+
* OPTIONAL (mmnto-ai/totem#2459, additive 1.2.0): the content address of slice-B's
|
|
647
|
+
* `InvocationFailureArtifact` for this lane's terminal EXECUTION-phase invoke
|
|
648
|
+
* failure. It reaches B's bounded evidence — classified `kind`, bounded
|
|
649
|
+
* stdout/stderr, exit code / signal, timeout state — ONE HOP away, mirroring how a
|
|
650
|
+
* `completed` lane reaches its run artifact via `runArtifactHash`. Present only
|
|
651
|
+
* when the orchestrator persisted the failure evidence (an `OrchestratorInvokeError`
|
|
652
|
+
* carrying a `failureArtifactHash`); ABSENT for admission-phase / pre-invoke
|
|
653
|
+
* failures that never produced one, and honest-absent on pre-1.2 artifacts. When
|
|
654
|
+
* present it MUST resolve via `loadInvocationFailureArtifact` (the reference is a
|
|
655
|
+
* real, loadable content address — never a dangling hash).
|
|
656
|
+
*/
|
|
657
|
+
failureArtifactHash: z.ZodOptional<z.ZodString>;
|
|
591
658
|
}, "strip", z.ZodTypeAny, {
|
|
592
659
|
status: "failed";
|
|
593
660
|
laneId: string;
|
|
594
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
661
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
595
662
|
configuredLane: string;
|
|
596
663
|
resolvedBackend?: string | undefined;
|
|
664
|
+
failureArtifactHash?: string | undefined;
|
|
597
665
|
}, {
|
|
598
666
|
status: "failed";
|
|
599
667
|
laneId: string;
|
|
600
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
668
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
601
669
|
configuredLane: string;
|
|
602
670
|
resolvedBackend?: string | undefined;
|
|
671
|
+
failureArtifactHash?: string | undefined;
|
|
603
672
|
}>]>, "many">;
|
|
604
673
|
/** MUST equal `lanes.length` (validated below — never trusted). */
|
|
605
674
|
attemptedLaneCount: z.ZodNumber;
|
|
@@ -737,10 +806,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
737
806
|
}, "strip", z.ZodTypeAny, {
|
|
738
807
|
createdAt: string;
|
|
739
808
|
diffScope: {
|
|
809
|
+
head: string;
|
|
740
810
|
source: "explicit-range";
|
|
741
811
|
diffHash: string;
|
|
742
812
|
base: string;
|
|
743
|
-
head: string;
|
|
744
813
|
} | {
|
|
745
814
|
source: "branch-vs-base";
|
|
746
815
|
diffHash: string;
|
|
@@ -772,9 +841,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
772
841
|
} | {
|
|
773
842
|
status: "failed";
|
|
774
843
|
laneId: string;
|
|
775
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
844
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
776
845
|
configuredLane: string;
|
|
777
846
|
resolvedBackend?: string | undefined;
|
|
847
|
+
failureArtifactHash?: string | undefined;
|
|
778
848
|
})[];
|
|
779
849
|
findings: {
|
|
780
850
|
message: string;
|
|
@@ -817,10 +887,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
817
887
|
}, {
|
|
818
888
|
createdAt: string;
|
|
819
889
|
diffScope: {
|
|
890
|
+
head: string;
|
|
820
891
|
source: "explicit-range";
|
|
821
892
|
diffHash: string;
|
|
822
893
|
base: string;
|
|
823
|
-
head: string;
|
|
824
894
|
} | {
|
|
825
895
|
source: "branch-vs-base";
|
|
826
896
|
diffHash: string;
|
|
@@ -852,9 +922,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
852
922
|
} | {
|
|
853
923
|
status: "failed";
|
|
854
924
|
laneId: string;
|
|
855
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
925
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
856
926
|
configuredLane: string;
|
|
857
927
|
resolvedBackend?: string | undefined;
|
|
928
|
+
failureArtifactHash?: string | undefined;
|
|
858
929
|
})[];
|
|
859
930
|
findings: {
|
|
860
931
|
message: string;
|
|
@@ -897,10 +968,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
897
968
|
}>, {
|
|
898
969
|
createdAt: string;
|
|
899
970
|
diffScope: {
|
|
971
|
+
head: string;
|
|
900
972
|
source: "explicit-range";
|
|
901
973
|
diffHash: string;
|
|
902
974
|
base: string;
|
|
903
|
-
head: string;
|
|
904
975
|
} | {
|
|
905
976
|
source: "branch-vs-base";
|
|
906
977
|
diffHash: string;
|
|
@@ -932,9 +1003,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
932
1003
|
} | {
|
|
933
1004
|
status: "failed";
|
|
934
1005
|
laneId: string;
|
|
935
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
1006
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
936
1007
|
configuredLane: string;
|
|
937
1008
|
resolvedBackend?: string | undefined;
|
|
1009
|
+
failureArtifactHash?: string | undefined;
|
|
938
1010
|
})[];
|
|
939
1011
|
findings: {
|
|
940
1012
|
message: string;
|
|
@@ -977,10 +1049,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
977
1049
|
}, {
|
|
978
1050
|
createdAt: string;
|
|
979
1051
|
diffScope: {
|
|
1052
|
+
head: string;
|
|
980
1053
|
source: "explicit-range";
|
|
981
1054
|
diffHash: string;
|
|
982
1055
|
base: string;
|
|
983
|
-
head: string;
|
|
984
1056
|
} | {
|
|
985
1057
|
source: "branch-vs-base";
|
|
986
1058
|
diffHash: string;
|
|
@@ -1012,9 +1084,10 @@ export declare const VerdictArtifactSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1012
1084
|
} | {
|
|
1013
1085
|
status: "failed";
|
|
1014
1086
|
laneId: string;
|
|
1015
|
-
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error";
|
|
1087
|
+
typedReason: "invoke-error" | "quota-exhausted" | "missing-artifact-emission" | "config-error" | "invoke-auth" | "invoke-model" | "invoke-process-spawn" | "invoke-process-exit" | "invoke-timeout";
|
|
1016
1088
|
configuredLane: string;
|
|
1017
1089
|
resolvedBackend?: string | undefined;
|
|
1090
|
+
failureArtifactHash?: string | undefined;
|
|
1018
1091
|
})[];
|
|
1019
1092
|
findings: {
|
|
1020
1093
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../src/artifacts/verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["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