pi-straw-boss 0.117.3 → 0.118.2

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.
@@ -5538,7 +5538,7 @@ var NOTICE_NEXT = {
5538
5538
  received: "Its task has not landed yet: wait for the landed notice.",
5539
5539
  returned: "Rework the car, then send a new car slip.",
5540
5540
  dropped: "",
5541
- landed: "Its task has landed: complete its todo."
5541
+ landed: "The car landed. Complete a car-landed todo; a deployment todo still needs deployment evidence."
5542
5542
  };
5543
5543
  var withNext = (state, line2) => NOTICE_NEXT[state] ? `${line2.replace(/[\s.]+$/, "")}. ${NOTICE_NEXT[state]}` : line2;
5544
5544
  var heldText2 = (who, since) => `sb: this device is held by ${who} since ${since}; it sends work here as ally workers. Finish what you hold, start no new work of your own, pause loops/watches that pick tickets; sb tells you when it ends.`;
@@ -120,7 +120,7 @@ import {
120
120
  writeEnd,
121
121
  writeJson,
122
122
  writerAlive
123
- } from "./chunk-CV2TPJUE.mjs";
123
+ } from "./chunk-OFZL2BZF.mjs";
124
124
 
125
125
  // src/server/cli.ts
126
126
  import { existsSync as existsSync3, realpathSync as realpathSync4 } from "node:fs";
@@ -308,7 +308,7 @@ import {
308
308
  writeStartError,
309
309
  writerAlive,
310
310
  yardPath
311
- } from "./chunk-CV2TPJUE.mjs";
311
+ } from "./chunk-OFZL2BZF.mjs";
312
312
 
313
313
  // src/server/main.ts
314
314
  import { homedir as homedir18 } from "node:os";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-straw-boss",
3
- "version": "0.117.3",
3
+ "version": "0.118.2",
4
4
  "description": "Straw Boss coordination for pi in Herdr: sessions join a tab's net by choice, the first joiner is its main agent, a workspace tower opens on demand with a live monitoring dashboard, and boss_broadcast reaches the rest",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/prompts/main.md CHANGED
@@ -1,6 +1,6 @@
1
1
  You are the main agent of Herdr tab {{tab}}, of kind {{duty}}: the boss is here.
2
- - Dispatch: split work by owning app. Read {{dir}}/planning.md (plans, anchors, briefs) and sibling apps-config.md (owners). One worker/app task end to end; todo first except quick scouts. Respect `blockedBy`. Parallel writers: `~/.herdr/worktrees/<repo>/<branch>` (trusted). Dispatch independent off-chain work to subagents in parallel. Unattended: `board_read` capacity budget (API-bound: `metadata.points` 0.25). Idle with ready todos: dispatch them.
3
- - Brief + anchor pass: complete todo, dispatch unblocked. Failed/cancelled: report blocked dependents; ask boss what's next. Review via `boss_pair`.
2
+ - Dispatch: split work by owning app. Read {{dir}}/planning.md (plans, anchors, briefs) and sibling apps-config.md (owners). One worker/app task end to end; todo first except quick scouts. Respect `blockedBy`. Parallel writers: `~/.herdr/worktrees/<repo>/<branch>` (trusted). Dispatch independent off-chain work to subagents in parallel. Unattended: `board_read` capacity budget (API-bound: `points` 0.25). Idle with ready todos: dispatch them.
3
+ - Promised outcome verified: complete todo, dispatch unblocked. Failed/cancelled: report blocked dependents; ask boss what's next. Review via `boss_pair`.
4
4
  - To agents: terse, point first. Keep negations, numbers, paths, IDs and quoted decisions verbatim; full sentences if ambiguous. Unsure? Restate or ask.
5
5
  - Shared merges and deploys require boss authorization.
6
6
  <!-- integration -->
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## 1. Name the graph
4
4
 
5
- The page shows it beside your kind. Take the first case that matches:
5
+ Pick the first match; it appears beside your kind:
6
6
 
7
- - **single-loop**: one bounded task for you or one subagent. Its plan is one todo whose `metadata.anchor` names its check.
7
+ - **single-loop**: one bounded task for you or one subagent. Its plan is one todo whose `anchor` names its check.
8
8
  - **fan-out/fan-in**: independent branches run in subagents, and you integrate their results.
9
9
  - **orchestrator-worker**: several workers, each owning one app's task end to end, with dependency edges.
10
10
 
@@ -12,32 +12,38 @@ An independent review is a checkpoint, not a graph.
12
12
 
13
13
  ## 2. Write the plan as todos
14
14
 
15
- For fan-out and orchestrator-worker, one todo per task:
15
+ Fan-out and orchestrator-worker: one todo per task.
16
16
 
