halfcycle 0.5.2 → 0.5.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/cli.js CHANGED
@@ -414,15 +414,15 @@ function readReviewPart(raw) {
414
414
  const name = raw["name"];
415
415
  const built = raw["built"];
416
416
  const decidable = raw["decidable"];
417
- const awaitingAnswer2 = raw["awaitingAnswer"];
417
+ const awaitingAnswer = raw["awaitingAnswer"];
418
418
  const sentBack = raw["sentBack"];
419
419
  if (!isNonEmptyString(part) || !isNonEmptyString(name))
420
420
  return null;
421
421
  if (typeof built !== "boolean" || typeof decidable !== "boolean")
422
422
  return null;
423
- if (typeof awaitingAnswer2 !== "boolean" || typeof sentBack !== "boolean")
423
+ if (typeof awaitingAnswer !== "boolean" || typeof sentBack !== "boolean")
424
424
  return null;
425
- return { part, name, built, decidable, awaitingAnswer: awaitingAnswer2, sentBack };
425
+ return { part, name, built, decidable, awaitingAnswer, sentBack };
426
426
  }
427
427
  function isPlainObject(value) {
428
428
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -4503,6 +4503,30 @@ var phaseReviewViewSchema = z20.discriminatedUnion("state", [
4503
4503
  phaseReviewOpenSchema,
4504
4504
  phaseReviewClosedSchema
4505
4505
  ]);
4506
+ function reviewPartAwaitingAnswer(part) {
4507
+ return part.questions.some((q) => q.agentAnswer === void 0);
4508
+ }
4509
+ function reviewPartSentBackIn(part, round) {
4510
+ return part.sentBack.some((s) => s.round === round);
4511
+ }
4512
+ function shownReviewEntryOf(view, shownAt) {
4513
+ const parts = view.parts.map((p) => ({
4514
+ part: p.part,
4515
+ name: p.name,
4516
+ built: p.built,
4517
+ decidable: p.decidable,
4518
+ awaitingAnswer: reviewPartAwaitingAnswer(p),
4519
+ sentBack: reviewPartSentBackIn(p, view.round)
4520
+ }));
4521
+ return {
4522
+ phase: view.phase,
4523
+ number: view.number,
4524
+ round: view.round,
4525
+ reviewVersion: view.reviewVersion,
4526
+ shownAt,
4527
+ parts
4528
+ };
4529
+ }
4506
4530
 
4507
4531
  // ../events/dist/build-record-v3.js
4508
4532
  var BUILD_RECORD_V3_FORMAT = "halfcycle-build-record/v3";
@@ -5146,8 +5170,35 @@ function ownerWaitClosedLineOf(item, question2) {
5146
5170
  }
5147
5171
  var OWNER_WAIT_DECLARATIONS_READ_FAILED = "Halfcycle could not read the decisions that waited for you.";
5148
5172
 
5149
- // ../events/dist/pacing.js
5173
+ // ../events/dist/owner-wait-answer.js
5150
5174
  import { z as z32 } from "zod";
5175
+ var ownerWaitShortIdSchema = z32.string().regex(/^[0-9a-f]{8}$/);
5176
+ var OWNER_WAIT_ANSWER_ACTS = ["approve", "decline"];
5177
+ var ownerWaitAnswerActSchema = z32.enum(OWNER_WAIT_ANSWER_ACTS);
5178
+ var ownerWaitChatRequestSchema = z32.discriminatedUnion("act", [
5179
+ z32.object({ act: z32.literal("approve"), wait: ownerWaitShortIdSchema }).strict(),
5180
+ z32.object({ act: z32.literal("decline"), wait: ownerWaitShortIdSchema, note: scopeNoteWireSchema }).strict()
5181
+ ]);
5182
+ function bareOutcome3(outcome) {
5183
+ return z32.object({ outcome: z32.literal(outcome) }).strict();
5184
+ }
5185
+ var ownerWaitChatResultSchema = z32.discriminatedUnion("outcome", [
5186
+ z32.object({
5187
+ outcome: z32.literal("recorded"),
5188
+ act: ownerWaitAnswerActSchema,
5189
+ question: z32.string().min(1)
5190
+ }).strict(),
5191
+ z32.object({ outcome: z32.literal("refused"), problems: z32.array(systemDescriptionProblemSchema).min(1) }).strict(),
5192
+ bareOutcome3("not-owner"),
5193
+ bareOutcome3("no-owner"),
5194
+ bareOutcome3("not-found"),
5195
+ bareOutcome3("ambiguous"),
5196
+ bareOutcome3("not-offered"),
5197
+ bareOutcome3("unavailable")
5198
+ ]);
5199
+
5200
+ // ../events/dist/pacing.js
5201
+ import { z as z33 } from "zod";
5151
5202
  var CLAUDE_PLANS = Object.freeze([
5152
5203
  Object.freeze({ id: "pro", words: "Pro", startingAgents: 2 }),
5153
5204
  Object.freeze({ id: "max-5x", words: "Max (5\xD7)", startingAgents: 4 }),
@@ -5158,7 +5209,7 @@ var CLAUDE_PLANS = Object.freeze([
5158
5209
  Object.freeze({ id: "not-sure", words: "Not sure", startingAgents: 2 })
5159
5210
  ]);
5160
5211
  var CLAUDE_PLAN_IDS = Object.freeze(CLAUDE_PLANS.map((plan) => plan.id));
5161
- var claudePlanSchema = z32.enum(CLAUDE_PLAN_IDS);
5212
+ var claudePlanSchema = z33.enum(CLAUDE_PLAN_IDS);
5162
5213
  var CLAUDE_PLAN_UNKNOWN = "not-sure";
5163
5214
  function claudePlanOf(id) {
5164
5215
  return CLAUDE_PLANS.find((plan) => plan.id === id) ?? CLAUDE_PLANS.find((plan) => plan.id === CLAUDE_PLAN_UNKNOWN) ?? CLAUDE_PLANS[0];
@@ -5167,21 +5218,21 @@ function claudePlanKnown(id) {
5167
5218
  return id !== null && id !== CLAUDE_PLAN_UNKNOWN;
5168
5219
  }
5169
5220
  var CLAUDE_PLAN_SET_IN = ["setup", "console"];
5170
- var claudePlanSetInSchema = z32.enum(CLAUDE_PLAN_SET_IN);
5221
+ var claudePlanSetInSchema = z33.enum(CLAUDE_PLAN_SET_IN);
5171
5222
  var KEEP_FREE_PERCENTS = [0, 20];
5172
- var keepFreePercentSchema = z32.union([z32.literal(KEEP_FREE_PERCENTS[0]), z32.literal(KEEP_FREE_PERCENTS[1])]);
5223
+ var keepFreePercentSchema = z33.union([z33.literal(KEEP_FREE_PERCENTS[0]), z33.literal(KEEP_FREE_PERCENTS[1])]);
5173
5224
  var PACE_AGENTS_MAX = 20;
5174
5225
  var PACE_WINDOW_KINDS = ["five-hour", "seven-day"];
5175
- var paceWindowKindSchema = z32.enum(PACE_WINDOW_KINDS);
5226
+ var paceWindowKindSchema = z33.enum(PACE_WINDOW_KINDS);
5176
5227
  var PACE_WINDOW_WORDS = Object.freeze({
5177
5228
  "five-hour": "5-hour window",
5178
5229
  "seven-day": "weekly window"
5179
5230
  });
5180
5231
  var PACE_STATES = ["full", "slowing", "holding"];
5181
- var paceStateSchema = z32.enum(PACE_STATES);
5182
- var claudePlanRequestSchema = z32.object({ claudePlan: claudePlanSchema }).strict();
5183
- var keepFreeRequestSchema = z32.object({ keepFreePercent: keepFreePercentSchema }).strict();
5184
- var pacingSettingsSchema = z32.object({
5232
+ var paceStateSchema = z33.enum(PACE_STATES);
5233
+ var claudePlanRequestSchema = z33.object({ claudePlan: claudePlanSchema }).strict();
5234
+ var keepFreeRequestSchema = z33.object({ keepFreePercent: keepFreePercentSchema }).strict();
5235
+ var pacingSettingsSchema = z33.object({
5185
5236
  claudePlan: claudePlanSchema.nullable(),
5186
5237
  claudePlanSetIn: claudePlanSetInSchema.nullable(),
5187
5238
  keepFreePercent: keepFreePercentSchema
@@ -5189,43 +5240,43 @@ var pacingSettingsSchema = z32.object({
5189
5240
  message: "a plan says where it was given, and only a plan does",
5190
5241
  path: ["claudePlanSetIn"]
5191
5242
  });
5192
- var pacingBasisTaskSchema = z32.object({
5243
+ var pacingBasisTaskSchema = z33.object({
5193
5244
  id: buildTaskIdSchema,
5194
- dependsOn: z32.array(buildTaskIdSchema).max(BUILD_SNAPSHOT_TASK_LIMIT),
5195
- budgetMinutes: z32.number().int().min(1).max(BUILD_TASK_BUDGET_MAX_MINUTES).optional(),
5196
- human: z32.boolean()
5245
+ dependsOn: z33.array(buildTaskIdSchema).max(BUILD_SNAPSHOT_TASK_LIMIT),
5246
+ budgetMinutes: z33.number().int().min(1).max(BUILD_TASK_BUDGET_MAX_MINUTES).optional(),
5247
+ human: z33.boolean()
5197
5248
  }).strict();
5198
- var pacingBasisSchema = z32.object({
5199
- outcome: z32.literal("basis"),
5249
+ var pacingBasisSchema = z33.object({
5250
+ outcome: z33.literal("basis"),
5200
5251
  claudePlan: claudePlanSchema.nullable(),
5201
5252
  keepFreePercent: keepFreePercentSchema,
5202
- settingsUrl: z32.string().min(1),
5253
+ settingsUrl: z33.string().min(1),
5203
5254
  phase: phaseNameSchema.nullable(),
5204
- tasks: z32.array(pacingBasisTaskSchema).max(BUILD_SNAPSHOT_TASK_LIMIT),
5205
- medianTaskMinutes: z32.number().nonnegative().nullable(),
5206
- medianTaskTokens: z32.number().nonnegative().nullable()
5255
+ tasks: z33.array(pacingBasisTaskSchema).max(BUILD_SNAPSHOT_TASK_LIMIT),
5256
+ medianTaskMinutes: z33.number().nonnegative().nullable(),
5257
+ medianTaskTokens: z33.number().nonnegative().nullable()
5207
5258
  }).strict();
5208
- var paceSuggestionSchema = z32.object({
5209
- number: z32.number().int().min(1).max(PACE_AGENTS_MAX),
5210
- minutes: z32.number().int().nonnegative().nullable(),
5211
- pauses: z32.number().int().nonnegative(),
5259
+ var paceSuggestionSchema = z33.object({
5260
+ number: z33.number().int().min(1).max(PACE_AGENTS_MAX),
5261
+ minutes: z33.number().int().nonnegative().nullable(),
5262
+ pauses: z33.number().int().nonnegative(),
5212
5263
  claudePlan: claudePlanSchema.nullable(),
5213
5264
  keepFreePercent: keepFreePercentSchema,
5214
- settingsUrl: z32.string().min(1).nullable(),
5265
+ settingsUrl: z33.string().min(1).nullable(),
5215
5266
  knownWindow: paceWindowKindSchema.nullable()
5216
5267
  }).strict();
5217
5268
  var PACE_NOT_PACED_REASONS = ["not-configured", "unreadable"];
5218
- var paceRunResultSchema = z32.discriminatedUnion("outcome", [
5219
- z32.object({
5220
- outcome: z32.literal("paced"),
5269
+ var paceRunResultSchema = z33.discriminatedUnion("outcome", [
5270
+ z33.object({
5271
+ outcome: z33.literal("paced"),
5221
5272
  pace: paceStateSchema,
5222
- number: z32.number().int().min(1).max(PACE_AGENTS_MAX),
5223
- allowedNow: z32.number().int().nonnegative(),
5273
+ number: z33.number().int().min(1).max(PACE_AGENTS_MAX),
5274
+ allowedNow: z33.number().int().nonnegative(),
5224
5275
  windowKind: paceWindowKindSchema.optional(),
5225
5276
  until: utcIso8601.optional(),
5226
5277
  suggestion: paceSuggestionSchema.optional()
5227
5278
  }).strict(),
5228
- z32.object({ outcome: z32.literal("not-paced"), reason: z32.enum(PACE_NOT_PACED_REASONS) }).strict()
5279
+ z33.object({ outcome: z33.literal("not-paced"), reason: z33.enum(PACE_NOT_PACED_REASONS) }).strict()
5229
5280
  ]);
5230
5281
  function paceAgentsOf(n) {
5231
5282
  return n === 1 ? "1 agent" : `${String(n)} agents`;
@@ -5310,15 +5361,15 @@ function paceAllowedNowOf(k) {
5310
5361
  var PACE_AGENTS_TOO_MANY = `Run at most ${String(PACE_AGENTS_MAX)} agents at once.`;
5311
5362
 
5312
5363
  // ../events/dist/autonomy.js
5313
- import { z as z33 } from "zod";
5364
+ import { z as z34 } from "zod";
5314
5365
  var AUTONOMY_CHANGED_IN = ["console", "chat"];
5315
- var autonomyChangedInSchema = z33.enum(AUTONOMY_CHANGED_IN);
5316
- var autonomySettingsSchema = z33.object({
5317
- on: z33.boolean(),
5366
+ var autonomyChangedInSchema = z34.enum(AUTONOMY_CHANGED_IN);
5367
+ var autonomySettingsSchema = z34.object({
5368
+ on: z34.boolean(),
5318
5369
  // whether builds run on their own
5319
- mayPublish: z33.boolean(),
5370
+ mayPublish: z34.boolean(),
5320
5371
  // whether builds may publish or release without waiting
5321
- maySpend: z33.boolean(),
5372
+ maySpend: z34.boolean(),
5322
5373
  // whether builds may spend money or sign up without waiting
5323
5374
  changedAt: utcIso8601.nullable(),
5324
5375
  // when the setting last changed; null if never
@@ -5328,37 +5379,37 @@ var autonomySettingsSchema = z33.object({
5328
5379
  message: "says when and where it changed, or neither",
5329
5380
  path: ["changedIn"]
5330
5381
  });
5331
- var autonomyChangeRequestSchema = z33.object({
5332
- on: z33.boolean(),
5382
+ var autonomyChangeRequestSchema = z34.object({
5383
+ on: z34.boolean(),
5333
5384
  // the switch
5334
- mayPublish: z33.boolean(),
5385
+ mayPublish: z34.boolean(),
5335
5386
  // the publish box
5336
- maySpend: z33.boolean()
5387
+ maySpend: z34.boolean()
5337
5388
  // the spend box
5338
5389
  }).strict();
5339
5390
  var AUTONOMY_CHAT_ACTS = ["on", "off"];
5340
- var autonomyChatActSchema = z33.enum(AUTONOMY_CHAT_ACTS);
5341
- var autonomyChatRequestSchema = z33.object({
5391
+ var autonomyChatActSchema = z34.enum(AUTONOMY_CHAT_ACTS);
5392
+ var autonomyChatRequestSchema = z34.object({
5342
5393
  act: autonomyChatActSchema
5343
5394
  // what the owner typed
5344
5395
  }).strict();
5345
- var autonomyChatResultSchema = z33.discriminatedUnion("outcome", [
5346
- z33.object({
5347
- outcome: z33.literal("recorded"),
5348
- on: z33.boolean()
5396
+ var autonomyChatResultSchema = z34.discriminatedUnion("outcome", [
5397
+ z34.object({
5398
+ outcome: z34.literal("recorded"),
5399
+ on: z34.boolean()
5349
5400
  // whether builds now run on their own
5350
5401
  }).strict(),
5351
- z33.object({ outcome: z33.literal("not-owner") }).strict(),
5352
- z33.object({ outcome: z33.literal("no-owner") }).strict(),
5353
- z33.object({ outcome: z33.literal("not-offered") }).strict(),
5354
- z33.object({ outcome: z33.literal("unavailable") }).strict()
5402
+ z34.object({ outcome: z34.literal("not-owner") }).strict(),
5403
+ z34.object({ outcome: z34.literal("no-owner") }).strict(),
5404
+ z34.object({ outcome: z34.literal("not-offered") }).strict(),
5405
+ z34.object({ outcome: z34.literal("unavailable") }).strict()
5355
5406
  ]);
5356
- var autonomyStateSchema = z33.object({
5357
- on: z33.boolean(),
5407
+ var autonomyStateSchema = z34.object({
5408
+ on: z34.boolean(),
5358
5409
  // whether builds run on their own
5359
- mayPublish: z33.boolean(),
5410
+ mayPublish: z34.boolean(),
5360
5411
  // whether builds may publish or release without waiting
5361
- maySpend: z33.boolean()
5412
+ maySpend: z34.boolean()
5362
5413
  // whether builds may spend money or sign up without waiting
5363
5414
  }).strict();
5364
5415
  var autonomyStateFileSchema = autonomyStateSchema.extend({
@@ -5367,8 +5418,8 @@ var autonomyStateFileSchema = autonomyStateSchema.extend({
5367
5418
  }).strict();
5368
5419
  var AUTONOMY_STATE_FILE_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
5369
5420
  var AUTONOMY_ACTIVITY_KINDS = ["went-ahead", "waiting", "approved", "closed", "waiting-on-owner"];
5370
- var autonomyActivityKindSchema = z33.enum(AUTONOMY_ACTIVITY_KINDS);
5371
- var autonomyActivityRowSchema = z33.object({
5421
+ var autonomyActivityKindSchema = z34.enum(AUTONOMY_ACTIVITY_KINDS);
5422
+ var autonomyActivityRowSchema = z34.object({
5372
5423
  kind: autonomyActivityKindSchema,
5373
5424
  // what happened
5374
5425
  phase: scopePhaseSchema,
@@ -5381,6 +5432,8 @@ var autonomyActivityRowSchema = z33.object({
5381
5432
  // whether the agent says it can be undone
5382
5433
  how: statementText(STATEMENT_MAX).optional(),
5383
5434
  // how to undo it, when it can be
5435
+ wait: ownerWaitShortIdSchema.optional(),
5436
+ // the short id the owner types to answer a waiting decision
5384
5437
  at: utcIso8601
5385
5438
  // when it happened
5386
5439
  }).strict().superRefine((row, ctx) => {
@@ -5407,6 +5460,9 @@ var autonomyActivityRowSchema = z33.object({
5407
5460
  });
5408
5461
  }
5409
5462
  }
5463
+ if (row.kind !== "waiting" && row.wait !== void 0) {
5464
+ ctx.addIssue({ code: "custom", message: "only a waiting decision is answered by typing", path: ["wait"] });
5465
+ }
5410
5466
  if (row.kind === "waiting" && (row.undoable !== void 0 || row.how !== void 0)) {
5411
5467
  ctx.addIssue({ code: "custom", message: "a waiting decision has not been made yet", path: ["undoable"] });
5412
5468
  }
@@ -5414,11 +5470,11 @@ var autonomyActivityRowSchema = z33.object({
5414
5470
  ctx.addIssue({ code: "custom", message: "says how to undo it exactly when it can be undone", path: ["how"] });
5415
5471
  }
5416
5472
  });
5417
- var autonomyActivitySchema = z33.object({
5418
- rows: z33.array(autonomyActivityRowSchema)
5473
+ var autonomyActivitySchema = z34.object({
5474
+ rows: z34.array(autonomyActivityRowSchema)
5419
5475
  // newest first
5420
5476
  }).strict();
5421
- var savedIdSchema = z33.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "must be lower-case letters, digits and single hyphens");
5477
+ var savedIdSchema = z34.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "must be lower-case letters, digits and single hyphens");
5422
5478
  var SAVED_REF_PREFIX = "refs/halfcycle/saved/";
5423
5479
  function savedRefOf(id) {
5424
5480
  return `${SAVED_REF_PREFIX}${id}`;
@@ -5457,33 +5513,33 @@ function isGitFolderSegment(segment) {
5457
5513
  return t === ".git" || /^git~\d+$/.test(t);
5458
5514
  }
5459
5515
  var SAVED_PATH_KEPT_IN = ["commit", "copy"];
5460
- var savedPathSchema = z33.object({
5461
- path: z33.string().max(4096).refine(isProjectRelativePath, { message: "must be a path inside the project" }),
5516
+ var savedPathSchema = z34.object({
5517
+ path: z34.string().max(4096).refine(isProjectRelativePath, { message: "must be a path inside the project" }),
5462
5518
  // the file, relative to the project
5463
- keptIn: z33.enum(SAVED_PATH_KEPT_IN)
5519
+ keptIn: z34.enum(SAVED_PATH_KEPT_IN)
5464
5520
  // in the save's commit, or copied beside this file
5465
5521
  }).strict();
5466
- var savedCommitSchema = z33.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, "must be a full commit hash");
5467
- var savedBranchSchema = z33.object({
5468
- name: z33.string().min(1).max(255).refine((n) => !hasControlCharacter(n) && !n.startsWith("-") && !n.includes("..") && n !== "HEAD", {
5522
+ var savedCommitSchema = z34.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, "must be a full commit hash");
5523
+ var savedBranchSchema = z34.object({
5524
+ name: z34.string().min(1).max(255).refine((n) => !hasControlCharacter(n) && !n.startsWith("-") && !n.includes("..") && n !== "HEAD", {
5469
5525
  message: "must be a branch name"
5470
5526
  }),
5471
5527
  // the branch's name
5472
5528
  commit: savedCommitSchema
5473
5529
  // the commit it pointed at
5474
5530
  }).strict();
5475
- var savedSchema = z33.object({
5531
+ var savedSchema = z34.object({
5476
5532
  id: savedIdSchema,
5477
5533
  // what restore is typed with
5478
5534
  savedAt: utcIso8601,
5479
5535
  // when the copy was made
5480
- ref: z33.string().min(1),
5536
+ ref: z34.string().min(1),
5481
5537
  // where the saved commit is kept
5482
- what: z33.string().min(1).max(2e3),
5538
+ what: z34.string().min(1).max(2e3),
5483
5539
  // what the action would have changed, in words
5484
- paths: z33.array(savedPathSchema),
5540
+ paths: z34.array(savedPathSchema),
5485
5541
  // every saved file
5486
- branches: z33.array(savedBranchSchema)
5542
+ branches: z34.array(savedBranchSchema)
5487
5543
  // every saved line of work
5488
5544
  }).strict().refine((s) => s.ref === savedRefOf(s.id), { message: "must be the ref of this save", path: ["ref"] });
5489
5545
  function autonomyA13(accepted, carried) {
@@ -5493,8 +5549,9 @@ function autonomyA14(count, parts, acceptLine) {
5493
5549
  const typed = acceptLine === null ? 'say "review what was built" and type the lines it gives.' : `say "review what was built", then type ${acceptLine} to accept them with those parts, or type the reject line it gives for a task's tests.`;
5494
5550
  return `The phase waits for you: ${String(count)} tests the agents said pass were not run by Halfcycle, so ${namesOf(parts)} wait for you too. Only you can accept or reject those tests. In your own coding agent's session, ` + typed;
5495
5551
  }
5496
- function autonomyA15(count) {
5497
- return `The phase waits for you: ${String(count)} parts were built without an approved scope, and only you can decide them.`;
5552
+ function autonomyA15(count, acceptLine) {
5553
+ const typed = acceptLine === null ? 'say "review what was built" and type the lines it gives.' : `type ${acceptLine} to accept them and close the phase, or say "review what was built" to decide one differently.`;
5554
+ return `The phase waits for you: ${String(count)} parts were built without an approved scope or outside the plan, and only you can decide them. In your own coding agent's session, ${typed}`;
5498
5555
  }
5499
5556
  function namesOf(names) {
5500
5557
  if (names.length <= 1)
@@ -14189,20 +14246,14 @@ var CHANGE_WORDS = {
14189
14246
  remove: "planned to be removed",
14190
14247
  "not-in-plan": "not in the plan"
14191
14248
  };
14192
- function awaitingAnswer(part) {
14193
- return part.questions.some((q) => q.agentAnswer === void 0);
14194
- }
14195
- function sentBackInRound(part, round) {
14196
- return part.sentBack.some((s) => s.round === round);
14197
- }
14198
14249
  function partStatus(part, round) {
14199
14250
  const settled = settledStatus(part);
14200
14251
  if (settled !== void 0) {
14201
14252
  return part.givenIn === "autonomy" ? `${settled}, ${DECIDED_BY_AUTONOMY_SENTENCE}` : settled;
14202
14253
  }
14203
- if (awaitingAnswer(part))
14254
+ if (reviewPartAwaitingAnswer(part))
14204
14255
  return "Waiting for the agent's answer";
14205
- if (sentBackInRound(part, round))
14256
+ if (reviewPartSentBackIn(part, round))
14206
14257
  return "Sent back, waiting for the next round";
14207
14258
  return "Waits for your decision";
14208
14259
  }
@@ -14377,22 +14428,7 @@ var AN3_LINE = "halfcycle review: the answer must be one paragraph of at most 1,
14377
14428
  var AN4_LINE = "halfcycle review: the answer looks like it holds a password or key, so it was not sent. Write it again without it.";
14378
14429
  var AN5_LINE = "halfcycle review: the answer was not accepted. Reword it in plain words and run this again.";
14379
14430
  function shownReviewEntry(view, shownAt) {
14380
- const parts = view.parts.map((p) => ({
14381
- part: p.part,
14382
- name: p.name,
14383
- built: p.built,
14384
- decidable: p.decidable,
14385
- awaitingAnswer: awaitingAnswer(p),
14386
- sentBack: sentBackInRound(p, view.round)
14387
- }));
14388
- return {
14389
- phase: view.phase,
14390
- number: view.number,
14391
- round: view.round,
14392
- reviewVersion: view.reviewVersion,
14393
- shownAt,
14394
- parts
14395
- };
14431
+ return shownReviewEntryOf(view, shownAt);
14396
14432
  }
14397
14433
  function writeShownReview(engagementId, entry, home) {
14398
14434
  const written = updateShownRecord(engagementId, (current) => ({
@@ -14864,7 +14900,7 @@ function closeStepReport(phase, attempt, engagementId) {
14864
14900
  exitCode = 0;
14865
14901
  break;
14866
14902
  case "autonomy-waits":
14867
- stdout.push(answer.reason === "unchecked-claims" ? autonomyA14(answer.count, answer.parts.map((p) => p.name), typedAcceptLine(phase)) : autonomyA15(answer.count));
14903
+ stdout.push(answer.reason === "unchecked-claims" ? autonomyA14(answer.count, answer.parts.map((p) => p.name), typedAcceptLine(phase)) : autonomyA15(answer.count, typedAcceptLine(phase)));
14868
14904
  exitCode = 0;
14869
14905
  break;
14870
14906
  default: