scar-cli 0.27.2__tar.gz → 0.27.3__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.
Files changed (172) hide show
  1. scar_cli-0.27.3/.github/workflows/scar-review-queue.yml +49 -0
  2. scar_cli-0.27.3/.release-please-manifest.json +3 -0
  3. scar_cli-0.27.2/.scars/candidates/slug-and-display-cleaning-are-different-jobs.md → scar_cli-0.27.3/.scars/0027-slug-and-display-cleaning-are-different-jobs.landmine.md +6 -4
  4. scar_cli-0.27.2/.scars/candidates/violation-evidence-must-not-persist-raw-edits.md → scar_cli-0.27.3/.scars/0028-violation-evidence-must-not-persist-raw-edits.fence.md +4 -2
  5. {scar_cli-0.27.2 → scar_cli-0.27.3}/CHANGELOG.md +7 -0
  6. {scar_cli-0.27.2 → scar_cli-0.27.3}/PKG-INFO +1 -1
  7. {scar_cli-0.27.2 → scar_cli-0.27.3}/plugin/plugin.json +1 -1
  8. {scar_cli-0.27.2 → scar_cli-0.27.3}/pyproject.toml +1 -1
  9. scar_cli-0.27.3/src/scar/__init__.py +0 -0
  10. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/cli.py +7 -4
  11. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/mcp.py +1 -2
  12. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/store.py +17 -2
  13. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_cli.py +22 -0
  14. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_docs.py +20 -0
  15. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_mcp.py +15 -0
  16. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_store.py +19 -0
  17. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_sweep.py +2 -2
  18. {scar_cli-0.27.2 → scar_cli-0.27.3}/uv.lock +1 -1
  19. scar_cli-0.27.2/.release-please-manifest.json +0 -3
  20. {scar_cli-0.27.2 → scar_cli-0.27.3}/.claude-plugin/marketplace.json +0 -0
  21. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  22. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  23. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  24. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  25. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/workflows/ci.yml +0 -0
  26. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/workflows/docs.yml +0 -0
  27. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/workflows/pr-validation.yml +0 -0
  28. {scar_cli-0.27.2 → scar_cli-0.27.3}/.github/workflows/release.yml +0 -0
  29. {scar_cli-0.27.2 → scar_cli-0.27.3}/.gitignore +0 -0
  30. {scar_cli-0.27.2 → scar_cli-0.27.3}/.pre-commit-config.yaml +0 -0
  31. {scar_cli-0.27.2 → scar_cli-0.27.3}/.pre-commit-hooks.yaml +0 -0
  32. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0001-git-grep-ere-pitfalls.landmine.md +0 -0
  33. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0002-agent-direct-hook-install.deadend.md +0 -0
  34. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0003-installer-binds-to-active-venv-scar.landmine.md +0 -0
  35. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0004-promote-roundtrip-drops-expires-evidence.landmine.md +0 -0
  36. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0005-history-rewrite-orphans-commit-evidence.landmine.md +0 -0
  37. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0006-yaml-pattern-anchor-over-escaping.landmine.md +0 -0
  38. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0007-release-please-config-change-skips-open-pr.landmine.md +0 -0
  39. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0008-rich-output-nontty-must-bypass-rich.landmine.md +0 -0
  40. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0009-anchor-survival-harness-measures-symbol-not-path-anchors.deadend.md +0 -0
  41. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0010-git-returncode-128-vs-empty-tracked-set.landmine.md +0 -0
  42. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0011-lint-compile-check-lets-redos-anchors-hang-hotpath.landmine.md +0 -0
  43. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0012-firing-log-readers-need-blanket-guards.landmine.md +0 -0
  44. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0013-docusaurus-future-v4-requires-faster-dep.landmine.md +0 -0
  45. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0014-inject-flag-dest-collides-with-subcommand-dispatch.landmine.md +0 -0
  46. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0015-zero-checkruns-means-approval-gate-not-workflow-bug.deadend.md +0 -0
  47. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0016-hook-ownership-must-be-kind-scoped.landmine.md +0 -0
  48. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0017-codex-pretool-context-can-replay-apply-patch.landmine.md +0 -0
  49. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0018-cli-subparsers-register-through-_add-wrapper.landmine.md +0 -0
  50. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0019-token-in-scar-body-cannot-prove-hook-delivery.deadend.md +0 -0
  51. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0020-one-directional-health-check-leaves-flattering-direction-unwatched.landmine.md +0 -0
  52. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0021-posttool-fix-in-hooks-does-not-reach-codex-or-cascade.landmine.md +0 -0
  53. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0022-codex-hook-delivery-needs-user-file-and-trust.landmine.md +0 -0
  54. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0023-cascade-block-exit-collides-with-argparse.fence.md +0 -0
  55. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0024-host-detection-must-not-read-the-process-home.deadend.md +0 -0
  56. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0025-one-plugin-hook-manifest-two-hosts-two-root-variables.landmine.md +0 -0
  57. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/0026-path-anchor-breadth-drives-the-review-due-threshold.landmine.md +0 -0
  58. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/README.md +0 -0
  59. /scar_cli-0.27.2/src/scar/__init__.py → /scar_cli-0.27.3/.scars/candidates/.gitkeep +0 -0
  60. {scar_cli-0.27.2 → scar_cli-0.27.3}/.scars/template.md +0 -0
  61. {scar_cli-0.27.2 → scar_cli-0.27.3}/AGENTS.md +0 -0
  62. {scar_cli-0.27.2 → scar_cli-0.27.3}/CONTRIBUTING.md +0 -0
  63. {scar_cli-0.27.2 → scar_cli-0.27.3}/IDEA.md +0 -0
  64. {scar_cli-0.27.2 → scar_cli-0.27.3}/LICENSE +0 -0
  65. {scar_cli-0.27.2 → scar_cli-0.27.3}/README.md +0 -0
  66. {scar_cli-0.27.2 → scar_cli-0.27.3}/ROADMAP.md +0 -0
  67. {scar_cli-0.27.2 → scar_cli-0.27.3}/SCAR-FORMAT.md +0 -0
  68. {scar_cli-0.27.2 → scar_cli-0.27.3}/SPEC.md +0 -0
  69. {scar_cli-0.27.2 → scar_cli-0.27.3}/STRESS-TEST.md +0 -0
  70. {scar_cli-0.27.2 → scar_cli-0.27.3}/action.yml +0 -0
  71. {scar_cli-0.27.2 → scar_cli-0.27.3}/codecov.yml +0 -0
  72. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/PROTOCOL.md +0 -0
  73. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/RESULTS.md +0 -0
  74. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/long_replay.py +0 -0
  75. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/replay.py +0 -0
  76. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/replay_shipped.py +0 -0
  77. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/anchor-survival/test_replay_shipped.py +0 -0
  78. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/auto-authorship/FINDINGS.md +0 -0
  79. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/auto-authorship/PROTOCOL.md +0 -0
  80. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/.gitignore +0 -0
  81. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/PROTOCOL.md +0 -0
  82. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/RESULTS.md +0 -0
  83. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/.scars/0001-vendor-retry-window.fence.md +0 -0
  84. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/.scars/0002-evicting-session-store.deadend.md +0 -0
  85. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/.scars/0003-export-column-order.landmine.md +0 -0
  86. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/README.md +0 -0
  87. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/payments/retry.py +0 -0
  88. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/reports/export.py +0 -0
  89. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/fixture/services/sessions.py +0 -0
  90. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/fence-honor/grade.py +0 -0
  91. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/harvest/PROTOCOL.md +0 -0
  92. {scar_cli-0.27.2 → scar_cli-0.27.3}/experiments/harvest/harvest.py +0 -0
  93. {scar_cli-0.27.2 → scar_cli-0.27.3}/hook/scar-hooks.py +0 -0
  94. {scar_cli-0.27.2 → scar_cli-0.27.3}/plugin/hooks/run.sh +0 -0
  95. {scar_cli-0.27.2 → scar_cli-0.27.3}/plugin/skills/scar-authoring/SKILL.md +0 -0
  96. {scar_cli-0.27.2 → scar_cli-0.27.3}/plugin/skills/scar-authoring/assets/template.md +0 -0
  97. {scar_cli-0.27.2 → scar_cli-0.27.3}/release-please-config.json +0 -0
  98. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/agent.py +0 -0
  99. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/cascade.py +0 -0
  100. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/codex.py +0 -0
  101. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/draftcheck.py +0 -0
  102. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/evidence.py +0 -0
  103. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/firing_log.py +0 -0
  104. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/gc.py +0 -0
  105. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/harvest.py +0 -0
  106. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/hooks.py +0 -0
  107. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/hosts.py +0 -0
  108. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/installer.py +0 -0
  109. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/lint.py +0 -0
  110. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/match.py +0 -0
  111. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/model.py +0 -0
  112. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/orphan.py +0 -0
  113. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/output.py +0 -0
  114. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/reanchor.py +0 -0
  115. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/renames.py +0 -0
  116. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/render.py +0 -0
  117. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/review.py +0 -0
  118. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/skills/scar-authoring/SKILL.md +0 -0
  119. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/skills/scar-authoring/assets/template.md +0 -0
  120. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/symbols.py +0 -0
  121. {scar_cli-0.27.2 → scar_cli-0.27.3}/src/scar/violation_evidence.py +0 -0
  122. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/conftest.py +0 -0
  123. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_action_yml.py +0 -0
  124. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_anchor_kind.py +0 -0
  125. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_block_capability.py +0 -0
  126. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_cascade.py +0 -0
  127. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_codex.py +0 -0
  128. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_context_size.py +0 -0
  129. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_draftcheck.py +0 -0
  130. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_evidence.py +0 -0
  131. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_firing_log.py +0 -0
  132. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_gc.py +0 -0
  133. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_git_hook.py +0 -0
  134. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_harvest.py +0 -0
  135. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_hooks.py +0 -0
  136. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_hosts.py +0 -0
  137. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_installer.py +0 -0
  138. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_json_contract.py +0 -0
  139. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_lifecycle.py +0 -0
  140. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_lint.py +0 -0
  141. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_match.py +0 -0
  142. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_matched_by.py +0 -0
  143. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_model.py +0 -0
  144. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_orphan.py +0 -0
  145. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_output.py +0 -0
  146. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_plugin.py +0 -0
  147. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_precommit_hooks.py +0 -0
  148. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_reanchor.py +0 -0
  149. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_renames.py +0 -0
  150. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_render.py +0 -0
  151. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_review.py +0 -0
  152. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_review_queue.py +0 -0
  153. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_skill.py +0 -0
  154. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_symbols.py +0 -0
  155. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_verdict_observability.py +0 -0
  156. {scar_cli-0.27.2 → scar_cli-0.27.3}/tests/test_violation_evidence.py +0 -0
  157. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/.gitignore +0 -0
  158. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docs/agents.md +0 -0
  159. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docs/concepts.md +0 -0
  160. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docs/index.md +0 -0
  161. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docs/methodology.md +0 -0
  162. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docs/quickstart.md +0 -0
  163. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/docusaurus.config.ts +0 -0
  164. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/package-lock.json +0 -0
  165. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/package.json +0 -0
  166. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/scripts/sync-changelog.mjs +0 -0
  167. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/sidebars.ts +0 -0
  168. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/src/css/custom.css +0 -0
  169. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/static/img/favicon.svg +0 -0
  170. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/static/img/social-card.png +0 -0
  171. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/static/llms.txt +0 -0
  172. {scar_cli-0.27.2 → scar_cli-0.27.3}/website/tsconfig.json +0 -0
