chatroom-cli 1.149.1 → 1.149.3
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
|
@@ -15047,7 +15047,6 @@ __export(exports_stdin_heredoc, {
|
|
|
15047
15047
|
HANDOFF_STDIN_DELIMITER: () => HANDOFF_STDIN_DELIMITER,
|
|
15048
15048
|
HANDOFF_MESSAGE_MARKER: () => HANDOFF_MESSAGE_MARKER,
|
|
15049
15049
|
ENHANCER_STDIN_DELIMITER: () => ENHANCER_STDIN_DELIMITER,
|
|
15050
|
-
CONTEXT_STDIN_DELIMITER: () => CONTEXT_STDIN_DELIMITER,
|
|
15051
15050
|
BACKLOG_STDIN_DELIMITER: () => BACKLOG_STDIN_DELIMITER,
|
|
15052
15051
|
AGENTIC_QUERY_STDIN_DELIMITER: () => AGENTIC_QUERY_STDIN_DELIMITER
|
|
15053
15052
|
});
|
|
@@ -15085,11 +15084,10 @@ function findReservedDelimiterLines(content) {
|
|
|
15085
15084
|
}
|
|
15086
15085
|
return hits;
|
|
15087
15086
|
}
|
|
15088
|
-
var HANDOFF_STDIN_DELIMITER = "CHATROOM_HANDOFF_END",
|
|
15087
|
+
var HANDOFF_STDIN_DELIMITER = "CHATROOM_HANDOFF_END", BACKLOG_STDIN_DELIMITER = "CHATROOM_BACKLOG_END", AGENTIC_QUERY_STDIN_DELIMITER = "CHATROOM_AGENTIC_QUERY_END", NOTIFY_USER_STDIN_DELIMITER = "CHATROOM_NOTIFY_END", PLAN_STDIN_DELIMITER = "CHATROOM_PLAN_END", ENHANCER_STDIN_DELIMITER = "CHATROOM_ENHANCER_END", CLASSIFY_STDIN_DELIMITER = "CHATROOM_CLASSIFY_END", HANDOFF_MESSAGE_MARKER = "---MESSAGE---", RESERVED_STDIN_HEREDOC_DELIMITERS, RESERVED_STRUCTURED_PARAM_MARKERS;
|
|
15089
15088
|
var init_stdin_heredoc = __esm(() => {
|
|
15090
15089
|
RESERVED_STDIN_HEREDOC_DELIMITERS = [
|
|
15091
15090
|
HANDOFF_STDIN_DELIMITER,
|
|
15092
|
-
CONTEXT_STDIN_DELIMITER,
|
|
15093
15091
|
BACKLOG_STDIN_DELIMITER,
|
|
15094
15092
|
AGENTIC_QUERY_STDIN_DELIMITER,
|
|
15095
15093
|
NOTIFY_USER_STDIN_DELIMITER,
|
|
@@ -70139,50 +70137,167 @@ var init_register_agent = __esm(() => {
|
|
|
70139
70137
|
init_services();
|
|
70140
70138
|
init_convex_error();
|
|
70141
70139
|
});
|
|
70142
|
-
// ../../services/backend/prompts/cli/
|
|
70143
|
-
|
|
70144
|
-
|
|
70140
|
+
// ../../services/backend/prompts/cli/task-started/main-prompt.ts
|
|
70141
|
+
var init_main_prompt = () => {};
|
|
70142
|
+
|
|
70143
|
+
// ../../services/backend/prompts/cli/task-started/index.ts
|
|
70144
|
+
var init_task_started = __esm(() => {
|
|
70145
|
+
init_main_prompt();
|
|
70146
|
+
});
|
|
70147
|
+
|
|
70148
|
+
// ../../services/backend/prompts/cli/handoff/command.ts
|
|
70149
|
+
function handoffCommand(params) {
|
|
70150
|
+
const prefix = params.cliEnvPrefix || "";
|
|
70151
|
+
const chatroomId = params.chatroomId || "<chatroom-id>";
|
|
70152
|
+
const role = params.role || "<role>";
|
|
70153
|
+
const nextRole = params.nextRole || "<target>";
|
|
70154
|
+
const placeholder = params.messagePlaceholder ?? "[Your message here]";
|
|
70155
|
+
const commandPrefix = `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="${nextRole}"`;
|
|
70156
|
+
return formatStdinHeredocCommand(commandPrefix, HANDOFF_STDIN_DELIMITER, placeholder, {
|
|
70157
|
+
messageMarker: HANDOFF_MESSAGE_MARKER
|
|
70158
|
+
});
|
|
70159
|
+
}
|
|
70160
|
+
var init_command = __esm(() => {
|
|
70161
|
+
init_stdin_heredoc();
|
|
70162
|
+
});
|
|
70163
|
+
|
|
70164
|
+
// ../../services/backend/prompts/teams/verifier-handoff-templates.ts
|
|
70165
|
+
function getEntryPointToVerifierHandoffTemplate(query) {
|
|
70166
|
+
const entryPoint = query.fromRole;
|
|
70167
|
+
return `Instructions (not part of the message): 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. List every message id that carries the claimed work under Log message ids, so the verifier can read those messages from the logs. Request this review only when the task involved code changes, in any conversation mode. The verdict returns to \`${entryPoint}\`.
|
|
70168
|
+
|
|
70169
|
+
## Round
|
|
70170
|
+
<1 or 2; for 2, cite the round-1 verdict message id>
|
|
70171
|
+
|
|
70172
|
+
## Mode
|
|
70173
|
+
<chat | code>
|
|
70174
|
+
|
|
70175
|
+
## User message id
|
|
70176
|
+
<id of the user's last message: the origin message id of the user task, or from \`chatroom messages anchor\`>
|
|
70177
|
+
|
|
70178
|
+
## Log message ids
|
|
70179
|
+
<one per line as \`<message id> — <sender role> — <what it shows>\`: every message that carries the claimed work, in order: builder and specialist handoff reports, the reviewer report, and commit or PR evidence messages; or exactly \`None beyond the user message.\`>
|
|
70180
|
+
|
|
70181
|
+
## Requested test runs
|
|
70182
|
+
<the test commands the user explicitly asked for, one per line, or exactly \`None requested.\`>
|
|
70183
|
+
|
|
70184
|
+
## Claimed outcome
|
|
70185
|
+
<requirement-by-requirement what you believe is complete>
|
|
70186
|
+
|
|
70187
|
+
## Evidence pointers
|
|
70188
|
+
<commit hashes, PR URLs, and test results the claimed outcome relies on, as quoted in the messages listed under Log message ids>
|
|
70189
|
+
|
|
70190
|
+
## Known gaps
|
|
70191
|
+
<anything incomplete, or exactly \`None.\`>
|
|
70192
|
+
|
|
70193
|
+
Instructions after the body (not part of the message): run the normal handoff command to \`${entryPoint}\` with the complete body above, then stop.
|
|
70194
|
+
|
|
70195
|
+
\`\`\`bash
|
|
70196
|
+
${handoffCommand({
|
|
70197
|
+
chatroomId: "<chatroom-id>",
|
|
70198
|
+
role: entryPoint,
|
|
70199
|
+
nextRole: "verifier",
|
|
70200
|
+
cliEnvPrefix: ""
|
|
70201
|
+
})}
|
|
70202
|
+
\`\`\``;
|
|
70145
70203
|
}
|
|
70146
|
-
|
|
70147
|
-
|
|
70148
|
-
-
|
|
70204
|
+
function getVerifierToEntryPointHandoffTemplate(query) {
|
|
70205
|
+
const entryPoint = query.toRole;
|
|
70206
|
+
return `Instructions (not part of the message): 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.
|
|
70207
|
+
|
|
70208
|
+
## Verdict
|
|
70209
|
+
<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)>
|
|
70210
|
+
|
|
70211
|
+
## Objective
|
|
70212
|
+
<user message id, any prior user messages used, objective in 1-2 sentences>
|
|
70149
70213
|
|
|
70150
70214
|
## Requirements
|
|
70151
|
-
|
|
70215
|
+
<numbered \`R1 — <requirement> — met | unmet | unverified — <evidence ref>\`>
|
|
70152
70216
|
|
|
70153
|
-
##
|
|
70154
|
-
|
|
70217
|
+
## User Expectations
|
|
70218
|
+
<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>
|
|
70155
70219
|
|
|
70156
|
-
##
|
|
70157
|
-
|
|
70220
|
+
## Evidence
|
|
70221
|
+
<bullets: \`<message id or handoff> — "<short quote>" — supports R#\`; for a requested test run, \`<command> — exit <result> — supports R#\`>
|
|
70158
70222
|
|
|
70159
|
-
|
|
70160
|
-
|
|
70223
|
+
## Missing or unmet
|
|
70224
|
+
<per unmet or unverified requirement or user expectation: what is missing and what evidence would resolve it; exactly \`None.\` if ${ACHIEVED}>
|
|
70161
70225
|
|
|
70162
|
-
|
|
70163
|
-
|
|
70164
|
-
|
|
70165
|
-
|
|
70226
|
+
## Scope and limits
|
|
70227
|
+
<state the test runs the verifier executed (command and exit result), or "No tests were run; none were requested."; the log range read (first and last message id, and the message count); whether the download was truncated; which Log message ids were found in that range and which were not>
|
|
70228
|
+
|
|
70229
|
+
Instructions after the body (not part of the message): run the normal handoff command to \`${entryPoint}\` with the complete body above, then stop.
|
|
70230
|
+
|
|
70231
|
+
\`\`\`bash
|
|
70232
|
+
${handoffCommand({
|
|
70233
|
+
chatroomId: "<chatroom-id>",
|
|
70234
|
+
role: "verifier",
|
|
70235
|
+
nextRole: entryPoint,
|
|
70236
|
+
cliEnvPrefix: ""
|
|
70237
|
+
})}
|
|
70238
|
+
\`\`\``;
|
|
70239
|
+
}
|
|
70240
|
+
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;
|
|
70241
|
+
var init_verifier_handoff_templates = __esm(() => {
|
|
70242
|
+
init_command();
|
|
70243
|
+
VERIFIER_VERDICTS = ["ACHIEVED", "NOT_ACHIEVED", "INCONCLUSIVE"];
|
|
70244
|
+
[ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE] = VERIFIER_VERDICTS;
|
|
70166
70245
|
});
|
|
70167
70246
|
|
|
70168
|
-
// ../../services/backend/prompts/
|
|
70169
|
-
function
|
|
70247
|
+
// ../../services/backend/prompts/utils/proof-of-verification.ts
|
|
70248
|
+
function messagesAnchorCommand(params = {}) {
|
|
70170
70249
|
const prefix = params.cliEnvPrefix ?? "";
|
|
70171
70250
|
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
70172
70251
|
const role = params.role ?? "<role>";
|
|
70173
|
-
return `${prefix}chatroom
|
|
70252
|
+
return `${prefix}chatroom messages anchor --chatroom-id="${chatroomId}" --role="${role}"`;
|
|
70174
70253
|
}
|
|
70175
|
-
|
|
70176
|
-
|
|
70177
|
-
|
|
70178
|
-
|
|
70179
|
-
|
|
70180
|
-
|
|
70181
|
-
|
|
70182
|
-
|
|
70183
|
-
|
|
70254
|
+
function messagesDownloadSinceCommand(params = {}) {
|
|
70255
|
+
const prefix = params.cliEnvPrefix ?? "";
|
|
70256
|
+
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
70257
|
+
const role = params.role ?? "<role>";
|
|
70258
|
+
const sinceMessageId = params.sinceMessageId ?? "<id>";
|
|
70259
|
+
const limit = params.limit ?? 100;
|
|
70260
|
+
return `${prefix}chatroom messages download --chatroom-id="${chatroomId}" --role="${role}" --since-message-id="${sinceMessageId}" --limit=${limit}`;
|
|
70261
|
+
}
|
|
70262
|
+
function verifierRequestCommand(params = {}) {
|
|
70263
|
+
const prefix = params.cliEnvPrefix ?? "";
|
|
70264
|
+
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
70265
|
+
const role = params.role ?? "<role>";
|
|
70266
|
+
return `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="verifier"`;
|
|
70267
|
+
}
|
|
70268
|
+
function getVerifierReviewDisclosureBlock(params = {}) {
|
|
70269
|
+
return `**Proof of verification (verifier review):**
|
|
70270
|
+
${VERIFIER_REVIEW_CHECKBOX}
|
|
70271
|
+
- Verifier review: <${VERIFIER_REVIEW_VALUES}>
|
|
70272
|
+
- Verifier request command (disclose the command you sent): \`${verifierRequestCommand(params)}\`
|
|
70273
|
+
- Verifier request message id: <id of your verifier handoff> · Round: <1 | 2>
|
|
70274
|
+
- Verdict message id: <id of the verifier's verdict handoff> · Verdict user message id: <id> (must equal the current last user message)
|
|
70275
|
+
- Verdict gaps (only if not ACHIEVED): <each unmet item, or \`None.\`>`;
|
|
70276
|
+
}
|
|
70277
|
+
function getProofOfVerificationComment(params = {}) {
|
|
70278
|
+
const anchorCmd = messagesAnchorCommand(params);
|
|
70279
|
+
const downloadCmd = messagesDownloadSinceCommand({
|
|
70280
|
+
...params,
|
|
70281
|
+
sinceMessageId: "<from-anchor>",
|
|
70282
|
+
limit: 100
|
|
70283
|
+
});
|
|
70284
|
+
return `<!-- Entry-point proof-of-completion workflow — run before filling this section:
|
|
70285
|
+
1. \`${anchorCmd}\` — locate the user's last message (and prior user messages for context)
|
|
70286
|
+
2. \`${downloadCmd}\` — download grep-friendly history since anchor; read handoffs and goals
|
|
70287
|
+
3. If the user's last message was terse (e.g. "do it", "raise a PR"), review prior user messages from anchor output and widen --limit before validating
|
|
70288
|
+
4. Validate commits/PRs against ALL requirements — not just the last slice. Incomplete → rework; do NOT hand off to user.
|
|
70289
|
+
Then: \`${anchorCmd}\` → \`${downloadCmd}\` (use the message ID from anchor output as --since-message-id) -->`;
|
|
70290
|
+
}
|
|
70291
|
+
function getEntryPointProofOfCompletionVerificationBlock(params = {}) {
|
|
70292
|
+
return `${getProofOfVerificationComment(params)}
|
|
70293
|
+
${PROOF_OF_VERIFICATION_CHECKBOX}
|
|
70294
|
+
${getVerifierReviewDisclosureBlock(params)}`;
|
|
70295
|
+
}
|
|
70296
|
+
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;
|
|
70297
|
+
var init_proof_of_verification = __esm(() => {
|
|
70298
|
+
init_verifier_handoff_templates();
|
|
70299
|
+
VERIFIER_REVIEW_VALUES = `${VERIFIER_VERDICTS.join(" | ")} | UNAVAILABLE (<reason>) | not required (no code changes)`;
|
|
70184
70300
|
});
|
|
70185
|
-
|
|
70186
70301
|
// ../../services/backend/prompts/cli/get-next-task/reminder.ts
|
|
70187
70302
|
function getNextTaskReminder() {
|
|
70188
70303
|
return "A foreground `get-next-task` blocks until the user or team message is ready, then resolves with that message as a chatroom task—treat the message content as the source of truth for what to do. Message availability requires exactly one such blocking tool call; the harness delivers chatroom tasks only while it blocks. Duplicate or backgrounded listeners can acknowledge tasks early and trigger grace-period cooldowns where your active session receives nothing.";
|
|
@@ -70200,7 +70315,9 @@ Exactly one active waiter should own task delivery at a time. Additional or back
|
|
|
70200
70315
|
|
|
70201
70316
|
After interruption or restart: complete any in-progress work, then restore a single foreground blocking \`get-next-task\` so chatroom tasks can arrive again.`;
|
|
70202
70317
|
}
|
|
70203
|
-
var init_reminder = () => {
|
|
70318
|
+
var init_reminder = __esm(() => {
|
|
70319
|
+
init_proof_of_verification();
|
|
70320
|
+
});
|
|
70204
70321
|
// ../../services/backend/prompts/utils/index.ts
|
|
70205
70322
|
var init_utils = __esm(() => {
|
|
70206
70323
|
init_env();
|
|
@@ -70234,7 +70351,7 @@ function getNextTaskCommand(params) {
|
|
|
70234
70351
|
const role = params.role || "<role>";
|
|
70235
70352
|
return `${prefix}chatroom get-next-task --chatroom-id="${chatroomId}" --role="${role}"`;
|
|
70236
70353
|
}
|
|
70237
|
-
var
|
|
70354
|
+
var init_command2 = () => {};
|
|
70238
70355
|
|
|
70239
70356
|
// src/commands/get-next-task/session.ts
|
|
70240
70357
|
class GetNextTaskSession {
|
|
@@ -70476,9 +70593,9 @@ To reconnect, run:`);
|
|
|
70476
70593
|
} catch (deliveryError) {
|
|
70477
70594
|
this.logAndExit(1, "task_delivery_failed", `⚠️ TASK CLAIMED BUT DELIVERY FAILED — ${sanitizeUnknownForTerminal(deliveryError.message)}`, `Task ID: ${task._id}
|
|
70478
70595
|
` + `The task has been claimed for your role.
|
|
70479
|
-
` + `Use
|
|
70596
|
+
` + `Use messages download to see your current task:
|
|
70480
70597
|
|
|
70481
|
-
` + ` ${this.cliEnvPrefix} chatroom
|
|
70598
|
+
` + ` ${this.cliEnvPrefix} chatroom messages download --chatroom-id=${this.chatroomId} --role=${this.role} --format=linear --limit=10`);
|
|
70482
70599
|
}
|
|
70483
70600
|
}
|
|
70484
70601
|
registerSignalHandlers() {
|
|
@@ -70493,7 +70610,7 @@ To reconnect, run:`);
|
|
|
70493
70610
|
}
|
|
70494
70611
|
var init_session2 = __esm(() => {
|
|
70495
70612
|
init_errorCodes();
|
|
70496
|
-
|
|
70613
|
+
init_command2();
|
|
70497
70614
|
init_values();
|
|
70498
70615
|
init_api3();
|
|
70499
70616
|
init_client2();
|
|
@@ -71050,22 +71167,6 @@ function getHandoffRecipientVisibilityCallout(toRole) {
|
|
|
71050
71167
|
> Recipient visibility: the ${recipient} receives only the text inside your ${sendCommand} command${toRole.toLowerCase() === "user" ? ", plus any `notify-user` notices you sent earlier in this task" : ""}. It cannot see anything you write in this agent session${toRole.toLowerCase() === "user" ? " (including direct replies)" : ""}, or tool output. Put your complete deliverable in the handoff message.`;
|
|
71051
71168
|
}
|
|
71052
71169
|
|
|
71053
|
-
// ../../services/backend/prompts/cli/handoff/command.ts
|
|
71054
|
-
function handoffCommand(params) {
|
|
71055
|
-
const prefix = params.cliEnvPrefix || "";
|
|
71056
|
-
const chatroomId = params.chatroomId || "<chatroom-id>";
|
|
71057
|
-
const role = params.role || "<role>";
|
|
71058
|
-
const nextRole = params.nextRole || "<target>";
|
|
71059
|
-
const placeholder = params.messagePlaceholder ?? "[Your message here]";
|
|
71060
|
-
const commandPrefix = `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="${nextRole}"`;
|
|
71061
|
-
return formatStdinHeredocCommand(commandPrefix, HANDOFF_STDIN_DELIMITER, placeholder, {
|
|
71062
|
-
messageMarker: HANDOFF_MESSAGE_MARKER
|
|
71063
|
-
});
|
|
71064
|
-
}
|
|
71065
|
-
var init_command2 = __esm(() => {
|
|
71066
|
-
init_stdin_heredoc();
|
|
71067
|
-
});
|
|
71068
|
-
|
|
71069
71170
|
// ../../services/backend/prompts/utils/file-reference-guidance.ts
|
|
71070
71171
|
function getFileReferenceGuidanceComment() {
|
|
71071
71172
|
return `<!-- File references (clickable in workspace UI): use repo-relative paths with a file extension — e.g. \`apps/webapp/src/modules/chatroom/foo.ts\` or [apps/webapp/src/foo.ts](apps/webapp/src/foo.ts). Avoid absolute paths, file:// prefixes, and paths without / or extension. -->`;
|
|
@@ -71192,7 +71293,7 @@ ${handoffCommand({
|
|
|
71192
71293
|
\`\`\``;
|
|
71193
71294
|
}
|
|
71194
71295
|
var init_architect_handoff_templates = __esm(() => {
|
|
71195
|
-
|
|
71296
|
+
init_command();
|
|
71196
71297
|
});
|
|
71197
71298
|
|
|
71198
71299
|
// ../../services/backend/prompts/teams/duo/handoff-templates/architect-planner-code.ts
|
|
@@ -71356,7 +71457,15 @@ var init_architect = __esm(() => {
|
|
|
71356
71457
|
});
|
|
71357
71458
|
|
|
71358
71459
|
// ../../services/backend/prompts/utils/code-change-verification.ts
|
|
71359
|
-
var CODE_CHANGE_VERIFICATION_CONFIRMATION = "- [ ] I confirm that I have run typecheck and tests for the project (only required if code changes were made)";
|
|
71460
|
+
var CODE_CHANGE_VERIFICATION_CONFIRMATION = "- [ ] I confirm that I have run typecheck and tests for the project (only required if code changes were made)", BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION;
|
|
71461
|
+
var init_code_change_verification = __esm(() => {
|
|
71462
|
+
BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION = [
|
|
71463
|
+
"- [ ] I confirm that the lightweight checks (typecheck and lint) ran on the code I changed",
|
|
71464
|
+
"- [ ] I confirm that every verification kind the brief marked `required` ran, and I recorded its command and result below",
|
|
71465
|
+
"- [ ] I confirm that every verification kind the brief marked `not applicable` is recorded below with the brief's reason"
|
|
71466
|
+
].join(`
|
|
71467
|
+
`);
|
|
71468
|
+
});
|
|
71360
71469
|
|
|
71361
71470
|
// ../../services/backend/prompts/utils/delegation-disclosure.ts
|
|
71362
71471
|
function getDelegationBriefDisclosureComment(briefSourceRole) {
|
|
@@ -71456,7 +71565,70 @@ ${getRoleGuidanceDisclosureComment(params)}`;
|
|
|
71456
71565
|
var ROLE_GUIDANCE_DISCLOSURE_CHECKBOX = "- [ ] I confirm that I've read and followed the role guidance before starting any work";
|
|
71457
71566
|
var init_role_guidance_disclosure = () => {};
|
|
71458
71567
|
|
|
71568
|
+
// ../../services/backend/prompts/utils/verification-kinds.ts
|
|
71569
|
+
var VERIFICATION_KINDS;
|
|
71570
|
+
var init_verification_kinds = __esm(() => {
|
|
71571
|
+
VERIFICATION_KINDS = [
|
|
71572
|
+
{
|
|
71573
|
+
id: "typecheck",
|
|
71574
|
+
label: "typecheck",
|
|
71575
|
+
timingLabel: "Typecheck",
|
|
71576
|
+
lightweight: true,
|
|
71577
|
+
command: "pnpm turbo run typecheck --filter=<package>"
|
|
71578
|
+
},
|
|
71579
|
+
{
|
|
71580
|
+
id: "lint",
|
|
71581
|
+
label: "lint",
|
|
71582
|
+
timingLabel: "Lint",
|
|
71583
|
+
lightweight: true,
|
|
71584
|
+
command: "pnpm exec eslint <files in scope>"
|
|
71585
|
+
},
|
|
71586
|
+
{
|
|
71587
|
+
id: "unit",
|
|
71588
|
+
label: "unit tests",
|
|
71589
|
+
timingLabel: "Unit tests",
|
|
71590
|
+
lightweight: false,
|
|
71591
|
+
command: "pnpm --dir <workspace> exec vitest run <test files in scope>"
|
|
71592
|
+
},
|
|
71593
|
+
{
|
|
71594
|
+
id: "integration",
|
|
71595
|
+
label: "integration tests",
|
|
71596
|
+
timingLabel: "Integration tests",
|
|
71597
|
+
lightweight: false,
|
|
71598
|
+
command: "pnpm --dir <workspace> exec vitest run <integration specs in scope>",
|
|
71599
|
+
note: "The chatroom-cli suite is `pnpm --filter chatroom-cli test:integration`."
|
|
71600
|
+
},
|
|
71601
|
+
{
|
|
71602
|
+
id: "e2e",
|
|
71603
|
+
label: "e2e",
|
|
71604
|
+
timingLabel: "E2E",
|
|
71605
|
+
lightweight: false,
|
|
71606
|
+
command: "pnpm --dir apps/webapp exec playwright test --config=tests/e2e/playwright.config.ts <specs in scope> --project=chromium"
|
|
71607
|
+
}
|
|
71608
|
+
];
|
|
71609
|
+
});
|
|
71610
|
+
|
|
71459
71611
|
// ../../services/backend/prompts/teams/builder-handback-handoff-templates.ts
|
|
71612
|
+
function getVerificationKindResultLine(kind) {
|
|
71613
|
+
const outcomes = kind.lightweight ? "<ran: command → result>" : "<ran: command → result | not run: reason | not applicable: the brief's reason>";
|
|
71614
|
+
return `- \`${kind.label}\` — ${outcomes}`;
|
|
71615
|
+
}
|
|
71616
|
+
function getVerificationKindTimingLine(kind) {
|
|
71617
|
+
return kind.lightweight ? `- ${kind.timingLabel}: <duration>` : `- ${kind.timingLabel}: <duration | not run | not applicable>`;
|
|
71618
|
+
}
|
|
71619
|
+
function getTimingReportSection() {
|
|
71620
|
+
return `## Timing report
|
|
71621
|
+
<!-- REQUIRED. Record the wall-clock duration of each activity you performed, as m:ss or h:mm:ss. Measure with timestamps (for example \`date +%s\` before and after each step). Write \`not run\` for an activity you did not perform and \`not applicable\` when it does not apply to this brief. Do not omit a row. Typecheck and lint always run, so record their duration; if either cannot run, it is a blocker under \`## Blockers / questions\`, not a \`not run\` row. -->
|
|
71622
|
+
- Brief reading: <duration | not run>
|
|
71623
|
+
- Implementation (code and tests written): <duration | not run>
|
|
71624
|
+
${VERIFICATION_KINDS.map(getVerificationKindTimingLine).join(`
|
|
71625
|
+
`)}
|
|
71626
|
+
- Commits: <duration | not run>
|
|
71627
|
+
- Push and PR: <duration | not run | not applicable>
|
|
71628
|
+
- Other activities: <name — duration, one line each | not applicable>
|
|
71629
|
+
- Slowest activity and why: <one phrase>
|
|
71630
|
+
- Total: <duration>`;
|
|
71631
|
+
}
|
|
71460
71632
|
function getBuilderHandbackTemplate(query) {
|
|
71461
71633
|
const recipientRole = query.toRole;
|
|
71462
71634
|
return getBuilderHandbackBody({
|
|
@@ -71484,7 +71656,12 @@ ${getFileReferenceProofOfCompletionExample()}
|
|
|
71484
71656
|
<evidence the goal was met — list every file you modified; for each behavior the brief's \`## Test seams\` section names a seam for: the test name, the seam it calls, the failure output observed before the implementation, and the passing output after>
|
|
71485
71657
|
|
|
71486
71658
|
## Code Change Verification
|
|
71487
|
-
${
|
|
71659
|
+
${BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION}
|
|
71660
|
+
Record each kind below, in this order, with its command and result. Typecheck and lint always run: record their command and result only. If either cannot run, put the blocker under \`## Blockers / questions\` and do not write \`not run\` here. For every other kind, write \`not run: <reason>\` or \`not applicable: <the brief's reason>\`.
|
|
71661
|
+
${VERIFICATION_KINDS.map(getVerificationKindResultLine).join(`
|
|
71662
|
+
`)}
|
|
71663
|
+
|
|
71664
|
+
${getTimingReportSection()}
|
|
71488
71665
|
|
|
71489
71666
|
## Blockers / questions
|
|
71490
71667
|
${getHandoffNotApplicableSectionComment("List blockers")}
|
|
@@ -71496,8 +71673,10 @@ ${getHandoffNotApplicableSectionComment("List review notes")}
|
|
|
71496
71673
|
\`\`\``;
|
|
71497
71674
|
}
|
|
71498
71675
|
var init_builder_handback_handoff_templates = __esm(() => {
|
|
71676
|
+
init_code_change_verification();
|
|
71499
71677
|
init_handoff_quality_principles();
|
|
71500
71678
|
init_role_guidance_disclosure();
|
|
71679
|
+
init_verification_kinds();
|
|
71501
71680
|
});
|
|
71502
71681
|
|
|
71503
71682
|
// ../../services/backend/prompts/teams/duo/handoff-templates/builder-planner-code.ts
|
|
@@ -71738,7 +71917,7 @@ var PROOF_OF_PRINCIPLES_REPORT;
|
|
|
71738
71917
|
var init_game_asset_designer_handoff_templates = __esm(() => {
|
|
71739
71918
|
init_game_asset_designer_evidence();
|
|
71740
71919
|
init_game_asset_designer_workflow();
|
|
71741
|
-
|
|
71920
|
+
init_command();
|
|
71742
71921
|
PROOF_OF_PRINCIPLES_REPORT = GAME_ASSET_RULES.map((rule) => `- [ ] ${rule} — <evidence: command lines and output values; grid values when a sheet was generated; naming map reference when names came from a mapping>`).join(`
|
|
71743
71922
|
`);
|
|
71744
71923
|
});
|
|
@@ -71789,18 +71968,40 @@ var init_planner_architect_chat = __esm(() => {
|
|
|
71789
71968
|
});
|
|
71790
71969
|
|
|
71791
71970
|
// ../../services/backend/prompts/teams/builder-delegation-handoff-templates.ts
|
|
71792
|
-
function
|
|
71793
|
-
const
|
|
71794
|
-
const
|
|
71795
|
-
|
|
71796
|
-
|
|
71797
|
-
|
|
71798
|
-
|
|
71971
|
+
function getVerificationKindFlagLine(kind) {
|
|
71972
|
+
const choice = kind.lightweight ? "**required**. Lightweight: the builder always runs it, so never mark it `not applicable`." : "**required** or **not applicable: <reason>**.";
|
|
71973
|
+
const note = kind.note ? ` ${kind.note}` : "";
|
|
71974
|
+
return `- \`${kind.label}\` — ${choice} Command: \`${kind.command}\`${note}`;
|
|
71975
|
+
}
|
|
71976
|
+
function getScopeLines(batching) {
|
|
71977
|
+
const focused = "`focused` — each run covers only the test files and workspaces that touch this brief's files.";
|
|
71978
|
+
const roundFinal = batching ? "`round-final` — each run covers the full scope: the full unit suite and full integration suite of every workspace the round changed, typecheck and lint of those workspaces (`pnpm lint` for the whole repository), and every e2e spec the round affects." : "`round-final` — each run covers the full scope: the full unit suite and full integration suite of every workspace this brief changed, typecheck and lint of those workspaces (`pnpm lint` for the whole repository), and every e2e spec this brief affects.";
|
|
71979
|
+
return [
|
|
71980
|
+
"Scope: <`focused` | `round-final`> — replace the placeholder with this brief's scope and keep only that definition below.",
|
|
71981
|
+
`- ${focused}`,
|
|
71982
|
+
`- ${roundFinal}`
|
|
71983
|
+
];
|
|
71984
|
+
}
|
|
71985
|
+
function getVerificationFlagsSection(batching) {
|
|
71986
|
+
return [
|
|
71987
|
+
"## Verification flags",
|
|
71988
|
+
"Mark each kind `required` or `not applicable: <reason>`. The builder runs every `required` kind with the command shown, always runs typecheck and lint, and records each `not applicable` kind in its hand-back.",
|
|
71989
|
+
...getScopeLines(batching),
|
|
71990
|
+
...VERIFICATION_KINDS.map(getVerificationKindFlagLine),
|
|
71991
|
+
WORKSPACE_PROSE_LINE,
|
|
71799
71992
|
"",
|
|
71800
71993
|
""
|
|
71801
71994
|
].join(`
|
|
71802
|
-
`)
|
|
71803
|
-
|
|
71995
|
+
`);
|
|
71996
|
+
}
|
|
71997
|
+
function getBatchingFragments(batching) {
|
|
71998
|
+
const roundGuidance = batching ? "A builder round trip is slow — implement, commit, verify. Group phases when one verification pass covers them, and land a risky or contract-changing phase alone. You decide the grouping. In the brief body, set the `## Verification flags` scope to `round-final` for the round's final brief and `focused` for the others." : "Keep one slice ≈ one focused review surface. Delegate slices incrementally — one at a time, not all at once. In the brief body, set the `## Verification flags` scope to `focused` for each slice and to `round-final` for the final slice, which runs the full pass once.";
|
|
71999
|
+
const endToEndRequirement = batching ? "- Name at least one end-to-end evidence for the feature on the round's final brief: a CLI run, an API call, a UI action, or the template render. Earlier briefs need focused evidence only; the round as a whole must be end-to-end verified. When the brief marks `e2e` `not applicable`, the Requirements must name which of these alternatives is the end-to-end evidence." : "- Name at least one end-to-end evidence that the feature works: a CLI run, an API call, a UI action, or the template render. Unit tests alone are insufficient for new features. When the brief marks `e2e` `not applicable`, the Requirements must name which of these alternatives is the end-to-end evidence.";
|
|
72000
|
+
return {
|
|
72001
|
+
roundGuidance,
|
|
72002
|
+
endToEndRequirement,
|
|
72003
|
+
verificationFlagsSection: getVerificationFlagsSection(batching)
|
|
72004
|
+
};
|
|
71804
72005
|
}
|
|
71805
72006
|
function getBuilderDelegationBriefTemplate(options) {
|
|
71806
72007
|
const { delegatorRole, gatesOwner, batching = false } = options;
|
|
@@ -71811,7 +72012,7 @@ function getBuilderDelegationBriefTemplate(options) {
|
|
|
71811
72012
|
**Division of labor:** For backend contract, API, or schema/persistence changes, the architect designs first and you delegate only after its design returns. You (${delegatorRole}) own slicing and sequencing of builder work. The UI/UX engineer owns UI/UX design. Include its target markup, classes, styles, and screen and flow drawings in UI implementation briefs; the builder implements the components.` : `**Before you delegate:** the \`${gatesOwner}\` clears research, triage, architecture, UI/UX, and asset gates before work reaches you. If a slice depends on a fact, design decision, or bug diagnosis that the work package does not settle, hand back to \`${gatesOwner}\` with the open question instead of guessing. Do not hand off to \`researcher\`, \`triage\`, \`architect\`, or any other specialist yourself.
|
|
71812
72013
|
|
|
71813
72014
|
**Division of labor:** You (${delegatorRole}) own turning the work package into file-level builder slices and sequencing them. Copy any UI/UX target markup, classes, styles, and drawings from the work package into UI implementation briefs; the builder implements the components.`;
|
|
71814
|
-
const { roundGuidance, endToEndRequirement,
|
|
72015
|
+
const { roundGuidance, endToEndRequirement, verificationFlagsSection } = getBatchingFragments(batching);
|
|
71815
72016
|
return `${getDelegationBriefIntro()}
|
|
71816
72017
|
|
|
71817
72018
|
${prelude}
|
|
@@ -71879,7 +72080,7 @@ ${endToEndRequirement}
|
|
|
71879
72080
|
- or: no test seam — <reason>
|
|
71880
72081
|
- For each named seam: write a failing test first, then make it pass (red-green). If the seam is \`no test seam\`, delete this line.
|
|
71881
72082
|
|
|
71882
|
-
${
|
|
72083
|
+
${verificationFlagsSection}## What to avoid
|
|
71883
72084
|
- <anti-patterns, recurring mistakes, or scope creep for this slice — be explicit>
|
|
71884
72085
|
- Do not test private methods or mock internal collaborators. A test that breaks on refactor while behavior is unchanged is wrong.
|
|
71885
72086
|
- Do not derive expected values by re-running the code's own formula. Take them from a known-good literal, a worked example, or the spec.
|
|
@@ -71893,7 +72094,10 @@ ${verificationScopeSection}## What to avoid
|
|
|
71893
72094
|
|
|
71894
72095
|
\`\`\`\``;
|
|
71895
72096
|
}
|
|
71896
|
-
var
|
|
72097
|
+
var WORKSPACE_PROSE_LINE = "`<workspace>` is a directory: `services/backend`, `apps/webapp`, `packages/cli`, or `packages/shared`. `--filter` takes the package name: `@workspace/backend`, `@workspace/webapp`, `chatroom-cli`, or `@workspace/shared`.";
|
|
72098
|
+
var init_builder_delegation_handoff_templates = __esm(() => {
|
|
72099
|
+
init_verification_kinds();
|
|
72100
|
+
});
|
|
71897
72101
|
|
|
71898
72102
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-builder-code.ts
|
|
71899
72103
|
function getPlannerBuilderCodeTemplate(_query) {
|
|
@@ -71982,7 +72186,7 @@ ${handoffCommand({
|
|
|
71982
72186
|
\`\`\``;
|
|
71983
72187
|
}
|
|
71984
72188
|
var init_product_manager_handoff_templates = __esm(() => {
|
|
71985
|
-
|
|
72189
|
+
init_command();
|
|
71986
72190
|
});
|
|
71987
72191
|
|
|
71988
72192
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-product-manager-code.ts
|
|
@@ -72067,7 +72271,7 @@ ${handoffCommand({
|
|
|
72067
72271
|
\`\`\``;
|
|
72068
72272
|
}
|
|
72069
72273
|
var init_researcher_handoff_templates = __esm(() => {
|
|
72070
|
-
|
|
72274
|
+
init_command();
|
|
72071
72275
|
});
|
|
72072
72276
|
|
|
72073
72277
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-researcher-code.ts
|
|
@@ -72155,7 +72359,7 @@ ${handoffCommand({
|
|
|
72155
72359
|
\`\`\``;
|
|
72156
72360
|
}
|
|
72157
72361
|
var init_reviewer_handoff_templates = __esm(() => {
|
|
72158
|
-
|
|
72362
|
+
init_command();
|
|
72159
72363
|
});
|
|
72160
72364
|
|
|
72161
72365
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-reviewer-code.ts
|
|
@@ -72226,7 +72430,7 @@ ${handoffCommand({
|
|
|
72226
72430
|
\`\`\``;
|
|
72227
72431
|
}
|
|
72228
72432
|
var init_triage_handoff_templates = __esm(() => {
|
|
72229
|
-
|
|
72433
|
+
init_command();
|
|
72230
72434
|
});
|
|
72231
72435
|
|
|
72232
72436
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-triage-code.ts
|
|
@@ -72370,7 +72574,7 @@ ${handoffCommand({
|
|
|
72370
72574
|
\`\`\``;
|
|
72371
72575
|
}
|
|
72372
72576
|
var init_uiux_engineer_handoff_templates = __esm(() => {
|
|
72373
|
-
|
|
72577
|
+
init_command();
|
|
72374
72578
|
});
|
|
72375
72579
|
|
|
72376
72580
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-uiux-engineer-code.ts
|
|
@@ -72397,18 +72601,6 @@ function getChatToUserHandoffTemplate() {
|
|
|
72397
72601
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-user-chat.ts
|
|
72398
72602
|
var init_planner_user_chat = () => {};
|
|
72399
72603
|
|
|
72400
|
-
// ../../services/backend/prompts/utils/context-disclosure.ts
|
|
72401
|
-
function getContextReadDisclosureComment(params = {}) {
|
|
72402
|
-
const command = contextReadCommand(params);
|
|
72403
|
-
return `<!-- Read context before handoff if not already done this task: \`${command}\`. State the context goal and confirm it was achieved. -->`;
|
|
72404
|
-
}
|
|
72405
|
-
function getContextReadDisclosureBlock(params = {}) {
|
|
72406
|
-
return `${CONTEXT_READ_DISCLOSURE_CHECKBOX}
|
|
72407
|
-
${getContextReadDisclosureComment(params)}`;
|
|
72408
|
-
}
|
|
72409
|
-
var CONTEXT_READ_DISCLOSURE_CHECKBOX = "- [ ] I confirm that I read the current chatroom task context using the command below and that the goal stated in that context has been met";
|
|
72410
|
-
var init_context_disclosure = () => {};
|
|
72411
|
-
|
|
72412
72604
|
// ../../services/backend/prompts/utils/handoff-severity-guidance.ts
|
|
72413
72605
|
function getHandoffSeverityGuidanceBlock() {
|
|
72414
72606
|
return `<!-- Severity: prefix each Tech Debt and Unresolved Decision bullet with [high], [medium], or [low] -->
|
|
@@ -72417,144 +72609,6 @@ function getHandoffSeverityGuidanceBlock() {
|
|
|
72417
72609
|
- [low] <minor cleanup — nice to have>`;
|
|
72418
72610
|
}
|
|
72419
72611
|
|
|
72420
|
-
// ../../services/backend/prompts/teams/verifier-handoff-templates.ts
|
|
72421
|
-
function getEntryPointToVerifierHandoffTemplate(query) {
|
|
72422
|
-
const entryPoint = query.fromRole;
|
|
72423
|
-
return `Instructions (not part of the message): 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}\`.
|
|
72424
|
-
|
|
72425
|
-
## Round
|
|
72426
|
-
<1 or 2; for 2, cite the round-1 verdict message id>
|
|
72427
|
-
|
|
72428
|
-
## Mode
|
|
72429
|
-
<chat | code>
|
|
72430
|
-
|
|
72431
|
-
## User message id
|
|
72432
|
-
<id of the user's last message: the origin message id of the user task, or from \`chatroom messages anchor\`>
|
|
72433
|
-
|
|
72434
|
-
## Context id
|
|
72435
|
-
<id from \`chatroom context read\`, or \`none\` if no context was read for this task>
|
|
72436
|
-
|
|
72437
|
-
## Requested test runs
|
|
72438
|
-
<the test commands the user explicitly asked for, one per line, or exactly \`None requested.\`>
|
|
72439
|
-
|
|
72440
|
-
## Claimed outcome
|
|
72441
|
-
<requirement-by-requirement what you believe is complete>
|
|
72442
|
-
|
|
72443
|
-
## Evidence pointers
|
|
72444
|
-
<builder handoff message ids, commits, PRs, and test results as quoted in those handoffs>
|
|
72445
|
-
|
|
72446
|
-
## Known gaps
|
|
72447
|
-
<anything incomplete, or exactly \`None.\`>
|
|
72448
|
-
|
|
72449
|
-
Instructions after the body (not part of the message): run the normal handoff command to \`${entryPoint}\` with the complete body above, then stop.
|
|
72450
|
-
|
|
72451
|
-
\`\`\`bash
|
|
72452
|
-
${handoffCommand({
|
|
72453
|
-
chatroomId: "<chatroom-id>",
|
|
72454
|
-
role: entryPoint,
|
|
72455
|
-
nextRole: "verifier",
|
|
72456
|
-
cliEnvPrefix: ""
|
|
72457
|
-
})}
|
|
72458
|
-
\`\`\``;
|
|
72459
|
-
}
|
|
72460
|
-
function getVerifierToEntryPointHandoffTemplate(query) {
|
|
72461
|
-
const entryPoint = query.toRole;
|
|
72462
|
-
return `Instructions (not part of the message): 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.
|
|
72463
|
-
|
|
72464
|
-
## Verdict
|
|
72465
|
-
<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)>
|
|
72466
|
-
|
|
72467
|
-
## Objective
|
|
72468
|
-
<user message id, any prior user messages used, objective in 1-2 sentences>
|
|
72469
|
-
|
|
72470
|
-
## Requirements
|
|
72471
|
-
<numbered \`R1 — <requirement> — met | unmet | unverified — <evidence ref>\`>
|
|
72472
|
-
|
|
72473
|
-
## User Expectations
|
|
72474
|
-
<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>
|
|
72475
|
-
|
|
72476
|
-
## Evidence
|
|
72477
|
-
<bullets: \`<message id or handoff> — "<short quote>" — supports R#\`; for a requested test run, \`<command> — exit <result> — supports R#\`>
|
|
72478
|
-
|
|
72479
|
-
## Missing or unmet
|
|
72480
|
-
<per unmet or unverified requirement or user expectation: what is missing and what evidence would resolve it; exactly \`None.\` if ${ACHIEVED}>
|
|
72481
|
-
|
|
72482
|
-
## Scope and limits
|
|
72483
|
-
<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>
|
|
72484
|
-
|
|
72485
|
-
Instructions after the body (not part of the message): run the normal handoff command to \`${entryPoint}\` with the complete body above, then stop.
|
|
72486
|
-
|
|
72487
|
-
\`\`\`bash
|
|
72488
|
-
${handoffCommand({
|
|
72489
|
-
chatroomId: "<chatroom-id>",
|
|
72490
|
-
role: "verifier",
|
|
72491
|
-
nextRole: entryPoint,
|
|
72492
|
-
cliEnvPrefix: ""
|
|
72493
|
-
})}
|
|
72494
|
-
\`\`\``;
|
|
72495
|
-
}
|
|
72496
|
-
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;
|
|
72497
|
-
var init_verifier_handoff_templates = __esm(() => {
|
|
72498
|
-
init_command2();
|
|
72499
|
-
VERIFIER_VERDICTS = ["ACHIEVED", "NOT_ACHIEVED", "INCONCLUSIVE"];
|
|
72500
|
-
[ACHIEVED, NOT_ACHIEVED, INCONCLUSIVE] = VERIFIER_VERDICTS;
|
|
72501
|
-
});
|
|
72502
|
-
|
|
72503
|
-
// ../../services/backend/prompts/utils/proof-of-verification.ts
|
|
72504
|
-
function messagesAnchorCommand(params = {}) {
|
|
72505
|
-
const prefix = params.cliEnvPrefix ?? "";
|
|
72506
|
-
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
72507
|
-
const role = params.role ?? "<role>";
|
|
72508
|
-
return `${prefix}chatroom messages anchor --chatroom-id="${chatroomId}" --role="${role}"`;
|
|
72509
|
-
}
|
|
72510
|
-
function messagesDownloadSinceCommand(params = {}) {
|
|
72511
|
-
const prefix = params.cliEnvPrefix ?? "";
|
|
72512
|
-
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
72513
|
-
const role = params.role ?? "<role>";
|
|
72514
|
-
const sinceMessageId = params.sinceMessageId ?? "<id>";
|
|
72515
|
-
const limit = params.limit ?? 100;
|
|
72516
|
-
return `${prefix}chatroom messages download --chatroom-id="${chatroomId}" --role="${role}" --since-message-id="${sinceMessageId}" --limit=${limit}`;
|
|
72517
|
-
}
|
|
72518
|
-
function verifierRequestCommand(params = {}) {
|
|
72519
|
-
const prefix = params.cliEnvPrefix ?? "";
|
|
72520
|
-
const chatroomId = params.chatroomId ?? "<chatroom-id>";
|
|
72521
|
-
const role = params.role ?? "<role>";
|
|
72522
|
-
return `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="verifier"`;
|
|
72523
|
-
}
|
|
72524
|
-
function getVerifierReviewDisclosureBlock(params = {}) {
|
|
72525
|
-
return `**Proof of verification (verifier review):**
|
|
72526
|
-
${VERIFIER_REVIEW_CHECKBOX}
|
|
72527
|
-
- Verifier review: <${VERIFIER_REVIEW_VALUES}>
|
|
72528
|
-
- Verifier request command (disclose the command you sent): \`${verifierRequestCommand(params)}\`
|
|
72529
|
-
- Verifier request message id: <id of your verifier handoff> · Round: <1 | 2>
|
|
72530
|
-
- Verdict message id: <id of the verifier's verdict handoff> · Verdict user message id: <id> (must equal the current last user message)
|
|
72531
|
-
- Verdict gaps (only if not ACHIEVED): <each unmet item, or \`None.\`>`;
|
|
72532
|
-
}
|
|
72533
|
-
function getProofOfVerificationComment(params = {}) {
|
|
72534
|
-
const anchorCmd = messagesAnchorCommand(params);
|
|
72535
|
-
const downloadCmd = messagesDownloadSinceCommand({
|
|
72536
|
-
...params,
|
|
72537
|
-
sinceMessageId: "<from-anchor>",
|
|
72538
|
-
limit: 100
|
|
72539
|
-
});
|
|
72540
|
-
return `<!-- Entry-point proof-of-completion workflow — run before filling this section:
|
|
72541
|
-
1. \`${anchorCmd}\` — locate the user's last message (and prior user messages for context)
|
|
72542
|
-
2. \`${downloadCmd}\` — download grep-friendly history since anchor; read handoffs and goals
|
|
72543
|
-
3. If the user's last message was terse (e.g. "do it", "raise a PR"), review prior user messages from anchor output and widen --limit before validating
|
|
72544
|
-
4. Validate commits/PRs against ALL requirements — not just the last slice. Incomplete → rework; do NOT hand off to user.
|
|
72545
|
-
Then: \`${anchorCmd}\` → \`${downloadCmd}\` (use the message ID from anchor output as --since-message-id) -->`;
|
|
72546
|
-
}
|
|
72547
|
-
function getEntryPointProofOfCompletionVerificationBlock(params = {}) {
|
|
72548
|
-
return `${getProofOfVerificationComment(params)}
|
|
72549
|
-
${PROOF_OF_VERIFICATION_CHECKBOX}
|
|
72550
|
-
${getVerifierReviewDisclosureBlock(params)}`;
|
|
72551
|
-
}
|
|
72552
|
-
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;
|
|
72553
|
-
var init_proof_of_verification = __esm(() => {
|
|
72554
|
-
init_verifier_handoff_templates();
|
|
72555
|
-
VERIFIER_REVIEW_VALUES = `${VERIFIER_VERDICTS.join(" | ")} | UNAVAILABLE (<reason>) | not required (no code changes)`;
|
|
72556
|
-
});
|
|
72557
|
-
|
|
72558
72612
|
// ../../services/backend/prompts/utils/unresolved-decisions.ts
|
|
72559
72613
|
function getUnresolvedDecisionsSectionBlock() {
|
|
72560
72614
|
return `## Unresolved Decisions
|
|
@@ -72566,7 +72620,7 @@ ${getHandoffSeverityGuidanceBlock()}
|
|
|
72566
72620
|
var init_unresolved_decisions = () => {};
|
|
72567
72621
|
|
|
72568
72622
|
// ../../services/backend/prompts/utils/handoff-report-template-body.ts
|
|
72569
|
-
function getHandoffReportTemplateBody(roleGuidanceContext
|
|
72623
|
+
function getHandoffReportTemplateBody(roleGuidanceContext) {
|
|
72570
72624
|
return `<handoff-overview>
|
|
72571
72625
|
<!-- When the task is informational (summaries, feedback, Q&A with no code changes): put the complete primary answer in Summary and What changed. Do not rely on earlier \`notify-user\` notices or session text. -->
|
|
72572
72626
|
## Summary
|
|
@@ -72591,16 +72645,12 @@ ${getHandoffNotApplicableSectionComment("List planning steps for trivial single-
|
|
|
72591
72645
|
${getHandoffQualityPrinciplesSectionBlock()}
|
|
72592
72646
|
|
|
72593
72647
|
## Proof of Completion
|
|
72594
|
-
${
|
|
72595
|
-
${getContextReadDisclosureBlock(roleGuidanceContext)}
|
|
72596
|
-
- Context goal: <state the context goal and confirm it was achieved>
|
|
72648
|
+
${getEntryPointProofOfCompletionVerificationBlock(roleGuidanceContext)}
|
|
72597
72649
|
- Requirements (one bullet per user requirement from the user's message — met/not met + evidence):
|
|
72598
72650
|
- <requirement> — <PR URL, commit hash, or file evidence>
|
|
72599
72651
|
- Files changed (code tasks — list every file modified):
|
|
72600
72652
|
${getFileReferenceProofOfCompletionExample()}
|
|
72601
|
-
- <additional files as needed
|
|
72602
|
-
${getFileReferenceProofOfCompletionExample()}
|
|
72603
|
-
<evidence the goal was met — list every file you (or the builder) modified>`}
|
|
72653
|
+
- <additional files as needed>
|
|
72604
72654
|
## Backlog Tasks Implemented
|
|
72605
72655
|
${getHandoffNotApplicableSectionComment("List backlog items addressed if none were in scope")}
|
|
72606
72656
|
- \`backlog-item-id\` — <backlog item title/summary and how this work addresses it>
|
|
@@ -72651,7 +72701,7 @@ ${getHandoffNotApplicableSectionComment("List manual steps outside the system")}
|
|
|
72651
72701
|
</handoff-action>`;
|
|
72652
72702
|
}
|
|
72653
72703
|
var init_handoff_report_template_body = __esm(() => {
|
|
72654
|
-
|
|
72704
|
+
init_code_change_verification();
|
|
72655
72705
|
init_handoff_quality_principles();
|
|
72656
72706
|
init_proof_of_verification();
|
|
72657
72707
|
init_role_guidance_disclosure();
|
|
@@ -72663,7 +72713,7 @@ function getPlannerUserCodeTemplate(roleGuidanceContext) {
|
|
|
72663
72713
|
return `${getHandoffReportTemplateIntro()}
|
|
72664
72714
|
|
|
72665
72715
|
\`\`\`markdown
|
|
72666
|
-
${getHandoffReportTemplateBody(roleGuidanceContext
|
|
72716
|
+
${getHandoffReportTemplateBody(roleGuidanceContext)}
|
|
72667
72717
|
\`\`\``;
|
|
72668
72718
|
}
|
|
72669
72719
|
var init_planner_user_code = __esm(() => {
|
|
@@ -73130,7 +73180,7 @@ function getSoloUserCodeTemplate(roleGuidanceContext) {
|
|
|
73130
73180
|
return `${getHandoffReportTemplateIntro()}
|
|
73131
73181
|
|
|
73132
73182
|
\`\`\`markdown
|
|
73133
|
-
${getHandoffReportTemplateBody(roleGuidanceContext
|
|
73183
|
+
${getHandoffReportTemplateBody(roleGuidanceContext)}
|
|
73134
73184
|
\`\`\``;
|
|
73135
73185
|
}
|
|
73136
73186
|
var init_solo_user_code = __esm(() => {
|
|
@@ -73572,7 +73622,7 @@ function getCoordinatorUserCodeTemplate(roleGuidanceContext) {
|
|
|
73572
73622
|
return `${getHandoffReportTemplateIntro()}
|
|
73573
73623
|
|
|
73574
73624
|
\`\`\`markdown
|
|
73575
|
-
${getHandoffReportTemplateBody(roleGuidanceContext
|
|
73625
|
+
${getHandoffReportTemplateBody(roleGuidanceContext)}
|
|
73576
73626
|
\`\`\``;
|
|
73577
73627
|
}
|
|
73578
73628
|
var init_coordinator_user_code = __esm(() => {
|
|
@@ -73917,6 +73967,7 @@ ${getHandoffNotApplicableSectionComment("List review notes")}
|
|
|
73917
73967
|
\`\`\``;
|
|
73918
73968
|
}
|
|
73919
73969
|
var init_specifier_coordinator_code = __esm(() => {
|
|
73970
|
+
init_code_change_verification();
|
|
73920
73971
|
init_handoff_quality_principles();
|
|
73921
73972
|
init_role_guidance_disclosure();
|
|
73922
73973
|
init_unresolved_decisions();
|
|
@@ -74192,7 +74243,7 @@ function viewHandoffTemplate(params) {
|
|
|
74192
74243
|
}
|
|
74193
74244
|
return template;
|
|
74194
74245
|
}
|
|
74195
|
-
var
|
|
74246
|
+
var init_view_template = __esm(() => {
|
|
74196
74247
|
init_handoff_templates4();
|
|
74197
74248
|
init_pair();
|
|
74198
74249
|
});
|
|
@@ -74210,8 +74261,8 @@ function printHandoffViewTemplate(options) {
|
|
|
74210
74261
|
process.exit(1);
|
|
74211
74262
|
}
|
|
74212
74263
|
}
|
|
74213
|
-
var
|
|
74214
|
-
|
|
74264
|
+
var init_view_template2 = __esm(() => {
|
|
74265
|
+
init_view_template();
|
|
74215
74266
|
});
|
|
74216
74267
|
|
|
74217
74268
|
// ../../services/backend/prompts/cli/handoff-templates/list-templates.ts
|
|
@@ -74245,7 +74296,7 @@ function listHandoffTemplatesCommand(params) {
|
|
|
74245
74296
|
var init_list_templates = __esm(() => {
|
|
74246
74297
|
init_handoff_templates4();
|
|
74247
74298
|
init_pair();
|
|
74248
|
-
|
|
74299
|
+
init_command();
|
|
74249
74300
|
});
|
|
74250
74301
|
|
|
74251
74302
|
// src/commands/handoff/list-templates.ts
|
|
@@ -74559,9 +74610,9 @@ var init_command5 = __esm(() => {
|
|
|
74559
74610
|
// ../../services/backend/prompts/sections/commands-reference.ts
|
|
74560
74611
|
var init_commands_reference = __esm(() => {
|
|
74561
74612
|
init_general_knowledge();
|
|
74562
|
-
init_command();
|
|
74563
|
-
init_reminder();
|
|
74564
74613
|
init_command2();
|
|
74614
|
+
init_reminder();
|
|
74615
|
+
init_command();
|
|
74565
74616
|
init_command5();
|
|
74566
74617
|
init_utils();
|
|
74567
74618
|
});
|
|
@@ -74854,16 +74905,16 @@ var init_verifier4 = __esm(() => {
|
|
|
74854
74905
|
[ACHIEVED2, NOT_ACHIEVED2, INCONCLUSIVE2] = VERIFIER_VERDICTS;
|
|
74855
74906
|
VERIFIER_GUIDANCE = `## Verifier Operating Model
|
|
74856
74907
|
|
|
74857
|
-
You are the verifier. Your main job is to check whether the user's goal was accomplished, judged from chatroom logs. You are advisory and read-only: do not edit files, implement code, run builds or linters,
|
|
74908
|
+
You are the verifier. Your main job is to check whether the user's goal was accomplished, judged from chatroom logs. You are advisory and read-only: do not edit files, implement code, run builds or linters, or act as the planner or builder. The one exception is test execution: it ${VERIFIER_TEST_RULE}.
|
|
74858
74909
|
|
|
74859
74910
|
${"{SESSION_CONTINUITY}"}
|
|
74860
74911
|
|
|
74861
74912
|
${getInterRoleHandoffRule()}
|
|
74862
74913
|
|
|
74863
|
-
1. Read the injected verification request: round, mode, user message id,
|
|
74864
|
-
2. Recover the objective from the logs. Run \`chatroom messages anchor --chatroom-id="<chatroom-id>" --role="verifier"\`, then \`chatroom messages download --chatroom-id="<chatroom-id>" --role="verifier" --since-message-id=<user message id> --limit=100\`. If the download is truncated, raise \`--limit\` and download again until the range is complete. If the anchor id differs from the request's user message id, use the request's id and report the mismatch. For terse follow-ups, recover intent from the prior user messages the anchor lists.
|
|
74914
|
+
1. Read the injected verification request: round, mode, user message id, Log message ids, requested test runs, claimed outcome, evidence pointers, and known gaps. The claimed outcome is a claim to be checked, never evidence.
|
|
74915
|
+
2. Recover the objective from the logs. Run \`chatroom messages anchor --chatroom-id="<chatroom-id>" --role="verifier"\`, then \`chatroom messages download --chatroom-id="<chatroom-id>" --role="verifier" --since-message-id=<user message id> --limit=100\`. If an id under Log message ids falls before the user message id, download from that id instead. If the download is truncated, raise \`--limit\` and download again until the range is complete. If the anchor id differs from the request's user message id, use the request's id and report the mismatch. For terse follow-ups, recover intent from the prior user messages the anchor lists.
|
|
74865
74916
|
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.
|
|
74866
|
-
3.
|
|
74917
|
+
3. Read every message listed under the request's Log message ids from the downloaded range, and confirm each one is present. If a listed id is missing, the log is incomplete: download again from that id, then name any id still missing under Scope and limits. A claim that rests only on a missing message is \`unverified\`, never \`met\`.
|
|
74867
74918
|
4. Decompose the objective into numbered requirements R1..Rn. Split compound requests and ignore anything the user did not actually ask for.
|
|
74868
74919
|
4a. User expectations: the user's handoff template defines what the user expects from the work. In a code mode, turn each applicable item that concerns the work into a user expectation: 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.
|
|
74869
74920
|
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.
|
|
@@ -75009,15 +75060,12 @@ var init_system_prompt = __esm(() => {
|
|
|
75009
75060
|
});
|
|
75010
75061
|
|
|
75011
75062
|
// ../../services/backend/prompts/native/task-started-content.ts
|
|
75012
|
-
var init_task_started_content =
|
|
75013
|
-
init_new();
|
|
75014
|
-
});
|
|
75063
|
+
var init_task_started_content = () => {};
|
|
75015
75064
|
|
|
75016
75065
|
// ../../services/backend/prompts/sections/classification-guide.ts
|
|
75017
75066
|
var init_classification_guide = __esm(() => {
|
|
75018
75067
|
init_cli();
|
|
75019
75068
|
init_task_started_content();
|
|
75020
|
-
init_utils();
|
|
75021
75069
|
});
|
|
75022
75070
|
|
|
75023
75071
|
// ../../services/backend/prompts/sections/getting-started.ts
|
|
@@ -75030,7 +75078,7 @@ var init_handoff_options = () => {};
|
|
|
75030
75078
|
|
|
75031
75079
|
// ../../services/backend/prompts/sections/next-step.ts
|
|
75032
75080
|
var init_next_step = __esm(() => {
|
|
75033
|
-
|
|
75081
|
+
init_command2();
|
|
75034
75082
|
init_utils();
|
|
75035
75083
|
});
|
|
75036
75084
|
|
|
@@ -75056,7 +75104,7 @@ function generateHandoffOutput(params) {
|
|
|
75056
75104
|
`);
|
|
75057
75105
|
}
|
|
75058
75106
|
var init_generator = __esm(() => {
|
|
75059
|
-
|
|
75107
|
+
init_command2();
|
|
75060
75108
|
init_reminder();
|
|
75061
75109
|
init_handoff_templates4();
|
|
75062
75110
|
init_system_prompt();
|
|
@@ -75912,7 +75960,7 @@ var init_plan_template = __esm(() => {
|
|
|
75912
75960
|
function viewPlanTemplate(params = {}) {
|
|
75913
75961
|
return getPlanTemplate(params);
|
|
75914
75962
|
}
|
|
75915
|
-
var
|
|
75963
|
+
var init_view_template3 = __esm(() => {
|
|
75916
75964
|
init_plan_template();
|
|
75917
75965
|
});
|
|
75918
75966
|
|
|
@@ -75924,8 +75972,8 @@ __export(exports_view_template2, {
|
|
|
75924
75972
|
function printPlanViewTemplate(options = {}) {
|
|
75925
75973
|
console.log(viewPlanTemplate({ nativeIntegration: true, cliEnvPrefix: options.cliEnvPrefix }));
|
|
75926
75974
|
}
|
|
75927
|
-
var
|
|
75928
|
-
|
|
75975
|
+
var init_view_template4 = __esm(() => {
|
|
75976
|
+
init_view_template3();
|
|
75929
75977
|
});
|
|
75930
75978
|
|
|
75931
75979
|
// ../../services/backend/src/domain/plan/parse-plan.ts
|
|
@@ -77834,12 +77882,6 @@ var init_render_delivery_attachments = __esm(() => {
|
|
|
77834
77882
|
});
|
|
77835
77883
|
|
|
77836
77884
|
// src/commands/task/read/render.ts
|
|
77837
|
-
function detectBacklogDivergence(contextContent, attachedIds) {
|
|
77838
|
-
if (!contextContent || attachedIds.length === 0) {
|
|
77839
|
-
return [];
|
|
77840
|
-
}
|
|
77841
|
-
return attachedIds.filter((id) => !contextContent.includes(id));
|
|
77842
|
-
}
|
|
77843
77885
|
function renderAttachments(input, chatroomId, role) {
|
|
77844
77886
|
return renderDeliveryAttachmentsBlock({
|
|
77845
77887
|
attachedBacklogItems: input.attachedBacklogItems,
|
|
@@ -77848,56 +77890,15 @@ function renderAttachments(input, chatroomId, role) {
|
|
|
77848
77890
|
attachedMessages: input.attachedMessages
|
|
77849
77891
|
}, { chatroomId, role, mode: "task-read" });
|
|
77850
77892
|
}
|
|
77851
|
-
function renderDivergenceWarnings(input) {
|
|
77852
|
-
const ctx = input.context;
|
|
77853
|
-
if (!ctx || !input.attachedBacklogItems || input.attachedBacklogItems.length === 0)
|
|
77854
|
-
return [];
|
|
77855
|
-
const attachedIds = input.attachedBacklogItems.map((i3) => i3._id);
|
|
77856
|
-
const divergentIds = detectBacklogDivergence(ctx.content, attachedIds);
|
|
77857
|
-
return divergentIds.map((id) => `⚠ Backlog ${id} diverges from context — confirm scope.`);
|
|
77858
|
-
}
|
|
77859
|
-
function renderStalenessNotice(elapsedHours) {
|
|
77860
|
-
if (elapsedHours < 4)
|
|
77861
|
-
return [];
|
|
77862
|
-
const ageLabel = elapsedHours >= 48 ? `${Math.round(elapsedHours / 24)}d old` : `${elapsedHours}h old`;
|
|
77863
|
-
return [
|
|
77864
|
-
`<system-notice>`,
|
|
77865
|
-
`⚠️ Context is ${ageLabel}.`,
|
|
77866
|
-
` Entry point role will update when needed.`,
|
|
77867
|
-
`</system-notice>`
|
|
77868
|
-
];
|
|
77869
|
-
}
|
|
77870
|
-
function renderContextSection(input, chatroomId, role) {
|
|
77871
|
-
const ctx = input.context;
|
|
77872
|
-
if (!ctx)
|
|
77873
|
-
return [];
|
|
77874
|
-
const lines = [
|
|
77875
|
-
"",
|
|
77876
|
-
"Background context (may be stale)",
|
|
77877
|
-
"<context>",
|
|
77878
|
-
ctx.content,
|
|
77879
|
-
"</context>"
|
|
77880
|
-
];
|
|
77881
|
-
if (ctx.triggerMessageContent) {
|
|
77882
|
-
lines.push(`(Trigger: chatroom context read --chatroom-id="${chatroomId}" --role="${role}")`);
|
|
77883
|
-
}
|
|
77884
|
-
lines.push(...renderStalenessNotice(ctx.elapsedHours));
|
|
77885
|
-
return lines;
|
|
77886
|
-
}
|
|
77887
77893
|
function renderTaskPrompt(input) {
|
|
77888
77894
|
const { taskId, status, content, chatroomId, role } = input;
|
|
77889
77895
|
const lines = [];
|
|
77890
77896
|
lines.push(`✅ Task content:`);
|
|
77891
77897
|
lines.push(` Task ID: ${taskId}`);
|
|
77892
77898
|
lines.push(` Status: ${status}`);
|
|
77893
|
-
if (input.context) {
|
|
77894
|
-
lines.push("On conflict, message wins over background context.");
|
|
77895
|
-
}
|
|
77896
|
-
lines.push(...renderDivergenceWarnings(input));
|
|
77897
77899
|
lines.push(`
|
|
77898
77900
|
${content}`);
|
|
77899
77901
|
lines.push(...renderAttachments(input, chatroomId, role));
|
|
77900
|
-
lines.push(...renderContextSection(input, chatroomId, role));
|
|
77901
77902
|
return lines.join(`
|
|
77902
77903
|
`);
|
|
77903
77904
|
}
|
|
@@ -77938,7 +77939,6 @@ function buildTaskPromptFromReadResult(result3, chatroomId, role) {
|
|
|
77938
77939
|
content: result3.content,
|
|
77939
77940
|
chatroomId,
|
|
77940
77941
|
role,
|
|
77941
|
-
context: result3.context && typeof result3.context === "object" ? result3.context : undefined,
|
|
77942
77942
|
attachedBacklogItems: Array.isArray(result3.attachedBacklogItems) ? result3.attachedBacklogItems : undefined,
|
|
77943
77943
|
attachedSnippets: Array.isArray(result3.attachedSnippets) ? result3.attachedSnippets : undefined,
|
|
77944
77944
|
attachedTasks: Array.isArray(result3.attachedTasks) ? result3.attachedTasks : undefined,
|
|
@@ -86187,28 +86187,11 @@ var init_messages = __esm(() => {
|
|
|
86187
86187
|
init_anchor();
|
|
86188
86188
|
});
|
|
86189
86189
|
|
|
86190
|
-
// src/commands/context/format-new-context-error.ts
|
|
86191
|
-
function formatNewContextError(cause) {
|
|
86192
|
-
const message = getErrorMessage(cause);
|
|
86193
|
-
if (message.includes("triggerMessageId") && message.includes("chatroom_messages")) {
|
|
86194
|
-
return `${message}
|
|
86195
|
-
${TRIGGER_MESSAGE_ID_HINT}`;
|
|
86196
|
-
}
|
|
86197
|
-
return message;
|
|
86198
|
-
}
|
|
86199
|
-
var TRIGGER_MESSAGE_ID_HINT = " hint: --trigger-message-id must be the origin-message-id attribute on the <task> tag, not task-id. Use the pre-filled value from the task intake command when provided.";
|
|
86200
|
-
var init_format_new_context_error = __esm(() => {
|
|
86201
|
-
init_convex_error();
|
|
86202
|
-
});
|
|
86203
|
-
|
|
86204
86190
|
// src/commands/context/index.ts
|
|
86205
86191
|
var exports_context = {};
|
|
86206
86192
|
__export(exports_context, {
|
|
86207
|
-
viewTemplate: () => viewTemplate,
|
|
86208
86193
|
readContextEffect: () => readContextEffect,
|
|
86209
86194
|
readContext: () => readContext,
|
|
86210
|
-
newContextEffect: () => newContextEffect,
|
|
86211
|
-
newContext: () => newContext,
|
|
86212
86195
|
listContextsEffect: () => listContextsEffect,
|
|
86213
86196
|
listContexts: () => listContexts,
|
|
86214
86197
|
inspectContextEffect: () => inspectContextEffect,
|
|
@@ -86237,15 +86220,9 @@ function handleContextError(err2) {
|
|
|
86237
86220
|
} else if (err2._tag === "InvalidChatroomId") {
|
|
86238
86221
|
console.error(`❌ Invalid chatroom ID format: ID must be 20-40 characters (got ${err2.id?.length || 0})`);
|
|
86239
86222
|
process.exit(1);
|
|
86240
|
-
} else if (err2._tag === "EmptyContent") {
|
|
86241
|
-
console.error(`❌ Context content cannot be empty`);
|
|
86242
|
-
process.exit(1);
|
|
86243
86223
|
} else if (err2._tag === "ReadContextFailed") {
|
|
86244
86224
|
console.error(`❌ Failed to read context: ${sanitizeUnknownForTerminal(err2.cause.message)}`);
|
|
86245
86225
|
process.exit(1);
|
|
86246
|
-
} else if (err2._tag === "NewContextFailed") {
|
|
86247
|
-
console.error(`❌ Failed to create context: ${formatNewContextError(err2.cause)}`);
|
|
86248
|
-
process.exit(1);
|
|
86249
86226
|
} else if (err2._tag === "ListContextsFailed") {
|
|
86250
86227
|
console.error(`❌ Failed to list contexts: ${sanitizeUnknownForTerminal(err2.cause.message)}`);
|
|
86251
86228
|
process.exit(1);
|
|
@@ -86260,19 +86237,11 @@ async function readContext(chatroomId, options, deps) {
|
|
|
86260
86237
|
const layer = commandServicesLayerFromDeps(d);
|
|
86261
86238
|
await exports_Effect.runPromise(readContextEffect(chatroomId, options).pipe(exports_Effect.catch((err2) => handleContextError(err2)), exports_Effect.provide(layer)));
|
|
86262
86239
|
}
|
|
86263
|
-
async function newContext(chatroomId, options, deps) {
|
|
86264
|
-
const d = deps ?? await createDefaultDeps18();
|
|
86265
|
-
const layer = commandServicesLayerFromDeps(d);
|
|
86266
|
-
await exports_Effect.runPromise(newContextEffect(chatroomId, options).pipe(exports_Effect.catch((err2) => handleContextError(err2)), exports_Effect.provide(layer)));
|
|
86267
|
-
}
|
|
86268
86240
|
async function listContexts(chatroomId, options, deps) {
|
|
86269
86241
|
const d = deps ?? await createDefaultDeps18();
|
|
86270
86242
|
const layer = commandServicesLayerFromDeps(d);
|
|
86271
86243
|
await exports_Effect.runPromise(listContextsEffect(chatroomId, options).pipe(exports_Effect.catch((err2) => handleContextError(err2)), exports_Effect.provide(layer)));
|
|
86272
86244
|
}
|
|
86273
|
-
function viewTemplate() {
|
|
86274
|
-
return getContextViewTemplate();
|
|
86275
|
-
}
|
|
86276
86245
|
async function inspectContext(chatroomId, options, deps) {
|
|
86277
86246
|
const d = deps ?? await createDefaultDeps18();
|
|
86278
86247
|
const layer = commandServicesLayerFromDeps(d);
|
|
@@ -86338,29 +86307,6 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
86338
86307
|
` + "═".repeat(60));
|
|
86339
86308
|
console.log("</context>");
|
|
86340
86309
|
});
|
|
86341
|
-
}), newContextEffect = (chatroomId, options) => exports_Effect.gen(function* () {
|
|
86342
|
-
const backend2 = yield* BackendService;
|
|
86343
|
-
const sessionId = yield* requireAuthenticatedChatroom(chatroomId);
|
|
86344
|
-
if (!options.content || options.content.trim().length === 0) {
|
|
86345
|
-
return yield* exports_Effect.fail({ _tag: "EmptyContent" });
|
|
86346
|
-
}
|
|
86347
|
-
const contextId = yield* backend2.mutation(api.contexts.createContext, {
|
|
86348
|
-
sessionId,
|
|
86349
|
-
chatroomId,
|
|
86350
|
-
content: options.content,
|
|
86351
|
-
role: options.role,
|
|
86352
|
-
triggerMessageId: options.triggerMessageId
|
|
86353
|
-
}).pipe(exports_Effect.catch((cause) => exports_Effect.fail({
|
|
86354
|
-
_tag: "NewContextFailed",
|
|
86355
|
-
cause
|
|
86356
|
-
})));
|
|
86357
|
-
yield* exports_Effect.sync(() => {
|
|
86358
|
-
console.log(`✅ Context created successfully`);
|
|
86359
|
-
console.log(` Context ID: ${contextId}`);
|
|
86360
|
-
console.log(` Created by: ${options.role}`);
|
|
86361
|
-
console.log(`
|
|
86362
|
-
\uD83D\uDCCC This context is now pinned for all agents in this chatroom.`);
|
|
86363
|
-
});
|
|
86364
86310
|
}), listContextsEffect = (chatroomId, options) => exports_Effect.gen(function* () {
|
|
86365
86311
|
const backend2 = yield* BackendService;
|
|
86366
86312
|
const sessionId = yield* requireSessionIdEffect(() => ({
|
|
@@ -86382,9 +86328,6 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
86382
86328
|
if (contexts.length === 0) {
|
|
86383
86329
|
console.log(`
|
|
86384
86330
|
\uD83D\uDCED No contexts found for this chatroom`);
|
|
86385
|
-
console.log(`
|
|
86386
|
-
\uD83D\uDCA1 Create a context with:`);
|
|
86387
|
-
console.log(` chatroom context new --chatroom-id=${chatroomId} --role=${options.role} --content="Your context summary"`);
|
|
86388
86331
|
return;
|
|
86389
86332
|
}
|
|
86390
86333
|
console.log(`
|
|
@@ -86429,31 +86372,18 @@ var readContextEffect = (chatroomId, options) => exports_Effect.gen(function* ()
|
|
|
86429
86372
|
console.log(`
|
|
86430
86373
|
\uD83D\uDCCA Staleness:`);
|
|
86431
86374
|
console.log(` Time elapsed: ${context3.elapsedHours.toFixed(1)} hours`);
|
|
86432
|
-
if (context3.elapsedHours >= 24) {
|
|
86433
|
-
console.log(`
|
|
86434
|
-
⚠️ This context is over 24 hours old.`);
|
|
86435
|
-
console.log(` Consider creating a new context with an updated summary.`);
|
|
86436
|
-
} else if (context3.elapsedHours >= 4) {
|
|
86437
|
-
console.log(`
|
|
86438
|
-
⚠️ This context is over 4 hours old.`);
|
|
86439
|
-
console.log(` Consider refreshing if the focus has shifted.`);
|
|
86440
|
-
}
|
|
86441
86375
|
console.log(`
|
|
86442
86376
|
\uD83D\uDCDD Content:`);
|
|
86443
86377
|
console.log("─".repeat(60));
|
|
86444
86378
|
console.log(sanitizeForTerminal(context3.content));
|
|
86445
86379
|
console.log("─".repeat(60));
|
|
86446
86380
|
console.log(`
|
|
86447
|
-
\uD83D\uDCA1 To create a new context:`);
|
|
86448
|
-
console.log(` chatroom context new --chatroom-id=${chatroomId} --role=${options.role} --content="Your updated summary"`);
|
|
86449
|
-
console.log(`
|
|
86450
86381
|
` + "═".repeat(60));
|
|
86451
86382
|
});
|
|
86452
86383
|
});
|
|
86453
86384
|
var init_context = __esm(() => {
|
|
86454
86385
|
init_serialize_message();
|
|
86455
86386
|
init_dist();
|
|
86456
|
-
init_format_new_context_error();
|
|
86457
86387
|
init_api3();
|
|
86458
86388
|
init_create_convex_command_deps();
|
|
86459
86389
|
init_services();
|
|
@@ -123156,7 +123086,7 @@ teamCommand.command("set").description("Set the team preset for a chatroom").req
|
|
|
123156
123086
|
});
|
|
123157
123087
|
handoffCommandGroup.command("view-template").description("Print the handoff template for one sender → recipient pair in one conversation mode (requires --from, --to, and --mode)").option("--from <role>", "Sending role (the role that runs the handoff)").option("--to <role>", "Receiving role (the --next-role of the handoff)").option("--mode <mode>", "Conversation mode: chat | code (required)").option("--team-id <teamId>", "Team id (solo, duo, trio); defaults to duo").action(async function(options) {
|
|
123158
123088
|
const parentOpts = this.parent?.opts() ?? {};
|
|
123159
|
-
const { printHandoffViewTemplate: printHandoffViewTemplate2 } = await Promise.resolve().then(() => (
|
|
123089
|
+
const { printHandoffViewTemplate: printHandoffViewTemplate2 } = await Promise.resolve().then(() => (init_view_template2(), exports_view_template));
|
|
123160
123090
|
printHandoffViewTemplate2({
|
|
123161
123091
|
from: options.from,
|
|
123162
123092
|
to: options.to,
|
|
@@ -123242,7 +123172,7 @@ program2.command("notify-user").description("Send the user an update while you k
|
|
|
123242
123172
|
});
|
|
123243
123173
|
var planCommand = program2.command("plan").description("Publish and read agent-authored phased plans");
|
|
123244
123174
|
planCommand.command("view-template").description("Print the plan template (static; no chatroom required)").option("--chatroom-id <id>", "Ignored (accepted for copy-paste compatibility)").option("--role <role>", "Ignored (accepted for copy-paste compatibility)").action(async () => {
|
|
123245
|
-
const { printPlanViewTemplate: printPlanViewTemplate2 } = await Promise.resolve().then(() => (
|
|
123175
|
+
const { printPlanViewTemplate: printPlanViewTemplate2 } = await Promise.resolve().then(() => (init_view_template4(), exports_view_template2));
|
|
123246
123176
|
printPlanViewTemplate2();
|
|
123247
123177
|
});
|
|
123248
123178
|
planCommand.command("publish").description("Publish a phased plan message (reads markdown from stdin)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--supersedes <planId>", "Plan message id this plan replaces").action(async (options) => {
|
|
@@ -123514,39 +123444,12 @@ messagesCommand.command("download").description("Download chatroom message histo
|
|
|
123514
123444
|
sinceMessageId: options.sinceMessageId
|
|
123515
123445
|
});
|
|
123516
123446
|
});
|
|
123517
|
-
var contextCommand = program2.command("context").description("
|
|
123447
|
+
var contextCommand = program2.command("context").description("Read and inspect chatroom context (read-only)");
|
|
123518
123448
|
contextCommand.command("read").description("Read context for your role (conversation history, tasks, status)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (options) => {
|
|
123519
123449
|
await maybeRequireAuth();
|
|
123520
123450
|
const { readContext: readContext2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
123521
123451
|
await readContext2(options.chatroomId, options);
|
|
123522
123452
|
});
|
|
123523
|
-
contextCommand.command("new").description("Create a new context and pin it for all agents").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role (creator of the context)").option("--content <content>", "Context summary/description (alternative: provide via stdin/heredoc)").option("--trigger-message-id <messageId>", "Message ID that triggered this context (anchors the context window)").action(async (options) => {
|
|
123524
|
-
await maybeRequireAuth();
|
|
123525
|
-
let content;
|
|
123526
|
-
if (options.content && options.content.trim().length > 0) {
|
|
123527
|
-
content = options.content.trim();
|
|
123528
|
-
} else {
|
|
123529
|
-
const stdinContent = await readStdin();
|
|
123530
|
-
const { CONTEXT_STDIN_DELIMITER: CONTEXT_STDIN_DELIMITER2, validateStdinHeredocBody: validateStdinHeredocBody2 } = await Promise.resolve().then(() => (init_stdin_heredoc(), exports_stdin_heredoc));
|
|
123531
|
-
if (!stdinContent.trim()) {
|
|
123532
|
-
console.error("❌ Context content cannot be empty.");
|
|
123533
|
-
console.error(' Provide content via --content="..." or stdin (heredoc):');
|
|
123534
|
-
console.error(" chatroom context new --chatroom-id=<id> --role=<role> << 'CHATROOM_CONTEXT_END'");
|
|
123535
|
-
console.error(" Your context summary here");
|
|
123536
|
-
console.error(" CHATROOM_CONTEXT_END");
|
|
123537
|
-
process.exit(1);
|
|
123538
|
-
}
|
|
123539
|
-
try {
|
|
123540
|
-
validateStdinHeredocBody2(stdinContent, CONTEXT_STDIN_DELIMITER2, "Context");
|
|
123541
|
-
} catch (err2) {
|
|
123542
|
-
console.error(`❌ ${err2.message}`);
|
|
123543
|
-
process.exit(1);
|
|
123544
|
-
}
|
|
123545
|
-
content = stdinContent.trim();
|
|
123546
|
-
}
|
|
123547
|
-
const { newContext: newContext2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
123548
|
-
await newContext2(options.chatroomId, { ...options, content });
|
|
123549
|
-
});
|
|
123550
123453
|
contextCommand.command("list").description("List recent contexts for a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--limit <n>", "Maximum number of contexts to show (default: 10)").action(async (options) => {
|
|
123551
123454
|
await maybeRequireAuth();
|
|
123552
123455
|
const { listContexts: listContexts2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
@@ -123560,10 +123463,6 @@ contextCommand.command("inspect").description("View a specific context with stal
|
|
|
123560
123463
|
const { inspectContext: inspectContext2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
123561
123464
|
await inspectContext2(options.chatroomId, options);
|
|
123562
123465
|
});
|
|
123563
|
-
contextCommand.command("view-template").description("Print a template for `chatroom context new` content.").option("--chatroom-id <id>", "Ignored (accepted for copy-paste compatibility)").option("--role <role>", "Ignored (accepted for copy-paste compatibility)").action(async () => {
|
|
123564
|
-
const { viewTemplate: viewTemplate2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
123565
|
-
console.log(viewTemplate2());
|
|
123566
|
-
});
|
|
123567
123466
|
var guidelinesCommand = program2.command("guidelines").description("View review guidelines by type");
|
|
123568
123467
|
guidelinesCommand.command("view").description("View guidelines for a specific review type").requiredOption("--type <type>", "Guideline type (coding|security|design|performance|all)").action(async (options) => {
|
|
123569
123468
|
await maybeRequireAuth();
|
|
@@ -123667,4 +123566,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
123667
123566
|
});
|
|
123668
123567
|
program2.parse();
|
|
123669
123568
|
|
|
123670
|
-
//# debugId=
|
|
123569
|
+
//# debugId=410059F0D2D328F464756E2164756E21
|