archal 0.9.19 → 0.10.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.
Files changed (83) hide show
  1. package/README.md +62 -154
  2. package/agents/openclaw/.archal.json +8 -0
  3. package/agents/openclaw/Dockerfile +97 -0
  4. package/agents/openclaw/README.md +113 -0
  5. package/agents/openclaw/drive.mjs +301 -0
  6. package/agents/openclaw/extract-openclaw-response-text.mjs +49 -0
  7. package/agents/openclaw/package.json +9 -0
  8. package/agents/openclaw/scenarios/acceptance/github-escalation-and-cleanup.md +43 -0
  9. package/agents/openclaw/scenarios/acceptance/jira-linear-release-triage.md +39 -0
  10. package/agents/openclaw/scenarios/acceptance/multi-clone-customer-risk-review.md +45 -0
  11. package/agents/openclaw/scenarios/acceptance/slack-incident-handoff.md +42 -0
  12. package/agents/openclaw/scenarios/acceptance/stripe-dunning-remediation.md +40 -0
  13. package/agents/openclaw/scenarios/close-stale-issues.md +35 -0
  14. package/agents/openclaw/scenarios/github-issue-triage-read-only.md +44 -0
  15. package/agents/openclaw/workspace/AGENTS.md +23 -0
  16. package/agents/openclaw/workspace/IDENTITY.md +8 -0
  17. package/agents/openclaw/workspace/SOUL.md +14 -0
  18. package/agents/openclaw/workspace/TOOLS.md +54 -0
  19. package/clone-assets/apify/tools.json +256 -22
  20. package/clone-assets/calcom/tools.json +2062 -0
  21. package/clone-assets/clickup/tools.json +3245 -0
  22. package/clone-assets/customerio/tools.json +2350 -0
  23. package/clone-assets/datadog/tools.json +734 -0
  24. package/clone-assets/github/tools.json +307 -27
  25. package/clone-assets/gitlab/tools.json +10688 -0
  26. package/clone-assets/google-workspace/tools.json +18 -6
  27. package/clone-assets/hubspot/tools.json +1604 -0
  28. package/clone-assets/jira/fidelity.json +1 -1
  29. package/clone-assets/jira/tools.json +266 -543
  30. package/clone-assets/linear/tools.json +278 -40
  31. package/clone-assets/ownerrez/tools.json +548 -0
  32. package/clone-assets/pricelabs/tools.json +343 -0
  33. package/clone-assets/sentry/tools.json +2821 -0
  34. package/clone-assets/slack/tools.json +1 -2
  35. package/clone-assets/stripe/tools.json +299 -46
  36. package/clone-assets/supabase/tools.json +437 -0
  37. package/clone-assets/unipile/tools.json +408 -0
  38. package/clone-assets/webflow/tools.json +2185 -0
  39. package/dist/autoloop-worker-types-CHaclqtD.d.cts +160 -0
  40. package/dist/cli.cjs +127896 -84811
  41. package/dist/{vitest/chunk-L36NXAU6.js → commands/autoloop-hosted-control-plane-client.cjs} +16344 -18845
  42. package/dist/commands/autoloop-hosted-control-plane-client.d.cts +133 -0
  43. package/dist/commands/autoloop-pr-verification.cjs +4312 -0
  44. package/dist/commands/autoloop-pr-verification.d.cts +19 -0
  45. package/dist/commands/autoloop-result-parser.cjs +27058 -0
  46. package/dist/commands/autoloop-result-parser.d.cts +196 -0
  47. package/dist/commands/autoloop-worker.cjs +38488 -0
  48. package/dist/commands/autoloop-worker.d.cts +102 -0
  49. package/dist/eval-shim.mjs +216 -0
  50. package/dist/index.cjs +15 -2
  51. package/dist/index.d.cts +3 -1
  52. package/dist/layer-1-ziaLpfLr.d.cts +62 -0
  53. package/dist/metafile-cjs.json +1 -0
  54. package/dist/reporter-entry.js +3 -0
  55. package/dist/sdk/index.cjs +51630 -0
  56. package/dist/sdk/index.d.cts +626 -0
  57. package/dist/vitest/chunk-2PDHTPZC.js +4867 -0
  58. package/dist/vitest/chunk-7L4BBB6M.js +2613 -0
  59. package/dist/vitest/index.cjs +6152 -75718
  60. package/dist/vitest/index.d.ts +22 -86
  61. package/dist/vitest/index.js +45 -414
  62. package/dist/vitest/runtime/hosted-session-reaper.cjs +682 -34399
  63. package/dist/vitest/runtime/hosted-session-reaper.js +1 -1
  64. package/dist/vitest/runtime/setup-files.js +2 -2
  65. package/manifest.json +9 -0
  66. package/package.json +20 -14
  67. package/skills/archal-agent/SKILL.md +86 -0
  68. package/skills/autoloop/SKILL.md +391 -0
  69. package/skills/autoloop/references/hosted-sources.md +94 -0
  70. package/skills/autoloop/references/trace-schema-mapping.md +104 -0
  71. package/skills/eval/SKILL.md +17 -15
  72. package/skills/free-account/SKILL.md +103 -0
  73. package/skills/install-agent/SKILL.md +202 -0
  74. package/skills/onboard/SKILL.md +29 -18
  75. package/skills/scenario/SKILL.md +36 -18
  76. package/skills/seed/SKILL.md +238 -0
  77. package/skills/vitest/SKILL.md +3 -2
  78. package/dist/harness.cjs +0 -62
  79. package/dist/harness.d.cts +0 -20
  80. package/dist/seed/dynamic-generator.cjs +0 -45687
  81. package/dist/seed/dynamic-generator.d.cts +0 -106
  82. package/dist/vitest/chunk-WZ7SA4CK.js +0 -47369
  83. package/skills/attach/SKILL.md +0 -402
