The JWT chain scanner only accepted a header at the start of a segment or
after `-`, so `session_<JWT>` reached the audit and cost logs unredacted.
Treat `_` as a prefix boundary too and cover it in the tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before 3.12 the parser rejects f"{d["k"]}" outright, so the shared sample
stopped at a parse error and the per-finding assertions failed on 3.11.
Samples that every supported Python parses now carry the per-finding
checks; the newer f-string forms run one per sample and accept either the
specific finding or the parse error.
Also flag unquoted X | Y annotations, which can fail at definition time
before 3.10, and check that a quoted union is not flagged.
The lookbehind added to keep the JWT scan linear also skipped tokens right
after a `-`, so `--cookie "session=jwt-<JWT>"` reached the logs unredacted.
Scan each `[A-Za-z0-9_.-]` run once instead, checking every dot segment for
a header at its start or after a `-`, decoding at most once per segment so
long `ey-ey-...` runs stay linear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A later batch save advances evaluated_at past edits to previously evaluated skills. Compare each saved evaluation mtime to the current inventory, including timestamps that move backward, and retain the legacy global timestamp fallback.
ast.parse(feature_version=...) on current Pythons goes no lower than the
3.7 grammar, and it accepts f-string forms that older interpreters reject:
the self-documenting {x=} (3.8) and, from 3.12, reused quotes, backslashes
and comments inside a replacement field. ast does not record these, so
the guard now reads each f-string's own source text. The sample file
proves both kinds are flagged and that 3.6-valid fields ({n == 1},
{n!r:>4}, escaped {{n=}}) are not.
instinct-cli keeps running on old interpreters, but people on one should
know they no longer get security fixes. On a Python older than 3.11 (3.10
reached end of life in October 2026) the CLI now prints one line to
stderr after parsing its arguments:
[instinct-cli] Python 3.8 is past end of life. instinct-cli still runs
on it; upgrade to Python 3.11 or newer for security fixes.
The command itself runs as before. The notice stays out of automated
output: `prune --quiet`, which observer-loop.sh runs, skips it, and
CLV2_SKIP_PYTHON_EOL_NOTICE=1 turns it off for anyone who keeps an old
Python on purpose. The threshold is one constant, _SUPPORTED_PYTHON, to
raise as versions age out. Importing the module prints nothing.
The hooks fall back to any Python 3 that runs, so users on an older
interpreter (RHEL 8's 3.6, for one) still reach instinct-cli. It failed
there at import: builtin generics such as list[dict] in signatures are
evaluated when the function is defined, which raises TypeError before
3.9, and str.removeprefix is 3.9+.
- Quote the builtin-generic annotations. Type checkers read them the
same way, and they stay valid under 3.14's deferred annotations.
- Strip the byte-order mark with startswith and a slice.
- Open the registry lock file with an explicit UTF-8 encoding.
- Say in the module docstring that 3.6 is the floor and what keeps it.
The new test parses the script with the oldest grammar ast offers and
rejects what a grammar check cannot see: unquoted builtin generics in evaluated
annotations, `from __future__ import annotations`, and 3.7+ methods and
keywords (capture_output, text, removeprefix and similar). A sample file
proves it catches each of those. It also runs import, status, export,
evolve, projects and prune under -X dev -X warn_default_encoding
-W error, so any deprecation or default-encoding warning on the current
Python fails the build. CI runs only current Pythons; this is a static
guard, not a run on a real 3.6.
commands-core copies scripts/lib into the Claude config root, so it does not repair a marketplace plugin installation. Lead with a direct dashboard run from a full checkout and keep commands-core as the non-marketplace reinstall path.
Co-Authored-By: TRAE <noreply@trae.ai>
The diagnostic always blamed scripts/lib/skill-evolution, hiding a nested failure such as a missing lib/utils.js, and the printed installer command selected no module. Include the module from the resolution error and point at a full-checkout install with --modules commands-core.
Co-Authored-By: TRAE <noreply@trae.ai>
- Replace the secret=/api_key= value regex with a single-pass, quote-aware
scanner so the whole Bash word is redacted when quoted and unquoted
fragments are joined (e.g. --secret='prefix-'suffix), while a value inside
an enclosing quoted string stops at that string's closing quote.
- Searching for the keyword itself (grep -n "secret =" file,
rg 'api_key:' dir) no longer redacts the rest of the command.
- Use a lookbehind instead of \b before the JWT header so long dot-free
ey-ey-... runs are scanned in linear time instead of quadratic.
- Add regression tests for joined fragments, keyword searches, and the
ey- performance case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A managed plugin install can lack scripts/lib/skill-evolution, which made skills-health fail on the first require with Cannot find module. Catch that specific resolution failure and print the install-apply remedy; other errors still propagate.
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.
Match JWT headers that start with ey or ew (whitespace after the opening
brace) and keep non-eyJ matches only when the header does not decode to
an object with an alg field. Parse secret= / api_key= values with escaped
double quotes, $'...' quoting and backslash escapes, and redact an
unterminated quoted value to the end of the command.
Refs #3846
sanitizeCommand only redacted keyword- or flag-shaped secrets, so a bare
Anthropic/OpenAI sk- key, a JWT, a PEM private key block, or a secret= /
api_key= / x-api-key: value was written verbatim to bash-commands.log and
cost-tracker.log. Add value-shape patterns for these and keep the key name
and separator for assignments so the log stays readable.
Refs #3846
- 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.
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 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.
On Windows, piped stdout defaults to cp1252, so `python3 gacha.py` crashed
on its first banner line with UnicodeEncodeError. That covers agent shell
tools and gacha.sh. Reconfigure stdout to UTF-8 before main(), the same
approach instinct-cli.py took for #1855.
The existing tests set PYTHONUTF8=1, which hid the crash. The new case
forces PYTHONIOENCODING=cp1252 without PYTHONUTF8, so it reproduces on any
OS: it fails on the previous gacha.py and passes with this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collect string-valued manifest.hooks as a file reference so missing files, directories, and paths outside the cache fail validation. Add regression coverage for valid and invalid hook references while preserving non-string and absent-hook behavior.
Closes#3786