pi-straw-boss 0.79.2 → 0.80.1
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/NOTICE.md +1 -0
- package/dist/server/{chunk-VOBPJZPJ.mjs → chunk-S2XBGLRM.mjs} +27 -1
- package/dist/server/cli.mjs +7 -6
- package/dist/server/main.mjs +482 -213
- package/package.json +1 -1
- package/prompts/duty-standing.md +1 -1
- package/roles/watchdog.md +17 -0
- package/src/header.ts +1 -1
- package/src/hygiene.ts +3 -3
- package/src/index.ts +2 -0
- package/src/netdata.ts +3 -0
- package/src/planmsg.ts +1 -1
- package/src/server/guihost.ts +15 -3
- package/src/server/main.ts +5 -2
- package/src/server/traincmds.ts +8 -7
- package/src/server/watchdogops.ts +46 -0
- package/src/server/watchread.ts +199 -0
- package/src/server/watchreport.ts +93 -0
- package/src/session.ts +3 -3
- package/src/train/appsconfig.ts +28 -1
- package/src/trainguard.ts +9 -9
- package/src/watchdog.ts +141 -0
package/NOTICE.md
CHANGED
|
@@ -119,6 +119,7 @@ The role pack in `roles/` (docs/specs/2026-11-09-agent-kinds.md §9) is derived
|
|
|
119
119
|
|
|
120
120
|
- `roles/worker.md`, `roles/scout.md`, `roles/reviewer.md`, `roles/visual-tester.md`, and `roles/adversarial-reviewer.md` start from the role overrides of [weihung-basic-agent](https://github.com/wayne930242/weihung-basic-agent) (`agents/`), MIT License, Copyright (c) 2026 wayne930242. Those overrides in turn derive from the pi-herdr-roles definitions below.
|
|
121
121
|
- `roles/planner.md` derives from [pi-herdr-roles](https://www.npmjs.com/package/pi-herdr-roles) 0.1.0 `roles/planner.md` alone.
|
|
122
|
+
- `roles/watchdog.md` is Straw Boss's own, derived from neither source.
|
|
122
123
|
|
|
123
124
|
pi-herdr-roles' role definitions were moved from [giuseppecrj/pi-herdr-agents](https://github.com/giuseppecrj/pi-herdr-agents) at commit `c2177dff835da44937e614e8a03d0405d442e848`, whose MIT notice is retained from its upstream lineage, [HazAT/pi-interactive-subagents](https://github.com/HazAT/pi-interactive-subagents) and [0xRichardH/pi-herdr-subagents](https://github.com/0xRichardH/pi-herdr-subagents). pi-herdr-roles 0.1.0 carries this notice:
|
|
124
125
|
|
|
@@ -4393,7 +4393,7 @@ function checkStages(stages) {
|
|
|
4393
4393
|
|
|
4394
4394
|
// src/train/appsconfig.ts
|
|
4395
4395
|
import { existsSync as existsSync8, readFileSync as readFileSync12, realpathSync as realpathSync2, statSync as statSync7 } from "node:fs";
|
|
4396
|
-
import { basename as basename2, dirname as dirname6, join as join12, resolve as resolve2 } from "node:path";
|
|
4396
|
+
import { basename as basename2, dirname as dirname6, join as join12, resolve as resolve2, sep as sep2 } from "node:path";
|
|
4397
4397
|
var MIGRATION = "see docs/how-it-works.md, Moving a project to 0.65.0";
|
|
4398
4398
|
function gitRoot(dir) {
|
|
4399
4399
|
for (let d = dir; ; d = dirname6(d)) {
|
|
@@ -4479,6 +4479,30 @@ function repoRoot(dir) {
|
|
|
4479
4479
|
return real2(root);
|
|
4480
4480
|
}
|
|
4481
4481
|
}
|
|
4482
|
+
function carRepos(dir, app, fallback = dir) {
|
|
4483
|
+
const read = readApps(dir), at2 = read.ok ? read.apps.find((a) => a.name === app)?.dir : void 0;
|
|
4484
|
+
if (typeof at2 !== "string") return [fallback];
|
|
4485
|
+
const home = repoRoot(dir);
|
|
4486
|
+
const inside2 = (path, root) => path.startsWith(root + sep2);
|
|
4487
|
+
const ownGitDir = (folder) => {
|
|
4488
|
+
const dot = join12(folder, ".git");
|
|
4489
|
+
if (statSync7(dot).isDirectory()) return true;
|
|
4490
|
+
const named2 = /^gitdir:\s*(.+)$/m.exec(readFileSync12(dot, "utf8"))?.[1]?.trim();
|
|
4491
|
+
return named2 !== void 0 && inside2(realpathSync2(resolve2(folder, named2)), home);
|
|
4492
|
+
};
|
|
4493
|
+
const own2 = (root) => {
|
|
4494
|
+
const folder = resolve2(root, at2);
|
|
4495
|
+
if (!inside2(folder, root) || !existsSync8(join12(folder, ".git"))) return [];
|
|
4496
|
+
try {
|
|
4497
|
+
const real2 = realpathSync2(folder);
|
|
4498
|
+
return inside2(real2, realpathSync2(root)) && ownGitDir(real2) ? [real2] : [];
|
|
4499
|
+
} catch {
|
|
4500
|
+
return [];
|
|
4501
|
+
}
|
|
4502
|
+
};
|
|
4503
|
+
const found = [.../* @__PURE__ */ new Set([...own2(resolve2(gitRoot(dir))), ...own2(home)])];
|
|
4504
|
+
return found.length ? found : [fallback];
|
|
4505
|
+
}
|
|
4482
4506
|
function checkoutProject(dir) {
|
|
4483
4507
|
const { file } = appsFile(dir);
|
|
4484
4508
|
let config;
|
|
@@ -6734,6 +6758,7 @@ export {
|
|
|
6734
6758
|
openRefusal,
|
|
6735
6759
|
projectAppsDir,
|
|
6736
6760
|
repoRoot,
|
|
6761
|
+
carRepos,
|
|
6737
6762
|
checkoutProject,
|
|
6738
6763
|
TRAIN,
|
|
6739
6764
|
isSessionRole,
|
|
@@ -6831,6 +6856,7 @@ export {
|
|
|
6831
6856
|
holding,
|
|
6832
6857
|
stepWaits,
|
|
6833
6858
|
waitingTrains,
|
|
6859
|
+
waitMessage,
|
|
6834
6860
|
writePrivate2 as writePrivate,
|
|
6835
6861
|
MAX_CAR_FILES,
|
|
6836
6862
|
readCar,
|
package/dist/server/cli.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
boardPath,
|
|
14
14
|
boardState,
|
|
15
15
|
callControl,
|
|
16
|
+
carRepos,
|
|
16
17
|
carsFolderOk,
|
|
17
18
|
checkAcceptRef,
|
|
18
19
|
checkCar,
|
|
@@ -88,7 +89,7 @@ import {
|
|
|
88
89
|
writeBoard,
|
|
89
90
|
writeJson,
|
|
90
91
|
writerAlive
|
|
91
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-S2XBGLRM.mjs";
|
|
92
93
|
|
|
93
94
|
// src/server/cli.ts
|
|
94
95
|
import { existsSync as existsSync2, realpathSync as realpathSync3 } from "node:fs";
|
|
@@ -285,7 +286,7 @@ function check(flags, io) {
|
|
|
285
286
|
if (accept.refusal) refusals.push(accept.refusal);
|
|
286
287
|
if (slip?.refusal) refusals.push(slip.refusal);
|
|
287
288
|
if (!setting.ok) refusals.push(setting.refusal);
|
|
288
|
-
let required = setting.ok ? setting.accept : [];
|
|
289
|
+
let required = setting.ok ? setting.accept : [], repos = [cwd];
|
|
289
290
|
if (!accept.refusal && !slip?.refusal && setting.ok) {
|
|
290
291
|
const app = typeof flags.app === "string" ? flags.app : slip ? parseSlip(slip.text).fields.car : evidenceApp(accept.text);
|
|
291
292
|
const dir = projectAppsDir(cwd);
|
|
@@ -293,20 +294,20 @@ function check(flags, io) {
|
|
|
293
294
|
if (app) refusals.push(`sb: app ${app} could not be checked: ${noAppsWhere(cwd)}; run train check in the project's checkout`);
|
|
294
295
|
} else {
|
|
295
296
|
const found = app ? readAppIntegration(dir, app) : { ok: false, refusal: "sb: the project has an apps.json, so name the app to check against: --app <name>" };
|
|
296
|
-
if (found.ok) required = [.../* @__PURE__ */ new Set([...required, ...found.accept])];
|
|
297
|
+
if (found.ok) required = [.../* @__PURE__ */ new Set([...required, ...found.accept])], repos = carRepos(dir, app, cwd);
|
|
297
298
|
else refusals.push(found.refusal);
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
if (!accept.refusal && !slip?.refusal && setting.ok && !refusals.length) {
|
|
301
302
|
const exists = io.exists ?? ((path) => existsSync(resolve3(cwd, path)));
|
|
302
|
-
const isAncestor = io.isAncestor ?? ((older, newer2) => {
|
|
303
|
+
const isAncestor = io.isAncestor ?? ((older, newer2) => repos.some((at) => {
|
|
303
304
|
try {
|
|
304
|
-
execFileSyncExe("git", ["merge-base", "--is-ancestor", older, newer2], { cwd, stdio: "ignore", timeout: 15e3, killSignal: "SIGKILL" });
|
|
305
|
+
execFileSyncExe("git", ["merge-base", "--is-ancestor", older, newer2], { cwd: at, stdio: "ignore", timeout: 15e3, killSignal: "SIGKILL" });
|
|
305
306
|
return true;
|
|
306
307
|
} catch {
|
|
307
308
|
return false;
|
|
308
309
|
}
|
|
309
|
-
});
|
|
310
|
+
}));
|
|
310
311
|
const options = { appAccept: required, exists, isAncestor };
|
|
311
312
|
refusals.push(...slip ? checkCar(slip.text, accept.text, options) : none ? checkAcceptRef("none", required) : checkEvidence(accept.text, options));
|
|
312
313
|
}
|