neurastream 0.2.45 → 0.2.46
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/blockers.ts +8 -1
- package/src/core/guards.ts +6 -1
- package/templates/config.yml +2 -2
package/package.json
CHANGED
package/src/core/blockers.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
// Contract (called by the guard for every subagent call that touches an open plan's repo,
|
|
6
6
|
// worktrees or "## Applies to" paths):
|
|
7
7
|
// argv the arguments written after the blocker name in the plan's "## Blockers" line
|
|
8
|
-
// stdin JSON {tool, input, cwd, agent: "main"|"sub", repo, plan, paths: [absolute paths]
|
|
8
|
+
// stdin JSON {tool, input, cwd, agent: "main"|"sub", repo, plan, paths: [absolute paths],
|
|
9
|
+
// foreign?: true} — foreign: the caller is staffed on a different plan, so judge
|
|
10
|
+
// only the paths listed (deny-path prunes the rest)
|
|
9
11
|
// exit 0 allow; exit 2 + one line on stderr = refuse the call with that reason.
|
|
10
12
|
|
|
11
13
|
import { readFileSync, statSync } from "node:fs";
|
|
@@ -21,6 +23,8 @@ export interface BlockerCall {
|
|
|
21
23
|
repo: string;
|
|
22
24
|
plan: string;
|
|
23
25
|
paths: string[];
|
|
26
|
+
/** True when the caller is staffed on a different plan (runBlockers sets it): judge only paths. */
|
|
27
|
+
foreign?: boolean;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export interface BlockerEnv {
|
|
@@ -599,6 +603,9 @@ export function denyPath(env: BlockerEnv): void {
|
|
|
599
603
|
if (CODE_MUTATING.test(env.command) || CODE_WRITE.test(env.command))
|
|
600
604
|
targets = [...(env.call.paths ?? []), ...evalPaths(env)];
|
|
601
605
|
} else if (env.shell) targets = shellTargets(env);
|
|
606
|
+
// A foreign plan's globs never reach past the paths that made its blockers run
|
|
607
|
+
// (I-20261028-111): the command may also name paths this plan does not cover.
|
|
608
|
+
if (env.call.foreign) targets = targets.filter((p) => env.call.paths.includes(p));
|
|
602
609
|
for (const p of targets) {
|
|
603
610
|
for (const g of env.args) {
|
|
604
611
|
if (matchesPath(p, g, env.call)) block(`${p} is forbidden by the plan (deny-path ${g})`);
|
package/src/core/guards.ts
CHANGED
|
@@ -544,10 +544,15 @@ export function spawnProblem(
|
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
function runBlockers(plan: Plan, hit: string[], e: ToolEvent, cfg: Config): string | null {
|
|
547
|
+
// A caller staffed on a different plan (staffing.json holds the task names, keyed by agentId)
|
|
548
|
+
// only grazes this plan (I-20261028-111): its path blockers must judge the covered paths,
|
|
549
|
+
// not every path the command names.
|
|
550
|
+
const staffing = readStaffing();
|
|
551
|
+
const foreign = !(staffing[plan.file] ?? []).includes(e.agentId) && Object.entries(staffing).some(([f, names]) => f !== plan.file && names.includes(e.agentId));
|
|
547
552
|
for (const b of plan.blockers) {
|
|
548
553
|
try {
|
|
549
554
|
execFileSync(b.script, b.args, {
|
|
550
|
-
input: JSON.stringify({ tool: e.tool, input: e.input, cwd: e.cwd, agent: e.agent, repo: plan.repo, plan: plan.file, paths: hit }),
|
|
555
|
+
input: JSON.stringify({ tool: e.tool, input: e.input, cwd: e.cwd, agent: e.agent, repo: plan.repo, plan: plan.file, paths: hit, ...(foreign ? { foreign: true } : {}) }),
|
|
551
556
|
encoding: "utf8",
|
|
552
557
|
timeout: cfg.guards.blocker_timeout_ms,
|
|
553
558
|
stdio: ["pipe", "pipe", "pipe"],
|
package/templates/config.yml
CHANGED
|
@@ -214,10 +214,10 @@ write_check: # write-time lint checks (src/core/write-check.ts):
|
|
|
214
214
|
enabled: false # on = check every edit; off in the shipped template
|
|
215
215
|
applies_to: sub # "sub" = subagents only; "all" = Main too
|
|
216
216
|
timeout_ms: 5000 # per linter run; a timeout, crash or missing linter allows the edit and logs a note
|
|
217
|
-
suppress: 'noqa|type:\s*ignore|oxlint-disable|eslint-disable|biome-ignore|@ts-ignore|@ts-expect-error|@ts-nocheck' # a new match counts as a new problem
|
|
217
|
+
suppress: '(#|//|/\*)\s*(noqa|type:\s*ignore|oxlint-disable|eslint-disable|biome-ignore|@ts-ignore|@ts-expect-error|@ts-nocheck)' # a new match counts as a new problem; the word only counts inside a comment
|
|
218
218
|
linters:
|
|
219
219
|
- ext: [".py"]
|
|
220
|
-
argv: ["ruff", "check", "--no-cache", "--output-format=concise", "--select", "E,F,B,S,C90,PERF,SIM", "{file}"]
|
|
220
|
+
argv: ["ruff", "check", "--no-cache", "--output-format=concise", "--select", "E,F,B,S,C90,PERF,SIM", "--ignore", "E501,S101", "{file}"]
|
|
221
221
|
pattern: '^.+?:\d+:\d+: (?<rule>\S+) '
|
|
222
222
|
- ext: [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]
|
|
223
223
|
argv: ["oxlint", "-f", "unix", "-D", "correctness", "-D", "suspicious", "-D", "perf", "{file}"]
|