@adhdev/mesh-shared 1.0.60-rc.41 → 1.0.60-rc.42

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.mjs CHANGED
@@ -1569,15 +1569,25 @@ function renderWorkerProtocolFooter(input = {}) {
1569
1569
  const scope = [];
1570
1570
  if (input.taskId) scope.push(`task ${input.taskId}`);
1571
1571
  if (input.taskMode) scope.push(`mode ${input.taskMode}`);
1572
- if (input.difficulty) scope.push(`difficulty ${input.difficulty}`);
1572
+ if (input.difficulty) {
1573
+ if (isMeshTaskDifficulty(input.difficulty)) {
1574
+ scope.push(`difficulty ${input.difficulty}`);
1575
+ } else {
1576
+ console.warn(
1577
+ `[worker-protocol] task ${input.taskId ?? "(unknown)"}: dropping invalid difficulty '${input.difficulty}' from the worker footer (expected one of easy, medium, difficult, freeform)`
1578
+ );
1579
+ }
1580
+ }
1573
1581
  if (input.readonly) scope.push("read-only");
1574
1582
  if (scope.length) lines.push(`You are a delegated worker (${scope.join(", ")}).`);
1575
1583
  else lines.push("You are a delegated worker.");
1576
1584
  lines.push(
1577
1585
  "When your work is finished, blocked, or has failed, call `report_completion` exactly once. Its `summary` is recorded verbatim as the authoritative record of this task \u2014 your terminal is not scraped for it \u2014 so state what you did, what you found, and where you left the branch.",
1578
1586
  "For work that runs longer than a few minutes, call `progress_update` at natural checkpoints so the coordinator can see you are alive without polling.",
1579
- "`peer_context_pull` shows what sibling tasks in this mission have reported; `git_status` / `git_diff` / `git_log` inspect your own workspace (pass its absolute path as `workspace`).",
1580
- "You have no coordinator tools (no `mesh_*`) by design: do not enqueue, dispatch, or restart anything. If you need a decision from the coordinator, finish with `report_completion` and outcome `blocked`, listing what you need in `blockers`."
1587
+ "`peer_context_pull` shows what sibling tasks in this mission have reported; `git_status` / `git_diff` / `git_log` inspect your own workspace \u2014 all three REQUIRE the absolute path to it as `workspace`.",
1588
+ "You have no coordinator tools (no `mesh_*`) by design: do not enqueue, dispatch, or restart anything. If you need a decision from the coordinator, finish with `report_completion` and outcome `blocked`, listing what you need in `blockers`.",
1589
+ "On a code-changing task, `report_completion` with outcome `completed` requires `touched_files` \u2014 send `[]` if you changed nothing, omitting the field is what gets refused. `blocked`/`failed` never need it, and a read-only task should omit it or send `[]`.",
1590
+ "If `report_completion` is refused, the response carries `validationErrors` (or a `hint`) naming exactly what to fix \u2014 correct that field and call it again; a refusal records nothing."
1581
1591
  );
1582
1592
  if (input.enclosedHandoffNotes && input.enclosedHandoffNotes > 0) {
1583
1593
  lines.push(