agent-conveyor 0.1.17 → 0.1.18
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/README.md
CHANGED
|
@@ -327,6 +327,11 @@ tmux attach -t codex-live-test
|
|
|
327
327
|
blockers, approval counts, and the next recommended manager action. This is
|
|
328
328
|
also the supported way to inspect asset receipts and per-slot receipt counts;
|
|
329
329
|
there is no separate `campaign assets` subcommand.
|
|
330
|
+
- `campaign closeout --name C [--failure-mode TEXT] [--json]` —
|
|
331
|
+
Produce a read-only closeout report from the campaign dashboard, including
|
|
332
|
+
verdict, worker thread ids, blockers, receipt counts by assignment, proof
|
|
333
|
+
checks, and the strongest realistic failure mode evidence to carry into a
|
|
334
|
+
manager/operator handoff.
|
|
330
335
|
|
|
331
336
|
Creative Ops Campaign manager loop:
|
|
332
337
|
|
|
@@ -402,6 +402,7 @@ function commandHelpText(program, command) {
|
|
|
402
402
|
` ${program} campaign asset --name launch --slot campaign-slot-id --assignment campaign-assignment-id --asset-type copy --title "Hooks v2" --allow-additional-receipt --json`,
|
|
403
403
|
` ${program} campaign status --name launch --json`,
|
|
404
404
|
` ${program} campaign dashboard --name launch --json`,
|
|
405
|
+
` ${program} campaign closeout --name launch --failure-mode "hidden duplicate receipt" --json`,
|
|
405
406
|
],
|
|
406
407
|
"manager-ack": [
|
|
407
408
|
`usage: ${program} manager-ack <task> --from-stdin ${path}`,
|
|
@@ -476,7 +477,7 @@ function commandHelpText(program, command) {
|
|
|
476
477
|
};
|
|
477
478
|
return linesByCommand[command] ?? [`usage: ${program} ${command} [-h] [options]`];
|
|
478
479
|
}
|
|
479
|
-
const CAMPAIGN_ACTION_NAMES = ["create", "add-slot", "attach-slot", "rotate-slot", "archive-slot", "brief", "assign", "asset", "status", "dashboard"];
|
|
480
|
+
const CAMPAIGN_ACTION_NAMES = ["create", "add-slot", "attach-slot", "rotate-slot", "archive-slot", "brief", "assign", "asset", "status", "dashboard", "closeout"];
|
|
480
481
|
const CAMPAIGN_ACTIONS = new Set(CAMPAIGN_ACTION_NAMES);
|
|
481
482
|
const CAMPAIGN_STRING_FLAGS = {
|
|
482
483
|
"--artifact-path": "artifactPath",
|
|
@@ -485,6 +486,7 @@ const CAMPAIGN_STRING_FLAGS = {
|
|
|
485
486
|
"--brief-json": "briefJson",
|
|
486
487
|
"--channel": "channel",
|
|
487
488
|
"--expected-thread-id": "expectedThreadId",
|
|
489
|
+
"--failure-mode": "failureMode",
|
|
488
490
|
"--instructions": "instructions",
|
|
489
491
|
"--objective": "objective",
|
|
490
492
|
"--prompt-summary": "promptSummary",
|
|
@@ -6258,6 +6260,13 @@ function runCampaignCommand(parsed, options) {
|
|
|
6258
6260
|
const dashboard = campaignDashboardSync(database, campaign);
|
|
6259
6261
|
return campaignResult(parsed, dashboard, renderCampaignDashboardText(dashboard));
|
|
6260
6262
|
}
|
|
6263
|
+
if (action === "closeout") {
|
|
6264
|
+
const dashboard = campaignDashboardSync(database, campaign);
|
|
6265
|
+
const closeout = campaignCloseoutReport(dashboard, {
|
|
6266
|
+
failureMode: parsed.flags.failureMode,
|
|
6267
|
+
});
|
|
6268
|
+
return campaignResult(parsed, closeout, renderCampaignCloseoutText(closeout));
|
|
6269
|
+
}
|
|
6261
6270
|
return errorResult(unsupportedCampaignActionMessage(action));
|
|
6262
6271
|
}
|
|
6263
6272
|
finally {
|
|
@@ -6342,6 +6351,107 @@ function renderCampaignDashboardText(dashboard) {
|
|
|
6342
6351
|
}
|
|
6343
6352
|
return lines;
|
|
6344
6353
|
}
|
|
6354
|
+
function campaignCloseoutReport(dashboard, options = {}) {
|
|
6355
|
+
const receiptCountsByAssignment = campaignReceiptCountsByAssignment(dashboard);
|
|
6356
|
+
const activeSlots = dashboard.slots.filter((slot) => slot.state !== "archived");
|
|
6357
|
+
const slotsMissingReceipts = activeSlots.filter((slot) => slot.assignments.length > 0 && slot.asset_receipts === 0);
|
|
6358
|
+
const duplicateAssignmentCounts = receiptCountsByAssignment.filter((item) => item.receipt_count > 1);
|
|
6359
|
+
const failureMode = options.failureMode
|
|
6360
|
+
?? "A hidden duplicate or missing worker receipt could make the campaign look closed while dashboard receipt counts are wrong.";
|
|
6361
|
+
const receiptEvidence = dashboard.slots
|
|
6362
|
+
.map((slot) => `${slot.slot_key}:assignments=${slot.assignments.length},receipts=${slot.asset_receipts}`)
|
|
6363
|
+
.join("; ");
|
|
6364
|
+
return {
|
|
6365
|
+
action: "closeout",
|
|
6366
|
+
approvals: dashboard.approvals,
|
|
6367
|
+
blockers: dashboard.blockers,
|
|
6368
|
+
campaign: dashboard.campaign,
|
|
6369
|
+
failure_mode: {
|
|
6370
|
+
evidence: `dashboard asset_total=${dashboard.summary.asset_total}; assignment_total=${dashboard.summary.assignment_total}; ${receiptEvidence}`,
|
|
6371
|
+
strongest_realistic_failure_mode: failureMode,
|
|
6372
|
+
},
|
|
6373
|
+
next_manager_action: dashboard.next_manager_action,
|
|
6374
|
+
proof_checks: [
|
|
6375
|
+
{
|
|
6376
|
+
check: "dashboard_loaded",
|
|
6377
|
+
evidence: `campaign_id=${dashboard.campaign.id}; updated_at=${dashboard.campaign.updated_at}`,
|
|
6378
|
+
status: "passed",
|
|
6379
|
+
},
|
|
6380
|
+
{
|
|
6381
|
+
check: "blockers_absent",
|
|
6382
|
+
evidence: `blockers=${dashboard.blockers.length}`,
|
|
6383
|
+
status: dashboard.blockers.length === 0 ? "passed" : "failed",
|
|
6384
|
+
},
|
|
6385
|
+
{
|
|
6386
|
+
check: "active_worker_slots_have_receipts",
|
|
6387
|
+
evidence: slotsMissingReceipts.length === 0
|
|
6388
|
+
? "all active slots with assignments have at least one receipt"
|
|
6389
|
+
: `missing_receipt_slots=${slotsMissingReceipts.map((slot) => slot.slot_key).join(",")}`,
|
|
6390
|
+
status: slotsMissingReceipts.length === 0 ? "passed" : "attention",
|
|
6391
|
+
},
|
|
6392
|
+
{
|
|
6393
|
+
check: "assignment_receipt_counts",
|
|
6394
|
+
evidence: duplicateAssignmentCounts.length === 0
|
|
6395
|
+
? "no assignment has more than one receipt"
|
|
6396
|
+
: `additional_receipt_assignments=${duplicateAssignmentCounts.map((item) => `${item.assignment_id}:${item.receipt_count}`).join(",")}`,
|
|
6397
|
+
status: duplicateAssignmentCounts.length === 0 ? "passed" : "attention",
|
|
6398
|
+
},
|
|
6399
|
+
{
|
|
6400
|
+
check: "human_review_gate",
|
|
6401
|
+
evidence: `needs_review=${dashboard.approvals.needs_review}; approved=${dashboard.approvals.approved}; published=${dashboard.approvals.published}`,
|
|
6402
|
+
status: dashboard.approvals.needs_review > 0 && dashboard.approvals.published === 0 ? "passed" : "attention",
|
|
6403
|
+
},
|
|
6404
|
+
],
|
|
6405
|
+
receipt_counts_by_assignment: receiptCountsByAssignment,
|
|
6406
|
+
summary: dashboard.summary,
|
|
6407
|
+
verdict: campaignCloseoutVerdict(dashboard),
|
|
6408
|
+
workers: dashboard.slots.map((slot) => ({
|
|
6409
|
+
active_assignments: slot.active_assignments,
|
|
6410
|
+
asset_receipts: slot.asset_receipts,
|
|
6411
|
+
blockers: slot.blockers,
|
|
6412
|
+
channel: slot.channel,
|
|
6413
|
+
codex_app_thread_id: slot.codex_app_thread_id,
|
|
6414
|
+
codex_app_thread_title: slot.codex_app_thread_title,
|
|
6415
|
+
lifecycle_state: slot.lifecycle.state,
|
|
6416
|
+
receipt_ids: slot.assets.map((asset) => asset.id),
|
|
6417
|
+
slot_key: slot.slot_key,
|
|
6418
|
+
state: slot.state,
|
|
6419
|
+
})),
|
|
6420
|
+
};
|
|
6421
|
+
}
|
|
6422
|
+
function campaignReceiptCountsByAssignment(dashboard) {
|
|
6423
|
+
return dashboard.slots.flatMap((slot) => slot.assignments.map((assignment) => ({
|
|
6424
|
+
assignment_id: assignment.id,
|
|
6425
|
+
receipt_count: slot.assets.filter((asset) => asset.assignment_id === assignment.id).length,
|
|
6426
|
+
slot_key: slot.slot_key,
|
|
6427
|
+
})));
|
|
6428
|
+
}
|
|
6429
|
+
function campaignCloseoutVerdict(dashboard) {
|
|
6430
|
+
if (dashboard.blockers.length > 0 || dashboard.summary.blocked_assignments > 0 || dashboard.summary.blocked_slots > 0 || dashboard.summary.stale_slots > 0) {
|
|
6431
|
+
return "blocked";
|
|
6432
|
+
}
|
|
6433
|
+
if (dashboard.next_manager_action.action === "close_campaign") {
|
|
6434
|
+
return "ready_to_close";
|
|
6435
|
+
}
|
|
6436
|
+
if (dashboard.approvals.needs_review > 0 || dashboard.approvals.rejected > 0) {
|
|
6437
|
+
return "needs_review";
|
|
6438
|
+
}
|
|
6439
|
+
return "needs_work";
|
|
6440
|
+
}
|
|
6441
|
+
function renderCampaignCloseoutText(report) {
|
|
6442
|
+
return [
|
|
6443
|
+
`campaign ${report.campaign.name} ${report.campaign.status}`,
|
|
6444
|
+
`closeout verdict ${report.verdict}`,
|
|
6445
|
+
`next ${report.next_manager_action.action}: ${report.next_manager_action.reason}`,
|
|
6446
|
+
`summary slots=${report.summary.active_slots}/${report.summary.archived_slots} assignments=${report.summary.assignment_total} assets=${report.summary.asset_total} blockers=${report.blockers.length}`,
|
|
6447
|
+
`approvals needs_review=${report.approvals.needs_review} approved=${report.approvals.approved} rejected=${report.approvals.rejected} published=${report.approvals.published}`,
|
|
6448
|
+
`failure_mode ${report.failure_mode.strongest_realistic_failure_mode}`,
|
|
6449
|
+
`failure_mode_evidence ${report.failure_mode.evidence}`,
|
|
6450
|
+
...report.proof_checks.map((check) => `proof ${check.status} ${check.check}: ${check.evidence}`),
|
|
6451
|
+
...report.receipt_counts_by_assignment.map((item) => `assignment_receipts ${item.slot_key} ${item.assignment_id}=${item.receipt_count}`),
|
|
6452
|
+
...report.workers.slice(0, 8).map((worker) => `worker ${worker.slot_key} ${worker.state}/${worker.lifecycle_state} assignments=${worker.active_assignments} receipts=${worker.asset_receipts} thread=${worker.codex_app_thread_id ?? "none"}`),
|
|
6453
|
+
];
|
|
6454
|
+
}
|
|
6345
6455
|
function statusCountsText(counts) {
|
|
6346
6456
|
return Object.entries(counts).map(([status, count]) => `${status}=${count}`).join(" ");
|
|
6347
6457
|
}
|