17
- - `subject`: the required outcome.
17
+ - `subject`: the promised outcome: branch ready, car landed, or deployed. Complete only on that outcome. Worker exit, passing check, reviewer done, car received and car landed are distinct facts.
18
18
  - `owner`: the subagent's name, or `self`.
19
- - `description`: the app, the worktree branch for a parallel writer, the anchor and who exercises it, and the exact artifact path a dependent will read.
20
- - `blockedBy`: the tasks whose output or landed change this one needs; the rest run in parallel, on an unattended device within its capacity budget. Serialize only on a real dependency or shared files.
21
- - `graph`: a graph name from section 1, exactly.
22
- - `metadata`: `{ "anchor": "...", "checkpoint": "own" | "<checkpoint todo id>", "points": <n> }`: its weight against the budget, as the boss or project weighs it (default 1; 0.25 for a light, API-bound worker).
19
+ - `description`: app, parallel writer's worktree branch, anchor and tester, exact artifact path for dependents.
20
+ - `blockedBy`: tasks supplying required output or landed changes. Run the rest within the unattended capacity budget. Serialize only on a real dependency or shared files.
21
+ - `graph`: exact section 1 name.
22
+ - `anchor`: the check. `points`: budget weight (boss or project rule; default 1, API-bound 0.25). `metadata.checkpoint`: `own` or checkpoint todo ID.
23
+
24
+ ```json
25
+ {"subject":"Parser branch ready","anchor":"npm test","points":1,"metadata":{"checkpoint":"own"}}
26
+ ```
23
27
  - Defer: `metadata.until` (ISO) or `metadata.waitsOn` (person). Your monitor, loop, or `boss_watch` (until its first change) prevents stale notices.
24
28
 
25
29
  ## 3. Name the anchors
26
30
 
27
- Use the lightest check that reaches the change and can fail before it:
31
+ Choose the lightest check that fails before the change:
28
32
 
29
33
  - **testing** (code): smallest red-first test. Run repo-wide suites, lint and type checks once at the shared checkpoint or before merge.<!-- integration --> In an `integration` app, see below.<!-- /integration -->
30
34
  - **pseudo-human**: operate the real interface; capture screenshots and measurements.
31
35
  - **human**: the boss tests or judges feel, wording or a business rule.
32
36
  - **adversarial-review**: fresh-context challenge against requirements for read-only work without an executable check.
33
37
 
34
- Tasks with one anchor share one checkpoint todo, `blockedBy` all contributors; workers hand it evidence. Keep distinct or cheaper local checks in place.
38
+ **Required checkpoints** (Delegation rule): wherever two or more contributors join; before every merge, deploy, publish or handoff; and at every Review trigger below.
39
+ **Placement:** Give each checkpoint one todo, `blockedBy` its contributors. Run its own `anchor` on the joined tree.
40
+ Contributors record green runs by SHA. The checkpoint reuses only runs tied to the tree it accepts; a child's report alone cannot complete it.
35
41
 
36
42
  <!-- integration -->
37
- For `integration`, follow `integrating`'s Principle: before handoff clear P0/P1 review, test your change and run the project skill's `Light checks`. `Full gates` run once, by the integrator, on the integrated pre-dev head. Before sending the slip, run `integration.accept` on your branch per `## Acceptance`, get the boss's nod, write absolute paths in `accept:` and `evidence`, and use the main prompt's `train check`: `--accept <file> --app-accept <integration.accept> --slip <slip>` (`--accept none` for empty `integration.accept`); a `human` anchor is this acceptance, not the train's.
43
+ Car slip = handoff. Follow `integrating`'s Principle: before handoff clear P0/P1 review, test your change and run the project skill's `Light checks`. `Full gates` run once, by the integrator, on the integrated pre-dev head. Before sending the slip, run `integration.accept` on your branch per `## Acceptance`, get the boss's nod, write absolute paths in `accept:` and `evidence`, and use the main prompt's `train check`: `--accept <file> --app-accept <integration.accept> --slip <slip>` (`--accept none` for empty `integration.accept`); a `human` anchor is this acceptance, not the train's.
38
44
 
39
45
  <!-- /integration -->
40
- After a passing anchor, get one fresh-context reviewer for shared contracts, authorization or permission data, or migrations. Otherwise review your diff against the brief.
46
+ After the anchor passes, apply the Review rule: one fresh-context reviewer for shared contracts, authorization or permission data, migrations, security, or work carried by two or more workers. Otherwise review your diff against the brief.
41
47
 
42
48
  ## 4. Start
43
49
 
package/src/moments.ts CHANGED
@@ -33,7 +33,7 @@ export const NOTICE_NEXT: Record<CarState, string> = {
33
33
  received: "Its task has not landed yet: wait for the landed notice.",
34
34
  returned: "Rework the car, then send a new car slip.",
35
35
  dropped: "",
36
- landed: "Its task has landed: complete its todo.",
36
+ landed: "The car landed. Complete a car-landed todo; a deployment todo still needs deployment evidence.",
37
37
  };
38
38
  /** A car notice line with its next step, as the coordinator is sent it. */
39
39
  export const withNext = (state: CarState, line: string): string => (NOTICE_NEXT[state] ? `${line.replace(/[\s.]+$/, "")}. ${NOTICE_NEXT[state]}` : line);
package/src/planhint.ts CHANGED
@@ -11,8 +11,8 @@ import { snapshotOfBranch } from "./todo.ts";
11
11
  /** The block's last line: what the main does with it. */
12
12
  export const PLAN_HINT_END = "Set the `graph` field on these todos.";
13
13
  const OPENING = "sb: your open todos name no graph. From planning.md:";
14
- /** The text of planning.md §1 and §2 the block leaves out, to stay near 1.2 KB: what the page shows, the capacity details (capacity notices carry them), and deferring. Each must be there: a cut that no longer matches is a file error. */
15
- const DROPPED = ["The page shows it beside your kind. ", ", on an unattended device within its capacity budget", " (default 1; 0.25 for a light, API-bound worker)", /^- Defer: .*\n?/m, /\*\*/g];
14
+ /** The text of planning.md §1 and §2 the block leaves out, to stay near 1.2 KB: the capacity details, the worked example, and deferring. Each must be there: a cut that no longer matches is a file error. */
15
+ const DROPPED = [" Run the rest within the unattended capacity budget.", " (boss or project rule; default 1, API-bound 0.25)", /^```json\n[\s\S]*?^```\n?/m, /^- Defer: .*\n?/m, /\*\*/g];
16
16
 
17
17
  /** One `## <n>.` section of planning.md, without its heading; a missing one is a file error. */
18
18
  function section(text: string, n: number): string {
package/src/preflight.ts CHANGED
@@ -8,7 +8,7 @@ import { snapshotScan } from "./todo.ts";
8
8
  // waits on refuses, because that todo can never become ready and a worker on it starts work out of order.
9
9
 
10
10
  export interface Preflight { refusal?: string; warnings: string[] }
11
- type Raw = { id?: unknown; uid?: unknown; status?: unknown; anchor?: unknown; blockedBy?: unknown };
11
+ type Raw = { id?: unknown; uid?: unknown; status?: unknown; anchor?: unknown; metadata?: { anchor?: unknown }; blockedBy?: unknown };
12
12
 
13
13
  /** Words that open a command line: an anchor that starts with one is runnable as written. */
14
14
  const COMMANDS = /^(?:npm|npx|pnpm|yarn|bun|bunx|node|deno|tsc|vitest|jest|go|cargo|make|just|uv|uvx|pytest|python3?|pip|dotnet|mvn|gradle|git|gh|glab|curl|bash|sh|zsh|rg|grep|ls|test|diff|jq|docker|kubectl|helm|terraform|ansible(?:-playbook)?|herdr|pi|sb|mpi|playwright|agent-browser|swift|xcodebuild|ruby|bundle|rake|php|composer|mix|elixir|ttt)\b/i;
@@ -87,9 +87,10 @@ export function preflightOf(snapshot: unknown, item: string, session: string): P
87
87
  if (cycle) return { refusal: `sb preflight: todo #${id} waits on a blockedBy cycle (${cycle.map((n) => `#${n}`).join(" → ")}), so it never becomes ready: break the cycle with todo update removeBlockedBy, then launch again.`, warnings: [] };
88
88
  const warnings: string[] = [];
89
89
  if ((snapshot as { v?: unknown }).v === 1) {
90
- const problem = anchorProblem(task.anchor);
90
+ const anchor = task.anchor ?? task.metadata?.anchor;
91
+ const problem = anchorProblem(anchor);
91
92
  if (problem === "missing") warnings.push(`sb preflight: todo #${id} has no anchor. Set the check that shows it done with todo update anchor (a command, or what is seen), so the result can be judged against it.`);
92
- else if (problem === "vague") warnings.push(`sb preflight: todo #${id}'s anchor ${quote(String(task.anchor).trim())} names no runnable check. Replace it with todo update anchor: a command to run, or what is seen when it is done.`);
93
+ else if (problem === "vague") warnings.push(`sb preflight: todo #${id}'s anchor ${quote(String(anchor).trim())} names no runnable check. Replace it with todo update anchor: a command to run, or what is seen when it is done.`);
93
94
  }
94
95
  const blockers = idsOf(task.blockedBy), deleted = blockers.filter((b) => x.byId.get(b)?.status === "deleted"), unknown = blockers.filter((b) => !x.byId.has(b));
95
96
  if (deleted.length || unknown.length) {