@@ -0,0 +1,49 @@
1
+ # .github/workflows/scar-review-queue.yml
2
+ name: Scar review queue
3
+ on:
4
+ schedule:
5
+ - cron: '0 7 * * 1'
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ issues: write
11
+
12
+ jobs:
13
+ queue:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0 # evidence-reachability checks need full history
19
+ - uses: astral-sh/setup-uv@v5
20
+ - name: Build the queue
21
+ # Keep lint's exit code, but let the next step run first: each run
22
+ # step is bash -e, so a bare failure would skip the issue sync.
23
+ run: |
24
+ set +e
25
+ uvx --from scar-cli scar lint --review-queue > queue.md
26
+ echo "status=$?" >> "$GITHUB_ENV"
27
+ exit 0
28
+ - name: Sync the rolling issue
29
+ env:
30
+ GH_TOKEN: ${{ github.token }}
31
+ run: |
32
+ label=scar-review-queue
33
+ gh label create "$label" --color BFD4F2 --description "Rolling Scar review queue" --force
34
+ issue=$(gh issue list --label "$label" --state all --limit 1 --json number,state)
35
+ number=$(jq -r '.[0].number // empty' <<<"$issue")
36
+ state=$(jq -r '.[0].state // empty' <<<"$issue")
37
+ if [ -s queue.md ]; then
38
+ if [ -z "$number" ]; then
39
+ gh issue create --title "Scar review queue" --label "$label" --body-file queue.md
40
+ else
41
+ gh issue edit "$number" --body-file queue.md
42
+ if [ "$state" = "CLOSED" ]; then gh issue reopen "$number"; fi
43
+ fi
44
+ elif [ -n "$number" ] && [ "$state" = "OPEN" ]; then
45
+ gh issue close "$number" --comment "Review queue is empty."
46
+ fi
47
+ - name: Fail the job if lint failed
48
+ if: env.status != '0'
49
+ run: exit 1
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.27.3"
3
+ }
@@ -1,15 +1,16 @@
1
1
  ---
