@sagentlab/navarch-runtime 0.1.95 → 0.1.96

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/delivery.cjs CHANGED
@@ -146,6 +146,10 @@ function describeBranch(branch) {
146
146
  * task.
147
147
  */
148
148
  function renderDeliveryCorrectionPrompt(args) {
149
+ const report = args.previousReport.trim();
150
+ const clippedReport = report.length > 8_000
151
+ ? `${report.slice(0, 8_000)}\n\n[... truncated]`
152
+ : report;
149
153
  return [
150
154
  args.originalPrompt.trim(),
151
155
  "",
@@ -157,10 +161,26 @@ function renderDeliveryCorrectionPrompt(args) {
157
161
  "so your earlier edits, commits, and branch are all still here — start with `git status` and",
158
162
  "`git log --oneline` and continue from there rather than redoing the work.",
159
163
  "",
160
- "Finish the delivery chain: commit the work, push the branch, and open the pull request.",
161
- "If part of the task genuinely cannot be completed, still deliver what does work as a pull request",
162
- "and state plainly in the description what is missing and why.",
164
+ "Inspect tracked and untracked changes before deciding what is undelivered work. Preserve required",
165
+ "evidence in task artifacts, remove only temporary files you created (such as `.review-*/` scratch",
166
+ "directories), and restore only tracked edits you made solely for local checks. Do not delete",
167
+ "unfamiliar or pre-existing changes, hide leftovers with ignore rules, or commit scratch files.",
168
+ ...(args.taskType === "review"
169
+ ? [
170
+ "This is a read-only review task. The generic delivery failure does not authorize commits,",
171
+ "pushes, rebases, merges, or a new PR. A dirty worktree may contain only review scratch files.",
172
+ "Check whether the native review already exists for this task and reviewed head. If it does,",
173
+ "reuse that review and its matching attestation; do not file a duplicate or implement findings.",
174
+ "If it does not, finish filing the review required by the original task. Leave a clean worktree.",
175
+ ]
176
+ : [
177
+ "Follow the original task's delivery contract. If it requires a PR, commit the intended work,",
178
+ "push the branch, and open or update the PR. A report-only task does not need a new PR.",
179
+ "If part of a PR task cannot be completed, deliver what does work and describe the gap.",
180
+ ]),
163
181
  "",
164
- "This session's worktree is deleted when the session ends. Work that is not pushed is lost.",
182
+ "Your final report replaces the previous one. Restate it in full in the required format, preserving",
183
+ "the verdict, reviewed head, findings, and validation limitations. Do not claim delivery you cannot verify.",
184
+ ...(clippedReport ? ["", "### Previous turn's final report", "", clippedReport] : []),
165
185
  ].join("\n");
166
186
  }
package/dist/prompt.cjs CHANGED
@@ -5,7 +5,7 @@ exports.renderGuidanceCorrectionPrompt = renderGuidanceCorrectionPrompt;
5
5
  exports.renderCompletionRemediationPrompt = renderCompletionRemediationPrompt;
6
6
  exports.renderHostedCheckpointNote = renderHostedCheckpointNote;
7
7
  const CODE_GRAPH_GUIDANCE = "For JS/TS dependency inspection, the runtime provides `navarch-runtime code-graph --query <symbol-or-file> --mode search|callers|callees|impact --commit HEAD`. If the runtime is not on PATH, use its installed entry point; do not install another copy mid-task. Results describe committed source and include commit/freshness warnings; inspect current files for uncommitted changes and unresolved dependencies.";
8
- const PROCESS_GUIDANCE = "Process management: this host may run other agent sessions. Keep the PID or tool handle of each preview server you start and stop only that owned process. Never use broad process-name or command-line matching (pkill, killall) to clean up servers: the agent launcher carries the task prompt in its arguments and can match those patterns, terminating your own session. Use a different port when a port is occupied by a process you do not own. Keep scratch files in the current worktree; paths in previous transcripts belong to earlier sessions.";
8
+ const PROCESS_GUIDANCE = "Process management: this host may run other agent sessions. Keep the PID or tool handle of each preview server you start and stop only that owned process. Never use broad process-name or command-line matching (pkill, killall) to clean up servers: the agent launcher carries the task prompt in its arguments and can match those patterns, terminating your own session. Use a different port when a port is occupied by a process you do not own. Keep scratch files in the current worktree; paths in previous transcripts belong to earlier sessions. Before your final report, inspect `git status --short`, including untracked files. Preserve required evidence in task artifacts, then remove only temporary files you created and restore only tracked edits you made solely for local checks. Do not delete unfamiliar or pre-existing changes, hide leftovers with ignore rules, or commit scratch files merely to make the worktree clean. Review tasks deliver a native review and attestation, never commits, pushes, or a new PR.";
9
9
  /** Overrides the playbooks' "default branch" PR base when the project sets a working branch. */
10
10
  function workingBranchNote(workingBranch) {
11
11
  if (!workingBranch)
package/dist/session.cjs CHANGED
@@ -706,6 +706,10 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
706
706
  `restarting agent turn ${deliveryCorrectionRetries}/${DELIVERY_CORRECTION_RETRIES} in the same worktree.`);
707
707
  nextPrompt = (0, delivery_cjs_1.renderDeliveryCorrectionPrompt)({
708
708
  originalPrompt: runPrompt,
709
+ taskType: task.task_type,
710
+ // The completion summary is capped at 500 characters. Preserve
711
+ // the final prose from adapters that only return stdout as well.
712
+ previousReport: (0, redact_cjs_1.redactText)(result.reportText ?? (0, exit_conditions_cjs_1.parseClaudeJsonResult)(result.stdout)?.result ?? result.stdout, registry.list()),
709
713
  reason: delivery.reason,
710
714
  attempt: deliveryCorrectionRetries,
711
715
  maxAttempts: DELIVERY_CORRECTION_RETRIES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sagentlab/navarch-runtime",
3
- "version": "0.1.95",
3
+ "version": "0.1.96",
4
4
  "description": "Navarch machine-side session manager: claims delivery tasks and runs them through local coding agents.",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",