agent-conveyor 0.1.18 → 0.1.19
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.
|
@@ -25,6 +25,15 @@ interface SpawnedCodexSessionDiscoveryOptions {
|
|
|
25
25
|
}
|
|
26
26
|
type TypescriptRuntimeOptions = {
|
|
27
27
|
args: readonly string[];
|
|
28
|
+
campaignReadbackBeforeVerify?: (context: {
|
|
29
|
+
databasePath: string;
|
|
30
|
+
readback: {
|
|
31
|
+
assignment?: string;
|
|
32
|
+
campaign: string;
|
|
33
|
+
channel?: string;
|
|
34
|
+
slot?: string;
|
|
35
|
+
};
|
|
36
|
+
}) => void;
|
|
28
37
|
codexCommandResolver?: (name: string) => string | null;
|
|
29
38
|
cwd?: string;
|
|
30
39
|
discoverSpawnedCodexSession?: (options: SpawnedCodexSessionDiscoveryOptions) => SpawnedCodexSessionDiscovery;
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import { taskAuditSync } from "../runtime/audit.js";
|
|
8
8
|
import { appAutopilotPlanSync, appLoopStatusSync, appWakeupDispatchPlanSync, appWakeupPlanSync, directInboxPollCommand, visibleSessionProtocolLines, } from "../runtime/app-autonomy.js";
|
|
9
9
|
import { classifyBusyWait, classifyStartupOutput } from "../runtime/classify.js";
|
|
10
|
-
import { addCampaignWorkerSlotSync, campaignDashboardSync, campaignStatusSync, createCampaignAssignmentSync, createCampaignSync, recordCampaignAssetReceiptSync, updateCampaignWorkerSlotLifecycleSync, upsertCampaignChannelBriefSync, } from "../runtime/campaigns.js";
|
|
10
|
+
import { addCampaignWorkerSlotSync, campaignDashboardSync, campaignSetupReadbackProofSync, campaignStatusSync, createCampaignAssignmentSync, createCampaignSync, recordCampaignAssetReceiptSync, updateCampaignWorkerSlotLifecycleSync, upsertCampaignChannelBriefSync, } from "../runtime/campaigns.js";
|
|
11
11
|
import { exportTaskSync } from "../runtime/export.js";
|
|
12
12
|
import { ingestSessionSync } from "../runtime/ingest.js";
|
|
13
13
|
import { acceptanceCriteriaForTaskSync, loopEvidenceCriterion, recordAdversarialLoopEvidenceSync, recordLoopEvidenceSync, recordVisualDiffLoopEvidenceSync, } from "../runtime/loop-evidence.js";
|
|
@@ -6096,12 +6096,16 @@ function runCampaignCommand(parsed, options) {
|
|
|
6096
6096
|
name: campaign,
|
|
6097
6097
|
objective,
|
|
6098
6098
|
});
|
|
6099
|
+
const readback = campaignSetupReadbackProofFromConfiguredDatabase(parsed, options, {
|
|
6100
|
+
campaign: campaignId,
|
|
6101
|
+
});
|
|
6099
6102
|
return campaignResult(parsed, {
|
|
6100
6103
|
action,
|
|
6101
6104
|
campaign,
|
|
6102
6105
|
campaign_id: campaignId,
|
|
6103
6106
|
created: true,
|
|
6104
|
-
|
|
6107
|
+
ledger_readback: readback,
|
|
6108
|
+
}, [`campaign ${campaign} created ${campaignId}`, campaignLedgerReadbackText(readback)]);
|
|
6105
6109
|
}
|
|
6106
6110
|
if (action === "add-slot") {
|
|
6107
6111
|
const slotKey = requiredStringFlag(parsed.flags.slotKey, "--slot-key");
|
|
@@ -6119,13 +6123,18 @@ function runCampaignCommand(parsed, options) {
|
|
|
6119
6123
|
slotKey,
|
|
6120
6124
|
...(state ? { state } : {}),
|
|
6121
6125
|
});
|
|
6126
|
+
const readback = campaignSetupReadbackProofFromConfiguredDatabase(parsed, options, {
|
|
6127
|
+
campaign,
|
|
6128
|
+
slot: slotId,
|
|
6129
|
+
});
|
|
6122
6130
|
return campaignResult(parsed, {
|
|
6123
6131
|
action,
|
|
6124
6132
|
campaign,
|
|
6125
6133
|
created: true,
|
|
6134
|
+
ledger_readback: readback,
|
|
6126
6135
|
slot_id: slotId,
|
|
6127
6136
|
slot_key: slotKey,
|
|
6128
|
-
}, [`campaign ${campaign} slot ${slotKey} created ${slotId}
|
|
6137
|
+
}, [`campaign ${campaign} slot ${slotKey} created ${slotId}`, campaignLedgerReadbackText(readback)]);
|
|
6129
6138
|
}
|
|
6130
6139
|
if (action === "attach-slot") {
|
|
6131
6140
|
const slot = requiredStringFlag(parsed.flags.slot, "--slot");
|
|
@@ -6194,13 +6203,18 @@ function runCampaignCommand(parsed, options) {
|
|
|
6194
6203
|
campaign,
|
|
6195
6204
|
channel,
|
|
6196
6205
|
});
|
|
6206
|
+
const readback = campaignSetupReadbackProofFromConfiguredDatabase(parsed, options, {
|
|
6207
|
+
campaign,
|
|
6208
|
+
channel,
|
|
6209
|
+
});
|
|
6197
6210
|
return campaignResult(parsed, {
|
|
6198
6211
|
action,
|
|
6199
6212
|
brief_id: briefId,
|
|
6200
6213
|
campaign,
|
|
6201
6214
|
channel,
|
|
6215
|
+
ledger_readback: readback,
|
|
6202
6216
|
upserted: true,
|
|
6203
|
-
}, [`campaign ${campaign} brief ${channel} upserted ${briefId}
|
|
6217
|
+
}, [`campaign ${campaign} brief ${channel} upserted ${briefId}`, campaignLedgerReadbackText(readback)]);
|
|
6204
6218
|
}
|
|
6205
6219
|
if (action === "assign") {
|
|
6206
6220
|
const slot = requiredStringFlag(parsed.flags.slot, "--slot");
|
|
@@ -6216,13 +6230,19 @@ function runCampaignCommand(parsed, options) {
|
|
|
6216
6230
|
title,
|
|
6217
6231
|
...(status ? { status } : {}),
|
|
6218
6232
|
});
|
|
6233
|
+
const readback = campaignSetupReadbackProofFromConfiguredDatabase(parsed, options, {
|
|
6234
|
+
assignment: assignmentId,
|
|
6235
|
+
campaign,
|
|
6236
|
+
slot,
|
|
6237
|
+
});
|
|
6219
6238
|
return campaignResult(parsed, {
|
|
6220
6239
|
action,
|
|
6221
6240
|
assignment_id: assignmentId,
|
|
6222
6241
|
campaign,
|
|
6223
6242
|
created: true,
|
|
6243
|
+
ledger_readback: readback,
|
|
6224
6244
|
slot_id: slot,
|
|
6225
|
-
}, [`campaign ${campaign} assignment created ${assignmentId}
|
|
6245
|
+
}, [`campaign ${campaign} assignment created ${assignmentId}`, campaignLedgerReadbackText(readback)]);
|
|
6226
6246
|
}
|
|
6227
6247
|
if (action === "asset") {
|
|
6228
6248
|
const slot = requiredStringFlag(parsed.flags.slot, "--slot");
|
|
@@ -6276,6 +6296,25 @@ function runCampaignCommand(parsed, options) {
|
|
|
6276
6296
|
function campaignActionsUsage() {
|
|
6277
6297
|
return CAMPAIGN_ACTION_NAMES.join("|");
|
|
6278
6298
|
}
|
|
6299
|
+
function campaignSetupReadbackProofFromConfiguredDatabase(parsed, options, readbackOptions) {
|
|
6300
|
+
const databasePath = runtimeDbPath(parsed, options);
|
|
6301
|
+
options.campaignReadbackBeforeVerify?.({ databasePath, readback: readbackOptions });
|
|
6302
|
+
const database = openDatabaseSync(databasePath);
|
|
6303
|
+
initializeDatabaseSync(database);
|
|
6304
|
+
try {
|
|
6305
|
+
return campaignSetupReadbackProofSync(database, readbackOptions);
|
|
6306
|
+
}
|
|
6307
|
+
catch (error) {
|
|
6308
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
6309
|
+
throw new Error(`campaign ledger readback failed after setup write: ${message}`, { cause: error });
|
|
6310
|
+
}
|
|
6311
|
+
finally {
|
|
6312
|
+
database.close();
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
function campaignLedgerReadbackText(proof) {
|
|
6316
|
+
return `ledger_readback ok campaign=${proof.campaign_id} checks=${proof.checks.map((check) => check.entity).join(",")}`;
|
|
6317
|
+
}
|
|
6279
6318
|
function unsupportedCampaignActionMessage(action) {
|
|
6280
6319
|
return `Unsupported campaign action: ${action ?? "<missing>"}; expected one of: ${CAMPAIGN_ACTION_NAMES.join(", ")}. Use \`conveyor campaign dashboard --name <campaign> --json\` to list assets and receipt counts.`;
|
|
6281
6320
|
}
|