@@ -0,0 +1,102 @@
1
+ import { A as AutoloopWorkerJob, C as CodexAuth, E as E2BAutoloopWorkerOptions, b as AutoloopWorker } from '../autoloop-worker-types-CHaclqtD.cjs';
2
+ export { c as AutoloopGithubInstallationTokenContext, d as AutoloopWorkerError, a as AutoloopWorkerResult, e as AzureCodexAuth, O as OpenAICodexAuth, i as isAutoloopWorkerError, p as preflightGithubAutoloopPermissions } from '../autoloop-worker-types-CHaclqtD.cjs';
3
+ import '../layer-1-ziaLpfLr.cjs';
4
+
5
+ declare const PHASES: readonly [{
6
+ readonly id: "01-grade" | "02-seed" | "03-reproduce" | "04-fix-pr";
7
+ readonly title: "Grade trace";
8
+ readonly envKind: "grade";
9
+ readonly buildPrompt: typeof buildGradePrompt;
10
+ }, {
11
+ readonly id: "01-grade" | "02-seed" | "03-reproduce" | "04-fix-pr";
12
+ readonly title: "Create seed and scenario";
13
+ readonly envKind: "codex";
14
+ readonly buildPrompt: typeof buildSeedPrompt;
15
+ }, {
16
+ readonly id: "01-grade" | "02-seed" | "03-reproduce" | "04-fix-pr";
17
+ readonly title: "Reproduce generated scenario";
18
+ readonly envKind: "codex";
19
+ readonly buildPrompt: typeof buildReproducePrompt;
20
+ }, {
21
+ readonly id: "01-grade" | "02-seed" | "03-reproduce" | "04-fix-pr";
22
+ readonly title: "Fix and verify PR";
23
+ readonly envKind: "fix";
24
+ readonly buildPrompt: typeof buildFixPrPrompt;
25
+ }];
26
+ type AutoloopPhaseId = (typeof PHASES)[number]['id'];
27
+ declare function buildCodexPrompt(job: AutoloopWorkerJob): string;
28
+ declare function buildGradePrompt(job: AutoloopWorkerJob): string;
29
+ declare function buildSeedPrompt(job: AutoloopWorkerJob): string;
30
+ declare function buildReproducePrompt(job: AutoloopWorkerJob): string;
31
+ declare function buildFixPrPrompt(job: AutoloopWorkerJob): string;
32
+
33
+ declare function resolveNativeHarnessRuntimeEnv(repoDir: string, env?: NodeJS.ProcessEnv): Record<string, string>;
34
+ declare function buildSandboxPhaseEnvs(input: {
35
+ traceId: string;
36
+ contentHash?: string;
37
+ repoRemote: string;
38
+ gitRepository?: string;
39
+ codexAuth?: CodexAuth;
40
+ archalEnv: Record<string, string>;
41
+ harnessModelEnv?: Record<string, string>;
42
+ nativeHarnessRuntimeEnv?: Record<string, string>;
43
+ githubInstallationToken?: string;
44
+ githubSourceBranch?: string;
45
+ githubPublishBranch?: string;
46
+ githubBaseBranch?: string;
47
+ ragReplayPackagePath?: string;
48
+ ragAnswerBenchmarkPath?: string;
49
+ ragRetrieverReplayPath?: string;
50
+ controlPlaneCloneFree?: boolean;
51
+ controlPlaneHarnessCommand?: string;
52
+ controlPlaneHarnessArgs?: string[];
53
+ controlPlaneJudgePrompt?: string;
54
+ operatorEnv?: NodeJS.ProcessEnv;
55
+ }): Record<'setup' | (typeof PHASES)[number]['id'], Record<string, string>>;
56
+ declare function resolveArchalSandboxPackage(_cliVersion?: string, env?: NodeJS.ProcessEnv): string;
57
+ declare function resolveArchalSandboxPackageArchivePath(env?: NodeJS.ProcessEnv): string | undefined;
58
+ declare function resolveCodexReasoningEffort(env: NodeJS.ProcessEnv): string;
59
+
60
+ declare function buildSetupShellCommand(): string;
61
+ declare function buildFixPrPhaseShellCommand(phaseId: AutoloopPhaseId): string;
62
+ declare function buildGradePhaseShellCommand(_phaseId: AutoloopPhaseId): string;
63
+ declare function buildSeedTemplateReproducePhaseShellCommand(phaseId: AutoloopPhaseId): string;
64
+ declare function buildSeedPhaseShellCommand(phaseId: AutoloopPhaseId): string;
65
+
66
+ declare function redactAutoloopTraceContents(contents: string): string;
67
+ declare function sanitizeAutoloopTraceContentsForSandbox(contents: string): string;
68
+
69
+ type ReusableSeedBundle = {
70
+ restored: boolean;
71
+ files: Array<{
72
+ path: string;
73
+ data: string;
74
+ }>;
75
+ };
76
+ type PhaseResumeDecision = {
77
+ reused: boolean;
78
+ reason: string;
79
+ };
80
+ declare function computeAutoloopPhaseFingerprint(job: AutoloopWorkerJob, sandboxPackageArchivePath: string | undefined): string;
81
+ declare function computeAutoloopSeedBundleFingerprint(job: AutoloopWorkerJob, sandboxPackageArchivePath: string | undefined): string;
82
+ declare function restoreReusableSeedBundle(job: AutoloopWorkerJob, fingerprint: string): ReusableSeedBundle;
83
+ declare function collectPhaseResumeArtifacts(job: AutoloopWorkerJob, fingerprint: string): Array<{
84
+ path: string;
85
+ data: string;
86
+ }>;
87
+ declare function phaseResumeDecision(job: AutoloopWorkerJob, phaseId: string, fingerprint: string, seedRestored: boolean): PhaseResumeDecision;
88
+ declare function persistReusablePhaseArtifacts(job: AutoloopWorkerJob, fingerprint: string): void;
89
+ declare function createE2BAutoloopWorker(options?: E2BAutoloopWorkerOptions): AutoloopWorker;
90
+ declare function localRepoSnapshotPackage(job: AutoloopWorkerJob): string | undefined;
91
+ declare function resolveSandboxPhaseCommandTimeoutMs(phaseId: string, phaseEnv: Record<string, string | undefined>): number;
92
+
93
+ declare const __autoloopWorkerTestInternals: {
94
+ collectPhaseResumeArtifacts: typeof collectPhaseResumeArtifacts;
95
+ computeAutoloopPhaseFingerprint: typeof computeAutoloopPhaseFingerprint;
96
+ computeAutoloopSeedBundleFingerprint: typeof computeAutoloopSeedBundleFingerprint;
97
+ persistReusablePhaseArtifacts: typeof persistReusablePhaseArtifacts;
98
+ phaseResumeDecision: typeof phaseResumeDecision;
99
+ restoreReusableSeedBundle: typeof restoreReusableSeedBundle;
100
+ };
101
+
102
+ export { AutoloopWorker, AutoloopWorkerJob, CodexAuth, __autoloopWorkerTestInternals, buildCodexPrompt, buildFixPrPhaseShellCommand, buildGradePhaseShellCommand, buildSandboxPhaseEnvs, buildSeedPhaseShellCommand, buildSeedPrompt, buildSeedTemplateReproducePhaseShellCommand, buildSetupShellCommand, createE2BAutoloopWorker, localRepoSnapshotPackage, redactAutoloopTraceContents, resolveArchalSandboxPackage, resolveArchalSandboxPackageArchivePath, resolveCodexReasoningEffort, resolveNativeHarnessRuntimeEnv, resolveSandboxPhaseCommandTimeoutMs, sanitizeAutoloopTraceContentsForSandbox };
@@ -0,0 +1,216 @@
1
+ // Eval-file runner shim. `archal run path/to/file.eval.ts` spawns this file
2
+ // in a subprocess (under `npx tsx` for TypeScript eval files, plain node
3
+ // otherwise) so the eval file's `import 'archal'` resolves to the consumer's
4
+ // own installed copy, not the CLI's bundled sources. It stays plain ESM with
5
+ // node builtins only and is staged into dist/ untouched by tsup — bundling to
6
+ // CJS would rewrite the dynamic import below into `require()`, which cannot
7
+ // load ESM eval files.
8
+ //
9
+ // Protocol: one JSON event per line on stdout, prefixed with the sentinel.
10
+ // Everything else on stdout is the eval file's own output and is passed
11
+ // through by the parent. The event shapes mirror the EvalShimEvent union in
12
+ // run-eval-file.ts. Exit code is 0 whenever the protocol completed (a `done`
13
+ // event was emitted) — pass/fail policy belongs to the parent; only a load
14
+ // failure exits non-zero.
15
+ import { pathToFileURL } from 'node:url';
16
+
17
+ // The parent passes a per-run random prefix so a line the eval file happens to
18
+ // print cannot accidentally collide with the protocol. This is collision
19
+ // avoidance, NOT a trust boundary: the eval file is imported into this same
20
+ // process and could read this value or forge events — that is acceptable
21
+ // because it is the user's own code running with the user's own credentials.
22
+ // Fall back to the fixed literal (must match EVAL_SHIM_SENTINEL in
23
+ // run-eval-file.ts) when invoked without it.
24
+ const SENTINEL = process.env.ARCHAL_EVAL_SENTINEL || 'ARCHAL_EVAL_EVENT ';
25
+
26
+ function emit(event) {
27
+ process.stdout.write(SENTINEL + JSON.stringify(event) + '\n');
28
+ }
29
+
30
+ // Duck-typed on the SDK Scenario shape ({ definition, run() }) instead of a
31
+ // brand so eval files keep working across archal versions and across multiple
32
+ // archal copies in one node_modules tree. `criteria` is intentionally NOT
33
+ // required: the SDK marks it optional (a scenario with no criteria is scored
34
+ // on exec success alone), so requiring it here would silently hide valid
35
+ // scenarios.
36
+ function isScenarioExport(value) {
37
+ return (
38
+ typeof value === 'object' &&
39
+ value !== null &&
40
+ typeof value.run === 'function' &&
41
+ typeof value.definition === 'object' &&
42
+ value.definition !== null &&
43
+ typeof value.definition.task === 'string'
44
+ );
45
+ }
46
+
47
+ function errorMessage(err) {
48
+ return err instanceof Error ? err.message : String(err);
49
+ }
50
+
51
+ // Mirrors SYNTHETIC_TRACE_TOOL_NAMES in @archal/evaluator's trace-activity.ts
52
+ // (the shim stays dependency-free, so the three names are duplicated here).
53
+ // Synthetic proxy/canary entries are bookkeeping, not agent action, and must
54
+ // not make a do-nothing agent look like it exercised the scenario.
55
+ const SYNTHETIC_TRACE_TOOL_NAMES = new Set([
56
+ 'sandbox_proxy_intercept',
57
+ 'sandbox_proxy_passthrough',
58
+ 'sandbox_canary_scan',
59
+ ]);
60
+
61
+ function countAgentToolCalls(trace) {
62
+ return trace.filter(
63
+ (entry) =>
64
+ entry !== null &&
65
+ typeof entry === 'object' &&
66
+ typeof entry.toolName === 'string' &&
67
+ !SYNTHETIC_TRACE_TOOL_NAMES.has(entry.toolName),
68
+ ).length;
69
+ }
70
+
71
+ function scenarioRunOptions(options) {
72
+ const runOptions = {};
73
+ if (typeof options.runs === 'number') {
74
+ runOptions.runs = options.runs;
75
+ }
76
+ if (typeof options.timeout === 'number') {
77
+ runOptions.timeout = options.timeout;
78
+ }
79
+ // The SDK exposes one run-time model option (`model`), advertised to the
80
+ // agent as AGENT_MODEL. The CLI's --agent-model maps onto it. --model
81
+ // selects the evaluator/judge model, which the SDK configures separately
82
+ // (there is no evaluator run-option seam yet), so it is intentionally not
83
+ // forwarded here rather than passed under a key scenario.run() ignores.
84
+ if (typeof options.agentModel === 'string') {
85
+ runOptions.model = options.agentModel;
86
+ }
87
+ if (
88
+ typeof options.agent === 'object' &&
89
+ options.agent !== null &&
90
+ typeof options.agent.command === 'string'
91
+ ) {
92
+ runOptions.agent = {
93
+ command: options.agent.command,
94
+ ...(Array.isArray(options.agent.args) ? { args: options.agent.args } : {}),
95
+ ...(typeof options.agent.cwd === 'string' ? { cwd: options.agent.cwd } : {}),
96
+ ...(typeof options.agent.env === 'object' && options.agent.env !== null
97
+ ? { env: options.agent.env }
98
+ : {}),
99
+ };
100
+ }
101
+ return runOptions;
102
+ }
103
+
104
+ async function main() {
105
+ const [evalPath, optionsJson] = process.argv.slice(2);
106
+ if (!evalPath) {
107
+ emit({ type: 'load-error', message: 'eval-shim: missing eval file path argument.' });
108
+ process.exitCode = 1;
109
+ return;
110
+ }
111
+
112
+ let options = {};
113
+ if (optionsJson) {
114
+ try {
115
+ options = JSON.parse(optionsJson);
116
+ } catch (err) {
117
+ emit({ type: 'load-error', message: `eval-shim: invalid options JSON: ${errorMessage(err)}` });
118
+ process.exitCode = 1;
119
+ return;
120
+ }
121
+ }
122
+
123
+ let evalModule;
124
+ try {
125
+ evalModule = await import(pathToFileURL(evalPath).href);
126
+ } catch (err) {
127
+ emit({ type: 'load-error', message: errorMessage(err) });
128
+ process.exitCode = 1;
129
+ return;
130
+ }
131
+
132
+ // Inspect each export inside its own try/catch: a throwing getter or a proxy
133
+ // trap on one export must not abort discovery of the remaining (valid)
134
+ // scenarios and turn into an opaque "exited unexpectedly".
135
+ const scenarios = [];
136
+ for (const [exportName, value] of Object.entries(evalModule)) {
137
+ try {
138
+ if (!isScenarioExport(value)) {
139
+ continue;
140
+ }
141
+ const definitionName = value.definition.name;
142
+ scenarios.push({
143
+ exportName,
144
+ // The SDK documents this fallback: a scenario's name defaults to its
145
+ // export name when omitted. An empty/whitespace name falls back too.
146
+ name:
147
+ typeof definitionName === 'string' && definitionName.trim()
148
+ ? definitionName
149
+ : exportName,
150
+ scenario: value,
151
+ });
152
+ } catch {
153
+ continue;
154
+ }
155
+ }
156
+
157
+ emit({
158
+ type: 'discovered',
159
+ scenarios: scenarios.map(({ exportName, name }) => ({ exportName, name })),
160
+ });
161
+
162
+ for (const { exportName, name, scenario } of scenarios) {
163
+ emit({ type: 'scenario-start', exportName, name });
164
+ if (options.requireDirectAgent === true && !options.agent && !scenario.definition.agent) {
165
+ emit({
166
+ type: 'scenario-error',
167
+ exportName,
168
+ name,
169
+ message:
170
+ 'This eval scenario resolves to a harness default, but eval files require a direct agent command. ' +
171
+ 'Set an "agent" block in .archal.json or declare the agent in scenario({ agent }).',
172
+ });
173
+ continue;
174
+ }
175
+ try {
176
+ const result = await scenario.run(scenarioRunOptions(options));
177
+ emit({
178
+ type: 'scenario-result',
179
+ exportName,
180
+ name,
181
+ satisfaction: result.satisfaction,
182
+ // judgment is absent when the scenario declares no criteria (the SDK
183
+ // scores those on exec success alone); fall back to the attempt's own
184
+ // satisfaction/passed and an empty criteria list instead of throwing.
185
+ runs: result.runs.map((run) => ({
186
+ score: run.judgment?.score ?? run.satisfaction,
187
+ // run.passed is the SDK's verdict and already folds in the
188
+ // zero-tool-call gate; the judgment's own passed is only a fallback
189
+ // for hand-rolled run shapes that never set a per-run passed.
190
+ passed: run.passed ?? run.judgment?.passed,
191
+ criteria: run.judgment?.criteria ?? [],
192
+ // The parent's pass policy needs this to fail runs whose agent
193
+ // never touched a clone, mirroring the markdown runner's
194
+ // no-tool-calls outcome. The SDK computes it on each attempt
195
+ // (ScenarioAttemptResult.toolCallCount) and owns the zero-tool-call
196
+ // policy; the trace-derived count survives only as a fallback for
197
+ // older installed SDK copies that predate the field. Absent both,
198
+ // activity is unknown, not zero, and must not fire the structural
199
+ // failure with a misleading zero-tool-call message.
200
+ ...(typeof run.toolCallCount === 'number'
201
+ ? { toolCallCount: run.toolCallCount }
202
+ : Array.isArray(run.outcome?.trace)
203
+ ? { toolCallCount: countAgentToolCalls(run.outcome.trace) }
204
+ : {}),
205
+ ...(run.exec ? { exec: run.exec } : {}),
206
+ })),
207
+ });
208
+ } catch (err) {
209
+ emit({ type: 'scenario-error', exportName, name, message: errorMessage(err) });
210
+ }
211
+ }
212
+
213
+ emit({ type: 'done' });
214
+ }
215
+
216
+ await main();
package/dist/index.cjs CHANGED
@@ -1,7 +1,20 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.9.19";
4
- const archal = { version };
3
+ const sdk = require('./sdk/index.cjs');
4
+ const version = "0.10.0";
5
+ const archal = { ...sdk, version };
5
6
 
