@adhdev/mesh-shared 1.0.60-rc.40 → 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.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -5
- package/dist/index.mjs.map +1 -1
- package/dist/turn-evidence.d.ts +9 -2
- package/dist/types.d.ts +11 -0
- package/package.json +1 -1
- package/src/turn-evidence.ts +14 -1
- package/src/types.ts +8 -0
- package/src/worker-protocol.ts +24 -2
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)
|
|
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
|
|
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(
|
|
@@ -1677,7 +1687,12 @@ var HOLD_REASONS = [
|
|
|
1677
1687
|
"live_pending",
|
|
1678
1688
|
"transcript_quiet",
|
|
1679
1689
|
"weak_candidate",
|
|
1680
|
-
"suspension_before_consumed"
|
|
1690
|
+
"suspension_before_consumed",
|
|
1691
|
+
// A genuine FSM end of a mesh turn whose worker holds a live worker-MCP bind:
|
|
1692
|
+
// the structured report is the primary evidence (design §F2), so the idle edge
|
|
1693
|
+
// only opens this hold (R9r) — a report commits (R17), a new busy edge cancels
|
|
1694
|
+
// it as a false idle (R12r), expiry commits weak (R13r).
|
|
1695
|
+
"await_report"
|
|
1681
1696
|
];
|
|
1682
1697
|
var TURN_OUTCOMES = ["completed", "failed", "cancelled"];
|
|
1683
1698
|
var COMMIT_STRENGTHS = ["genuine", "weak", "tool_report", "operator"];
|
|
@@ -1777,7 +1792,8 @@ var TURN_EVIDENCE_FIELD_SPECS = {
|
|
|
1777
1792
|
blockReason: enOpt(TURN_END_BLOCK_REASONS),
|
|
1778
1793
|
releasedByHardCap: boolOpt,
|
|
1779
1794
|
nativeOutcome: enOpt(NATIVE_TURN_OUTCOMES),
|
|
1780
|
-
live: { t: "live", optional: true }
|
|
1795
|
+
live: { t: "live", optional: true },
|
|
1796
|
+
reportExpected: boolOpt
|
|
1781
1797
|
},
|
|
1782
1798
|
transcript_final: {
|
|
1783
1799
|
selfAttributing: bool,
|