scar-cli 0.24.0__tar.gz → 0.25.0__tar.gz
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.
- scar_cli-0.25.0/.release-please-manifest.json +3 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0001-git-grep-ere-pitfalls.landmine.md +1 -1
- scar_cli-0.24.0/.scars/candidates/cascade-block-exit-collides-with-argparse.md → scar_cli-0.25.0/.scars/0023-cascade-block-exit-collides-with-argparse.fence.md +5 -3
- scar_cli-0.24.0/.scars/candidates/host-detection-must-not-read-the-process-home.md → scar_cli-0.25.0/.scars/0024-host-detection-must-not-read-the-process-home.deadend.md +5 -3
- scar_cli-0.24.0/.scars/candidates/one-plugin-hook-manifest-two-hosts-two-root-variables.md → scar_cli-0.25.0/.scars/0025-one-plugin-hook-manifest-two-hosts-two-root-variables.landmine.md +4 -2
- scar_cli-0.24.0/.scars/candidates/path-anchor-breadth-drives-the-review-due-threshold.md → scar_cli-0.25.0/.scars/0026-path-anchor-breadth-drives-the-review-due-threshold.landmine.md +5 -3
- {scar_cli-0.24.0 → scar_cli-0.25.0}/CHANGELOG.md +22 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/PKG-INFO +1 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/SPEC.md +37 -11
- {scar_cli-0.24.0 → scar_cli-0.25.0}/plugin/plugin.json +1 -1
- {scar_cli-0.24.0/src/scar → scar_cli-0.25.0/plugin}/skills/scar-authoring/SKILL.md +3 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/pyproject.toml +1 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/cascade.py +14 -6
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/cli.py +209 -11
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/codex.py +9 -3
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/hooks.py +29 -3
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/match.py +104 -26
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/mcp.py +1 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/orphan.py +55 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/render.py +22 -3
- {scar_cli-0.24.0/plugin → scar_cli-0.25.0/src/scar}/skills/scar-authoring/SKILL.md +3 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/symbols.py +13 -2
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_cascade.py +46 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_cli.py +527 -2
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_codex.py +5 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_hooks.py +37 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_json_contract.py +19 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_match.py +117 -1
- scar_cli-0.25.0/tests/test_matched_by.py +179 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_orphan.py +197 -1
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_render.py +35 -0
- scar_cli-0.25.0/tests/test_sweep.py +277 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/uv.lock +2 -2
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docs/agents.md +1 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docs/concepts.md +3 -2
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docs/methodology.md +2 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docs/quickstart.md +1 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docusaurus.config.ts +2 -0
- scar_cli-0.25.0/website/static/img/social-card.png +0 -0
- scar_cli-0.24.0/.release-please-manifest.json +0 -3
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.claude-plugin/marketplace.json +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/workflows/ci.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/workflows/docs.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/workflows/pr-validation.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.github/workflows/release.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.gitignore +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.pre-commit-config.yaml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.pre-commit-hooks.yaml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0002-agent-direct-hook-install.deadend.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0003-installer-binds-to-active-venv-scar.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0004-promote-roundtrip-drops-expires-evidence.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0005-history-rewrite-orphans-commit-evidence.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0006-yaml-pattern-anchor-over-escaping.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0007-release-please-config-change-skips-open-pr.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0008-rich-output-nontty-must-bypass-rich.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0009-anchor-survival-harness-measures-symbol-not-path-anchors.deadend.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0010-git-returncode-128-vs-empty-tracked-set.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0011-lint-compile-check-lets-redos-anchors-hang-hotpath.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0012-firing-log-readers-need-blanket-guards.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0013-docusaurus-future-v4-requires-faster-dep.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0014-inject-flag-dest-collides-with-subcommand-dispatch.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0015-zero-checkruns-means-approval-gate-not-workflow-bug.deadend.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0016-hook-ownership-must-be-kind-scoped.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0017-codex-pretool-context-can-replay-apply-patch.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0018-cli-subparsers-register-through-_add-wrapper.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0019-token-in-scar-body-cannot-prove-hook-delivery.deadend.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0020-one-directional-health-check-leaves-flattering-direction-unwatched.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0021-posttool-fix-in-hooks-does-not-reach-codex-or-cascade.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/0022-codex-hook-delivery-needs-user-file-and-trust.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/README.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/.scars/template.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/AGENTS.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/CONTRIBUTING.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/IDEA.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/LICENSE +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/README.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/ROADMAP.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/SCAR-FORMAT.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/STRESS-TEST.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/action.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/codecov.yml +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/PROTOCOL.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/RESULTS.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/long_replay.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/replay.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/replay_shipped.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/anchor-survival/test_replay_shipped.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/auto-authorship/FINDINGS.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/auto-authorship/PROTOCOL.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/.gitignore +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/PROTOCOL.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/RESULTS.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/.scars/0001-vendor-retry-window.fence.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/.scars/0002-evicting-session-store.deadend.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/.scars/0003-export-column-order.landmine.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/README.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/payments/retry.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/reports/export.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/fixture/services/sessions.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/fence-honor/grade.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/harvest/PROTOCOL.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/experiments/harvest/harvest.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/hook/scar-hooks.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/plugin/hooks/run.sh +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/plugin/skills/scar-authoring/assets/template.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/release-please-config.json +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/__init__.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/agent.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/draftcheck.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/evidence.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/firing_log.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/gc.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/harvest.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/hosts.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/installer.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/lint.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/model.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/output.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/reanchor.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/renames.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/review.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/skills/scar-authoring/assets/template.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/src/scar/store.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/conftest.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_action_yml.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_anchor_kind.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_block_capability.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_context_size.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_docs.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_draftcheck.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_evidence.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_firing_log.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_gc.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_git_hook.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_harvest.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_hosts.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_installer.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_lifecycle.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_lint.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_mcp.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_model.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_output.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_plugin.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_precommit_hooks.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_reanchor.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_renames.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_review.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_skill.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_store.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_symbols.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/tests/test_verdict_observability.py +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/.gitignore +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/docs/index.md +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/package-lock.json +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/package.json +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/scripts/sync-changelog.mjs +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/sidebars.ts +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/src/css/custom.css +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/static/img/favicon.svg +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/static/llms.txt +0 -0
- {scar_cli-0.24.0 → scar_cli-0.25.0}/website/tsconfig.json +0 -0
|
@@ -10,7 +10,7 @@ anchors:
|
|
|
10
10
|
- path: experiments/anchor-survival/
|
|
11
11
|
- path: src/scar/harvest.py
|
|
12
12
|
- pattern: "git.{0,20}grep"
|
|
13
|
-
violation: "git
|
|
13
|
+
violation: "git[^#\n]{0,60}grep[^#\n]{0,80}[\x22\x27][^\x22\x27#\n]{0,40}\\b"
|
|
14
14
|
evidence:
|
|
15
15
|
- note: "orphaned receipt — pre-v0.1.0 commit 5c63b14 produced a fake 0% anchor-survival run before diagnosis (gate 0.2); resolves at github.com/Daily-Nerd/Scar/commit/5c63b14 until GC, not in fresh clones (rewritten at the v0.1.0 release)"
|
|
16
16
|
expires:
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
2
|
+
id: 23
|
|
3
3
|
type: fence
|
|
4
4
|
title: Cascade's block code is 2, and so is argparse's error code — never exit 2 directly from cascade-hook
|
|
5
5
|
severity: high
|
|
6
6
|
confidence: 0.9
|
|
7
7
|
created: 2026-08-04
|
|
8
8
|
authors: ["claude-code"]
|
|
9
|
+
promoted_by: Kibukx
|
|
10
|
+
promoted_by_source: explicit
|
|
9
11
|
anchors:
|
|
10
12
|
- path: src/scar/cascade.py
|
|
11
13
|
- path: src/scar/installer.py
|
|
12
14
|
- pattern: "cascade-hook"
|
|
13
15
|
evidence:
|
|
14
16
|
- issue: 197
|
|
15
|
-
- note:
|
|
17
|
+
- note: .windsurf/hooks.json is committed and workspace-level, so a teammate on an older scar-cli runs whatever command string we wrote
|
|
16
18
|
expires:
|
|
17
19
|
condition: "Cascade gains a non-blocking context channel (an additionalContext equivalent), so blocking is no longer the injection path at all"
|
|
18
20
|
review_after: 2027-02-04
|
|
19
|
-
status:
|
|
21
|
+
status: active
|
|
20
22
|
---
|
|
21
23
|
|
|
22
24
|
`scar cascade-hook` signals "block this action" with sentinel exit code 20,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
2
|
+
id: 24
|
|
3
3
|
type: deadend
|
|
4
4
|
title: Host detection must take home from installer.CLAUDE_DIR, never Path.home() — a bare call passes locally and fails every other machine
|
|
5
5
|
severity: high
|
|
6
6
|
confidence: 0.9
|
|
7
7
|
created: 2026-09-07
|
|
8
8
|
authors: ["claude-code"]
|
|
9
|
+
promoted_by: Kibukx
|
|
10
|
+
promoted_by_source: explicit
|
|
9
11
|
anchors:
|
|
10
12
|
- pattern: "detect_hosts\("
|
|
11
13
|
- symbol: src/scar/cli.py::_detect
|
|
12
14
|
evidence:
|
|
13
15
|
- issue: 318
|
|
14
|
-
- note:
|
|
16
|
+
- note: 2026-09-07, during the multi-host skill install work: the skill-install refusal resolved home with Path.home(). Under HOME=empty the suite went 1031 passed / 2 FAILED, both PRE-EXISTING tests, printing 'claude not detected on this machine, nothing written'. Fixed by reusing _detect(). Branch SHAs deliberately omitted: scar #5 fired on the amend that wrote this, and squash-merge would orphan them.
|
|
15
17
|
expires:
|
|
16
18
|
condition: "detect_hosts takes home from one injected seam no caller can bypass"
|
|
17
19
|
review_after: 2027-03-08
|
|
18
|
-
status:
|
|
20
|
+
status: active
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
`Path.home()` in a detection path looks obviously right and is a trap. Tests
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
2
|
+
id: 25
|
|
3
3
|
type: landmine
|
|
4
4
|
title: A plugin hook manifest is read by every host that installs the plugin, and hosts expand different root variables
|
|
5
5
|
severity: high
|
|
6
6
|
confidence: 0.9
|
|
7
7
|
created: 2026-09-03
|
|
8
8
|
authors: ["claude-code"]
|
|
9
|
+
promoted_by: Kibukx
|
|
10
|
+
promoted_by_source: explicit
|
|
9
11
|
anchors:
|
|
10
12
|
- path: plugin/
|
|
11
13
|
- path: src/scar/installer.py
|
|
@@ -16,7 +18,7 @@ evidence:
|
|
|
16
18
|
expires:
|
|
17
19
|
condition: "the plugin format gains per-host scoping for hook files"
|
|
18
20
|
review_after: 2026-12-01
|
|
19
|
-
status:
|
|
21
|
+
status: active
|
|
20
22
|
---
|
|
21
23
|
|
|
22
24
|
Claude Code merges plugin.json hooks with hooks/hooks.json and defines only
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
id:
|
|
2
|
+
id: 26
|
|
3
3
|
type: landmine
|
|
4
4
|
title: A whole-file or whole-directory path anchor makes the review-due threshold report anchor breadth, not code hazard
|
|
5
5
|
severity: medium
|
|
6
6
|
confidence: 0.8
|
|
7
7
|
created: 2026-09-04
|
|
8
8
|
authors: ["claude-code"]
|
|
9
|
+
promoted_by: Kibukx
|
|
10
|
+
promoted_by_source: explicit
|
|
9
11
|
anchors:
|
|
10
12
|
- path: SCAR-FORMAT.md
|
|
11
13
|
- pattern: "review_after_firings"
|
|
12
14
|
evidence:
|
|
13
15
|
- issue: 312
|
|
14
|
-
- note:
|
|
16
|
+
- note: triage of all five over-threshold scars in this repo on 2026-09-04: four were over-anchored, one was a real code fix
|
|
15
17
|
expires:
|
|
16
18
|
condition: "lint reports what share of a scar's firings touched the hazard, so the review-due warning can distinguish breadth from recurrence"
|
|
17
19
|
review_after: 2027-03-04
|
|
18
|
-
status:
|
|
20
|
+
status: active
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
`scar lint` warns past `review_after_firings` that either the guarded code
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.25.0](https://github.com/Daily-Nerd/Scar/compare/v0.24.0...v0.25.0) (2026-10-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **firing-log:** record which anchor kinds matched each scar ([#335](https://github.com/Daily-Nerd/Scar/issues/335)) ([#339](https://github.com/Daily-Nerd/Scar/issues/339)) ([aa6b719](https://github.com/Daily-Nerd/Scar/commit/aa6b719089d504fce045052598e8d93ef1832fd7))
|
|
9
|
+
* **lint:** warn on a violation that cannot arm, dead candidate anchors, and broad patterns ([#325](https://github.com/Daily-Nerd/Scar/issues/325)) ([#328](https://github.com/Daily-Nerd/Scar/issues/328)) ([b3b3224](https://github.com/Daily-Nerd/Scar/commit/b3b3224c31a6b29f9d253290dd0e7bf99e1e7e56))
|
|
10
|
+
* **render:** header names the pre-cap total when the cap cut scars ([#322](https://github.com/Daily-Nerd/Scar/issues/322)) ([fc3754b](https://github.com/Daily-Nerd/Scar/commit/fc3754beef137d1d51bf0079d8172765a0277c73))
|
|
11
|
+
* **sweep:** run every armed violation over the whole tree and report live hits ([#326](https://github.com/Daily-Nerd/Scar/issues/326)) ([#329](https://github.com/Daily-Nerd/Scar/issues/329)) ([ecbd159](https://github.com/Daily-Nerd/Scar/commit/ecbd1597db6536d801a05c80a69fa1bd3e945ccc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **lint:** report duplicate scar ids, and stop the matcher dropping one ([#327](https://github.com/Daily-Nerd/Scar/issues/327)) ([210f4c7](https://github.com/Daily-Nerd/Scar/commit/210f4c77197fa603d8659f9717ef8350277fc6f8))
|
|
17
|
+
* **match:** symbol anchor is a content signal only when the edit mentions the symbol ([#338](https://github.com/Daily-Nerd/Scar/issues/338)) ([0a1aac6](https://github.com/Daily-Nerd/Scar/commit/0a1aac63c8118fb3701c56fd6a9c03de08fe3581))
|
|
18
|
+
* **orphan:** count symbol anchors in orphan detection and report one that no longer resolves ([#337](https://github.com/Daily-Nerd/Scar/issues/337)) ([#342](https://github.com/Daily-Nerd/Scar/issues/342)) ([321f9de](https://github.com/Daily-Nerd/Scar/commit/321f9de04f18630d6354ee6cd204b0dba67f0bda))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
|
|
23
|
+
* **anchors:** say path anchors are prefixes, and teach the skill when to use symbol anchors ([#340](https://github.com/Daily-Nerd/Scar/issues/340)) ([7babb9f](https://github.com/Daily-Nerd/Scar/commit/7babb9face9116f9dfa5884a14cefdeb6b9bee90))
|
|
24
|
+
|
|
3
25
|
## [0.24.0](https://github.com/Daily-Nerd/Scar/compare/v0.23.0...v0.24.0) (2026-09-08)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -59,6 +59,8 @@ Do not reintroduce Redis (or any evicting store) for sessions unless sessions
|
|
|
59
59
|
become stateless/re-derivable. Postgres-backed sessions are intentional.
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
An `id` identifies one scar. `scar lint` reports an id carried by more than one numbered scar file as an error on each of them (two branches that each promote a candidate both take the next number), naming the other files and the next free id. It does not renumber: firing-log rows and evidence notes already reference the number, so which scar keeps it is a human call. Candidates are not checked: promotion assigns their id, and they never fire.
|
|
63
|
+
|
|
62
64
|
### Type semantics
|
|
63
65
|
|
|
64
66
|
- **`deadend`** — protects against *re-attempting an approach*. Primary anchor is often a `pattern` (the approach reappearing anywhere), not a location.
|
|
@@ -71,18 +73,20 @@ The hard technical problem. Line numbers are dead on arrival; file paths die on
|
|
|
71
73
|
|
|
72
74
|
Four anchor classes, used in combination:
|
|
73
75
|
|
|
74
|
-
1. **Path anchors** — file or directory
|
|
76
|
+
1. **Path anchors** — file or directory prefixes. A directory with a trailing slash or a file path both work; wildcards are not expanded. Cheap, survive content change, die on rename (mitigated by git rename tracking during re-anchor).
|
|
75
77
|
2. **Symbol anchors** — function/class/method names resolved via tree-sitter. Survive moves within and across files in the same repo. Primary anchor class for fences.
|
|
78
|
+
For orphan detection (#337) a symbol anchor is live while its definition resolves: `path::name` in that file, a bare name in any tracked file the `[symbols]` extra can parse. Without the extra it cannot be checked, so it holds the scar alive the way a command anchor does, and `scar lint` prints one `symbols-unchecked` hint per run.
|
|
76
79
|
3. **Pattern anchors** — regex/AST patterns over *new* code (diff-scoped, not whole-repo). The only anchor class that can catch a dead end being re-attempted in a brand-new file. Powers `deadend` enforcement.
|
|
77
80
|
4. **Command anchors** (#175) — regexes over a *shell command about to execute* (`PreToolUse:Bash` and `scar inject --command`). The only anchor class with a firing surface for run-a-command mistakes — knowledge like "bare `uv sync` strips extras" has no edit to anchor to. Never matched against paths or content (structurally immune to self-match/partial-rot) and exempt from content liveness; `review_after` is the freshness mechanism.
|
|
78
81
|
|
|
79
|
-
Plus a **content fingerprint** (normalized-token hash of the protected region) used not for matching but for *drift detection*: fingerprint drift is an advisory warning surfaced by `scar orphan` and `scar lint`. The `orphaned` transition itself is driven by the location anchors
|
|
82
|
+
Plus a **content fingerprint** (normalized-token hash of the protected region) used not for matching but for *drift detection*: fingerprint drift is an advisory warning surfaced by `scar orphan` and `scar lint`. The `orphaned` transition itself is driven by the location anchors (a scar orphans when all of its path/pattern/symbol anchors go dead) and surfaces in `scar status` and CI as "this knowledge has come loose: re-anchor or archive." Orphaned ≠ deleted, ever.
|
|
80
83
|
|
|
81
84
|
## 3. CLI surface (v0)
|
|
82
85
|
|
|
83
86
|
```
|
|
84
87
|
scar init # create .scars/ with a seeded example candidate; installs nothing (hooks are explicit: scar hook install)
|
|
85
88
|
scar check <path|diff> # scars relevant to a path or staged diff; exit code for CI
|
|
89
|
+
scar sweep # run every armed violation over the whole tree; read-only, exit 0 unless --exit-code
|
|
86
90
|
scar why <path> # human-readable history of pain for a file/dir
|
|
87
91
|
scar challenge <id> # open a challenge: contest staleness with evidence
|
|
88
92
|
scar harvest # mine git history, emit candidate scars to .scars/candidates/
|
|
@@ -117,7 +121,7 @@ Also `PostToolUse`/stop-hook prompt: *"You appear to have abandoned approach X a
|
|
|
117
121
|
|
|
118
122
|
### 4.3 Ranking and the fatigue budget
|
|
119
123
|
|
|
120
|
-
Hard rule: **max 3 scars injected per edit, max ~120 words each.** A scar system that warns constantly is a scar system that gets uninstalled. Ranking: `severity_weight × confidence × anchor_specificity`, sorted descending (`confidence` is the static authored weight
|
|
124
|
+
Hard rule: **max 3 scars injected per edit, max ~120 words each.** A scar system that warns constantly is a scar system that gets uninstalled. Ranking: `severity_weight × confidence × anchor_specificity`, sorted descending (`confidence` is the static authored weight, see §5). Everything else is reachable via `scar why` but not pushed. The cut is never silent (#321): when more scars matched than the cap allows, the injection header reads `3 of 5 matched shown` (the count is distinct scars, taken before the cut). With no census the header makes no claim about a total, and when nothing was cut it is unchanged.
|
|
121
125
|
|
|
122
126
|
## 5. Lifecycle
|
|
123
127
|
|
|
@@ -167,8 +171,8 @@ All harvest output is `candidates/`, never active. Precision over recall: a harv
|
|
|
167
171
|
|
|
168
172
|
## 9. Machine-readable output contract
|
|
169
173
|
|
|
170
|
-
|
|
171
|
-
`gc`, `orphan`, `reanchor`, `draft-check`. Two more are machine-mode by
|
|
174
|
+
Ten subcommands accept `--json`: `lint`, `status`, `check`, `sweep`, `why`,
|
|
175
|
+
`stats`, `gc`, `orphan`, `reanchor`, `draft-check`. Two more are machine-mode by
|
|
172
176
|
design: `scar inject` (hook JSON or silence) and `scar brief --compact`.
|
|
173
177
|
|
|
174
178
|
Everything in this section is a **promise to external consumers**. It exists
|
|
@@ -221,9 +225,10 @@ Top-level keys, and the keys of each object inside the listed arrays.
|
|
|
221
225
|
|
|
222
226
|
| Command | Guaranteed top-level | Array item keys |
|
|
223
227
|
|---|---|---|
|
|
224
|
-
| `lint` | `files` int, `findings` array, `failed` int, `orphans`, `partial_rot`, `symbol_drift`, `revivals`, `reverse_hints`, `unreachable_evidence` arrays, `shallow_clone` bool | `findings[]`: `file`, `level`, `message` |
|
|
228
|
+
| `lint` | `files` int, `findings` array, `failed` int, `orphans`, `partial_rot`, `symbol_drift`, `revivals`, `reverse_hints`, `unreachable_evidence` arrays, `symbols_unchecked` array of int, `shallow_clone` bool | `findings[]`: `file`, `level`, `message` |
|
|
225
229
|
| `status` | `scars_dir` str, `active`, `challenged`, `candidates`, `review_due`, `orphan_detected`, `orphaned`, `partial_rot`, `broken` arrays, `counts` object | `active[]`: `id`, `type`, `severity`, `title`. `candidates[]` are strings. `counts`: `active`, `candidates`, `orphan_detected`, `orphaned`, `partial_rot`, `broken` |
|
|
226
230
|
| `check` | `paths` array of str, `scars` array | `scars[]`: `id`, `type`, `severity`, `confidence`, `status`, `title`, `body` |
|
|
231
|
+
| `sweep` | `files` int (tracked files swept), `skipped` int (tracked files with no readable content: oversized or binary), `scars` int (scars armed on at least one swept file), `hits` array | `hits[]`: `id` int, `type`, `severity`, `title`, `source` (scar file, repo-relative), `path`, `line` int (1-based), `excerpt` |
|
|
227
232
|
| `why` | `path` str, `records` array | `records[]`: `id`, `type`, `status`, `title`, `file`, `body` |
|
|
228
233
|
| `stats` | `repo` str, `total_firings` int, `per_scar` array, `most_fired` int, `last_fired` str, `never_fired` array of int, `demotions` int, `demotions_path_only` int, `demotions_cooldown` int, `demotions_reason_unknown` int, `census_known` int, `census_unknown` int, `cofires_per_edit` float **or null**, `edits_multi_fire` int, `path_only_ratio` float **or null**, `edits_observed` int, `injection_rate` float **or null**, `retrieval_misses` int **or null**, `instrument_disconnected` bool, `posttool_silent` bool, `last_fired_age_days` int, `armed_firings` int, `armed_unknown` int, `verdicts_expected` int, `verdicts_observed` int, `verdicts_unresolved` int, `verdicts_unplaceable` int, `firings_block_capable` int, `firings_advisory` int, `firings_block_unknown` int, `all_firings_advisory` bool, `firings_context_known` int, `firings_context_unknown` int, `command_firings` int, `firings_kind_unknown` int, `advisories` array. `window` object **only when `--since`/`--until` is given** | `per_scar[]`: `id`, `count`, `violations`. `window`: `since`, `until`, `excluded_undated` |
|
|
229
234
|
| `gc` | `removed_markers` int, `dropped_firings` int, `dry_run` bool, `candidates` array, `fp_log` object | `candidates[]`: `name`, `age_days`. `fp_log`: `present`, `size`, `lines` |
|
|
@@ -373,8 +378,8 @@ CI, and never emits JSON.
|
|
|
373
378
|
A scar rendered as a one-liner was demoted for one of two reasons, and they are
|
|
374
379
|
opposite evidence. A **path-only** demotion means the anchor proved the file
|
|
375
380
|
was in scope and nothing in the edit matched: a near miss. A **cooldown**
|
|
376
|
-
demotion means the edit content matched (a pattern hit, a symbol
|
|
377
|
-
command matched) and the full body was withheld only because it had been shown
|
|
381
|
+
demotion means the edit content matched (a pattern hit, a symbol the edit
|
|
382
|
+
names, a command matched) and the full body was withheld only because it had been shown
|
|
378
383
|
in the last four hours: a hit we chose not to repeat.
|
|
379
384
|
|
|
380
385
|
`demoted_ids` lists both in one field. `demotion_reasons` records which is
|
|
@@ -402,9 +407,18 @@ never recoverable from the log.
|
|
|
402
407
|
|
|
403
408
|
`matched` records what `_match_target` returned before `_select_top` truncated
|
|
404
409
|
it: `{"total": n, "content": c, "path_only": p}` with `content + path_only ==
|
|
405
|
-
total`. `content` matched the edit itself (a pattern hit, a symbol
|
|
406
|
-
command matched). `path_only` matched nothing but the file's location.
|
|
407
|
-
split is the same one the fatigue budget uses to tier, counted before it
|
|
410
|
+
total`. `content` matched the edit itself (a pattern hit, a symbol the edit
|
|
411
|
+
names, a command matched). `path_only` matched nothing but the file's location.
|
|
412
|
+
The split is the same one the fatigue budget uses to tier, counted before it
|
|
413
|
+
cuts.
|
|
414
|
+
|
|
415
|
+
A symbol anchor yields one of two `matched_by` kinds. `symbol` means the file
|
|
416
|
+
on disk defines the symbol and the edited text names it as a whole word (the
|
|
417
|
+
innermost name, so `src/a.py::Store.save` looks for `save`); it is a content
|
|
418
|
+
signal. `symbol_file` means the file defines the symbol but the edited text
|
|
419
|
+
never names it; it counts as `path_only`, like a path anchor. The hook sees the
|
|
420
|
+
new text without line numbers, so a name mention is the strongest proof
|
|
421
|
+
available that the edit touched the symbol.
|
|
408
422
|
|
|
409
423
|
The key is written by every shipped writer (edit, command, Codex, Cascade). It
|
|
410
424
|
is **omitted** by a writer that did not count, never zeroed: zeros would claim
|
|
@@ -458,6 +472,18 @@ denominators changed.
|
|
|
458
472
|
hook recorded **anything**, so command rows and kind-unknown rows answer it
|
|
459
473
|
just as well as edit rows do.
|
|
460
474
|
|
|
475
|
+
`matched_by` on a firing row says which anchor kinds matched each scar that
|
|
476
|
+
fired, keyed by the scar id as a string, kinds in rank order:
|
|
477
|
+
`{"24": ["path", "symbol"], "1": ["content_pattern"]}`. `scar_ids` says that a
|
|
478
|
+
scar fired and `matched` is a census for the whole edit; neither says what a
|
|
479
|
+
given scar matched on. The kinds are opaque strings copied from the matcher, so
|
|
480
|
+
a new anchor kind appears here without a format change.
|
|
481
|
+
|
|
482
|
+
Every scar that fired has a non-empty list. The key is **omitted**, never
|
|
483
|
+
emptied, when a writer has no match objects in hand, and a MISSING `matched_by`
|
|
484
|
+
means the row predates the field, never "no kinds". Readers must not treat its
|
|
485
|
+
absence as a value.
|
|
486
|
+
|
|
461
487
|
### 9.4 Enforcement
|
|
462
488
|
|
|
463
489
|
`tests/test_json_contract.py` asserts every guaranteed key above against live
|
|
@@ -96,6 +96,9 @@ self-match).
|
|
|
96
96
|
|
|
97
97
|
- `path:` = repo-relative prefix (file or directory). `pattern:` =
|
|
98
98
|
case-insensitive regex over path + new content.
|
|
99
|
+
- `symbol:` = `path::name` or a bare name. Use it for code likely to move or be
|
|
100
|
+
renamed: it follows the definition, not the path. Needs the `[symbols]` extra
|
|
101
|
+
(`uv tool install "scar-cli[symbols]"`), Python, TypeScript and JavaScript.
|
|
99
102
|
- Severity: `low | medium | high | critical`.
|
|
100
103
|
- Injection is capped at ~3 scars / ~700 chars each — write tight: 5–15 lines,
|
|
101
104
|
evidence cited inline.
|
|
@@ -38,12 +38,13 @@ from .hooks import (
|
|
|
38
38
|
_extract_edit_content,
|
|
39
39
|
_log_firing,
|
|
40
40
|
_log_violation_firing,
|
|
41
|
+
_matched_by_of,
|
|
41
42
|
_read_payload,
|
|
42
43
|
_state_dir,
|
|
43
44
|
)
|
|
44
45
|
from .match import (MatchCensus, armed_scar_ids, find_violations,
|
|
45
46
|
has_content_signal, rank_and_census_for_edit)
|
|
46
|
-
from .render import compact_block, rule_line
|
|
47
|
+
from .render import compact_block, cut_total, rule_line
|
|
47
48
|
from .store import ScarStore
|
|
48
49
|
|
|
49
50
|
# NOT 2, which is what Cascade reads as "block". argparse also exits 2 on an
|
|
@@ -120,16 +121,19 @@ def _remember_fired(keys: list[str]) -> bool:
|
|
|
120
121
|
return True
|
|
121
122
|
|
|
122
123
|
|
|
123
|
-
def _block_text(scars: list) -> str:
|
|
124
|
+
def _block_text(scars: list, matched_total: int | None = None) -> str:
|
|
124
125
|
"""What the agent reads on the bounced action. Compact tier only — this
|
|
125
126
|
renders as an error in the Cascade UI, and the agent needs the constraint,
|
|
126
|
-
not the essay.
|
|
127
|
+
not the essay. When the fatigue cap cut matches, the closing line says so
|
|
128
|
+
in a clause (#321); no census, or one that shows no cut, changes nothing."""
|
|
129
|
+
cut = cut_total(len(scars), matched_total)
|
|
130
|
+
shown = "" if cut is None else f"{len(scars)} of {cut} matched shown. "
|
|
127
131
|
return (
|
|
128
132
|
f"SCAR blocked this action once — {len(scars)} scar(s) record why it "
|
|
129
133
|
"went wrong before. Read them, then retry: the identical action goes "
|
|
130
134
|
"through, informed.\n\n"
|
|
131
135
|
+ compact_block(scars)
|
|
132
|
-
+ "\n\
|
|
136
|
+
+ f"\n\n{shown}Full records in .scars/ (`scar why <path>`).")
|
|
133
137
|
|
|
134
138
|
|
|
135
139
|
def _partition(matches: list, fired: dict[str, float], trajectory: str,
|
|
@@ -173,7 +177,10 @@ def _respond(store: ScarStore, trajectory: str, target: str,
|
|
|
173
177
|
if not to_block:
|
|
174
178
|
return 0
|
|
175
179
|
scars = [m.scar for m in to_block]
|
|
176
|
-
|
|
180
|
+
# Only a cap cut counts: matches the partition above sent to stdout instead
|
|
181
|
+
# of the block were not cut, so the census must exceed the whole list.
|
|
182
|
+
capped = census.total if census and census.total > len(matches) else None
|
|
183
|
+
print(_block_text(scars, capped), file=sys.stderr)
|
|
177
184
|
# Firing log parity (#106) records what the AGENT saw, and here only a
|
|
178
185
|
# block reaches it — a stdout line went to the human. So the surface-only
|
|
179
186
|
# matches are NOT logged, and in particular not as `demoted_ids`: that
|
|
@@ -184,7 +191,8 @@ def _respond(store: ScarStore, trajectory: str, target: str,
|
|
|
184
191
|
# refuse the action. Surface-only matches never reach the log at all
|
|
185
192
|
# (see the comment above), so every windsurf row is block-capable.
|
|
186
193
|
_log_firing(store, target, scars, runtime=RUNTIME, block_capable=True,
|
|
187
|
-
matched=census, anchor_kind=anchor_kind
|
|
194
|
+
matched=census, anchor_kind=anchor_kind,
|
|
195
|
+
matched_by=_matched_by_of(to_block))
|
|
188
196
|
return BLOCK_EXIT
|
|
189
197
|
|
|
190
198
|
|