@pome-sh/cli 0.40.0 → 0.42.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/build-info.json +3 -3
- package/dist/{chunk-G7252TQ3.js → chunk-46POYRLY.js} +22 -40
- package/dist/{chunk-BS47AE55.js → chunk-STMGQ7GU.js} +1 -1
- package/dist/{chunk-AEFXTGW3.js → chunk-WERG4AUH.js} +1 -1
- package/dist/{runDemo-B2SXM4OC.js → runDemo-DRDMCG25.js} +2 -2
- package/dist/{runTrialGroup-I6FCP2L5.js → runTrialGroup-BP446HIE.js} +2 -2
- package/dist/src/cli/main.js +55 -41
- package/dist/{twinSeed-7M4GOIBS.js → twinSeed-X6VHBOLM.js} +11 -6
- package/dist/{twinStart-N6HTOARC.js → twinStart-QQU6OIO4.js} +1 -1
- package/package.json +1 -1
- package/tasks/14-stripe-refund-retry.expected-events.jsonl +0 -3
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.42.0",
|
|
4
|
+
"git_sha": "88bf8097cb93566a7b23eeddec28e4440325cf91",
|
|
5
|
+
"build_time": "2026-08-30T06:50:07.914Z"
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-
|
|
2
|
-
import { readSeedFileText, parseSeedFileText, soleTwinOf, seedsForTwins } from './chunk-VPXIGCZW.js';
|
|
1
|
+
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-STMGQ7GU.js';
|
|
2
|
+
import { readSeedFileText, parseSeedFileText, soleTwinOf, twinsNamedBy, seedsForTwins } from './chunk-VPXIGCZW.js';
|
|
3
3
|
import { readManifest, normalizeManifestTwins } from './chunk-DFOQGAKS.js';
|
|
4
4
|
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema, isMultiTwinSeedEnvelope } from './chunk-NNXVR46L.js';
|
|
5
5
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
@@ -73,9 +73,10 @@ async function writeVerdictArtifact(runDir, verdict) {
|
|
|
73
73
|
throw err;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function isVerdictArtifact(parsed) {
|
|
77
77
|
if (typeof parsed !== "object" || parsed === null) return false;
|
|
78
78
|
const v = parsed;
|
|
79
|
+
if (v.version !== VERDICT_ARTIFACT_VERSION) return false;
|
|
79
80
|
if (v.source !== "cloud-finalize") return false;
|
|
80
81
|
if (typeof v.session_id !== "string") return false;
|
|
81
82
|
if (typeof v.task_name !== "string") return false;
|
|
@@ -84,6 +85,11 @@ function looksLikeVerdictArtifactBase(parsed) {
|
|
|
84
85
|
if (typeof v.finalized_at !== "string") return false;
|
|
85
86
|
if (typeof v.passed !== "boolean") return false;
|
|
86
87
|
if (typeof v.score !== "number") return false;
|
|
88
|
+
if (typeof v.state !== "string" || !VALID_STATES.has(v.state)) return false;
|
|
89
|
+
if (typeof v.evaluated !== "number") return false;
|
|
90
|
+
if (typeof v.not_evaluated !== "number") return false;
|
|
91
|
+
if (typeof v.pre_satisfied !== "number") return false;
|
|
92
|
+
if (typeof v.total !== "number") return false;
|
|
87
93
|
if (!Array.isArray(v.criteria_results)) return false;
|
|
88
94
|
return v.criteria_results.every((r) => {
|
|
89
95
|
if (typeof r !== "object" || r === null) return false;
|
|
@@ -92,18 +98,6 @@ function looksLikeVerdictArtifactBase(parsed) {
|
|
|
92
98
|
return typeof criterion === "object" && criterion !== null && typeof criterion.text === "string" && typeof result.reason === "string" && typeof result.passed === "boolean" && typeof result.skipped === "boolean";
|
|
93
99
|
});
|
|
94
100
|
}
|
|
95
|
-
function isVerdictArtifact(parsed) {
|
|
96
|
-
if (!looksLikeVerdictArtifactBase(parsed)) return false;
|
|
97
|
-
const v = parsed;
|
|
98
|
-
if (v.version !== VERDICT_ARTIFACT_VERSION) return false;
|
|
99
|
-
if (typeof v.task_path !== "string") return false;
|
|
100
|
-
if (typeof v.state !== "string" || !VALID_STATES.has(v.state)) return false;
|
|
101
|
-
if (typeof v.evaluated !== "number") return false;
|
|
102
|
-
if (typeof v.not_evaluated !== "number") return false;
|
|
103
|
-
if (typeof v.pre_satisfied !== "number") return false;
|
|
104
|
-
if (typeof v.total !== "number") return false;
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
101
|
var MISSING_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
108
102
|
"ENOENT",
|
|
109
103
|
"ENOTDIR",
|
|
@@ -128,21 +122,17 @@ async function readVerdictArtifactDetailed(runDir) {
|
|
|
128
122
|
} catch {
|
|
129
123
|
return { status: "unreadable" };
|
|
130
124
|
}
|
|
131
|
-
if (!looksLikeVerdictArtifactBase(parsed)) return { status: "unreadable" };
|
|
132
|
-
const version = typeof parsed.version === "number" ? parsed.version : null;
|
|
133
|
-
if (version !== VERDICT_ARTIFACT_VERSION) return { status: "stale-version", version };
|
|
134
125
|
if (!isVerdictArtifact(parsed)) return { status: "unreadable" };
|
|
135
126
|
return { status: "ok", trial: { runDir, verdict: parsed } };
|
|
136
127
|
}
|
|
137
128
|
async function scanVerdictArtifactsDetailed(artifactsRoot) {
|
|
138
129
|
const trials = [];
|
|
139
|
-
const staleVersionDirs = [];
|
|
140
130
|
const unreadableDirs = [];
|
|
141
131
|
let slugs;
|
|
142
132
|
try {
|
|
143
133
|
slugs = await readdir(artifactsRoot);
|
|
144
134
|
} catch {
|
|
145
|
-
return { trials,
|
|
135
|
+
return { trials, unreadableDirs };
|
|
146
136
|
}
|
|
147
137
|
for (const slug of slugs) {
|
|
148
138
|
const slugDir = join(artifactsRoot, slug);
|
|
@@ -156,33 +146,20 @@ async function scanVerdictArtifactsDetailed(artifactsRoot) {
|
|
|
156
146
|
const runDir = join(slugDir, runId);
|
|
157
147
|
const result = await readVerdictArtifactDetailed(runDir);
|
|
158
148
|
if (result.status === "ok") trials.push(result.trial);
|
|
159
|
-
else if (result.status === "stale-version") staleVersionDirs.push(runDir);
|
|
160
149
|
else if (result.status === "unreadable") unreadableDirs.push(runDir);
|
|
161
150
|
}
|
|
162
151
|
}
|
|
163
152
|
unreadableDirs.sort();
|
|
164
|
-
return { trials,
|
|
153
|
+
return { trials, unreadableDirs };
|
|
165
154
|
}
|
|
166
155
|
async function discoverRunSet(target) {
|
|
167
156
|
const anchorResult = await readVerdictArtifactDetailed(target);
|
|
168
|
-
if (anchorResult.status === "stale-version") {
|
|
169
|
-
return {
|
|
170
|
-
kind: "trial-dir",
|
|
171
|
-
set: null,
|
|
172
|
-
incompleteSet: null,
|
|
173
|
-
totalSets: 0,
|
|
174
|
-
staleVersionCount: 1,
|
|
175
|
-
unreadableCount: 0,
|
|
176
|
-
unreadablePaths: []
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
157
|
if (anchorResult.status === "unreadable") {
|
|
180
158
|
return {
|
|
181
159
|
kind: "trial-dir",
|
|
182
160
|
set: null,
|
|
183
161
|
incompleteSet: null,
|
|
184
162
|
totalSets: 0,
|
|
185
|
-
staleVersionCount: 0,
|
|
186
163
|
unreadableCount: 1,
|
|
187
164
|
unreadablePaths: [target]
|
|
188
165
|
};
|
|
@@ -190,7 +167,7 @@ async function discoverRunSet(target) {
|
|
|
190
167
|
if (anchorResult.status === "ok") {
|
|
191
168
|
const anchor = anchorResult.trial;
|
|
192
169
|
const root = join(target, "..", "..");
|
|
193
|
-
const { trials: trials2,
|
|
170
|
+
const { trials: trials2, unreadableDirs: unreadableDirs2 } = await scanVerdictArtifactsDetailed(root);
|
|
194
171
|
const sets2 = groupRunSets(trials2);
|
|
195
172
|
const own = sets2.find(
|
|
196
173
|
(s) => anchor.verdict.group_id !== null && s.groupId === anchor.verdict.group_id || anchor.verdict.group_id === null && s.trials.length === 1 && s.trials[0].verdict.session_id === anchor.verdict.session_id
|
|
@@ -200,12 +177,11 @@ async function discoverRunSet(target) {
|
|
|
200
177
|
set: own,
|
|
201
178
|
incompleteSet: null,
|
|
202
179
|
totalSets: Math.max(sets2.length, 1),
|
|
203
|
-
staleVersionCount: staleVersionDirs2.length,
|
|
204
180
|
unreadableCount: unreadableDirs2.length,
|
|
205
181
|
unreadablePaths: unreadableDirs2
|
|
206
182
|
};
|
|
207
183
|
}
|
|
208
|
-
const { trials,
|
|
184
|
+
const { trials, unreadableDirs } = await scanVerdictArtifactsDetailed(target);
|
|
209
185
|
const sets = groupRunSets(trials);
|
|
210
186
|
const failedSet = latestFailedRunSet(sets);
|
|
211
187
|
return {
|
|
@@ -213,7 +189,6 @@ async function discoverRunSet(target) {
|
|
|
213
189
|
set: failedSet,
|
|
214
190
|
incompleteSet: failedSet ? null : latestIncompleteRunSet(sets),
|
|
215
191
|
totalSets: sets.length,
|
|
216
|
-
staleVersionCount: staleVersionDirs.length,
|
|
217
192
|
unreadableCount: unreadableDirs.length,
|
|
218
193
|
unreadablePaths: unreadableDirs
|
|
219
194
|
};
|
|
@@ -702,8 +677,15 @@ async function resolveSessionSeed(seedPath, requestedTwins) {
|
|
|
702
677
|
const raw = readSeedFileText(seedPath, "pome sandbox create --seed");
|
|
703
678
|
const origin = `--seed ${seedPath}`;
|
|
704
679
|
const file = parseSeedFileText(raw, origin);
|
|
680
|
+
const sole = soleTwinOf(file);
|
|
681
|
+
if (requestedTwins.length === 0 && sole === void 0) {
|
|
682
|
+
const named = twinsNamedBy(file);
|
|
683
|
+
throw new Error(
|
|
684
|
+
named.length === 0 ? `${origin} is a flat seed, so it does not name a twin. Pass the name: pome sandbox create --twin <${SESSION_TWIN_NAMES.join("|")}> --seed ${seedPath}` : `${origin} names ${named.length} twins (${named.join(", ")}), so it does not say which the sandbox is for. Pass the name: ${named.map((twin) => `--twin ${twin}`).join(" ")} --seed ${seedPath}`
|
|
685
|
+
);
|
|
686
|
+
}
|
|
705
687
|
const twins = normalizeSessionTwins(
|
|
706
|
-
requestedTwins.length > 0 ? requestedTwins : [
|
|
688
|
+
requestedTwins.length > 0 ? requestedTwins : [sole]
|
|
707
689
|
);
|
|
708
690
|
const byTwin = await seedsForTwins(file, twins, origin);
|
|
709
691
|
return {
|
|
@@ -1255,4 +1237,4 @@ async function abandonBestEffort(client, sessionId, errorCode) {
|
|
|
1255
1237
|
}
|
|
1256
1238
|
}
|
|
1257
1239
|
|
|
1258
|
-
export { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, DEFAULT_DOCS_SITE_ORIGIN, SESSION_TWIN_NAMES,
|
|
1240
|
+
export { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, DEFAULT_DOCS_SITE_ORIGIN, SESSION_TWIN_NAMES, clearLocalCredentials, discoverRunSet, ensurePomeGitignored, friendlyHostedError, persistCredentialsAfterLogin, postAgentResolver, readLinkCache, resolveCachedAgentId, resolveCredentials, resolveRunAgentIdentity, resolveSeams, runSessionCreate, runSessionList, runSessionStop, runTaskHosted, writeLinkCache };
|
|
@@ -1525,7 +1525,7 @@ function scoreFromFinalizeResponse(finalized) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
function redactJsonl(body) {
|
|
1527
1527
|
const lines = body.split("\n");
|
|
1528
|
-
const redacted = lines.
|
|
1528
|
+
const redacted = lines.map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
|
|
1529
1529
|
try {
|
|
1530
1530
|
return JSON.stringify(redactSecrets(JSON.parse(line)));
|
|
1531
1531
|
} catch {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-
|
|
1
|
+
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-STMGQ7GU.js';
|
|
2
2
|
import { createRecorder, bootTwin } from './chunk-5NPGY73F.js';
|
|
3
3
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
4
4
|
import { buildEgressAllowlist, readBlockedEgress } from './chunk-CBFKZZBR.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { newGroupId } from './chunk-JNXZBK3O.js';
|
|
2
2
|
import { DemoCapacityError, capacityLabel, parseCapacityMarker, capacityKindFrom } from './chunk-ZX4WNSZ5.js';
|
|
3
|
-
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-
|
|
4
|
-
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, isNarrated, outcomeOf, criterionPhrase, narratorReadingLines } from './chunk-
|
|
3
|
+
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-WERG4AUH.js';
|
|
4
|
+
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, isNarrated, outcomeOf, criterionPhrase, narratorReadingLines } from './chunk-STMGQ7GU.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
6
|
import './chunk-PASFBRK4.js';
|
|
7
7
|
import './chunk-3FZY376K.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { newGroupId } from './chunk-JNXZBK3O.js';
|
|
2
|
-
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-
|
|
3
|
-
import { createHostedClient, parseTaskFile, outcomeOf, isNarrated, criterionPhrase, narratorReadingLines } from './chunk-
|
|
2
|
+
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-46POYRLY.js';
|
|
3
|
+
import { createHostedClient, parseTaskFile, outcomeOf, isNarrated, criterionPhrase, narratorReadingLines } from './chunk-STMGQ7GU.js';
|
|
4
4
|
import './chunk-VPXIGCZW.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
6
|
import './chunk-PASFBRK4.js';
|
package/dist/src/cli/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, SESSION_TWIN_NAMES, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet,
|
|
3
|
-
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-
|
|
4
|
-
import { parseTaskFile, scoreStatus, runScoreLine, narratorReadingLines, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, criterionRowLine, readCodeCriteria, createHostedClient,
|
|
2
|
+
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, SESSION_TWIN_NAMES, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-46POYRLY.js';
|
|
3
|
+
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-WERG4AUH.js';
|
|
4
|
+
import { parseTaskFile, scoreStatus, runScoreLine, narratorReadingLines, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, criterionRowLine, readCodeCriteria, createHostedClient, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-STMGQ7GU.js';
|
|
5
5
|
import '../../chunk-VPXIGCZW.js';
|
|
6
6
|
import '../../chunk-NW7HGA2K.js';
|
|
7
7
|
import { GMAIL_CHECKS } from '../../chunk-JM6VS62R.js';
|
|
@@ -21,7 +21,7 @@ import { oneOf, defineCheck, repoRef, VACUITY_SENTINEL_NUMBER, childStatePath, V
|
|
|
21
21
|
import '../../chunk-YBWG5JK2.js';
|
|
22
22
|
import '../../chunk-HRAD7MRX.js';
|
|
23
23
|
import { eventSchema, isLegacyEventRow } from '../../chunk-6KJC4BTO.js';
|
|
24
|
-
import {
|
|
24
|
+
import { redactSecrets, redactEvent } from '../../chunk-SG6ZTIMT.js';
|
|
25
25
|
import '../../chunk-2K6BJ3PI.js';
|
|
26
26
|
import '../../chunk-FBSA5L36.js';
|
|
27
27
|
import { Command } from 'commander';
|
|
@@ -38,17 +38,37 @@ import Anthropic from '@anthropic-ai/sdk';
|
|
|
38
38
|
import { zodOutputFormat } from '@anthropic-ai/sdk/helpers/zod';
|
|
39
39
|
|
|
40
40
|
async function readEventsJsonl(runDir) {
|
|
41
|
+
const file = resolve(runDir, "events.jsonl");
|
|
41
42
|
let raw;
|
|
42
43
|
try {
|
|
43
|
-
raw = await readFile(
|
|
44
|
+
raw = await readFile(file, "utf8");
|
|
44
45
|
} catch (err) {
|
|
45
46
|
if (err.code === "ENOENT") {
|
|
46
47
|
return { kind: "missing" };
|
|
47
48
|
}
|
|
48
49
|
throw err;
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
-
const
|
|
51
|
+
const events = [];
|
|
52
|
+
const lines = raw.split("\n");
|
|
53
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
54
|
+
const line = lines[i].trim();
|
|
55
|
+
if (line.length === 0) continue;
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(line);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`pome inspect: ${file} line ${i + 1} is not valid JSON \u2014 ${err instanceof Error ? err.message : String(err)}. Re-run the task to record the trace again.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
const result = eventSchema.safeParse(parsed);
|
|
65
|
+
if (!result.success) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`pome inspect: ${file} line ${i + 1} is not a recorded event \u2014 ${result.error.issues[0]?.message ?? "unrecognized shape"}. Re-run the task to record the trace again.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
events.push(result.data);
|
|
71
|
+
}
|
|
52
72
|
return { kind: "events", events };
|
|
53
73
|
}
|
|
54
74
|
function computeTraceHealth(input) {
|
|
@@ -290,8 +310,8 @@ async function startCallbackServer(expectedState) {
|
|
|
290
310
|
let rejectCode = null;
|
|
291
311
|
let settled = false;
|
|
292
312
|
let deliveredCode = false;
|
|
293
|
-
const codePromise = new Promise((
|
|
294
|
-
resolveCode =
|
|
313
|
+
const codePromise = new Promise((resolve6, reject) => {
|
|
314
|
+
resolveCode = resolve6;
|
|
295
315
|
rejectCode = reject;
|
|
296
316
|
});
|
|
297
317
|
const fail = (err) => {
|
|
@@ -335,9 +355,9 @@ async function startCallbackServer(expectedState) {
|
|
|
335
355
|
succeed(code);
|
|
336
356
|
void closeServer(server);
|
|
337
357
|
});
|
|
338
|
-
await new Promise((
|
|
358
|
+
await new Promise((resolve6, reject) => {
|
|
339
359
|
server?.once("error", reject);
|
|
340
|
-
server?.listen(0, "127.0.0.1",
|
|
360
|
+
server?.listen(0, "127.0.0.1", resolve6);
|
|
341
361
|
});
|
|
342
362
|
const address = server.address();
|
|
343
363
|
if (!address || typeof address === "string") {
|
|
@@ -374,21 +394,21 @@ async function startCallbackServer(expectedState) {
|
|
|
374
394
|
};
|
|
375
395
|
}
|
|
376
396
|
function closeServer(server) {
|
|
377
|
-
return new Promise((
|
|
378
|
-
server?.close(() =>
|
|
397
|
+
return new Promise((resolve6) => {
|
|
398
|
+
server?.close(() => resolve6());
|
|
379
399
|
});
|
|
380
400
|
}
|
|
381
401
|
async function openBrowser(url) {
|
|
382
402
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "powershell.exe" : "xdg-open";
|
|
383
403
|
const args = process.platform === "win32" ? ["-NoProfile", "-Command", "Start-Process", url] : [url];
|
|
384
|
-
await new Promise((
|
|
404
|
+
await new Promise((resolve6) => {
|
|
385
405
|
execFile(command, args, (error) => {
|
|
386
406
|
if (error) {
|
|
387
407
|
console.error(
|
|
388
408
|
"Could not open a browser automatically \u2014 copy the URL above into a browser."
|
|
389
409
|
);
|
|
390
410
|
}
|
|
391
|
-
|
|
411
|
+
resolve6();
|
|
392
412
|
});
|
|
393
413
|
});
|
|
394
414
|
}
|
|
@@ -591,7 +611,7 @@ function topicMatchesFilter(t, filter) {
|
|
|
591
611
|
return t.id.includes(f) || t.title.toLowerCase().includes(f) || t.keywords.some((k) => k.toLowerCase().includes(f)) || t.path.toLowerCase().includes(f);
|
|
592
612
|
}
|
|
593
613
|
async function promptLine(rl, q) {
|
|
594
|
-
return await new Promise((
|
|
614
|
+
return await new Promise((resolve6) => rl.question(q, resolve6));
|
|
595
615
|
}
|
|
596
616
|
function printTopicUrl(topic, site) {
|
|
597
617
|
console.log(`${site}${topic.path}`);
|
|
@@ -3605,13 +3625,19 @@ function validateJsonl(name, raw) {
|
|
|
3605
3625
|
const line = lines[i].trim();
|
|
3606
3626
|
if (line.length === 0) continue;
|
|
3607
3627
|
nonEmpty += 1;
|
|
3628
|
+
let parsed;
|
|
3608
3629
|
try {
|
|
3609
|
-
JSON.parse(line);
|
|
3630
|
+
parsed = JSON.parse(line);
|
|
3610
3631
|
} catch {
|
|
3611
3632
|
throw new HostedUsageError(
|
|
3612
3633
|
`pome eval: ${name} is corrupt \u2014 line ${i + 1} is not valid JSON.`
|
|
3613
3634
|
);
|
|
3614
3635
|
}
|
|
3636
|
+
if (name === "events.jsonl" && isLegacyEventRow(parsed)) {
|
|
3637
|
+
throw new HostedUsageError(
|
|
3638
|
+
`pome eval: events.jsonl line ${i + 1} has no "kind" \u2014 it was recorded before the unified event shape, and the control plane refuses it. Re-run the task to record the trace again.`
|
|
3639
|
+
);
|
|
3640
|
+
}
|
|
3615
3641
|
}
|
|
3616
3642
|
if (name === "events.jsonl" && nonEmpty === 0) {
|
|
3617
3643
|
throw new HostedUsageError(
|
|
@@ -3744,11 +3770,7 @@ async function runEval(options) {
|
|
|
3744
3770
|
baseUrl: options.hosted.baseUrl,
|
|
3745
3771
|
apiKey: options.hosted.apiKey
|
|
3746
3772
|
});
|
|
3747
|
-
const eventsJsonl = artifacts.eventsJsonl
|
|
3748
|
-
const parsed = JSON.parse(line);
|
|
3749
|
-
const event2 = isLegacyEventRow(parsed) ? toTwinHttpEvent(parsed) : parsed;
|
|
3750
|
-
return JSON.stringify(redactEvent(event2));
|
|
3751
|
-
}).join("\n") + "\n";
|
|
3773
|
+
const eventsJsonl = redactJsonl(artifacts.eventsJsonl);
|
|
3752
3774
|
const blobs = {
|
|
3753
3775
|
eventsJsonl,
|
|
3754
3776
|
stateInitialJson: JSON.stringify(
|
|
@@ -4575,7 +4597,7 @@ function firstSentence(description) {
|
|
|
4575
4597
|
function resolveExampleRef(env = process.env) {
|
|
4576
4598
|
const override = env.POME_EXAMPLE_REF?.trim();
|
|
4577
4599
|
if (override) return override;
|
|
4578
|
-
const baked = "
|
|
4600
|
+
const baked = "88bf8097cb93566a7b23eeddec28e4440325cf91".trim() ;
|
|
4579
4601
|
return FULL_SHA.test(baked) ? baked : "main";
|
|
4580
4602
|
}
|
|
4581
4603
|
function rawUrlFor(example, file, ref) {
|
|
@@ -4929,7 +4951,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
4929
4951
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4930
4952
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
4931
4953
|
function readPackageVersion() {
|
|
4932
|
-
if ("0.
|
|
4954
|
+
if ("0.42.0".length > 0) return "0.42.0";
|
|
4933
4955
|
try {
|
|
4934
4956
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4935
4957
|
const candidates = [
|
|
@@ -5201,7 +5223,7 @@ function createProgram() {
|
|
|
5201
5223
|
(value, previous = []) => [...previous, value]
|
|
5202
5224
|
).option(
|
|
5203
5225
|
"--seed <path>",
|
|
5204
|
-
"Start the sandbox from a JSON or YAML seed file instead of each twin's default. A seed REPLACES the default; it does not merge. Same file `pome twin start --seed` takes; write one with `pome twin seed <name>`."
|
|
5226
|
+
"Start the sandbox from a JSON or YAML seed file instead of each twin's default. A seed REPLACES the default; it does not merge. Same file `pome twin start --seed` takes; write one with `pome twin new-seed <name>`."
|
|
5205
5227
|
).option(
|
|
5206
5228
|
"--secrets-file <path>",
|
|
5207
5229
|
"Write shell exports containing session secrets to a local file with mode 0600"
|
|
@@ -5405,7 +5427,7 @@ function createProgram() {
|
|
|
5405
5427
|
taskForRuns.config.runs
|
|
5406
5428
|
);
|
|
5407
5429
|
if (k > 1) {
|
|
5408
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
5430
|
+
const { runTrialGroup } = await import('../../runTrialGroup-BP446HIE.js');
|
|
5409
5431
|
const fileForRerun = relative(process.cwd(), file);
|
|
5410
5432
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
5411
5433
|
const groupResult = await runTrialGroup({
|
|
@@ -5498,7 +5520,7 @@ function createProgram() {
|
|
|
5498
5520
|
process.exitCode = 5;
|
|
5499
5521
|
return;
|
|
5500
5522
|
}
|
|
5501
|
-
const { runDemo } = await import('../../runDemo-
|
|
5523
|
+
const { runDemo } = await import('../../runDemo-DRDMCG25.js');
|
|
5502
5524
|
const result = await runDemo({
|
|
5503
5525
|
apiBase: globals(cmd).apiUrl.replace(/\/$/, ""),
|
|
5504
5526
|
dashboardBase: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
@@ -5590,14 +5612,9 @@ function createProgram() {
|
|
|
5590
5612
|
}
|
|
5591
5613
|
const root = target ?? "runs";
|
|
5592
5614
|
const discovery = await discoverRunSet(resolve(root));
|
|
5593
|
-
if (discovery.staleVersionCount > 0) {
|
|
5594
|
-
console.error(
|
|
5595
|
-
`${discovery.staleVersionCount} verdict.json file(s) under ${root} are not artifact version ${VERDICT_ARTIFACT_VERSION} (the only version this CLI reads) and were skipped \u2014 re-run \`pome run\` to record those trials again.`
|
|
5596
|
-
);
|
|
5597
|
-
}
|
|
5598
5615
|
if (discovery.unreadableCount > 0) {
|
|
5599
5616
|
console.error(
|
|
5600
|
-
`${discovery.unreadableCount} verdict.json file(s) under ${root} could not be read (truncated, hand-edited, or not a verdict artifact) and were skipped:`
|
|
5617
|
+
`${discovery.unreadableCount} verdict.json file(s) under ${root} could not be read (truncated, hand-edited, written by an older CLI, or not a verdict artifact) and were skipped \u2014 re-run \`pome run\` to record those trials again:`
|
|
5601
5618
|
);
|
|
5602
5619
|
for (const path of discovery.unreadablePaths.slice(0, MAX_UNREADABLE_PATHS_SHOWN)) {
|
|
5603
5620
|
console.error(` - ${path}`);
|
|
@@ -5608,7 +5625,7 @@ function createProgram() {
|
|
|
5608
5625
|
}
|
|
5609
5626
|
}
|
|
5610
5627
|
if (discovery.totalSets === 0) {
|
|
5611
|
-
if (discovery.
|
|
5628
|
+
if (discovery.unreadableCount === 0) {
|
|
5612
5629
|
console.error(
|
|
5613
5630
|
`No finalized run sets under ${root} \u2014 hosted \`pome run\` records a verdict.json per trial; run one first (or point fix-prompt at your artifacts dir).`
|
|
5614
5631
|
);
|
|
@@ -5689,16 +5706,13 @@ function createProgram() {
|
|
|
5689
5706
|
).description(
|
|
5690
5707
|
"Start a standalone twin as a long-lived foreground server (Ctrl-C to stop)"
|
|
5691
5708
|
).action(async (name, options) => {
|
|
5692
|
-
const { runTwinStartCommand } = await import('../../twinStart-
|
|
5709
|
+
const { runTwinStartCommand } = await import('../../twinStart-QQU6OIO4.js');
|
|
5693
5710
|
await runTwinStartCommand(name, options);
|
|
5694
5711
|
});
|
|
5695
|
-
twin.command("seed").argument("<name...>", `Twin name (${TWIN_NAME_LIST.join(" | ")}). Repeat for one file covering several.`).option("--out <path>", "Write to this file instead of stdout. Refuses to overwrite.").
|
|
5696
|
-
"
|
|
5697
|
-
"Emit the shape a `<task>.seed.json` sidecar takes \u2014 flat for one twin, the per-twin envelope for more, the rule the task's `## Config` twins already set. Without it you get a seed file for `--seed`, which is always the envelope."
|
|
5698
|
-
).description(
|
|
5699
|
-
"Print a starter seed file for a twin, generated from the twin's own starting state"
|
|
5712
|
+
twin.command("new-seed").argument("<name...>", `Twin name (${TWIN_NAME_LIST.join(" | ")}). Repeat for one file covering several.`).option("--out <path>", "Write to this file instead of stdout. Refuses to overwrite.").summary("Print a new starter seed file for a twin").description(
|
|
5713
|
+
"Print a new starter seed file for a twin, generated from the twin's own starting state. One twin is flat, several are the per-twin envelope. Boot it with `twin start <twin> --seed`, seed a sandbox with `sandbox create --twin <twin> --seed`, or drop it beside a task as <task>.seed.json"
|
|
5700
5714
|
).action(async (names, options) => {
|
|
5701
|
-
const { runTwinSeedCommand } = await import('../../twinSeed-
|
|
5715
|
+
const { runTwinSeedCommand } = await import('../../twinSeed-X6VHBOLM.js');
|
|
5702
5716
|
await runTwinSeedCommand(names, options);
|
|
5703
5717
|
});
|
|
5704
5718
|
twin.command("status").summary("Print the local twin's status").description(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-RPPF2KDQ.js';
|
|
2
2
|
import { writeFile } from 'node:fs/promises';
|
|
3
3
|
|
|
4
|
-
async function generateSeedFile(twins
|
|
4
|
+
async function generateSeedFile(twins) {
|
|
5
5
|
if (twins.length === 0) {
|
|
6
6
|
throw new Error(`No twin specified. Pass at least one of: ${TWIN_NAMES.join(", ")}.`);
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ async function generateSeedFile(twins, opts = {}) {
|
|
|
19
19
|
const entry = TWIN_REGISTRY[twin];
|
|
20
20
|
envelope[twin] = await entry.parseSeed(await entry.defaultSeed());
|
|
21
21
|
}
|
|
22
|
-
const body =
|
|
22
|
+
const body = twins.length === 1 ? envelope[twins[0]] : envelope;
|
|
23
23
|
return `${JSON.stringify(body, null, 2)}
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
@@ -36,16 +36,21 @@ async function writeSeedFile(path, text) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
async function runTwinSeedCommand(names, options = {}) {
|
|
39
|
-
const text = await generateSeedFile(names
|
|
39
|
+
const text = await generateSeedFile(names);
|
|
40
40
|
if (options.out === void 0) {
|
|
41
41
|
process.stdout.write(text);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
await writeSeedFile(options.out, text);
|
|
45
|
-
|
|
46
|
-
console.error(`Wrote ${options.out} \u2014 the ${names.join(" + ")} ${what}.`);
|
|
45
|
+
console.error(`Wrote ${options.out} \u2014 the ${names.join(" + ")} starting seed.`);
|
|
47
46
|
console.error(
|
|
48
|
-
|
|
47
|
+
`Boot ${names.length === 1 ? "it" : "one"} locally: pome twin start ${names[0]} --seed ${options.out}`
|
|
48
|
+
);
|
|
49
|
+
console.error(
|
|
50
|
+
`Hosted: pome sandbox create ${names.map((twin) => `--twin ${twin}`).join(" ")} --seed ${options.out}`
|
|
51
|
+
);
|
|
52
|
+
console.error(
|
|
53
|
+
names.length === 1 ? `As a task seed: drop it beside a ${names[0]} task as <task>.seed.json.` : `As a task seed: drop it beside a task whose \`## Config\` reads twins: [${names.join(", ")}], named <task>.seed.json.`
|
|
49
54
|
);
|
|
50
55
|
}
|
|
51
56
|
|
|
@@ -152,7 +152,7 @@ async function runTwinStartCommand(nameArg, options) {
|
|
|
152
152
|
);
|
|
153
153
|
} else {
|
|
154
154
|
console.log(
|
|
155
|
-
`Seed: the ${name} twin's default (pass --seed <path>, or write one with \`pome twin seed ${name}\`).`
|
|
155
|
+
`Seed: the ${name} twin's default (pass --seed <path>, or write one with \`pome twin new-seed ${name}\`).`
|
|
156
156
|
);
|
|
157
157
|
}
|
|
158
158
|
if (resolved.source === "persisted") {
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
{"ts":"2026-05-11T22:21:54.256Z","run_id":"m0-1-refund-retry","twin":"stripe","request_id":"req_f2e53238-8783-4cfd-b5de-efd60f442be8","correlation_id":"req_f2e53238-8783-4cfd-b5de-efd60f442be8","scenario_step_id":null,"step_id":null,"tool_call_id":null,"method":"POST","path":"/s/default/v1/refunds","request_body":"{\"charge\":\"ch_q9dVWLmN4flQFRzqYRe7iAu1\",\"amount\":7500}","status":402,"response_body":{"error":{"type":"card_error","code":"card_declined","message":"Simulated lost-response failure: refund persisted server-side, but response delivery to the client failed."}},"latency_ms":0,"fidelity":"semantic","state_mutation":true,"state_delta":{"before":null,"after":{"id":"re_LOW1fo91HP1TYIe31f04Kpcn","account_id":"acct_default","charge_id":"ch_q9dVWLmN4flQFRzqYRe7iAu1","payment_intent_id":"pi_pKYzqMO9yYaY2jesB8VcRRxc","amount":7500,"currency":"usd","status":"succeeded","reason":null,"idempotency_key":null,"created":1778538114}},"error":"Simulated lost-response failure: refund persisted server-side, but response delivery to the client failed."}
|
|
2
|
-
{"ts":"2026-05-11T22:21:54.257Z","run_id":"m0-1-refund-retry","twin":"stripe","request_id":"req_c0774431-a954-458c-9b38-8f416cfde198","correlation_id":"req_c0774431-a954-458c-9b38-8f416cfde198","scenario_step_id":null,"step_id":null,"tool_call_id":null,"method":"POST","path":"/s/default/v1/refunds","request_body":"{\"charge\":\"ch_q9dVWLmN4flQFRzqYRe7iAu1\",\"amount\":7500}","status":200,"response_body":{"id":"re_L5jCYOtsrPiLpbCCiQZtnOmv","object":"refund","amount":7500,"balance_transaction":null,"charge":"ch_q9dVWLmN4flQFRzqYRe7iAu1","created":1778538114,"currency":"usd","metadata":{},"payment_intent":"pi_pKYzqMO9yYaY2jesB8VcRRxc","reason":null,"receipt_number":null,"source_transfer_reversal":null,"status":"succeeded","transfer_reversal":null},"latency_ms":1,"fidelity":"semantic","state_mutation":true,"state_delta":{"before":null,"after":{"id":"re_L5jCYOtsrPiLpbCCiQZtnOmv","account_id":"acct_default","charge_id":"ch_q9dVWLmN4flQFRzqYRe7iAu1","payment_intent_id":"pi_pKYzqMO9yYaY2jesB8VcRRxc","amount":7500,"currency":"usd","status":"succeeded","reason":null,"idempotency_key":null,"created":1778538114}},"error":null}
|
|
3
|
-
{"ts":"2026-05-11T22:21:54.257Z","run_id":"m0-1-refund-retry","twin":"stripe","request_id":"req_37c6074d-7b44-4c06-8b69-86567aa2ae8a","correlation_id":"req_37c6074d-7b44-4c06-8b69-86567aa2ae8a","scenario_step_id":null,"step_id":null,"tool_call_id":null,"method":"GET","path":"/s/default/v1/charges/ch_q9dVWLmN4flQFRzqYRe7iAu1","request_body":null,"status":200,"response_body":{"id":"ch_q9dVWLmN4flQFRzqYRe7iAu1","object":"charge","amount":20000,"amount_captured":20000,"amount_refunded":15000,"application":null,"application_fee":null,"application_fee_amount":null,"balance_transaction":"txn_nuda9v4Uks4931U8xOShQZsV","billing_details":{"address":{"city":null,"country":null,"line1":null,"line2":null,"postal_code":null,"state":null},"email":null,"name":null,"phone":null},"calculated_statement_descriptor":null,"captured":true,"created":1778538114,"currency":"usd","customer":null,"description":null,"disputed":false,"failure_balance_transaction":null,"failure_code":null,"failure_message":null,"fraud_details":{},"invoice":null,"livemode":false,"metadata":{},"on_behalf_of":null,"outcome":{"network_status":"approved_by_network","reason":null,"risk_level":"normal","seller_message":"Payment complete.","type":"authorized"},"paid":true,"payment_intent":"pi_pKYzqMO9yYaY2jesB8VcRRxc","payment_method":null,"payment_method_details":{"type":"crypto","crypto":{"buyer_address":null,"network":"base","token_currency":"usdc","transaction_hash":null}},"receipt_email":null,"receipt_number":null,"receipt_url":null,"refunded":false,"review":null,"shipping":null,"source_transfer":null,"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"succeeded","transfer_data":null,"transfer_group":null},"latency_ms":0,"fidelity":"semantic","state_mutation":false,"state_delta":null,"error":null}
|