CLASSIFIER_NOTICE matched by prefix, so a pasted notice followed by a
user question was dropped from both summary paths. Anchor it to the
whole message so trailing user text is kept, and add a regression test.
Also pass ECC_SKIP_LLM_SUMMARY=1 in the withTranscript fixture helper so
an inherited ECC_LLM_SUMMARY_INTERVAL=1 cannot trigger claude -p.
Refs #3867
Assisted-by: Claude <noreply@anthropic.com>
Bash ends a decoded $'...' string at its first NUL, so `cat <<$'EOF\0X'`
ends at the line EOF, but the splitter looked for EOF\0X and swallowed
the commands after the body. A carriage return or a no-break space is
not a blank to Bash, so `echo foo\r# && npm run dev` runs the dev
server, but the splitter read the # as a comment. And spreading a long
substitution's segments into push() threw RangeError, which the hook's
catch turned into an allow. Truncate the decoded part at the NUL, use
Bash's blanks for word starts, and append the segments one at a time.
The safety-classifier notice filter only covered the mechanical summary.
When generateSessionSummary runs (low context or message interval),
extractConversationText read the raw transcript and passed the notice to
the LLM as a user turn, so it could still reach saved context.
Move the check into one shared isClassifierNotice() in
scripts/lib/llm-summary.js and use it in both userMessageText() and
extractConversationText(). Add LLM-path regression tests, and split the
session-end classifier-notice tests into small functions (<50 lines).
Refs #3867
Assisted-by: Claude <noreply@anthropic.com>
In `echo $$'\'; npm run dev`, Bash reads `$$` as the process-ID parameter
and the quote after it as an ordinary single quote, so it runs
`npm run dev`. The splitter took the second `$` as the start of ANSI-C
quoting, which hid the semicolon, and a here-document delimiter such as
`$$'EOF'` was read as `$EOF`, so the body never ended. Consume the `$$`
pair first in both places.
The suite printed 'N passed, M failed', which parseCounts ignores, so its three cases vanished from combined totals. Use the runner's Passed:/Failed: format.
Co-Authored-By: TRAE <noreply@trae.ai>
A symlink alias to .claude/settings.json resolved past the lexical settings check, and a project whose root is .claude collapsed the class path to bare settings.json. Judge the resolved absolute path and the symlink-resolved path as well, with regressions for both.
Co-Authored-By: TRAE <noreply@trae.ai>
Run the Windows full suite with two workers while retaining serial suites and exact file accounting. Resolve Bash before restricting fixture PATH, and add five junction regressions while retaining native symlink coverage.
Validation: both local full runs executed all 456 files exactly once; 9108 passed and the same 24 symlink-permission cases failed. Two workers reduced local runtime from 1324.987s to 885.387s. The 24 native symlink cases passed in the baseline GitHub Windows job.
Review on #3830 found that memory-vault's symlink guard sat above the
try/finally that removes the fixture, so a refusal returned before
cleanup and left the directory in the OS temp dir.
Auditing the other guard sites turned up the same shape in memory-mcp,
where binRoot is created before the guard and only removed in the
finally. Six leaked ecc-memory-bin-* directories were still sitting in
this host's temp dir from earlier runs.
Both guards now sit immediately inside the try. Verified by counting
ecc-* temp directories either side of a run of both files: delta 0.
The remaining guard sites were checked and are already inside their
cleanup scope.
Review on #3830 pointed out that the helper's tests replaced methods on
the shared fs and console objects, which AGENTS.md rules out, and that
the recording arrays were mutated with push.
trySymlink now takes an optional deps argument in the shape
collectResources already uses, `(deps.symlinkSync || fs.symlinkSync)`,
so the refusal branches can be driven without touching anything shared.
The 13 existing call sites pass at most three arguments and are
unchanged. The recorders rebuild their arrays rather than appending.
Also adds a case that omits deps entirely, so the default dependency is
still covered rather than only the injected one.
Re-verified by mutation: emptying UNSUPPORTED_CODES, returning true
unconditionally, removing the rethrow, dropping the skip notice, and
ignoring the injected stand-in each fail 2 to 4 of the 8 cases.
Review on #3830 raised two points against 2f898d7b.
The three artifacts.push calls mutated an array after creating it, which
AGENTS.md rules out ("Immutability (CRITICAL): Always create new objects,
never mutate"). The list is now a single literal with conditional
spreads, so the link-based cases still join it only where the OS allows
the link.
In memory-vault, the readRegularTextFile check on the target reads no
link at all, so the symlink guard now sits below it rather than above.
On a host that refuses the link, that assertion runs instead of being
skipped with the rest.
Review on #3830 noted that the helper had no focused tests: a host that
permits symlinks only ever exercises the success branch, so nothing
proved the skip path this PR adds actually works.
Drives fs.symlinkSync with a stand-in to cover success and argument
forwarding, each of the three supported refusal codes, an unrelated
error, and an error with no code at all.
Verified by mutation rather than by a green run: emptying
UNSUPPORTED_CODES, returning true unconditionally, removing the rethrow,
and dropping the skip notice each fail 2 to 3 of the 7 cases.
Review on #3830 found two places where the early return added in 09de2c24
also skipped assertions that never needed a symlink:
- coordination-inventory: the oversized-JSON and missing-directory checks
were skipped. The expected task count holds whether or not the link
exists, so trySymlink is now called as a plain statement.
- frontend-design-direction: the incomplete-gate, malformed-input and
no-argument checks were skipped. Link-based artifacts are now appended
only when their link succeeds, so a refusal narrows the case list
instead of ending the test. The junction case now runs on Windows,
where it previously sat behind two returns that had already fired.
Also converts the one remaining direct fs.symlinkSync in
opencode-consent-legacy-lock. Junctions are permitted without elevation
on Windows, so that call did not fail here, but it still throws on a
filesystem with no symlink support at all.
Reject numeric prefixes, fractions and unsafe window integers consistently with summary scheduling while preserving resolver precedence. Cap only the default context reminder at eighty percent of a valid earlier native compaction budget; explicit thresholds, including zero, retain their intentional policy. Document the independent capacity, summary and advisory contracts.
RED controls reproduce malformed-budget summary triggers and the known-1M/native-200k missed reminder. Resolver65, helper47, actualStop18 and actualPreToolUse54 pass on Node18 and24. Parent and independent reviewer approved the exact diff before commit. Registry rebinding remains the integration coordinator responsibility after combining documentation repairs.
Clarify native compaction budget scheduling independently of the model window resolver and retain immutable transcript fixtures. Helper43, ten independent scheduling controls, affected lint and independent review passed.
Separate confirmed model capacity from Stop-summary scheduling. Use the smaller confirmed capacity/native budget, or native-only budget for inferred capacity. Three unit and one actual hook RED cases now pass; helper43, actualStop15 and ten independent controls pass without changing the capacity resolver.
Dropping the previous-character check in toggleQuote let the `'` of `\'` close an ANSI-C `$'...'` string, so `echo $'it\'s'; (rm -rf /tmp/x)` left a quote open and the group was never extracted. Track `$'...'` in the quote state and consume backslash escapes inside it, as bash does, and cover the inner scanners (`(...)`, `$(...)`, `{ ...; }` bodies) with quotes ending in a backslash.