@h-rig/cli 0.0.6-alpha.40 → 0.0.6-alpha.41

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.
@@ -58,6 +58,7 @@ import {
58
58
  writeJsonFile as writeJsonFile2
59
59
  } from "@rig/runtime/control-plane/authority-files";
60
60
  import { taskLookup } from "@rig/runtime/control-plane/native/task-ops";
61
+ import { readPriorPrProgressPromptSection } from "@rig/runtime/control-plane/prompt-context";
61
62
  import { buildProviderTaskRunInstructionLines } from "@rig/runtime/control-plane/provider/runtime-instructions";
62
63
  import { loadRigTaskRunSkillBody } from "@rig/runtime/control-plane/provider/rig-task-run-skill";
63
64
 
@@ -315,7 +316,7 @@ ${acceptance}` : null,
315
316
  ${sourceContractLines.join(`
316
317
  `)}` : null,
317
318
  scopeText || renderSourceScopeValidation(sourceTask, sourceValidation) || null,
318
- readPriorPrProgressForPrompt(input.projectRoot, input.taskId),
319
+ readPriorPrProgressPromptSection(input.projectRoot, input.taskId),
319
320
  initialPrompt ? `Additional operator guidance:
320
321
  ${initialPrompt}` : null,
321
322
  providerLines.length > 0 ? `Provider-specific runtime tooling:
@@ -325,26 +326,6 @@ ${providerLines.join(" ")}` : null,
325
326
 
326
327
  `);
327
328
  }
328
- function readPriorPrProgressForPrompt(projectRoot, taskId) {
329
- for (const candidate of [
330
- resolve3(projectRoot, ".worktrees", taskId, "artifacts", taskId, "pr-state.json"),
331
- resolve3(projectRoot, "artifacts", taskId, "pr-state.json")
332
- ]) {
333
- try {
334
- const raw = JSON.parse(readFileSync(candidate, "utf8"));
335
- const entries = Array.isArray(raw) ? raw : [raw];
336
- const first = entries.find((entry) => entry && typeof entry === "object" && typeof entry.url === "string");
337
- if (!first)
338
- continue;
339
- return [
340
- `Prior progress exists for this task: PR ${first.url}${first.branch ? ` (branch ${first.branch})` : ""} was opened by an earlier run.`,
341
- "Check its current state first (diff, checks, review). If the work is already complete and checks are green,",
342
- "run `rig-agent completion-verification` to merge and close instead of re-implementing anything."
343
- ].join(" ");
344
- } catch {}
345
- }
346
- return null;
347
- }
348
329
  function firstPromptString(...values) {
349
330
  for (const value of values) {
350
331
  const trimmed = typeof value === "string" ? value.trim() : "";