@rallycry/conveyor-agent 10.13.14 → 10.13.15

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.
@@ -965,15 +965,6 @@ var AgentConnection = class _AgentConnection {
965
965
  updateStatus(status) {
966
966
  this.emitStatus(status);
967
967
  }
968
- emitCodeReviewResult(content, approved) {
969
- if (!this.socket) return;
970
- void this.call("submitCodeReviewResult", {
971
- sessionId: this.config.sessionId,
972
- content,
973
- approved
974
- }).catch(() => {
975
- });
976
- }
977
968
  /**
978
969
  * The session's key hit a hard usage cap — ask the server to stamp it
979
970
  * limited and hand back the best remaining key's credential env (or a
@@ -2049,9 +2040,10 @@ var SubmitCodeReviewResultRequestSchema = z3.object({
2049
2040
  sessionId: z3.string(),
2050
2041
  approved: z3.boolean(),
2051
2042
  content: z3.string(),
2052
- // Canonical risk derived by the reviewer (approve low; changes max issue
2053
- // severity). Applied raise-only server-side; never lowers an explicit value.
2054
- risk: riskLevelSchema.optional(),
2043
+ // Canonical risk level the reviewer assigned to this change. Required on every
2044
+ // verdict — the reviewer must judge it. Applied authoritatively server-side
2045
+ // (may raise OR lower an already-set value; the reviewer has that authority).
2046
+ risk: riskLevelSchema,
2055
2047
  // The commit SHA the reviewer actually reviewed. When present, the verdict is
2056
2048
  // rejected unless the task is still at this SHA (guards against a late
2057
2049
  // old-SHA verdict overwriting a newer review cycle).
@@ -2432,6 +2424,7 @@ var ListMyLiveSessionsRequestSchema = z4.object({
2432
2424
  var ListProjectSessionGroupsRequestSchema = z4.object({
2433
2425
  projectId: z4.string()
2434
2426
  });
2427
+ var ListMyLiveSessionsAcrossProjectsRequestSchema = z4.object({});
2435
2428
  var GetProjectAvailableTuisRequestSchema = z4.object({
2436
2429
  projectId: z4.string()
2437
2430
  });
@@ -6529,6 +6522,14 @@ function buildReviewPrompt(context) {
6529
6522
  `- Explain what's wrong and suggest fixes`,
6530
6523
  `- Focus on substantive issues, not style nitpicks (linting handles that)`,
6531
6524
  ``,
6525
+ `#### Risk level (required on BOTH tools):`,
6526
+ `Every verdict MUST include a \`risk\` level \u2014 judge it by the surface area the change touches:`,
6527
+ `- \`critical\`: touches critical/foundational surface (auth, billing, data integrity, migrations)`,
6528
+ `- \`high\`: touches important surface with broad blast radius`,
6529
+ `- \`medium\`: moderate, contained surface area`,
6530
+ `- \`low\`: small or isolated change`,
6531
+ `The task may already have a risk level set. If your review makes you disagree with it, set the level you believe is correct \u2014 you have the authority to override it in either direction.`,
6532
+ ``,
6532
6533
  `### Previous Review Feedback`,
6533
6534
  `If previous review feedback is present in the chat history, verify those specific issues were addressed before raising new concerns.`,
6534
6535
  ``,
@@ -8279,20 +8280,18 @@ async function endReviewSession(connection, reason) {
8279
8280
  reason
8280
8281
  });
8281
8282
  }
8282
- function riskFromIssues(issues) {
8283
- if (issues.some((i) => i.severity === "critical")) return "critical";
8284
- if (issues.some((i) => i.severity === "major")) return "high";
8285
- return "medium";
8286
- }
8283
+ var RISK_LEVELS2 = ["critical", "high", "medium", "low"];
8284
+ var riskDescription = "REQUIRED. The risk level this change carries, judged by the surface area it touches: critical = touches critical/foundational surface, high = important surface, medium = moderate, low = small/isolated. Set this on every verdict. You have authority to override a risk level already set on the task if you disagree with it.";
8287
8285
  function buildCodeReviewTools(connection) {
8288
8286
  return [
8289
8287
  defineTool(
8290
8288
  "approve_code_review",
8291
- "Approve the code review and exit. Use when the diff passes all review criteria. Takes only a summary \u2014 for changes, use request_code_changes with a structured issues[] list.",
8289
+ "Approve the code review and exit. Use when the diff passes all review criteria. Requires a summary and a risk level \u2014 for changes, use request_code_changes with a structured issues[] list.",
8292
8290
  {
8293
- summary: z14.string().describe("Brief summary of what was reviewed and why it looks good")
8291
+ summary: z14.string().describe("Brief summary of what was reviewed and why it looks good"),
8292
+ risk: z14.enum(RISK_LEVELS2).describe(riskDescription)
8294
8293
  },
8295
- async ({ summary }) => {
8294
+ async ({ summary, risk }) => {
8296
8295
  const content = `**Code Review: Approved** :white_check_mark:
8297
8296
 
8298
8297
  ${summary}`;
@@ -8300,7 +8299,7 @@ ${summary}`;
8300
8299
  sessionId: connection.sessionId,
8301
8300
  approved: true,
8302
8301
  content,
8303
- risk: "low"
8302
+ risk
8304
8303
  });
8305
8304
  connection.sendEvent({
8306
8305
  type: "code_review_complete",
@@ -8323,9 +8322,10 @@ ${summary}`;
8323
8322
  description: z14.string().describe("What is wrong and how to fix it")
8324
8323
  })
8325
8324
  ).describe("List of issues found during review"),
8326
- summary: z14.string().describe("Brief overall summary of the review findings")
8325
+ summary: z14.string().describe("Brief overall summary of the review findings"),
8326
+ risk: z14.enum(RISK_LEVELS2).describe(riskDescription)
8327
8327
  },
8328
- async ({ issues, summary }) => {
8328
+ async ({ issues, summary, risk }) => {
8329
8329
  const issueLines = issues.map((issue) => {
8330
8330
  const loc = issue.line ? `:${issue.line}` : "";
8331
8331
  return `- **[${issue.severity}]** \`${issue.file}${loc}\`: ${issue.description}`;
@@ -8339,7 +8339,7 @@ ${issueLines}`;
8339
8339
  sessionId: connection.sessionId,
8340
8340
  approved: false,
8341
8341
  content,
8342
- risk: riskFromIssues(issues)
8342
+ risk
8343
8343
  });
8344
8344
  connection.sendEvent({
8345
8345
  type: "code_review_complete",
@@ -11853,4 +11853,4 @@ export {
11853
11853
  loadConveyorConfig,
11854
11854
  unshallowRepo
11855
11855
  };
11856
- //# sourceMappingURL=chunk-J4UH5TOO.js.map
11856
+ //# sourceMappingURL=chunk-SAHOFQBQ.js.map