neurastream 0.2.81 → 0.2.83
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/README.md +4 -1
- package/package.json +1 -1
- package/src/core/guards.ts +3 -3
- package/src/core/wip-roots.ts +6 -1
package/README.md
CHANGED
|
@@ -133,7 +133,7 @@ Green is both exiting 0.
|
|
|
133
133
|
|
|
134
134
|
`neurastream traces briefs --since 30d` lists each spawn brief Main sent (shared context first, then the task's own text) with its features — length, a `file:line`, a verify command, a phase id, a plan path, a `Call budget` line, the number of acceptance lines — next to the spawned agent's waste and whether its work was accepted. `--json` gives the rows, `--report` compares the rows with and without each feature (a side with fewer than `traces.briefs.min_n` rows prints "n too small"). Brief text never prints. Read the report with care: a spawn without a plan is never accepted, and accept records exist only since scoring began, so all-time accept rates mostly measure when and for what an agent was spawned, not how good the brief was. Compare plan briefs from the same period before turning a gap into a rule; on 30 days of real briefs that comparison showed no feature strong enough for a brief-lint warning.
|
|
135
135
|
|
|
136
|
-
`neurastream labels episodes [--since 30d] [--json]` joins score events, subagent runs and the successful spawn brief that named each agent. Died or over-budget runs without an accept are included with no commits. The default window is `labels.episode_days` (30); `--since` overrides it. `neurastream labels assign <episode> --party plan|implementer|both --why <text>` appends a party override. A flipped episode loses `labels.flip_weight` (default 1) of its accept points on the board and the gate; a plan-party flip also counts against MAIN.
|
|
136
|
+
`neurastream labels episodes [--since 30d] [--json]` joins score events, subagent runs and the successful spawn brief that named each agent. Died or over-budget runs without an accept are included with no commits. The default window is `labels.episode_days` (30); `--since` overrides it for `labels episodes` only. `neurastream labels update --repo <dir>` takes no `--since` (the same `labels.episode_days` window, and only `--repo`). `neurastream labels assign <episode> --party plan|implementer|both --why <text>` appends a party override. A flipped episode loses `labels.flip_weight` (default 1) of its accept points on the board and the gate; a plan-party flip also counts against MAIN.
|
|
137
137
|
|
|
138
138
|
`neurastream diff-check [--staged | <rev>]` is the removal check: an added comment line matching `labels.removal_comment_patterns` is flagged, and a commit whose subject matches `labels.removal_subjects` flags every added non-blank line. It prints `file:line: text` and exits 1 on hits; pure deletions pass, and a config regex that does not compile is skipped (fail-open, never refused). The plan-guard runs the same scan when a subagent's shell calls `git commit` on its staged diff and refuses the commit listing the flagged lines; Main is not gated.
|
|
139
139
|
|
|
@@ -426,6 +426,9 @@ Config (defaults):
|
|
|
426
426
|
labels:
|
|
427
427
|
episode_days: 30
|
|
428
428
|
flip_weight: 1.0
|
|
429
|
+
repos: []
|
|
430
|
+
removal_comment_patterns: ['\bremoved\b', '\bno longer\b', '\bpreviously\b', '\bused to\b', '\bwas deleted\b']
|
|
431
|
+
removal_subjects: ['^(remove|drop|delete)\b', '^chore: remove']
|
|
429
432
|
traces:
|
|
430
433
|
bloat:
|
|
431
434
|
first_call_max: 150000
|
package/package.json
CHANGED
package/src/core/guards.ts
CHANGED
|
@@ -217,10 +217,10 @@ function writePlanReviews(reviews: Record<string, PlanReview>, code: Record<stri
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
/** The progress entry that records a review — PLAN for the spawn gate, CODE for the phase tick gate (P6); only a subagent's edit can carry one. The verdict is the match, never a substring. */
|
|
221
|
-
const REVIEW_LINE = /^- (?:\d{4}-\d{2}-\d{2} \d{2}:\d{2} [^\s:]+: )?(PLAN|CODE) REVIEW: (PASS|FAIL)\b/;
|
|
220
|
+
/** The progress entry that records a review — PLAN for the spawn gate, CODE for the phase tick gate (P6); only a subagent's edit can carry one. The verdict is the match, never a substring. The time may carry a zone word (`23:35 CET`). */
|
|
221
|
+
const REVIEW_LINE = /^- (?:\d{4}-\d{2}-\d{2} \d{2}:\d{2}(?: [A-Z]{2,5})? [^\s:]+: )?(PLAN|CODE) REVIEW: (PASS|FAIL)\b/;
|
|
222
222
|
/** Any entry that opens like a review line; one that REVIEW_LINE does not match is restored, not recorded. */
|
|
223
|
-
const REVIEW_LOOKALIKE = /^- (?:\d{4}-\d{2}-\d{2} \d{2}:\d{2} [^\s:]+: )?(PLAN|CODE) REVIEW\b/;
|
|
223
|
+
const REVIEW_LOOKALIKE = /^- (?:\d{4}-\d{2}-\d{2} \d{2}:\d{2}(?: [A-Z]{2,5})? [^\s:]+: )?(PLAN|CODE) REVIEW\b/;
|
|
224
224
|
|
|
225
225
|
/** Who launches an agent: Main's launch may use a plan review's exemption, a sub's never may (plan 20261028_1600 P4i). */
|
|
226
226
|
export type Spawner = "main" | "sub";
|
package/src/core/wip-roots.ts
CHANGED
|
@@ -16,10 +16,15 @@ export function deadGitfile(dir: string): boolean {
|
|
|
16
16
|
return !existsSync(resolve(dir, first.slice("gitdir: ".length).trim()));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/** The worktree's ref key: one valid git ref component, also for paths outside home (`../`) or dot dirs. */
|
|
19
20
|
export function keyOf(path: string, home: string): string {
|
|
20
21
|
const realHome = existsSync(home) ? realpathSync(home) : home;
|
|
21
22
|
const realPath = existsSync(path) ? realpathSync(path) : path;
|
|
22
|
-
return relative(realHome, realPath)
|
|
23
|
+
return relative(realHome, realPath)
|
|
24
|
+
.replace(/[^A-Za-z0-9._-]+/g, "_")
|
|
25
|
+
.replace(/\.{2,}/g, "_")
|
|
26
|
+
.replace(/^[._]+|_+$/g, "")
|
|
27
|
+
.replace(/\.lock$/, "_lock");
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
function walkFolder(dir: string, currentDepth: number, maxDepth: number, out: string[]): void {
|