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.
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>
Move ECC_SHOW_RECOVERY_HINTS parsing into scripts/lib/hooks/recovery-hints.js so every hook trims and accepts the same truthy values. Add default-off and opt-in assertions for the condensed GateGuard denial, config-protection (protected and truncated payloads) and the fail-closed truncation wrapper.
Co-Authored-By: TRAE <noreply@trae.ai>
Removing the exemption gated top-level edits, but subagent Edit/Write/MultiEdit still consult only sensitive or hard-linked targets, so an ordinary settings file bypassed the gate. Classify .claude/settings*.json as sensitive in the shared target class and cover all three subagent edit tools plus both settings file names.
Co-Authored-By: TRAE <noreply@trae.ai>
- Add the config-health skill: a read-only monitor for hook wiring, rule references, and rule staleness; every mode exits 0.
- Ship its own SessionStart hook asset so installing the module registers the monitor; keep PreToolUse opt-in.
- Keep one install-state record per hook source, so hooks-runtime and config-health can share settings.json and uninstall removes both.
- Split the monitor into a CLI entry plus constants, paths, and scan modules; split scan_command and the hook contract suite. All files are under 800 lines and no function body reaches 50 lines.
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.
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.
AGENTS.md asks for new objects rather than mutation. toggleQuote now returns the updated quote state (or null when the character is not a quote it toggles), skipOuterSpan returns it alongside the skipped index, and each scanner reassigns its own local state.
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.