@vibe-agent-toolkit/agent-skills 0.1.40 → 0.1.41-rc.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/dist/skill-test/eval-executor.d.ts +50 -0
- package/dist/skill-test/eval-executor.d.ts.map +1 -0
- package/dist/skill-test/eval-executor.js +85 -0
- package/dist/skill-test/eval-executor.js.map +1 -0
- package/dist/skill-test/eval-fragment.d.ts +278 -0
- package/dist/skill-test/eval-fragment.d.ts.map +1 -0
- package/dist/skill-test/eval-fragment.js +128 -0
- package/dist/skill-test/eval-fragment.js.map +1 -0
- package/dist/skill-test/eval-grader.d.ts +54 -0
- package/dist/skill-test/eval-grader.d.ts.map +1 -0
- package/dist/skill-test/eval-grader.js +184 -0
- package/dist/skill-test/eval-grader.js.map +1 -0
- package/dist/skill-test/eval-inputs.d.ts +355 -0
- package/dist/skill-test/eval-inputs.d.ts.map +1 -1
- package/dist/skill-test/eval-inputs.js +36 -8
- package/dist/skill-test/eval-inputs.js.map +1 -1
- package/dist/skill-test/eval-lint.d.ts +51 -0
- package/dist/skill-test/eval-lint.d.ts.map +1 -0
- package/dist/skill-test/eval-lint.js +157 -0
- package/dist/skill-test/eval-lint.js.map +1 -0
- package/dist/skill-test/evals-template.d.ts.map +1 -1
- package/dist/skill-test/evals-template.js +7 -0
- package/dist/skill-test/evals-template.js.map +1 -1
- package/dist/skill-test/executor-prompt.d.ts +41 -0
- package/dist/skill-test/executor-prompt.d.ts.map +1 -0
- package/dist/skill-test/executor-prompt.js +63 -0
- package/dist/skill-test/executor-prompt.js.map +1 -0
- package/dist/skill-test/exit-codes.d.ts +8 -5
- package/dist/skill-test/exit-codes.d.ts.map +1 -1
- package/dist/skill-test/exit-codes.js +12 -7
- package/dist/skill-test/exit-codes.js.map +1 -1
- package/dist/skill-test/fragment-merge.d.ts +46 -0
- package/dist/skill-test/fragment-merge.d.ts.map +1 -0
- package/dist/skill-test/fragment-merge.js +77 -0
- package/dist/skill-test/fragment-merge.js.map +1 -0
- package/dist/skill-test/friction-schema.d.ts +10 -10
- package/dist/skill-test/friction-schema.d.ts.map +1 -1
- package/dist/skill-test/friction-schema.js +6 -1
- package/dist/skill-test/friction-schema.js.map +1 -1
- package/dist/skill-test/grader-model.d.ts +6 -0
- package/dist/skill-test/grader-model.d.ts.map +1 -0
- package/dist/skill-test/grader-model.js +6 -0
- package/dist/skill-test/grader-model.js.map +1 -0
- package/dist/skill-test/grader-prompt.d.ts +74 -0
- package/dist/skill-test/grader-prompt.d.ts.map +1 -0
- package/dist/skill-test/grader-prompt.js +173 -0
- package/dist/skill-test/grader-prompt.js.map +1 -0
- package/dist/skill-test/grading-adapter.d.ts +5 -11
- package/dist/skill-test/grading-adapter.d.ts.map +1 -1
- package/dist/skill-test/grading-adapter.js +9 -22
- package/dist/skill-test/grading-adapter.js.map +1 -1
- package/dist/skill-test/grading-schema.d.ts +18 -15
- package/dist/skill-test/grading-schema.d.ts.map +1 -1
- package/dist/skill-test/grading-schema.js +6 -5
- package/dist/skill-test/grading-schema.js.map +1 -1
- package/dist/skill-test/index.d.ts +13 -3
- package/dist/skill-test/index.d.ts.map +1 -1
- package/dist/skill-test/index.js +13 -3
- package/dist/skill-test/index.js.map +1 -1
- package/dist/skill-test/pipeline.d.ts +29 -0
- package/dist/skill-test/pipeline.d.ts.map +1 -0
- package/dist/skill-test/pipeline.js +77 -0
- package/dist/skill-test/pipeline.js.map +1 -0
- package/dist/skill-test/prompt-invariants.d.ts +27 -0
- package/dist/skill-test/prompt-invariants.d.ts.map +1 -0
- package/dist/skill-test/prompt-invariants.js +38 -0
- package/dist/skill-test/prompt-invariants.js.map +1 -0
- package/dist/skill-test/run-harness.d.ts +187 -55
- package/dist/skill-test/run-harness.d.ts.map +1 -1
- package/dist/skill-test/run-harness.js +539 -189
- package/dist/skill-test/run-harness.js.map +1 -1
- package/dist/skill-test/tier-plan.d.ts +89 -0
- package/dist/skill-test/tier-plan.d.ts.map +1 -0
- package/dist/skill-test/tier-plan.js +96 -0
- package/dist/skill-test/tier-plan.js.map +1 -0
- package/dist/skill-test/tool-eval-schema.d.ts +412 -0
- package/dist/skill-test/tool-eval-schema.d.ts.map +1 -0
- package/dist/skill-test/tool-eval-schema.js +83 -0
- package/dist/skill-test/tool-eval-schema.js.map +1 -0
- package/dist/validators/packaging-validator.d.ts +8 -1
- package/dist/validators/packaging-validator.d.ts.map +1 -1
- package/dist/validators/packaging-validator.js.map +1 -1
- package/package.json +5 -5
- package/schemas/friction-report.json +2 -1
- package/dist/skill-test/experimenter-prompt.d.ts +0 -42
- package/dist/skill-test/experimenter-prompt.d.ts.map +0 -1
- package/dist/skill-test/experimenter-prompt.js +0 -104
- package/dist/skill-test/experimenter-prompt.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skill-test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,GAIpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skill-test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,GAIpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAwB,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM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C;AAC9B,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAoB,MAAM,WAAW,CAAC;AACvF,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,YAAY,GAIb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,GAIhB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic, pure, unit-testable bounded-parallel pipeline runner.
|
|
3
|
+
*
|
|
4
|
+
* Runs `worker` over `items` with at most `concurrency` in flight at once.
|
|
5
|
+
* Results are returned in input order regardless of completion order. A
|
|
6
|
+
* worker may throw {@link RateLimitSignal} to back off and retry: the affected
|
|
7
|
+
* item sleeps (per-item, via the injected `sleep`) then retries, bounded by a
|
|
8
|
+
* retry cap; other in-flight workers are NOT paused. Any other thrown error
|
|
9
|
+
* propagates and fails the whole run.
|
|
10
|
+
*
|
|
11
|
+
* Zero claude/network dependency: callers inject `sleep` for deterministic
|
|
12
|
+
* tests (no real timers, no `Math.random`).
|
|
13
|
+
*/
|
|
14
|
+
/** Thrown by a worker to back off (sleep) and retry the current item. */
|
|
15
|
+
export declare class RateLimitSignal extends Error {
|
|
16
|
+
}
|
|
17
|
+
export interface RunPipelineOptions<T, R> {
|
|
18
|
+
readonly items: readonly T[];
|
|
19
|
+
/** Max number of workers in flight at once. Must be >= 1. */
|
|
20
|
+
readonly concurrency: number;
|
|
21
|
+
readonly worker: (item: T, index: number) => Promise<R>;
|
|
22
|
+
/** ms to wait before retrying, given the 1-based retry attempt number.
|
|
23
|
+
* Default: exponential backoff, min(60_000, 1000 * 2^(attempt-1)). */
|
|
24
|
+
readonly onRateLimit?: (attempt: number) => number;
|
|
25
|
+
/** Injectable for tests; defaults to a real `setTimeout`-based sleep. */
|
|
26
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare function runPipeline<T, R>(o: RunPipelineOptions<T, R>): Promise<R[]>;
|
|
29
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/skill-test/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,yEAAyE;AACzE,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C,MAAM,WAAW,kBAAkB,CAAC,CAAC,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACxD;2EACuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AA8CD,wBAAsB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CA8BjF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic, pure, unit-testable bounded-parallel pipeline runner.
|
|
3
|
+
*
|
|
4
|
+
* Runs `worker` over `items` with at most `concurrency` in flight at once.
|
|
5
|
+
* Results are returned in input order regardless of completion order. A
|
|
6
|
+
* worker may throw {@link RateLimitSignal} to back off and retry: the affected
|
|
7
|
+
* item sleeps (per-item, via the injected `sleep`) then retries, bounded by a
|
|
8
|
+
* retry cap; other in-flight workers are NOT paused. Any other thrown error
|
|
9
|
+
* propagates and fails the whole run.
|
|
10
|
+
*
|
|
11
|
+
* Zero claude/network dependency: callers inject `sleep` for deterministic
|
|
12
|
+
* tests (no real timers, no `Math.random`).
|
|
13
|
+
*/
|
|
14
|
+
/** Thrown by a worker to back off (sleep) and retry the current item. */
|
|
15
|
+
export class RateLimitSignal extends Error {
|
|
16
|
+
}
|
|
17
|
+
/** Bounded retries on RateLimitSignal before giving up and rethrowing. */
|
|
18
|
+
const MAX_RATE_LIMIT_RETRIES = 5;
|
|
19
|
+
const DEFAULT_BACKOFF_BASE_MS = 1000;
|
|
20
|
+
const DEFAULT_BACKOFF_CAP_MS = 60_000;
|
|
21
|
+
function defaultOnRateLimit(attempt) {
|
|
22
|
+
return Math.min(DEFAULT_BACKOFF_CAP_MS, DEFAULT_BACKOFF_BASE_MS * 2 ** (attempt - 1));
|
|
23
|
+
}
|
|
24
|
+
function defaultSleep(ms) {
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
setTimeout(resolve, ms);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runs a single item to completion, retrying on {@link RateLimitSignal} up to
|
|
31
|
+
* {@link MAX_RATE_LIMIT_RETRIES} times using the provided backoff + sleep.
|
|
32
|
+
*/
|
|
33
|
+
async function runItemWithRetry(item, index, worker, onRateLimit, sleep) {
|
|
34
|
+
let attempt = 0;
|
|
35
|
+
for (;;) {
|
|
36
|
+
try {
|
|
37
|
+
return await worker(item, index);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (!(error instanceof RateLimitSignal)) {
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
attempt += 1;
|
|
44
|
+
if (attempt > MAX_RATE_LIMIT_RETRIES) {
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
await sleep(onRateLimit(attempt));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export async function runPipeline(o) {
|
|
52
|
+
const { items, concurrency, worker } = o;
|
|
53
|
+
const onRateLimit = o.onRateLimit ?? defaultOnRateLimit;
|
|
54
|
+
const sleep = o.sleep ?? defaultSleep;
|
|
55
|
+
if (!Number.isInteger(concurrency) || concurrency < 1) {
|
|
56
|
+
throw new Error(`runPipeline: concurrency must be an integer >= 1 (got ${concurrency})`);
|
|
57
|
+
}
|
|
58
|
+
const results = new Array(items.length);
|
|
59
|
+
let nextIndex = 0;
|
|
60
|
+
async function runWorkerLoop() {
|
|
61
|
+
for (;;) {
|
|
62
|
+
const index = nextIndex;
|
|
63
|
+
nextIndex += 1;
|
|
64
|
+
if (index >= items.length) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Non-null: index < items.length was just checked above.
|
|
68
|
+
const item = items[index];
|
|
69
|
+
results[index] = await runItemWithRetry(item, index, worker, onRateLimit, sleep);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const poolSize = Math.min(concurrency, items.length);
|
|
73
|
+
const pool = Array.from({ length: poolSize }, () => runWorkerLoop());
|
|
74
|
+
await Promise.all(pool);
|
|
75
|
+
return results;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/skill-test/pipeline.ts"],"names":[],"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ariants — a missing required directive, or the presence of a
|
|
4
|
+
* forbidden phrase (e.g. an executor "blinding breaker").
|
|
5
|
+
*
|
|
6
|
+
* Shared across the `*-prompt.ts` modules in `skill-test/` so
|
|
7
|
+
* `exit-codes.ts`'s `mapErrorToExitCode` maps all of them to the same
|
|
8
|
+
* user-correctable preflight exit code (2), regardless of which prompt
|
|
9
|
+
* builder raised it.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PromptInvariantError extends Error {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Append the per-run integrity-nonce directive to the grader prompt. The recipient must copy
|
|
16
|
+
* `nonce` verbatim into the artifact it writes, as a top-level `runNonce`
|
|
17
|
+
* field; the harness then rejects any artifact whose nonce is absent or wrong.
|
|
18
|
+
* This is defense-in-depth against untrusted skill code forging a passing
|
|
19
|
+
* result in the shared sandbox — without the secret nonce (delivered only via
|
|
20
|
+
* stdin, never written to disk) a forged result cannot be authenticated.
|
|
21
|
+
*
|
|
22
|
+
* Appended AFTER any prompt-invariant assertion and AFTER any user prompt
|
|
23
|
+
* override, so the nonce requirement is ALWAYS enforced and a committed
|
|
24
|
+
* config cannot opt out of it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function appendIntegrityNonceDirective(prompt: string, nonce: string): string;
|
|
27
|
+
//# sourceMappingURL=prompt-invariants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-invariants.d.ts","sourceRoot":"","sources":["../../src/skill-test/prompt-invariants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQnF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when a vat-generated prompt (executor or grader) violates one of its
|
|
3
|
+
* required invariants — a missing required directive, or the presence of a
|
|
4
|
+
* forbidden phrase (e.g. an executor "blinding breaker").
|
|
5
|
+
*
|
|
6
|
+
* Shared across the `*-prompt.ts` modules in `skill-test/` so
|
|
7
|
+
* `exit-codes.ts`'s `mapErrorToExitCode` maps all of them to the same
|
|
8
|
+
* user-correctable preflight exit code (2), regardless of which prompt
|
|
9
|
+
* builder raised it.
|
|
10
|
+
*/
|
|
11
|
+
export class PromptInvariantError extends Error {
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(`Prompt invariant violated: ${message}`);
|
|
14
|
+
this.name = 'PromptInvariantError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Append the per-run integrity-nonce directive to the grader prompt. The recipient must copy
|
|
19
|
+
* `nonce` verbatim into the artifact it writes, as a top-level `runNonce`
|
|
20
|
+
* field; the harness then rejects any artifact whose nonce is absent or wrong.
|
|
21
|
+
* This is defense-in-depth against untrusted skill code forging a passing
|
|
22
|
+
* result in the shared sandbox — without the secret nonce (delivered only via
|
|
23
|
+
* stdin, never written to disk) a forged result cannot be authenticated.
|
|
24
|
+
*
|
|
25
|
+
* Appended AFTER any prompt-invariant assertion and AFTER any user prompt
|
|
26
|
+
* override, so the nonce requirement is ALWAYS enforced and a committed
|
|
27
|
+
* config cannot opt out of it.
|
|
28
|
+
*/
|
|
29
|
+
export function appendIntegrityNonceDirective(prompt, nonce) {
|
|
30
|
+
return [
|
|
31
|
+
prompt,
|
|
32
|
+
'',
|
|
33
|
+
'INTEGRITY (required, do this LAST): the artifact you write MUST include a',
|
|
34
|
+
`top-level string field "runNonce" whose value is EXACTLY: ${nonce}`,
|
|
35
|
+
'Copy it verbatim. vat rejects an artifact whose runNonce is missing or wrong.',
|
|
36
|
+
].join('\n');
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=prompt-invariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-invariants.js","sourceRoot":"","sources":["../../src/skill-test/prompt-invariants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAc,EAAE,KAAa;IACzE,OAAO;QACL,MAAM;QACN,EAAE;QACF,2EAA2E;QAC3E,6DAA6D,KAAK,EAAE;QACpE,+EAA+E;KAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -5,15 +5,23 @@
|
|
|
5
5
|
* lock → assert safe workdir + harness root → stage → resolve staged-subject
|
|
6
6
|
* eval path → bootstrap-check (scaffold template + exit 3 if absent)
|
|
7
7
|
* → preflight (return early exitCode 2 on failure) → ack enforcement
|
|
8
|
-
* → build
|
|
9
|
-
* →
|
|
8
|
+
* → dry-run short-circuit → build per-eval work items → run the vat-owned
|
|
9
|
+
* executor→grader pipeline (bounded-parallel) → merge grader fragments →
|
|
10
|
+
* write grading.json/friction.json (vat is SOLE writer) → reconcile verdict
|
|
11
|
+
* → release lock → return result
|
|
10
12
|
*/
|
|
11
13
|
import type { SkillSourceDescriptor } from '@vibe-agent-toolkit/resources';
|
|
14
|
+
import { type spawnHeadlessClaude } from '@vibe-agent-toolkit/utils';
|
|
12
15
|
import type { ResolveSkillSourceContext, SkillSource } from '../skill-source/types.js';
|
|
16
|
+
import type { EvalFragment } from './eval-fragment.js';
|
|
17
|
+
import { type EvalEntry, type EvalSuite } from './eval-inputs.js';
|
|
13
18
|
import { type SkillTestExitCodeValue } from './exit-codes.js';
|
|
14
19
|
import { type FrictionItem } from './friction-schema.js';
|
|
20
|
+
import { type GradingVerdict } from './grading-adapter.js';
|
|
15
21
|
import { type PreflightInput } from './preflight.js';
|
|
16
22
|
import { type StageItem } from './staging.js';
|
|
23
|
+
import { type SkippedEvalsSummary } from './tier-plan.js';
|
|
24
|
+
import { type ToolEvalReport } from './tool-eval-schema.js';
|
|
17
25
|
/** Auth modes supported by the harness. */
|
|
18
26
|
export type HarnessAuthMode = 'inherit' | 'subscription' | 'api-key' | 'auto';
|
|
19
27
|
/** Auth mechanism requirements. */
|
|
@@ -52,8 +60,22 @@ export interface RunHarnessOptions {
|
|
|
52
60
|
auth?: HarnessAuthMode;
|
|
53
61
|
/** Required auth mechanism. */
|
|
54
62
|
requireAuth?: HarnessAuthMechanism;
|
|
55
|
-
/**
|
|
56
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Pinned grader/judge model for the per-eval grader spawns. Defaults to
|
|
65
|
+
* {@link DEFAULT_GRADER_MODEL}. Deliberately distinct from `model` (which is
|
|
66
|
+
* the model under test in the executor spawns) so the judge stays comparable
|
|
67
|
+
* across runs regardless of the subject model.
|
|
68
|
+
*/
|
|
69
|
+
graderModel?: string;
|
|
70
|
+
/** Bounded-parallel executor→grader pipeline width. Defaults to {@link DEFAULT_CONCURRENCY}. */
|
|
71
|
+
concurrency?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Injectable spawn seam (tests only). When set, it replaces the real
|
|
74
|
+
* {@link spawnHeadlessClaude} in BOTH the executor and grader per-eval spawns,
|
|
75
|
+
* so a test can drive the full harness with a fake `claude` and no real
|
|
76
|
+
* install. Production callers leave it undefined (the real spawn is used).
|
|
77
|
+
*/
|
|
78
|
+
spawn?: typeof spawnHeadlessClaude;
|
|
57
79
|
/** Enable A/B baseline run (with/without skill). */
|
|
58
80
|
baseline?: boolean;
|
|
59
81
|
/** Allow unverified skill source (skip manifest check). */
|
|
@@ -103,8 +125,21 @@ export interface RunHarnessOptions {
|
|
|
103
125
|
dryRunStagedExistingDist?: boolean;
|
|
104
126
|
/** Feature B: explicit env var injections (interpolated at stage time). */
|
|
105
127
|
env?: Record<string, string>;
|
|
106
|
-
/** Feature A: host env var names to forward to the
|
|
128
|
+
/** Feature A: host env var names to forward to the executor spawn if present. */
|
|
107
129
|
passEnv?: readonly string[];
|
|
130
|
+
/**
|
|
131
|
+
* Declared executables the subject skill ships (name + kind + howInvoked),
|
|
132
|
+
* populated by run.ts from the resolved subject's packaging config WHEN cleanly
|
|
133
|
+
* reachable (a `buildable` ref carries `packagingConfig`; a plain path source
|
|
134
|
+
* does not — issue #145 Phase T). Passed to the grader on the WITH arm ONLY as
|
|
135
|
+
* a recognition aid alongside each eval's `toolExpectations`. Absent → the
|
|
136
|
+
* grader still matches tools by the commands it sees in the transcript.
|
|
137
|
+
*/
|
|
138
|
+
declaredExecutables?: Array<{
|
|
139
|
+
name: string;
|
|
140
|
+
howInvoked: string;
|
|
141
|
+
kind: string;
|
|
142
|
+
}>;
|
|
108
143
|
/**
|
|
109
144
|
* Opt-OUT of eval gating (for interactive use). By DEFAULT (false/absent) a
|
|
110
145
|
* failing verdict returns exit EvalFailure (4) — fail-closed, so CI catches a
|
|
@@ -120,8 +155,8 @@ export interface RunHarnessResult {
|
|
|
120
155
|
summary: string;
|
|
121
156
|
}
|
|
122
157
|
/**
|
|
123
|
-
* Built-in cost/runtime safety ceilings
|
|
124
|
-
* SAME values the harness applies as defaults, but exported as an explicit cap so
|
|
158
|
+
* Built-in cost/runtime safety ceilings applied PER executor/grader spawn. These
|
|
159
|
+
* are the SAME values the harness applies as defaults, but exported as an explicit cap so
|
|
125
160
|
* the CLI precedence layer (run.ts) can enforce a critical asymmetry:
|
|
126
161
|
*
|
|
127
162
|
* - a CLI flag (explicit operator intent, typed at the terminal for THIS run)
|
|
@@ -140,21 +175,13 @@ export declare const SKILL_TEST_BUILTIN_CAPS: {
|
|
|
140
175
|
readonly timeoutSeconds: number;
|
|
141
176
|
};
|
|
142
177
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* unbounded budget). An EXPLICIT `--timeout` always bypasses this (see resolveTimeoutMs).
|
|
149
|
-
*/
|
|
150
|
-
export declare function computeDefaultTimeoutMs(declaredEvalCount: number): number;
|
|
151
|
-
/**
|
|
152
|
-
* Resolve the effective wall-clock timeout (ms). An explicit `--timeout` (seconds)
|
|
153
|
-
* ALWAYS wins, unchanged. Otherwise the default scales with the declared eval count
|
|
154
|
-
* via {@link computeDefaultTimeoutMs}; when that count is unknown/unparseable at the
|
|
155
|
-
* call site, fall back to the flat 300s default.
|
|
178
|
+
* Resolve the effective PER-EVAL wall-clock timeout (ms). Each executor and
|
|
179
|
+
* grader spawn is an independent, bounded-parallel unit (issue #145), so the
|
|
180
|
+
* budget is a flat per-spawn ceiling — NOT scaled by the suite size the way the
|
|
181
|
+
* old single serial run's budget was. An explicit `--timeout` (seconds)
|
|
182
|
+
* wins; otherwise the flat {@link DEFAULT_TIMEOUT_MS} default applies.
|
|
156
183
|
*/
|
|
157
|
-
export declare function resolveTimeoutMs(opts: RunHarnessOptions
|
|
184
|
+
export declare function resolveTimeoutMs(opts: RunHarnessOptions): number;
|
|
158
185
|
/**
|
|
159
186
|
* Map an eval verdict to a process exit code. Default behavior (fail-closed): a
|
|
160
187
|
* failing verdict escalates to EvalFailure (4) — distinct from the harness-broke
|
|
@@ -203,34 +230,6 @@ export declare function renderPreflightSummary(checks: {
|
|
|
203
230
|
* (the harness Step-6 check and the run.ts pre-build check cannot diverge).
|
|
204
231
|
*/
|
|
205
232
|
export declare function isAcknowledged(opts: Pick<RunHarnessOptions, 'dryRun' | 'acknowledgedRunsSkillCode'>): boolean;
|
|
206
|
-
/** Optional context for the timeout message (surfaced only when available). */
|
|
207
|
-
export interface TimeoutMessageContext {
|
|
208
|
-
/** Number of evals the suite DECLARED (parsed suite length), if known. */
|
|
209
|
-
declaredEvalCount?: number;
|
|
210
|
-
/** Best-effort count of evals that completed before the timeout, if cheaply known. */
|
|
211
|
-
completedEvalCount?: number;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Format the experimenter-timeout message. Pure so it can be unit-tested. Always
|
|
215
|
-
* reports the raw budget (ms + a minute label). When the declared eval count is
|
|
216
|
-
* known it appends the count and a hint that the default budget scales with eval
|
|
217
|
-
* count (raise `--timeout`/`--stall` for larger suites); when a best-effort
|
|
218
|
-
* completed count is also available it notes `completed ~N/declared`. With no
|
|
219
|
-
* declared count it stays honest and omits those clauses.
|
|
220
|
-
*/
|
|
221
|
-
export declare function formatTimeoutMessage(input: {
|
|
222
|
-
timeoutMs: number;
|
|
223
|
-
} & TimeoutMessageContext): string;
|
|
224
|
-
/**
|
|
225
|
-
* Translate a non-success spawn outcome into an InternalHarnessError (exit 1).
|
|
226
|
-
* A stall, a timeout, OR a non-zero exit are each authoritative — a non-zero exit
|
|
227
|
-
* is never laundered into a PASS even if a grading.json happens to be on disk.
|
|
228
|
-
*/
|
|
229
|
-
export declare function assertExperimenterSucceeded(spawnResult: {
|
|
230
|
-
stalled: boolean;
|
|
231
|
-
timedOut: boolean;
|
|
232
|
-
status: number;
|
|
233
|
-
}, stallMs: number | undefined, timeoutMs: number, timeoutContext?: TimeoutMessageContext): void;
|
|
234
233
|
/**
|
|
235
234
|
* Format a friction report for human consumption — one line per entry as
|
|
236
235
|
* `[<severity>] <category>: <message>`. Pure; returns the empty string for no
|
|
@@ -247,14 +246,15 @@ export declare function formatFrictionReport(items: readonly FrictionItem[]): st
|
|
|
247
246
|
export declare function subjectSkillName(opts: RunHarnessOptions): string;
|
|
248
247
|
export declare function resolveScaffoldEvalsPath(opts: RunHarnessOptions, repoRoot: string, evalsSubpath: string): string;
|
|
249
248
|
/** Parse the staged eval suite and materialize each eval's input `files` into
|
|
250
|
-
* `<harnessRoot>/workspaces/<id>/`. Returns the workspaces root
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* leak a prior run's inputs. Throws {@link EvalInputError}
|
|
254
|
-
* exit 2) on a bad suite or a missing input file. */
|
|
249
|
+
* `<harnessRoot>/workspaces/<id>/`. Returns the workspaces root, the parsed
|
|
250
|
+
* {@link EvalSuite} (so the eval loop has the entries without re-reading), and the
|
|
251
|
+
* declared eval count (derived from the suite). The dir is wiped first so a reused
|
|
252
|
+
* harness root cannot leak a prior run's inputs. Throws {@link EvalInputError}
|
|
253
|
+
* (mapped by the caller to exit 2) on a bad suite or a missing input file. */
|
|
255
254
|
export declare function stageWorkspacesForRun(evalsPath: string, harnessRoot: string): {
|
|
256
255
|
workspacesRoot: string;
|
|
257
256
|
declaredEvalCount: number;
|
|
257
|
+
suite: EvalSuite;
|
|
258
258
|
};
|
|
259
259
|
/** Inputs for the dry-run summary string. */
|
|
260
260
|
export interface DryRunSummaryInput {
|
|
@@ -271,8 +271,14 @@ export interface DryRunSummaryInput {
|
|
|
271
271
|
provenanceFingerprint: string;
|
|
272
272
|
/** Number of entries in the staged manifest. */
|
|
273
273
|
provenanceEntryCount: number;
|
|
274
|
-
/** The assembled model flag string (e.g. `--model claude-opus-4-8`). */
|
|
274
|
+
/** The assembled model flag string for the executor (e.g. `--model claude-opus-4-8`). */
|
|
275
275
|
modelFlag: string;
|
|
276
|
+
/** Number of declared evals a real run would execute. */
|
|
277
|
+
evalCount: number;
|
|
278
|
+
/** Bounded-parallel executor→grader pipeline width a real run would use. */
|
|
279
|
+
concurrency: number;
|
|
280
|
+
/** Pinned grader/judge model a real run would grade with. */
|
|
281
|
+
graderModel: string;
|
|
276
282
|
}
|
|
277
283
|
/**
|
|
278
284
|
* Build the dry-run summary string. Pure function so it can be unit-tested
|
|
@@ -311,6 +317,132 @@ export interface CleanupHarnessOptions {
|
|
|
311
317
|
* could otherwise delete the symlink's target outside tmp.
|
|
312
318
|
*/
|
|
313
319
|
export declare function cleanupHarness(harnessRoot: string, opts: CleanupHarnessOptions): void;
|
|
320
|
+
/** One unit of executor→grader work: an eval + which arm (with/without skill). */
|
|
321
|
+
export interface EvalWorkItem {
|
|
322
|
+
entry: EvalEntry;
|
|
323
|
+
arm: 'with' | 'without';
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Build the per-eval work items for a set of evals (one tier's worth, or a whole
|
|
327
|
+
* suite). Every eval gets a WITH arm (skill present). When `baseline` is set,
|
|
328
|
+
* every eval ALSO gets a WITHOUT arm (skill absent) so vat can record an
|
|
329
|
+
* informational A/B — the WITHOUT arm never contributes to the pass/fail verdict
|
|
330
|
+
* (see {@link partitionFragmentsByArm}) and never drives tier gating. Pure +
|
|
331
|
+
* unit-testable.
|
|
332
|
+
*/
|
|
333
|
+
export declare function buildEvalWorkItems(evals: readonly EvalEntry[], baseline: boolean): EvalWorkItem[];
|
|
334
|
+
/**
|
|
335
|
+
* Partition graded fragments into the WITH arm (the authoritative verdict +
|
|
336
|
+
* grading.json) and the WITHOUT arm (baseline.json, informational only). A
|
|
337
|
+
* fragment with no `arm` (or `arm: 'with'`) is a WITH-arm fragment. Pure +
|
|
338
|
+
* unit-testable.
|
|
339
|
+
*/
|
|
340
|
+
export declare function partitionFragmentsByArm(fragments: EvalFragment[]): {
|
|
341
|
+
withArm: EvalFragment[];
|
|
342
|
+
withoutArm: EvalFragment[];
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* The vat-only grader dir for a run: `<tmp>/vat-skill-grade-<dirToken>/`. It is
|
|
346
|
+
* deliberately OUTSIDE the harness root (the skill's `--add-dir` sandbox) and
|
|
347
|
+
* created 0700, so it is invisible to Claude's own permission model and to any
|
|
348
|
+
* OTHER OS user. Pure (derives a path only).
|
|
349
|
+
*
|
|
350
|
+
* SCOPE OF THE GUARANTEE — read honestly. `--add-dir`/`bypassPermissions` is
|
|
351
|
+
* Claude's permission model, NOT an OS sandbox: the executor's skill code runs
|
|
352
|
+
* as the SAME OS uid as vat, so it CAN read a 0700 dir this process owns. The
|
|
353
|
+
* layered defenses here — dir outside the sandbox, named by an unpredictable
|
|
354
|
+
* `dirToken` (distinct from the integrity nonce, which never touches the dir
|
|
355
|
+
* name or any argv and travels only via grader stdin), the nonce echoed back
|
|
356
|
+
* per fragment, and each fragment file unlinked the instant vat reads it — RAISE
|
|
357
|
+
* THE BAR against same-uid forgery (a forger must now win a per-fragment
|
|
358
|
+
* read→overwrite race against a secret it cannot predict, with no persisted copy
|
|
359
|
+
* to harvest at leisure). They do NOT amount to true isolation from same-uid
|
|
360
|
+
* code. The complete fix is running the grader under a SEPARATE OS uid /
|
|
361
|
+
* container; that is tracked as a follow-up (see CHANGELOG "Security" notes) and
|
|
362
|
+
* is the only thing that closes the residual race outright.
|
|
363
|
+
*/
|
|
364
|
+
export declare function resolveGraderOutDir(dirToken: string): string;
|
|
365
|
+
/**
|
|
366
|
+
* The executor working directory for one eval: its staged input workspace
|
|
367
|
+
* `<workspacesRoot>/<id>` when the eval declares input `files`, else undefined
|
|
368
|
+
* (the executor then defaults to the staged subject dir). Pure + unit-testable.
|
|
369
|
+
*/
|
|
370
|
+
export declare function resolvePerEvalWorkspaceDir(entry: EvalEntry, workspacesRoot: string): string | undefined;
|
|
371
|
+
/** Best-effort removal of the vat-only grader dir (never throws — runs from cleanup). */
|
|
372
|
+
export declare function removeGraderOutDir(graderOutDir: string | undefined): void;
|
|
373
|
+
/** The results/ artifacts vat is the SOLE writer of, resolved for one run. */
|
|
374
|
+
export interface ArtifactPaths {
|
|
375
|
+
gradingOut: string;
|
|
376
|
+
frictionOut: string;
|
|
377
|
+
baselineOut: string;
|
|
378
|
+
toolEvalOut: string;
|
|
379
|
+
}
|
|
380
|
+
/** Resolve the run's grading/friction/baseline/tool-eval artifact paths under
|
|
381
|
+
* `resultsDir`. Single source of truth for the filenames (used by the
|
|
382
|
+
* pre-pipeline stale wipe AND the post-merge writer). */
|
|
383
|
+
export declare function resolveArtifactPaths(resultsDir: string): ArtifactPaths;
|
|
384
|
+
/**
|
|
385
|
+
* Remove any PRIOR run's artifacts before this run writes its own. The harness
|
|
386
|
+
* root is deterministic per skill-set and reused across runs (`--keep`/`--out`, or
|
|
387
|
+
* after a crash/SIGKILL that preempted cleanup), so a stale grading/friction/
|
|
388
|
+
* baseline/tool-eval.json can otherwise survive into a run that throws BEFORE the merge —
|
|
389
|
+
* where the `finally` would then echo the PRIOR run's friction as if it were this
|
|
390
|
+
* run's. Wiping all three up front closes that cross-run leak. Best-effort
|
|
391
|
+
* (`force: true`) — a missing file is fine.
|
|
392
|
+
*/
|
|
393
|
+
export declare function wipeStaleArtifacts(paths: ArtifactPaths): void;
|
|
394
|
+
/**
|
|
395
|
+
* The COMPOSITE run verdict (issue #145 Phase T): the run passes only when BOTH
|
|
396
|
+
* the prose-expectation grading passed AND every tool-expectation verdict passed.
|
|
397
|
+
* Tool verdicts live in tool-eval.json (a SEPARATE channel — C2); this combines
|
|
398
|
+
* the two at the exit-code layer WITHOUT mixing the channels' data. When no eval
|
|
399
|
+
* declared `toolExpectations`, `toolEval.evals` is empty and this equals
|
|
400
|
+
* `outputAllPassed`. Pure + unit-testable.
|
|
401
|
+
*/
|
|
402
|
+
export declare function computeCompositeVerdict(outputAllPassed: boolean, toolEval: ToolEvalReport): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* The run's final pass/fail after cost-tiered fail-fast: the {@link
|
|
405
|
+
* computeCompositeVerdict} of the tiers that RAN, AND no tiers were skipped. A
|
|
406
|
+
* fail-fast run that gated higher tiers is NEVER a pass (skipped ≠ passed) — this
|
|
407
|
+
* forces `false` so the exit code is EvalFailure (4), never downgraded to 0 by the
|
|
408
|
+
* composite path alone. Pure + unit-testable.
|
|
409
|
+
*/
|
|
410
|
+
export declare function resolveCompositeAllPassed(outputAllPassed: boolean, toolEval: ToolEvalReport, skipped: SkippedEvalsSummary | undefined): boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Running total of spend across every executor+grader session in a run (adopter
|
|
413
|
+
* follow-up). `sessions` counts only sessions that REPORTED a `total_cost_usd`, so
|
|
414
|
+
* `≈$${totalUsd} across ${sessions} sessions` is always internally consistent (the
|
|
415
|
+
* sum is over exactly those sessions). Mutated in place by {@link recordSessionCost}
|
|
416
|
+
* — safe under the cooperative (single-threaded) pipeline concurrency.
|
|
417
|
+
*/
|
|
418
|
+
export interface RunCostSummary {
|
|
419
|
+
totalUsd: number;
|
|
420
|
+
sessions: number;
|
|
421
|
+
}
|
|
422
|
+
/** Fold one session's `total_cost_usd` into the accumulator; a non-number (mock spawn / missing result) is ignored. */
|
|
423
|
+
export declare function recordSessionCost(acc: RunCostSummary, totalCostUsd: number | undefined): void;
|
|
424
|
+
/**
|
|
425
|
+
* The ` | ≈$0.42 across 6 sessions` spend suffix for the summary line, or `''`
|
|
426
|
+
* when no session reported a cost (e.g. every spawn was a test mock) so the suffix
|
|
427
|
+
* never adds noise to a run with no cost signal. Pure + unit-testable.
|
|
428
|
+
*/
|
|
429
|
+
export declare function formatRunCostSuffix(cost: RunCostSummary | undefined): string;
|
|
430
|
+
/**
|
|
431
|
+
* The run's human summary line, computed from the COMPOSITE verdict so an
|
|
432
|
+
* output-pass with a failing tool verdict still reads FAIL. The prose-expectation
|
|
433
|
+
* counts (`passed/total`) come from the grading verdict; when any tool-expectation
|
|
434
|
+
* verdict failed, a `(N tool)` suffix names how many — so a composite FAIL whose
|
|
435
|
+
* OUTPUT counts look all-green (e.g. `FAIL 3/3 (1 tool)`) is self-explaining. Pure.
|
|
436
|
+
*/
|
|
437
|
+
export declare function buildRunSummary(verdict: GradingVerdict, toolEval: ToolEvalReport, compositeAllPassed: boolean): string;
|
|
438
|
+
/**
|
|
439
|
+
* The run summary line, appending the fail-fast SKIPPED note when the tier gate
|
|
440
|
+
* stopped higher tiers. Legibility is required — the skipped tiers are named on
|
|
441
|
+
* their own line, never silently dropped. Pure. Note that a run with skipped
|
|
442
|
+
* tiers ALWAYS reads FAIL (skipped ≠ passed forces `compositeAllPassed` false at
|
|
443
|
+
* the call site), so the base line is already FAIL when the note is present.
|
|
444
|
+
*/
|
|
445
|
+
export declare function buildRunSummaryWithSkips(verdict: GradingVerdict, toolEval: ToolEvalReport, compositeAllPassed: boolean, skipped: SkippedEvalsSummary | undefined, cost?: RunCostSummary): string;
|
|
314
446
|
/**
|
|
315
447
|
* Domain orchestrator for `vat skill test run`. Pure of process.exit — all
|
|
316
448
|
* exit-code decisions live in the caller (run.ts).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-harness.d.ts","sourceRoot":"","sources":["../../src/skill-test/run-harness.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"run-harness.d.ts","sourceRoot":"","sources":["../../src/skill-test/run-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EASL,KAAK,mBAAmB,EAGzB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAuB,yBAAyB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAuD,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGvH,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM7E,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA8BlF,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9E,mCAAmC;AACnC,MAAM,MAAM,oBAAoB,GAA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