neurastream 0.2.2 → 0.2.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neurastream",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Guardrails for running many AI coding agents at once: plan queue, blockers, call budgets, provider caps, scoring, merge-verified close.",
5
5
  "keywords": ["ai-agents", "coding-agents", "orchestration", "guardrails", "omp", "bun", "cli"],
6
6
  "homepage": "https://github.com/umiddey/neurastream#readme",
@@ -301,7 +301,7 @@ function subRules(e: ToolEvent, input: Record<string, unknown>, paths: string[],
301
301
  return `${p} is a plan file: change its "## Progress" section only with the edit or write tool.`;
302
302
  }
303
303
  for (const plan of plans) {
304
- const hit = paths.filter(p => !q.isOrchestrationPath(p, plans) && q.planCovers(plan, p));
304
+ const hit = paths.filter(p => !q.isOrchestrationPath(p, plans) && q.planCovers(plan, p, plans));
305
305
  if (!hit.length) continue;
306
306
  if (plan.errors.length) return `plan ${plan.file} is invalid (${plan.errors.join("; ")}). Stop and report to Main.`;
307
307
  const why = runBlockers(plan, hit, e, cfg);
@@ -283,9 +283,16 @@ function under(p: string, root: string): boolean {
283
283
  return p === root || p.startsWith(`${root}/`);
284
284
  }
285
285
 
286
- export function planCovers(plan: Plan, p: string): boolean {
287
- if (under(p, plan.repo) || plan.appliesTo.some(a => under(p, a)) || (plan.worktree && under(p, plan.worktree))) return true;
288
- return repoRoot(p) === plan.repo;
286
+ export function planCovers(plan: Plan, p: string, plans: Plan[] = []): boolean {
287
+ // One plan = one worktree (0.2.0 one-index): a linked worktree that another open plan names
288
+ // as its Worktree is that plan's ground, so this plan covers such a path only through its
289
+ // own Worktree or ## Applies to — the repo-level fallback below must not claim every
290
+ // worktree of the shared repo. Paths in the main checkout and in worktrees no open plan
291
+ // names stay covered as before (safe default).
292
+ const g = gitTop(p);
293
+ if (g && plans.some(o => o !== plan && o.status === "open" && o.worktree && o.worktree === g.top))
294
+ return plan.appliesTo.some(a => under(p, a)) || (!!plan.worktree && under(p, plan.worktree));
295
+ return under(p, plan.repo) || plan.appliesTo.some(a => under(p, a)) || (!!plan.worktree && under(p, plan.worktree)) || repoRoot(p) === plan.repo;
289
296
  }
290
297
 
291
298
  export function planAt(p: string, plans: Plan[]): Plan | null {