neurastream 0.2.72 → 0.2.73
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/package.json +1 -1
- package/src/core/guards.ts +7 -3
package/package.json
CHANGED
package/src/core/guards.ts
CHANGED
|
@@ -1355,12 +1355,16 @@ function subRules(e: ToolEvent, input: Record<string, unknown>, paths: string[],
|
|
|
1355
1355
|
for (const plan of plans) {
|
|
1356
1356
|
const hit = paths.filter(p => !q.isOrchestrationPath(p, plans) && q.planCovers(plan, p, plans));
|
|
1357
1357
|
if (!hit.length) continue;
|
|
1358
|
-
|
|
1358
|
+
// An invalid plan stops code writes, not reads and not the repair of plan files: refusing those
|
|
1359
|
+
// too left a planner unable to fix the very errors the guard named (writes are checked before
|
|
1360
|
+
// the file is valid, so no valid text could ever land).
|
|
1361
|
+
const readOnly = cfg.guards.read_tools.includes(e.tool) || (cfg.guards.shell_tools.includes(e.tool) && !writes.length && !writesShellText(input, cfg));
|
|
1362
|
+
const planRepair = writes.length > 0 && writes.every(w => q.planAt(w, plans));
|
|
1363
|
+
if (plan.errors.length && !readOnly && !planRepair) return `plan ${plan.file} is invalid (${plan.errors.join("; ")}). Stop and report to Main.`;
|
|
1359
1364
|
// P5c (plan 20261031_1207): reads and read-only shell calls skip the phase-0 blockers — a
|
|
1360
1365
|
// failing blocker used to deny every read of a covered path and send the worker back blind.
|
|
1361
1366
|
// The shell filter is the review lock's (writesShellText), so landing text keeps its blocker.
|
|
1362
|
-
|
|
1363
|
-
if (!readOnly) {
|
|
1367
|
+
if (!readOnly && !planRepair) {
|
|
1364
1368
|
const why = runBlockers(plan, hit, e, cfg);
|
|
1365
1369
|
if (why) return why;
|
|
1366
1370
|
}
|