chatroom-cli 1.129.1 → 1.130.1

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/index.js CHANGED
@@ -20417,10 +20417,19 @@ var init_agent_role = __esm(() => {
20417
20417
  });
20418
20418
 
20419
20419
  // ../../services/backend/src/domain/entities/chatroom-workspace-task-inbox.ts
20420
- var ephemeralAssigneeValidator, permanentAssigneeValidator, workspaceTaskAssigneeValidator, workspaceTaskInboxEventStatusValidator, workspaceTaskInboxTaskValidator, workspaceTaskInboxEventFields, workspaceTaskInboxEventValidator;
20420
+ var WorkspaceTaskInboxEventType, WorkspaceTaskInboxEventStatus, ephemeralAssigneeValidator, permanentAssigneeValidator, workspaceTaskAssigneeValidator, workspaceTaskInboxEventStatusValidator, workspaceTaskInboxTaskHeaderFields, workspaceTaskInboxTaskHeaderValidator, legacyWorkspaceTaskInboxTaskFields, workspaceTaskInboxTaskValidator, workspaceTaskInboxEventFields, workspaceTaskInboxEventValidator;
20421
20421
  var init_chatroom_workspace_task_inbox = __esm(() => {
20422
20422
  init_agent_role();
20423
20423
  init_values();
20424
+ ((WorkspaceTaskInboxEventType2) => {
20425
+ WorkspaceTaskInboxEventType2["TaskAssigned"] = "task_assigned";
20426
+ WorkspaceTaskInboxEventType2["TaskUpdated"] = "task_updated";
20427
+ WorkspaceTaskInboxEventType2["TaskDeleted"] = "task_deleted";
20428
+ })(WorkspaceTaskInboxEventType ||= {});
20429
+ ((WorkspaceTaskInboxEventStatus2) => {
20430
+ WorkspaceTaskInboxEventStatus2["Pending"] = "pending";
20431
+ WorkspaceTaskInboxEventStatus2["Processed"] = "processed";
20432
+ })(WorkspaceTaskInboxEventStatus ||= {});
20424
20433
  ephemeralAssigneeValidator = v.object({
20425
20434
  type: v.literal("ephemeral" /* Ephemeral */),
20426
20435
  ephemeral: v.object({
@@ -20434,13 +20443,20 @@ var init_chatroom_workspace_task_inbox = __esm(() => {
20434
20443
  });
20435
20444
  workspaceTaskAssigneeValidator = v.union(permanentAssigneeValidator, ephemeralAssigneeValidator);
20436
20445
  workspaceTaskInboxEventStatusValidator = v.union(v.literal("pending" /* Pending */), v.literal("processed" /* Processed */));
20437
- workspaceTaskInboxTaskValidator = v.object({
20446
+ workspaceTaskInboxTaskHeaderFields = {
20438
20447
  taskId: v.id("chatroom_tasks"),
20439
20448
  chatroomId: v.id("chatroom_rooms"),
20440
- createdBy: v.string(),
20441
- content: v.string(),
20442
20449
  status: v.string(),
20443
20450
  assignedTo: v.optional(v.string()),
20451
+ createdAt: v.number(),
20452
+ updatedAt: v.number(),
20453
+ startInNewSession: v.optional(v.boolean())
20454
+ };
20455
+ workspaceTaskInboxTaskHeaderValidator = v.object(workspaceTaskInboxTaskHeaderFields);
20456
+ legacyWorkspaceTaskInboxTaskFields = {
20457
+ createdBy: v.optional(v.string()),
20458
+ content: v.optional(v.string()),
20459
+ queuePosition: v.optional(v.number()),
20444
20460
  sourceMessageId: v.optional(v.id("chatroom_messages")),
20445
20461
  attachedTaskIds: v.optional(v.array(v.id("chatroom_tasks"))),
20446
20462
  origin: v.optional(v.string()),
@@ -20448,19 +20464,19 @@ var init_chatroom_workspace_task_inbox = __esm(() => {
20448
20464
  value: v.optional(v.string()),
20449
20465
  priority: v.optional(v.number()),
20450
20466
  parentTaskIds: v.optional(v.array(v.id("chatroom_tasks"))),
20451
- createdAt: v.number(),
20452
- updatedAt: v.number(),
20453
20467
  acknowledgedAt: v.optional(v.number()),
20454
20468
  startedAt: v.optional(v.number()),
20455
20469
  completedAt: v.optional(v.number()),
20456
- queuePosition: v.number(),
20457
20470
  plannerEnhancerEnabled: v.optional(v.boolean()),
20458
20471
  conversationMode: v.optional(v.string()),
20459
20472
  originUserMessageId: v.optional(v.id("chatroom_messages")),
20460
20473
  enhancerEnabledAtEnqueue: v.optional(v.boolean()),
20461
- startInNewSession: v.optional(v.boolean()),
20462
20474
  taskEnvelope: v.optional(v.any()),
20463
20475
  sessionPolicyConsumedAt: v.optional(v.number())
20476
+ };
20477
+ workspaceTaskInboxTaskValidator = v.object({
20478
+ ...workspaceTaskInboxTaskHeaderValidator.fields,
20479
+ ...legacyWorkspaceTaskInboxTaskFields
20464
20480
  });
20465
20481
  workspaceTaskInboxEventFields = {
20466
20482
  machineId: v.string(),
@@ -35325,6 +35341,99 @@ function buildUncoveredTurnNudgePrompt(args2) {
35325
35341
  // ../../services/backend/src/domain/entities/participant.ts
35326
35342
  var NATIVE_WAITING_ACTION = "native:waiting", NATIVE_TASK_INJECTED_ACTION = "native:task-injected", GET_NEXT_TASK_STARTED_ACTION = "get-next-task:started";
35327
35343
 
35344
+ // ../../services/backend/src/domain/entities/_shared/convex-id.ts
35345
+ function convexIdSchema(_tableName) {
35346
+ return exports_external.custom((value) => typeof value === "string" && value.length > 0);
35347
+ }
35348
+ var init_convex_id = __esm(() => {
35349
+ init_zod();
35350
+ });
35351
+
35352
+ // ../../services/backend/src/domain/usecase/machine/assigned-task-contract.ts
35353
+ var ACTIVE_TASK_STATUSES2, activeTaskStatusSchema, ASSIGNED_TASK_SIGNAL_TYPES, assignedTaskSignalTypeSchema, SESSION_AUGMENTATION_MODES, sessionAugmentationSchema, AGENT_DESIRED_STATES, agentDesiredStateSchema, AGENT_CIRCUIT_STATES, agentCircuitStateSchema, ephemeralAgentConfigSchema, assignedTaskAssigneeSchema, chatroomTaskIdSchema, chatroomRoomIdSchema, assignedTaskAgentConfigSchema, assignedTaskParticipantSchema, assignedTaskSignalBootstrapFields, assignedTaskSignalSchema, assignedTaskPresenceSignalSchema, assignedTaskPresenceDeltaSchema, assignedTaskRowSchema;
35354
+ var init_assigned_task_contract = __esm(() => {
35355
+ init_zod();
35356
+ init_convex_id();
35357
+ init_chatroom_workspace_task_inbox();
35358
+ ACTIVE_TASK_STATUSES2 = ["pending", "acknowledged", "in_progress"];
35359
+ activeTaskStatusSchema = exports_external.enum(ACTIVE_TASK_STATUSES2);
35360
+ ASSIGNED_TASK_SIGNAL_TYPES = ["task", "agent_config"];
35361
+ assignedTaskSignalTypeSchema = exports_external.enum(ASSIGNED_TASK_SIGNAL_TYPES);
35362
+ SESSION_AUGMENTATION_MODES = ["none", "new_session"];
35363
+ sessionAugmentationSchema = exports_external.enum(SESSION_AUGMENTATION_MODES);
35364
+ AGENT_DESIRED_STATES = ["running", "stopped"];
35365
+ agentDesiredStateSchema = exports_external.enum(AGENT_DESIRED_STATES);
35366
+ AGENT_CIRCUIT_STATES = ["closed", "open", "half-open"];
35367
+ agentCircuitStateSchema = exports_external.enum(AGENT_CIRCUIT_STATES);
35368
+ ephemeralAgentConfigSchema = exports_external.object({
35369
+ agentHarness: exports_external.string(),
35370
+ model: exports_external.string(),
35371
+ workingDir: exports_external.string()
35372
+ });
35373
+ assignedTaskAssigneeSchema = exports_external.union([
35374
+ exports_external.object({ type: exports_external.literal("permanent" /* Permanent */) }),
35375
+ exports_external.object({
35376
+ type: exports_external.literal("ephemeral" /* Ephemeral */),
35377
+ ephemeral: ephemeralAgentConfigSchema
35378
+ })
35379
+ ]);
35380
+ chatroomTaskIdSchema = convexIdSchema("chatroom_tasks");
35381
+ chatroomRoomIdSchema = convexIdSchema("chatroom_rooms");
35382
+ assignedTaskAgentConfigSchema = exports_external.object({
35383
+ role: exports_external.string(),
35384
+ machineId: exports_external.string()
35385
+ });
35386
+ assignedTaskParticipantSchema = exports_external.object({
35387
+ lastSeenAction: exports_external.string().nullable(),
35388
+ lastSeenAt: exports_external.number().nullable()
35389
+ });
35390
+ assignedTaskSignalBootstrapFields = {
35391
+ taskId: chatroomTaskIdSchema,
35392
+ chatroomId: chatroomRoomIdSchema,
35393
+ role: exports_external.string(),
35394
+ status: activeTaskStatusSchema,
35395
+ signalType: assignedTaskSignalTypeSchema,
35396
+ revisionKey: exports_external.string(),
35397
+ machineId: exports_external.string(),
35398
+ agentHarness: exports_external.string(),
35399
+ createdAt: exports_external.number(),
35400
+ workingDir: exports_external.string().optional(),
35401
+ assignedTo: exports_external.string().optional(),
35402
+ sessionAugmentation: sessionAugmentationSchema.optional(),
35403
+ requestsNativeColdSession: exports_external.boolean().optional()
35404
+ };
35405
+ assignedTaskSignalSchema = exports_external.object(assignedTaskSignalBootstrapFields);
35406
+ assignedTaskPresenceSignalSchema = exports_external.object({
35407
+ taskId: chatroomTaskIdSchema,
35408
+ chatroomId: chatroomRoomIdSchema,
35409
+ role: exports_external.string(),
35410
+ lastSeenAt: exports_external.number().nullable(),
35411
+ lastSeenAction: exports_external.string().nullable().optional(),
35412
+ presenceUpdatedAt: exports_external.number(),
35413
+ presenceKey: exports_external.string()
35414
+ });
35415
+ assignedTaskPresenceDeltaSchema = exports_external.object({
35416
+ taskId: chatroomTaskIdSchema,
35417
+ role: exports_external.string(),
35418
+ presenceKey: exports_external.string()
35419
+ });
35420
+ assignedTaskRowSchema = exports_external.object({
35421
+ taskId: chatroomTaskIdSchema,
35422
+ chatroomId: chatroomRoomIdSchema,
35423
+ status: activeTaskStatusSchema,
35424
+ assignedTo: exports_external.string().optional(),
35425
+ updatedAt: exports_external.number(),
35426
+ createdAt: exports_external.number(),
35427
+ agentConfig: assignedTaskAgentConfigSchema,
35428
+ participant: assignedTaskParticipantSchema.optional(),
35429
+ requestsNativeColdSession: exports_external.boolean().optional(),
35430
+ assignee: assignedTaskAssigneeSchema.optional()
35431
+ }).transform((row) => ({
35432
+ ...row,
35433
+ assignedTo: row.assignedTo
35434
+ }));
35435
+ });
35436
+
35328
35437
  // src/infrastructure/mappers/map-assigned-task-view.ts
35329
35438
  function mapAssignedTask(row) {
35330
35439
  return {
@@ -35433,25 +35542,49 @@ function createConvexNativeTaskDeliveryGateway(backend2) {
35433
35542
  }
35434
35543
  };
35435
35544
  }
35545
+ function toWorkspaceTaskInboxEvent({
35546
+ _id: eventId,
35547
+ ...row
35548
+ }) {
35549
+ return { ...row, eventId };
35550
+ }
35436
35551
  function mapPendingTaskInboxRows(rows) {
35437
- return rows.map((row) => ({
35438
- eventId: row._id,
35439
- machineId: row.machineId,
35440
- chatroomId: row.chatroomId,
35441
- taskId: row.taskId,
35442
- role: row.role,
35443
- ...row.assignee === undefined ? {} : {
35444
- assignee: row.assignee
35445
- },
35446
- eventType: row.eventType,
35447
- status: row.status,
35448
- createdAt: row.createdAt,
35449
- ...row.processedAt === undefined ? {} : { processedAt: row.processedAt },
35450
- task: row.task
35451
- }));
35552
+ return exports_external.array(exports_external.unknown()).parse(rows).flatMap((raw) => {
35553
+ const parsed = pendingTaskInboxRowSchema.safeParse(raw);
35554
+ if (!parsed.success) {
35555
+ console.warn(`[TaskService] skipping malformed task inbox row: ${exports_external.prettifyError(parsed.error)}`);
35556
+ return [];
35557
+ }
35558
+ return [toWorkspaceTaskInboxEvent(parsed.data)];
35559
+ });
35452
35560
  }
35561
+ var pendingTaskInboxTaskSchema, pendingTaskInboxRowSchema;
35453
35562
  var init_convex_native_task_delivery_gateway = __esm(() => {
35563
+ init_chatroom_workspace_task_inbox();
35564
+ init_assigned_task_contract();
35565
+ init_zod();
35454
35566
  init_api3();
35567
+ pendingTaskInboxTaskSchema = exports_external.object({
35568
+ taskId: exports_external.string(),
35569
+ chatroomId: exports_external.string(),
35570
+ status: exports_external.string(),
35571
+ assignedTo: exports_external.string().optional(),
35572
+ createdAt: exports_external.number(),
35573
+ updatedAt: exports_external.number(),
35574
+ startInNewSession: exports_external.boolean().optional()
35575
+ });
35576
+ pendingTaskInboxRowSchema = exports_external.object({
35577
+ _id: exports_external.string(),
35578
+ machineId: exports_external.string(),
35579
+ chatroomId: exports_external.string(),
35580
+ taskId: exports_external.string(),
35581
+ role: exports_external.string(),
35582
+ assignee: assignedTaskAssigneeSchema.optional(),
35583
+ eventType: exports_external.enum(WorkspaceTaskInboxEventType),
35584
+ status: exports_external.enum(WorkspaceTaskInboxEventStatus),
35585
+ createdAt: exports_external.number(),
35586
+ task: pendingTaskInboxTaskSchema
35587
+ });
35455
35588
  });
35456
35589
 
35457
35590
  // src/daemon/infrastructure/event-stream/daemon-event-emitter.ts
@@ -100665,6 +100798,102 @@ function getHandoffSeverityGuidanceBlock() {
100665
100798
  - [low] <minor cleanup — nice to have>`;
100666
100799
  }
100667
100800
 
100801
+ // ../../services/backend/prompts/teams/verifier-handoff-templates.ts
100802
+ function normalizeEntryPointRole3(entryPointRole) {
100803
+ return entryPointRole.trim().toLowerCase() || "planner";
100804
+ }
100805
+ function getEntryPointToVerifierHandoffTemplate(entryPointRole) {
100806
+ const entryPoint = normalizeEntryPointRole3(entryPointRole);
100807
+ return `${getHandoffRecipientVisibilityCallout("verifier")}
100808
+
100809
+ ## Handoff Template (${entryPoint} → verifier)
100810
+
100811
+ The verifier judges, from chatroom logs only, whether the user's last message was achieved. It ${VERIFIER_TEST_RULE}; list any user-requested tests under Requested test runs. Treat the claimed outcome as a claim, not as evidence: the verifier does not trust it and checks every requirement against the logs themselves. Request this review only when the task involved code changes, in any conversation mode. The verdict returns to \`${entryPoint}\`.
100812
+
100813
+ ## Round
100814
+ <1 or 2; for 2, cite the round-1 verdict message id>
100815
+
100816
+ ## Mode
100817
+ <chat | code | code:enhanced>
100818
+
100819
+ ## User message id
100820
+ <id of the user's last message: the origin message id of the user task, or from \`chatroom messages anchor\`>
100821
+
100822
+ ## Context id
100823
+ <id from \`chatroom context read\`, or \`none\` if no context was read for this task>
100824
+
100825
+ ## Requested test runs
100826
+ <the test commands the user explicitly asked for, one per line, or exactly \`None requested.\`>
100827
+
100828
+ ## Claimed outcome
100829
+ <requirement-by-requirement what you believe is complete>
100830
+
100831
+ ## Evidence pointers
100832
+ <builder handoff message ids, commits, PRs, and test results as quoted in those handoffs>
100833
+
100834
+ ## Known gaps
100835
+ <anything incomplete, or exactly \`None.\`>
100836
+
100837
+ ## Handoff
100838
+ Send this request to the verifier with the command below, then stop. The verdict returns to \`${entryPoint}\`.
100839
+
100840
+ \`\`\`bash
100841
+ ${handoffCommand({
100842
+ chatroomId: "<chatroom-id>",
100843
+ role: entryPoint,
100844
+ nextRole: "verifier",
100845
+ cliEnvPrefix: ""
100846
+ })}
100847
+ \`\`\``;
100848
+ }
100849
+ function getVerifierToEntryPointHandoffTemplate(entryPointRole) {
100850
+ const entryPoint = normalizeEntryPointRole3(entryPointRole);
100851
+ return `${getHandoffRecipientVisibilityCallout(entryPoint)}
100852
+
100853
+ ## Handoff Template (Verifier → ${entryPoint})
100854
+
100855
+ Return one advisory verdict for the authoritative request. This review is non-binding: it uses chatroom logs, plus the requested test runs listed in the request, if any, deciding every requirement from the evidence those logs and runs actually contain. It also checks the work against the user's expectations (\`## User Expectations\`) under the same logs-only, claim-is-not-evidence rule. It ${VERIFIER_TEST_RULE}. Never accept the claimed outcome as proof. Use the exact sections below, in this order.
100856
+
100857
+ ## Verdict
100858
+ <exactly one of ${VERIFIER_VERDICTS.join(", ")} as the value; ${ACHIEVED} only if every requirement and user expectation is met; ${NOT_ACHIEVED} if any requirement or user expectation is unmet (logs show it was not done, or contradict it); ${INCONCLUSIVE} if none is unmet but any is unverified (logs are silent)>
100859
+
100860
+ ## Objective
100861
+ <user message id, any prior user messages used, objective in 1-2 sentences>
100862
+
100863
+ ## Requirements
100864
+ <numbered \`R1 — <requirement> — met | unmet | unverified — <evidence ref>\`>
100865
+
100866
+ ## User Expectations
100867
+ <numbered \`U1 — <expectation from the user's handoff template> — met | unmet | unverified — <evidence ref>\`; exactly \`None applicable.\` in chat mode or when no expectation applies>
100868
+
100869
+ ## Evidence
100870
+ <bullets: \`<message id or handoff> — "<short quote>" — supports R#\`; for a requested test run, \`<command> — exit <result> — supports R#\`>
100871
+
100872
+ ## Missing or unmet
100873
+ <per unmet or unverified requirement or user expectation: what is missing and what evidence would resolve it; exactly \`None.\` if ${ACHIEVED}>
100874
+
100875
+ ## Scope and limits
100876
+ <state the test runs the verifier executed (command and exit result), or "No tests were run; none were requested."; log range read; whether the download was truncated; context id read and whether it matched the request>
100877
+
100878
+ ## Handoff
100879
+ Run the normal handoff command to \`${entryPoint}\` with this complete verdict, then stop.
100880
+
100881
+ \`\`\`bash
100882
+ ${handoffCommand({
100883
+ chatroomId: "<chatroom-id>",
100884
+ role: "verifier",
100885
+ nextRole: entryPoint,
100886
+ cliEnvPrefix: ""
100887
+ })}
100888
+ \`\`\``;
100889
+ }
100890
+ var VERIFIER_VERDICTS, VERIFIER_TEST_RULE = "runs no test the user did not ask for, and never builds, lints, or edits", ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE;
100891
+ var init_verifier_handoff_templates = __esm(() => {
100892
+ init_command2();
100893
+ VERIFIER_VERDICTS = ["ACHIEVED", "NOT_ACHIEVED", "INCONCLUSIVE"];
100894
+ [ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE] = VERIFIER_VERDICTS;
100895
+ });
100896
+
100668
100897
  // ../../services/backend/prompts/utils/proof-of-verification.ts
100669
100898
  function messagesAnchorCommand(params = {}) {
100670
100899
  const prefix = params.cliEnvPrefix ?? "";
@@ -100680,6 +100909,21 @@ function messagesDownloadSinceCommand(params = {}) {
100680
100909
  const limit = params.limit ?? 100;
100681
100910
  return `${prefix}chatroom messages download --chatroom-id="${chatroomId}" --role="${role}" --since-message-id="${sinceMessageId}" --limit=${limit}`;
100682
100911
  }
100912
+ function verifierRequestCommand(params = {}) {
100913
+ const prefix = params.cliEnvPrefix ?? "";
100914
+ const chatroomId = params.chatroomId ?? "<chatroom-id>";
100915
+ const role = params.role ?? "<role>";
100916
+ return `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="verifier"`;
100917
+ }
100918
+ function getVerifierReviewDisclosureBlock(params = {}) {
100919
+ return `**Proof of verification (verifier review):**
100920
+ ${VERIFIER_REVIEW_CHECKBOX}
100921
+ - Verifier review: <${VERIFIER_REVIEW_VALUES}>
100922
+ - Verifier request command (disclose the command you sent): \`${verifierRequestCommand(params)}\`
100923
+ - Verifier request message id: <id of your verifier handoff> · Round: <1 | 2>
100924
+ - Verdict message id: <id of the verifier's verdict handoff> · Verdict user message id: <id> (must equal the current last user message)
100925
+ - Verdict gaps (only if not ACHIEVED): <each unmet item, or \`None.\`>`;
100926
+ }
100683
100927
  function getProofOfVerificationComment(params = {}) {
100684
100928
  const anchorCmd = messagesAnchorCommand(params);
100685
100929
  const downloadCmd = messagesDownloadSinceCommand({
@@ -100696,9 +100940,14 @@ Then: \`${anchorCmd}\` → \`${downloadCmd}\` (use the message ID from anchor ou
100696
100940
  }
100697
100941
  function getEntryPointProofOfCompletionVerificationBlock(params = {}) {
100698
100942
  return `${getProofOfVerificationComment(params)}
100699
- ${PROOF_OF_VERIFICATION_CHECKBOX}`;
100943
+ ${PROOF_OF_VERIFICATION_CHECKBOX}
100944
+ ${getVerifierReviewDisclosureBlock(params)}`;
100700
100945
  }
100701
- var PROOF_OF_VERIFICATION_CHECKBOX = "- [ ] I confirm I verified the user's full request: anchored on the last user message, downloaded history since that anchor, reviewed handoffs/goals (including prior user messages when the latest was a terse follow-up), and validated every requirement below before this handoff";
100946
+ var PROOF_OF_VERIFICATION_CHECKBOX = "- [ ] I confirm I verified the user's full request: anchored on the last user message, downloaded history since that anchor, reviewed handoffs/goals (including prior user messages when the latest was a terse follow-up), and validated every requirement below before this handoff", VERIFIER_REVIEW_CHECKBOX = "- [ ] I checked the verifier verdict for this task: its user message id is the user's current last message, it is round 1 or 2 (maximum 2), and the verdict is `ACHIEVED` — or every unmet item is listed under Unresolved / action required", VERIFIER_REVIEW_VALUES;
100947
+ var init_proof_of_verification = __esm(() => {
100948
+ init_verifier_handoff_templates();
100949
+ VERIFIER_REVIEW_VALUES = `${VERIFIER_VERDICTS.join(" | ")} | UNAVAILABLE (<reason>) | not required (no code changes)`;
100950
+ });
100702
100951
 
100703
100952
  // ../../services/backend/prompts/utils/unresolved-decisions.ts
100704
100953
  function getUnresolvedDecisionsSectionBlock() {
@@ -100798,6 +101047,7 @@ ${getHandoffNotApplicableSectionComment("List manual steps outside the system")}
100798
101047
  var init_handoff_report_template_body = __esm(() => {
100799
101048
  init_context_disclosure();
100800
101049
  init_handoff_quality_principles();
101050
+ init_proof_of_verification();
100801
101051
  init_role_guidance_disclosure();
100802
101052
  init_unresolved_decisions();
100803
101053
  });
@@ -100829,11 +101079,11 @@ function getChatToUserHandoffTemplate() {
100829
101079
  var init_chat_handoff_template = () => {};
100830
101080
 
100831
101081
  // ../../services/backend/prompts/teams/researcher-handoff-templates.ts
100832
- function normalizeEntryPointRole3(entryPointRole) {
101082
+ function normalizeEntryPointRole4(entryPointRole) {
100833
101083
  return entryPointRole.trim().toLowerCase() || "planner";
100834
101084
  }
100835
101085
  function getEntryPointToResearcherHandoffTemplate(entryPointRole) {
100836
- const entryPoint = normalizeEntryPointRole3(entryPointRole);
101086
+ const entryPoint = normalizeEntryPointRole4(entryPointRole);
100837
101087
  return `${getHandoffRecipientVisibilityCallout("researcher")}
100838
101088
 
100839
101089
  ## Handoff Template (${entryPoint} → researcher)
@@ -100862,7 +101112,7 @@ ${handoffCommand({
100862
101112
  \`\`\``;
100863
101113
  }
100864
101114
  function getResearcherToEntryPointHandoffTemplate(entryPointRole) {
100865
- const entryPoint = normalizeEntryPointRole3(entryPointRole);
101115
+ const entryPoint = normalizeEntryPointRole4(entryPointRole);
100866
101116
  return `${getHandoffRecipientVisibilityCallout(entryPoint)}
100867
101117
 
100868
101118
  ## Handoff Template (Researcher → ${entryPoint})
@@ -100913,11 +101163,11 @@ var init_researcher_handoff_templates = __esm(() => {
100913
101163
  });
100914
101164
 
100915
101165
  // ../../services/backend/prompts/teams/triage-handoff-templates.ts
100916
- function normalizeEntryPointRole4(entryPointRole) {
101166
+ function normalizeEntryPointRole5(entryPointRole) {
100917
101167
  return entryPointRole.trim().toLowerCase() || "planner";
100918
101168
  }
100919
101169
  function getEntryPointToTriageHandoffTemplate(entryPointRole) {
100920
- const entryPoint = normalizeEntryPointRole4(entryPointRole);
101170
+ const entryPoint = normalizeEntryPointRole5(entryPointRole);
100921
101171
  return `${getHandoffRecipientVisibilityCallout("triage")}
100922
101172
 
100923
101173
  ## Handoff Template (${entryPoint} → triage)
@@ -100936,12 +101186,12 @@ ${handoffCommand({
100936
101186
  \`\`\``;
100937
101187
  }
100938
101188
  function getTriageToEntryPointHandoffTemplate(entryPointRole) {
100939
- const entryPoint = normalizeEntryPointRole4(entryPointRole);
101189
+ const entryPoint = normalizeEntryPointRole5(entryPointRole);
100940
101190
  return `${getHandoffRecipientVisibilityCallout(entryPoint)}
100941
101191
 
100942
101192
  ## Handoff Template (Triage → ${entryPoint})
100943
101193
 
100944
- Return a complete, evidence-backed investigation of the authoritative reported bug. Triage is advisory: do not edit implementation files or implement the proposed fix. Use the exact sections below. Cite concrete repository paths and symbols, observed behavior, commands, and test output. Distinguish confirmed findings from hypotheses; never claim a test proved behavior unless its failing assertion demonstrates the report.
101194
+ Return a complete, evidence-backed investigation of the authoritative reported bug. Triage is advisory: do not edit implementation files or implement the proposed fix. Begin with the \`## Summary\` section, then use the remaining sections below in order. Use \`###\` for sub-items within a section. Cite concrete repository paths and symbols, observed behavior, commands, and test output. Distinguish confirmed findings from hypotheses; never claim a test proved behavior unless its failing assertion demonstrates the report.
100945
101195
 
100946
101196
  ## Summary
100947
101197
  <briefly state the diagnosis and whether the root cause was confirmed or remains a hypothesis>
@@ -100980,99 +101230,6 @@ var init_triage_handoff_templates = __esm(() => {
100980
101230
  init_command2();
100981
101231
  });
100982
101232
 
100983
- // ../../services/backend/prompts/teams/verifier-handoff-templates.ts
100984
- function normalizeEntryPointRole5(entryPointRole) {
100985
- return entryPointRole.trim().toLowerCase() || "planner";
100986
- }
100987
- function getEntryPointToVerifierHandoffTemplate(entryPointRole) {
100988
- const entryPoint = normalizeEntryPointRole5(entryPointRole);
100989
- return `${getHandoffRecipientVisibilityCallout("verifier")}
100990
-
100991
- ## Handoff Template (${entryPoint} → verifier)
100992
-
100993
- The verifier judges, from chatroom logs only, whether the user's last message was achieved. It ${VERIFIER_TEST_RULE}; list any user-requested tests under Requested test runs. Treat the claimed outcome as a claim, not as evidence: the verifier does not trust it and checks every requirement against the logs themselves. Request this review only when the task involved code changes, in any conversation mode. The verdict returns to \`${entryPoint}\`.
100994
-
100995
- ## Round
100996
- <1 or 2; for 2, cite the round-1 verdict message id>
100997
-
100998
- ## Mode
100999
- <chat | code | code:enhanced>
101000
-
101001
- ## User message id
101002
- <id of the user's last message: the origin message id of the user task, or from \`chatroom messages anchor\`>
101003
-
101004
- ## Context id
101005
- <id from \`chatroom context read\`, or \`none\` if no context was read for this task>
101006
-
101007
- ## Requested test runs
101008
- <the test commands the user explicitly asked for, one per line, or exactly \`None requested.\`>
101009
-
101010
- ## Claimed outcome
101011
- <requirement-by-requirement what you believe is complete>
101012
-
101013
- ## Evidence pointers
101014
- <builder handoff message ids, commits, PRs, and test results as quoted in those handoffs>
101015
-
101016
- ## Known gaps
101017
- <anything incomplete, or exactly \`None.\`>
101018
-
101019
- ## Handoff
101020
- Send this request to the verifier with the command below, then stop. The verdict returns to \`${entryPoint}\`.
101021
-
101022
- \`\`\`bash
101023
- ${handoffCommand({
101024
- chatroomId: "<chatroom-id>",
101025
- role: entryPoint,
101026
- nextRole: "verifier",
101027
- cliEnvPrefix: ""
101028
- })}
101029
- \`\`\``;
101030
- }
101031
- function getVerifierToEntryPointHandoffTemplate(entryPointRole) {
101032
- const entryPoint = normalizeEntryPointRole5(entryPointRole);
101033
- return `${getHandoffRecipientVisibilityCallout(entryPoint)}
101034
-
101035
- ## Handoff Template (Verifier → ${entryPoint})
101036
-
101037
- Return one advisory verdict for the authoritative request. This review is non-binding: it uses chatroom logs, plus the requested test runs listed in the request, if any, deciding every requirement from the evidence those logs and runs actually contain. It ${VERIFIER_TEST_RULE}. Never accept the claimed outcome as proof. Use the exact sections below, in this order.
101038
-
101039
- ## Verdict
101040
- <exactly one of ${VERIFIER_VERDICTS.join(", ")} as the value; ${ACHIEVED} only if every requirement is met; ${NOT_ACHIEVED} if any requirement is unmet (logs show it was not done, or contradict it); ${INCONCLUSIVE} if none is unmet but any is unverified (logs are silent)>
101041
-
101042
- ## Objective
101043
- <user message id, any prior user messages used, objective in 1-2 sentences>
101044
-
101045
- ## Requirements
101046
- <numbered \`R1 — <requirement> — met | unmet | unverified — <evidence ref>\`>
101047
-
101048
- ## Evidence
101049
- <bullets: \`<message id or handoff> — "<short quote>" — supports R#\`; for a requested test run, \`<command> — exit <result> — supports R#\`>
101050
-
101051
- ## Missing or unmet
101052
- <per unmet or unverified requirement: what is missing and what evidence would resolve it; exactly \`None.\` if ${ACHIEVED}>
101053
-
101054
- ## Scope and limits
101055
- <state the test runs the verifier executed (command and exit result), or "No tests were run; none were requested."; log range read; whether the download was truncated; context id read and whether it matched the request>
101056
-
101057
- ## Handoff
101058
- Run the normal handoff command to \`${entryPoint}\` with this complete verdict, then stop.
101059
-
101060
- \`\`\`bash
101061
- ${handoffCommand({
101062
- chatroomId: "<chatroom-id>",
101063
- role: "verifier",
101064
- nextRole: entryPoint,
101065
- cliEnvPrefix: ""
101066
- })}
101067
- \`\`\``;
101068
- }
101069
- var VERIFIER_VERDICTS, VERIFIER_TEST_RULE = "runs no test the user did not ask for, and never builds, lints, or edits", ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE;
101070
- var init_verifier_handoff_templates = __esm(() => {
101071
- init_command2();
101072
- VERIFIER_VERDICTS = ["ACHIEVED", "NOT_ACHIEVED", "INCONCLUSIVE"];
101073
- [ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE] = VERIFIER_VERDICTS;
101074
- });
101075
-
101076
101233
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner.ts
101077
101234
  var duoPlannerHandoffContract;
101078
101235
  var init_planner = __esm(() => {
@@ -101871,7 +102028,9 @@ var init_glossary = __esm(() => {
101871
102028
  });
101872
102029
 
101873
102030
  // ../../services/backend/prompts/cli/history-retrieval/guidance.ts
101874
- var init_guidance = () => {};
102031
+ var init_guidance = __esm(() => {
102032
+ init_proof_of_verification();
102033
+ });
101875
102034
 
101876
102035
  // ../../services/backend/prompts/sections/general-knowledge.ts
101877
102036
  var init_general_knowledge = __esm(() => {
@@ -101879,6 +102038,7 @@ var init_general_knowledge = __esm(() => {
101879
102038
  init_glossary();
101880
102039
  init_guidance();
101881
102040
  init_utils3();
102041
+ init_proof_of_verification();
101882
102042
  });
101883
102043
 
101884
102044
  // ../../services/backend/prompts/sections/commands-reference.ts
@@ -101899,7 +102059,9 @@ function getInterRoleHandoffRule() {
101899
102059
  // ../../services/backend/prompts/cli/sections/handoff-rules.ts
101900
102060
  var init_handoff_rules = () => {};
101901
102061
  // ../../services/backend/prompts/cli/sections/proof-of-verification.ts
101902
- var init_proof_of_verification = () => {};
102062
+ var init_proof_of_verification2 = __esm(() => {
102063
+ init_proof_of_verification();
102064
+ });
101903
102065
 
101904
102066
  // ../../services/backend/prompts/cli/sections/operating-model.ts
101905
102067
  var init_operating_model = () => {};
@@ -101908,7 +102070,7 @@ var init_operating_model = () => {};
101908
102070
  var init_sections = __esm(() => {
101909
102071
  init_core_responsibilities();
101910
102072
  init_handoff_rules();
101911
- init_proof_of_verification();
102073
+ init_proof_of_verification2();
101912
102074
  init_operating_model();
101913
102075
  });
101914
102076
 
@@ -101975,6 +102137,29 @@ chatroom handoff --chatroom-id="<chatroom-id>" --role="researcher" --next-role="
101975
102137
  \`\`\``;
101976
102138
  });
101977
102139
 
102140
+ // ../../services/backend/prompts/cli/roles/triage.ts
102141
+ var TRIAGE_GUIDANCE;
102142
+ var init_triage3 = __esm(() => {
102143
+ init_sections();
102144
+ TRIAGE_GUIDANCE = `## Triage Operating Model
102145
+
102146
+ You are the triage agent responsible for investigating a reported bug so the entry point can delegate a precise fix. You are advisory only: do not edit implementation files or implement the fix.
102147
+
102148
+ ${"{SESSION_CONTINUITY}"}
102149
+
102150
+ ${getInterRoleHandoffRule()}
102151
+
102152
+ 1. Recover the reported bug from the injected task and chatroom history: the observed behavior, the expected behavior, and any reproduction details. If the expected behavior is not explicit, state the assumption you made.
102153
+ 2. Trace the relevant code paths with concrete repository paths and symbols. Label every finding \`confirmed\` or \`hypothesis\`. Never present a hypothesis as fact.
102154
+ 3. Attempt a focused reproduction only when it is cheap and safe. A focused regression test may be written as evidence. Do not edit implementation files.
102155
+ 4. Write the report using the sections in the injected \`<handoff-templates>\`, in the order given, beginning with the \`## Summary\` section.
102156
+ 5. Hand the report to the configured entry point with the normal command, then stop:
102157
+
102158
+ \`\`\`bash
102159
+ chatroom handoff --chatroom-id="<chatroom-id>" --role="triage" --next-role="{ENTRY_POINT_ROLE}"
102160
+ \`\`\``;
102161
+ });
102162
+
101978
102163
  // ../../services/backend/prompts/cli/roles/uiux-engineer.ts
101979
102164
  var UIUX_ENGINEER_GUIDANCE;
101980
102165
  var init_uiux_engineer3 = __esm(() => {
@@ -102006,6 +102191,8 @@ The handoff must contain every required brief section, repository evidence, chos
102006
102191
  var ACHIEVED2, NOT_ACHIEVED2, INCONCLUSIVE2, VERIFIER_GUIDANCE;
102007
102192
  var init_verifier3 = __esm(() => {
102008
102193
  init_verifier_handoff_templates();
102194
+ init_chat_handoff_template();
102195
+ init_handoff_report_template_body();
102009
102196
  init_sections();
102010
102197
  [ACHIEVED2, NOT_ACHIEVED2, INCONCLUSIVE2] = VERIFIER_VERDICTS;
102011
102198
  VERIFIER_GUIDANCE = `## Verifier Operating Model
@@ -102021,8 +102208,9 @@ ${getInterRoleHandoffRule()}
102021
102208
  2a. Requested test runs: if the user's last message (or prior user messages for this objective) explicitly asks for tests to be run, run exactly those commands from the repository root, record the command and exit result, and count the output as evidence. Run no test the user did not ask for. If the request is absent, run nothing.
102022
102209
  3. Run \`chatroom context read --chatroom-id="<chatroom-id>" --role="verifier"\` and note any mismatch with the request's context id.
102023
102210
  4. Decompose the objective into numbered requirements R1..Rn. Split compound requests and ignore anything the user did not actually ask for.
102211
+ 4a. User expectations: the user's handoff template (the section at the end of this prompt) defines what the user expects from the work. In a code mode, turn each applicable item that concerns the work into an expectation \`U1..Un\`: each requirement's evidence (PR, commit, or file), files changed, Code Change Verification, backlog items moved to \`pending_user_review\` after a verified end-to-end feature with a PR, and any manual steps or unresolved decisions the user must act on. Skip presentation-only items: template disclosure checkboxes, section order, collapsing, diagram format, and Proof of Planning. In \`chat\` mode the template asks only for a direct, concise answer, so add no expectations beyond the requirements.
102024
102212
  5. Find evidence for every requirement in the logs alone: builder handoff reports, planner delegations, quoted test output, commits, and PRs. \`met\` requires concrete evidence in the logs. The planner's claimed outcome is a claim, not evidence. Silence means \`unverified\`. A contradiction, or a log showing the requirement was not done, means \`unmet\`. Never state that tests passed unless a log reports it, or you ran the requested tests yourself.
102025
- 6. Choose the verdict by the rules in the injected verdict template: exactly one of ${VERIFIER_VERDICTS.join(", ")}. ${ACHIEVED2} only if every requirement is met; ${NOT_ACHIEVED2} if any requirement is unmet; ${INCONCLUSIVE2} if none is unmet but any is unverified.
102213
+ 6. Choose the verdict by the rules in the injected verdict template: exactly one of ${VERIFIER_VERDICTS.join(", ")}. ${ACHIEVED2} only if every requirement and every U-expectation is met; ${NOT_ACHIEVED2} if any is unmet; ${INCONCLUSIVE2} if none is unmet but any is unverified.
102026
102214
  7. Follow the injected \`<handoff-templates>\` verdict template exactly, in its order, and put the complete verdict in the handoff. Then hand off to the configured entry point with the normal command, then stop:
102027
102215
 
102028
102216
  \`\`\`bash
@@ -102052,6 +102240,7 @@ var init_fromContext2 = __esm(() => {
102052
102240
  init_builder2();
102053
102241
  init_planner2();
102054
102242
  init_researcher2();
102243
+ init_triage3();
102055
102244
  init_uiux_engineer3();
102056
102245
  init_verifier3();
102057
102246
  init_fromContext();
@@ -138448,4 +138637,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
138448
138637
  });
138449
138638
  program2.parse();
138450
138639
 
138451
- //# debugId=8506C14FCD932D1964756E2164756E21
138640
+ //# debugId=107270B63CF350A064756E2164756E21