6
7
  archal.default = archal;
7
8
  module.exports = archal;
9
+
10
+ // Keep Node CommonJS named-export detection explicit for ESM importers.
11
+ module.exports.benchmark = sdk.benchmark;
12
+ module.exports.check = sdk.check;
13
+ module.exports.clones = sdk.clones;
14
+ module.exports.criterion = sdk.criterion;
15
+ module.exports.entity = sdk.entity;
16
+ module.exports.judge = sdk.judge;
17
+ module.exports.publish = sdk.publish;
18
+ module.exports.reportAgentMetrics = sdk.reportAgentMetrics;
19
+ module.exports.scenario = sdk.scenario;
20
+ module.exports.version = version;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './sdk/index.cjs';
1
2
  export declare const version: string;
2
- declare const archal: { readonly version: string };
3
+ import * as sdk from './sdk/index.cjs';
4
+ declare const archal: typeof sdk & { readonly version: string };
3
5
  export default archal;
@@ -0,0 +1,62 @@
1
+ declare const AUTOLOOP_PHASES: readonly ["queued", "grade", "seed", "reproduce", "fix_pr", "done"];
2
+ declare const AUTOLOOP_ACTIVE_PHASES: readonly ["grade", "seed", "reproduce", "fix_pr"];
3
+ declare const AUTOLOOP_PHASE_HEALTH_STATUSES: readonly ["running", "completed", "stream_reconnect_recovered", "stalled_no_artifact", "timeout", "failed"];
4
+ declare const AUTOLOOP_TRACE_SOURCE_STATUSES: readonly ["active", "paused", "error", "disabled"];
5
+ type AutoloopExecutionPolicy = 'observe' | 'grade' | 'seed' | 'reproduce' | 'fix';
6
+ type AutoloopRunResultSubmissionPhaseResult = {
7
+ phase: 'grade';
8
+ status: 'passed' | 'failed' | 'flaky' | 'inconclusive' | 'infrastructure';
9
+ summary: string;
10
+ confidence?: number | null;
11
+ failureClass?: string | null;
12
+ payload?: unknown;
13
+ } | {
14
+ phase: 'seed';
15
+ status: 'seeded' | 'blocked' | 'failed';
16
+ summary: string;
17
+ payload?: unknown;
18
+ } | {
19
+ phase: 'reproduce';
20
+ status: 'reproduced' | 'not_reproduced' | 'flaky' | 'blocked';
21
+ summary: string;
22
+ reason?: string | null;
23
+ diagnostic?: string | null;
24
+ hasCloneEvidence?: boolean;
25
+ hasCriteriaEvidence?: boolean;
26
+ payload?: unknown;
27
+ replayPlan?: unknown;
28
+ regressionPack?: unknown;
29
+ assertionResult?: unknown;
30
+ } | {
31
+ phase: 'fix_pr';
32
+ status: 'pr_open' | 'checks_passing' | 'blocked' | 'failed';
33
+ summary: string;
34
+ issueUrl?: string | null;
35
+ prUrl?: string | null;
36
+ branchName?: string | null;
37
+ baseBranch?: string | null;
38
+ latestCheckState?: 'unknown' | 'pending' | 'passing' | 'failing' | 'blocked' | 'no_checks' | null;
39
+ localValidationStatus?: string | null;
40
+ blockingReason?: string | null;
41
+ postFixReproduceStatus?: string | null;
42
+ postFixReproduceReason?: string | null;
43
+ postFixReproduceHasCloneEvidence?: boolean;
44
+ postFixReproduceHasCriteriaEvidence?: boolean;
45
+ postFixReproduceIdentityMatchesPreFix?: boolean;
46
+ postFixReproduceCommitSha?: string | null;
47
+ postFixReproduceFailureSummary?: string | null;
48
+ postFixReproduceCloneEvidenceExpected?: boolean;
49
+ reproductionReverified?: boolean;
50
+ payload?: unknown;
51
+ };
52
+ type AutoloopRunResultSubmissionBody = Record<string, unknown>;
53
+ type AutoloopBenchmarkExportConfig = {
54
+ enabled: boolean;
55
+ };
56
+
57
+ type AutoloopTraceSourceStatus = (typeof AUTOLOOP_TRACE_SOURCE_STATUSES)[number];
58
+ type AutoloopPhase = (typeof AUTOLOOP_PHASES)[number];
59
+ type AutoloopActivePhase = (typeof AUTOLOOP_ACTIVE_PHASES)[number];
60
+ type AutoloopPhaseHealthStatus = (typeof AUTOLOOP_PHASE_HEALTH_STATUSES)[number];
61
+
62
+ export type { AutoloopRunResultSubmissionPhaseResult as A, AutoloopPhaseHealthStatus as a, AutoloopPhase as b, AutoloopExecutionPolicy as c, AutoloopBenchmarkExportConfig as d, AutoloopActivePhase as e, AutoloopTraceSourceStatus as f, AutoloopRunResultSubmissionBody as g };