2
- id: 0
2
+ id: 27
3
3
  type: landmine
4
4
  title: sanitize_signal_text is display cleaning, not a filename rule; slugify must not call it
5
5
  severity: medium
6
6
  confidence: 0.8
7
7
  created: 2026-11-06
8
8
  authors: ["claude-code"]
9
+ promoted_by: Kibukx
10
+ promoted_by_source: explicit
9
11
  anchors:
10
- - symbol: src/scar/store.py::slugify
11
12
  - path: src/scar/store.py
12
- violation: "(?<!def )sanitize_signal_text\("
13
+ - symbol: src/scar/store.py::slugify
13
14
  evidence:
14
15
  - issue: 365
15
16
  - issue: 159
@@ -17,7 +18,8 @@ evidence:
17
18
  expires:
18
19
  condition: "slugify and sanitize_signal_text stop sharing any code, or harvested titles stop being cleaned"
19
20
  review_after: 2027-11-06
20
- status: candidate
21
+ violation: "(?<!def )sanitize_signal_text\("
22
+ status: active
21
23
  ---
22
24
 
23
25
  `sanitize_signal_text` (#159) cleans mined git text for a human to read, so it
@@ -1,11 +1,13 @@
1
1
  ---
2
- id: 0
2
+ id: 28
3
3
  type: fence
4
4
  title: Violation evidence omits raw edits deliberately because excerpts can contain secrets
5
5
  severity: high
6
6
  confidence: 0.9
7
7
  created: 2026-11-05
8
8
  authors: ["codex"]
9
+ promoted_by: Kibukx
10
+ promoted_by_source: explicit
9
11
  anchors:
10
12
  - path: src/scar/violation_evidence.py
11
13
  - path: src/scar/hooks.py
@@ -13,7 +15,7 @@ evidence:
13
15
  - issue: 317
14
16
  expires:
15
17
  condition: "a reviewed capture design can retain original edits without exposing arbitrary secrets"
16
- status: candidate
18
+ status: active
17
19
  ---
18
20
 
19
21
  The display excerpt is arbitrary edited content, not safe log text (#317).
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.27.3](https://github.com/Daily-Nerd/Scar/compare/v0.27.2...v0.27.3) (2026-11-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **store:** one owner creates candidates/ and init keeps it in git ([#371](https://github.com/Daily-Nerd/Scar/issues/371)) ([67ed3ae](https://github.com/Daily-Nerd/Scar/commit/67ed3aec8c0be8b0a4e8d1248cc95914ff560c95))
9
+
3
10
  ## [0.27.2](https://github.com/Daily-Nerd/Scar/compare/v0.27.1...v0.27.2) (2026-11-07)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scar-cli
3
- Version: 0.27.2
3
+ Version: 0.27.3
4
4
  Summary: SCAR — version control for negative knowledge (deadends, fences, landmines)
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scar",
3
- "version": "0.27.2",
3
+ "version": "0.27.3",
4
4
  "description": "SCAR — version control for negative knowledge (deadends, fences, landmines)",
5
5
  "hooks": {
6
6
  "PreToolUse": [
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scar-cli"
3
- version = "0.27.2"
3
+ version = "0.27.3"
4
4
  description = "SCAR — version control for negative knowledge (deadends, fences, landmines)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
@@ -84,7 +84,7 @@ def _cmd_init(args) -> int:
84
84
  # decision, not damage, so re-running init never resurrects it.
85
85
  seeded = False
86
86
  if fresh and not getattr(args, "no_seed", False):
87
- example = scars / "candidates" / EXAMPLE_SEED_NAME
87
+ example = ScarStore(root=Path.cwd(), scars_dir=scars).ensure_candidates_dir() / EXAMPLE_SEED_NAME
88
88
  example.write_text(EXAMPLE_SEED, encoding="utf-8")
89
89
  seeded = True
90
90
  has_history = _has_git_history(Path.cwd())
@@ -2847,10 +2847,13 @@ def _harvest_write(repo: Path, args) -> int:
2847
2847
  print(f"harvest --write: N must be 1..{_WRITE_CAP} — mined candidates "
2848
2848
  "run ~13% precision, more drafts than that buries the reviewer")
2849
2849
  return 1
2850
- cand_dir = repo / ".scars" / "candidates"
2851
- if not cand_dir.is_dir():
2852
- print(f"no .scars/candidates/ in {repo} — run `scar init` there first")
2850
+ scars_dir = repo / ".scars"
2851
+ if not scars_dir.is_dir():
2852
+ print(f"no .scars/ in {repo}: run `scar init` there first")
2853
2853
  return 1
2854
+ # candidates/ is not git-tracked when empty (#370); only a missing .scars/
2855
+ # means Scar is not set up. The store is the one owner of the folder.
2856
+ cand_dir = ScarStore(root=repo, scars_dir=scars_dir).ensure_candidates_dir()
2854
2857
 
2855
2858
  result = harvest(repo)
2856
2859
  tracked = set(_hgit(repo, "ls-files").splitlines())
@@ -104,8 +104,7 @@ def _draft(args: dict[str, Any]) -> dict[str, Any]:
104
104
  errors = [f.message for f in findings if f.level == "error"]
105
105
  if errors:
106
106
  raise ValueError("refusing to draft invalid scar: " + "; ".join(errors))
107
- candidates = store.scars_dir / "candidates"
108
- candidates.mkdir(exist_ok=True)
107
+ candidates = store.ensure_candidates_dir()
109
108
  stem = _slug(str(args.get("slug") or scar.title))
110
109
  path = candidates / f"{stem}.md"
111
110
  i = 2
@@ -169,7 +169,7 @@ def init_scars(repo_root: Path) -> Path:
169
169
  """Create .scars/ layout. Idempotent; never clobbers existing files."""
170
170
  scars = Path(repo_root) / ".scars"
171
171
  scars.mkdir(exist_ok=True)
172
- (scars / "candidates").mkdir(exist_ok=True)
172
+ ScarStore(root=Path(repo_root), scars_dir=scars).ensure_candidates_dir()
173
173
  for name, content in (("README.md", README), ("template.md", TEMPLATE)):
174
174
  f = scars / name
175
175
  if not f.exists():
@@ -247,8 +247,23 @@ class ScarStore:
247
247
  pass
248
248
  return out
249
249
 
250
+ @property
251
+ def candidates_dir(self) -> Path:
252
+ return self.scars_dir / "candidates"
253
+
254
+ def ensure_candidates_dir(self) -> Path:
255
+ """The one place candidates/ is created (#370). Idempotent. Also keeps
256
+ an empty .gitkeep so the folder survives the last promotion in git;
257
+ candidates() and lint only look at *.md, so it is never a candidate."""
258
+ cand = self.candidates_dir
259
+ cand.mkdir(exist_ok=True)
260
+ keep = cand / ".gitkeep"
261
+ if not keep.exists():
262
+ keep.write_text("", encoding="utf-8")
263
+ return cand
264
+
250
265
  def candidates(self) -> list[Path]:
251
- cand = self.scars_dir / "candidates"
266
+ cand = self.candidates_dir
252
267
  return sorted(p for p in cand.glob("*.md")) if cand.is_dir() else []
253
268
 
254
269
  def next_id(self) -> int:
@@ -1470,6 +1470,28 @@ def test_harvest_write_requires_scars_dir(tmp_path, capsys):
1470
1470
  assert "scar init" in capsys.readouterr().out
1471
1471
 
1472
1472
 
1473
+ def test_harvest_write_recreates_missing_candidates_dir(harvest_write_repo):
1474
+ """#370: a missing candidates/ is not 'Scar not initialised'; .scars/ is."""
1475
+ import shutil
1476
+ shutil.rmtree(harvest_write_repo / ".scars" / "candidates")
1477
+ assert main(["harvest", str(harvest_write_repo), "--write", "2"]) == 0
1478
+ assert list((harvest_write_repo / ".scars" / "candidates").glob("*.md"))
1479
+
1480
+
1481
+ def test_harvest_write_works_after_last_candidate_promoted(harvest_write_repo):
1482
+ """#370: with only .gitkeep left (last candidate promoted), harvest
1483
+ --write still runs."""
1484
+ cand = harvest_write_repo / ".scars" / "candidates"
1485
+ assert (cand / ".gitkeep").is_file()
1486
+ assert main(["harvest", str(harvest_write_repo), "--write", "2"]) == 0
1487
+ assert list(cand.glob("*.md"))
1488
+
1489
+
1490
+ def test_init_writes_candidates_gitkeep(repo):
1491
+ assert main(["init", "--no-seed"]) == 0
1492
+ assert (repo / ".scars" / "candidates" / ".gitkeep").is_file()
1493
+
1494
+
1473
1495
  def test_write_title_and_slug_sanitize_markdown_and_urls():
1474
1496
  """Git text (revert subjects, squash-merge subjects) can carry markdown
1475
1497
  links, emphasis, and bare URLs; leaked into a candidate they make the title
@@ -54,3 +54,23 @@ def test_agents_doc_documents_review_queue_recipe():
54
54
  assert "2>/dev/null" not in recipe and "|| true" not in recipe
55
55
  assert "lint errors" in recipe
56
56
  assert "\u2014" not in text.split("### Review queue")[1].split("## Machine-readable")[0]
57
+
58
+
59
+ def test_review_queue_workflow_matches_documented_recipe():
60
+ """#367: this repo runs the same review queue workflow it documents. The
61
+ recipe adopters copy and the workflow we run must not drift apart."""
62
+ import re
63
+
64
+ docs = ROOT / "website" / "docs" / "agents.md"
65
+ workflow = ROOT / ".github" / "workflows" / "scar-review-queue.yml"
66
+ blocks = re.findall(
67
+ r"```yaml\n(# \.github/workflows/scar-review-queue\.yml\n.*?)```",
68
+ docs.read_text(encoding="utf-8"),
69
+ flags=re.DOTALL,
70
+ )
71
+ assert len(blocks) == 1, "expected exactly one review queue yaml block in the docs"
72
+ assert workflow.is_file(), f"missing {workflow.relative_to(ROOT)}"
73
+ assert workflow.read_text(encoding="utf-8").rstrip("\n") == blocks[0].rstrip("\n"), (
74
+ "website/docs/agents.md recipe and .github/workflows/scar-review-queue.yml "
75
+ "differ: update whichever file is stale, both must change together"
76
+ )
@@ -186,3 +186,18 @@ def test_scar_draft_underscored_slug_keeps_word_separators(tmp_path):
186
186
  })
187
187
  data = json.loads(_text(result))
188
188
  assert data["candidate"].endswith("my-file-name-landmine.md")
189
+
190
+
191
+ def test_scar_draft_recreates_missing_candidates_dir(tmp_path):
192
+ import shutil
193
+ init_scars(tmp_path)
194
+ shutil.rmtree(tmp_path / ".scars" / "candidates")
195
+ result = _handle("tools/call", {
196
+ "name": "scar_draft",
197
+ "arguments": {"repo": str(tmp_path), "type": "deadend",
198
+ "title": "Redis failed here",
199
+ "anchors": [{"pattern": "redis"}],
200
+ "body": "Redis was tried and abandoned."},
201
+ })
202
+ assert json.loads(_text(result))["status"] == "candidate"
203
+ assert (tmp_path / ".scars" / "candidates" / "redis-failed-here.md").is_file()
@@ -409,3 +409,22 @@ def test_promote_keeps_underscores_as_separators(repo):
409
409
  out = ScarStore.discover(repo).promote(
410
410
  _cand(repo, "my_file_name.landmine.md"), reviewer="k")
411
411
  assert out.name == "0001-my-file-name.landmine.md"
412
+
413
+
414
+ # --- one owner for candidates/ (#370) ---
415
+
416
+ def test_init_writes_empty_gitkeep_that_is_not_a_candidate(repo):
417
+ keep = repo / ".scars" / "candidates" / ".gitkeep"
418
+ assert keep.is_file() and keep.read_text() == ""
419
+ store = ScarStore.discover(repo)
420
+ assert store.candidates() == []
421
+ assert store.broken() == []
422
+
423
+
424
+ def test_ensure_candidates_dir_recreates_missing_folder_idempotently(repo):
425
+ import shutil
426
+ shutil.rmtree(repo / ".scars" / "candidates")
427
+ store = ScarStore.discover(repo)
428
+ path = store.ensure_candidates_dir()
429
+ assert path == repo / ".scars" / "candidates" and path.is_dir()
430
+ assert store.ensure_candidates_dir() == path
@@ -215,7 +215,7 @@ def test_sweep_plain_output_is_stable(repo, capsys):
215
215
  lines = capsys.readouterr().out.splitlines()
216
216
  assert lines[0] == "src/a.py:2: scar #42 (fence): No raw sleep"
217
217
  assert lines[1] == " time.sleep(1)"
218
- assert lines[-1] == "swept 4 files, skipped 0, 1 scars armed, 1 hits"
218
+ assert lines[-1] == "swept 5 files, skipped 0, 1 scars armed, 1 hits"
219
219
 
220
220
 
221
221
  def test_sweep_plain_output_with_no_hits_is_only_the_summary(repo, capsys):
@@ -266,7 +266,7 @@ def test_sweep_tty_renders_hits_and_summary(repo, capsys, monkeypatch):
266
266
  assert "scar #42" in out
267
267
  assert "No raw sleep" in out
268
268
  assert "time.sleep(1) [x]" in out # brackets survive rich markup
269
- assert "swept 4 files, skipped 0, 1 scars armed, 1 hits" in out
269
+ assert "swept 5 files, skipped 0, 1 scars armed, 1 hits" in out
270
270
 
271
271
 
272
272
  def test_sweep_tty_with_no_hits_prints_only_the_summary(repo, capsys, monkeypatch):
@@ -297,7 +297,7 @@ wheels = [
297
297
 
298
298
  [[package]]
299
299
  name = "scar-cli"
300
- version = "0.27.2"
300
+ version = "0.27.3"
301
301
  source = { editable = "." }
302
302
  dependencies = [
303
303
  { name = "rich" },
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.27.2"
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes