v0.2.0 - Provenance
Added
- Provenance.
PostToolUsenow records the actionable atoms of every scanned output (URLs/hosts, package specs, pipe-to-shell commands, base64 blobs) in a per-session, redacted, bounded trace;PreToolUseattributes proposed actions to those traces and adds two action classes,origin.untrustedandorigin.suspect, evaluated by two new default rules (ask-origin-untrusted,deny-origin-suspect). Hook reasons and audit entries carry the evidence ("… appeared in the output of mcp__sentry__get_issue (…) 40 s ago"); clean outputs that contain atoms are annotated for Claude Code's auto-mode classifier viaclassifierContext. Packages the project already depends on are never counted for shell commands.- Upgrade note: a custom
~/.stroq/policy.yamlreplaces the default policy wholesale, so provenance is enforced only if it contains rules fororigin.suspectandorigin.untrusted— copydeny-origin-suspectandask-origin-untrustedfrompolicies/default.yaml(keeping them ahead of theask-*rules).
- Upgrade note: a custom
stroq why [--seq <n>]: explains the most recent denied or asked action — rule, provenance evidence, and session taint.stroq untaint --session <id>now also clears the session's provenance trace, so a false positive stops producingorigin.*decisions.- Demo: a Sentry-style poisoned MCP result (
examples/demo/events/4-post-mcp-sentry.json) followed by thenpxit suggests.
Fixed
- CI's rules-bundle check no longer depends on machine speed. Previously, CI regenerated
packages/core/src/rules.bundle.jsonand diffed it against the committed copy; a GitHub runner slower than the maintainer's machine could push a rule over the regex performance gate's threshold, disabling a rule the committed bundle didn't and failing CI with an unrelated-looking diff.scripts/build-rules.ts --check(wired into CI aspnpm build:rules --check --advisory-perf, and available locally aspnpm check:rules) now re-verifies rule compilation and the benign-corpus scan against the already-committedrules/atr-disabled.jsonand byte-compares an in-memory rebuild against the committed bundle, without measuring performance at all.--advisory-perfstill times every rule and prints aWARNINGfor anything over threshold that isn't already disabled, but never fails the build. - The local performance gate's threshold (
pnpm build:rules, run by a maintainer to regenerate the bundle) dropped from 50 ms to 25 ms, leaving margin for machines slower than the one that produced the committed bundle.
Changed
scripts/build-rules.tsis now a thin CLI overscripts/lib/rules-pipeline.ts, a set of pure functions (load, compile, benign-corpus gate, timing gate, assemble, compare) covered directly bypackages/core/test/rules/rules-pipeline.test.ts.- npm package published as
@stroq/cli; the unscoped namestroqis refused by the registry's similarity check. The CLI binary is unaffected — it's still invoked asstroq(npm install -g @stroq/cli, thenstroq init; ornpx @stroq/cli initfor one-off use).
Install or upgrade: npx @stroq/cli@0.2.0 init (or npm install -g @stroq/cli@0.2.0).