scar-cli 0.34.0__tar.gz → 0.35.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.
Files changed (224) hide show
  1. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/workflows/ci.yml +10 -2
  2. scar_cli-0.35.0/.github/workflows/scar-review-queue.yml +21 -0
  3. scar_cli-0.35.0/.github/workflows/scar.yml +137 -0
  4. scar_cli-0.35.0/.release-please-manifest.json +3 -0
  5. scar_cli-0.34.0/.scars/candidates/scar-files-have-one-reader.md → scar_cli-0.35.0/.scars/0032-scar-files-have-one-reader.landmine.md +6 -2
  6. scar_cli-0.35.0/.scars/candidates/a-scar-rewrite-carries-its-own-note.md +42 -0
  7. scar_cli-0.35.0/.scars/candidates/cascade-execution-id-is-not-an-edit-id.md +33 -0
  8. scar_cli-0.35.0/.scars/candidates/lint-judges-an-act-only-where-a-command-can-clear-it.md +38 -0
  9. scar_cli-0.35.0/.scars/candidates/release-please-cannot-write-workflow-files.md +32 -0
  10. {scar_cli-0.34.0 → scar_cli-0.35.0}/CHANGELOG.md +16 -0
  11. {scar_cli-0.34.0 → scar_cli-0.35.0}/PKG-INFO +25 -12
  12. {scar_cli-0.34.0 → scar_cli-0.35.0}/README.md +24 -11
  13. {scar_cli-0.34.0 → scar_cli-0.35.0}/SPEC.md +59 -15
  14. scar_cli-0.35.0/action.yml +54 -0
  15. {scar_cli-0.34.0 → scar_cli-0.35.0}/plugin/hooks/run.sh +6 -3
  16. {scar_cli-0.34.0 → scar_cli-0.35.0}/plugin/plugin.json +1 -1
  17. {scar_cli-0.34.0 → scar_cli-0.35.0}/pyproject.toml +1 -1
  18. {scar_cli-0.34.0 → scar_cli-0.35.0}/release-please-config.json +4 -0
  19. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/cascade.py +14 -1
  20. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/cli.py +90 -51
  21. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/codex.py +8 -14
  22. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/hooks.py +91 -16
  23. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/lint.py +22 -10
  24. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/model.py +59 -1
  25. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/orphan.py +8 -0
  26. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/renames.py +64 -26
  27. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/signedpromote.py +14 -10
  28. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/store.py +62 -36
  29. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/verify.py +2 -2
  30. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_action_yml.py +14 -3
  31. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_anchor_kind.py +2 -2
  32. scar_cli-0.35.0/tests/test_call_signals.py +213 -0
  33. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_cli.py +10 -25
  34. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_codex.py +3 -0
  35. scar_cli-0.35.0/tests/test_docs.py +308 -0
  36. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_hook_failures.py +40 -2
  37. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_hooks.py +10 -10
  38. scar_cli-0.35.0/tests/test_lifecycle_policy.py +344 -0
  39. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_lint_downgrade.py +12 -2
  40. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_matched_by.py +4 -4
  41. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_plugin.py +20 -0
  42. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_renames.py +64 -127
  43. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_resign.py +8 -4
  44. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_scar_reader.py +2 -2
  45. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_sign_in_place.py +23 -2
  46. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_signing_contract.py +24 -5
  47. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_terminal_plain_parity.py +2 -2
  48. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_verdict_observability.py +2 -1
  49. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_write_gate.py +77 -5
  50. {scar_cli-0.34.0 → scar_cli-0.35.0}/uv.lock +1 -1
  51. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docs/agents.md +55 -46
  52. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docs/concepts.md +8 -6
  53. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docs/quickstart.md +1 -0
  54. scar_cli-0.34.0/.github/workflows/scar-review-queue.yml +0 -49
  55. scar_cli-0.34.0/.release-please-manifest.json +0 -3
  56. scar_cli-0.34.0/action.yml +0 -57
  57. scar_cli-0.34.0/tests/test_docs.py +0 -76
  58. {scar_cli-0.34.0 → scar_cli-0.35.0}/.claude-plugin/marketplace.json +0 -0
  59. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  60. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  61. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  62. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  63. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/workflows/docs.yml +0 -0
  64. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/workflows/pr-validation.yml +0 -0
  65. {scar_cli-0.34.0 → scar_cli-0.35.0}/.github/workflows/release.yml +0 -0
  66. {scar_cli-0.34.0 → scar_cli-0.35.0}/.gitignore +0 -0
  67. {scar_cli-0.34.0 → scar_cli-0.35.0}/.pre-commit-config.yaml +0 -0
  68. {scar_cli-0.34.0 → scar_cli-0.35.0}/.pre-commit-hooks.yaml +0 -0
  69. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0001-git-grep-ere-pitfalls.landmine.md +0 -0
  70. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0002-agent-direct-hook-install.deadend.md +0 -0
  71. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0003-installer-binds-to-active-venv-scar.landmine.md +0 -0
  72. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0004-promote-roundtrip-drops-expires-evidence.landmine.md +0 -0
  73. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0005-history-rewrite-orphans-commit-evidence.landmine.md +0 -0
  74. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0006-yaml-pattern-anchor-over-escaping.landmine.md +0 -0
  75. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0007-release-please-config-change-skips-open-pr.landmine.md +0 -0
  76. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0008-rich-output-nontty-must-bypass-rich.landmine.md +0 -0
  77. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0009-anchor-survival-harness-measures-symbol-not-path-anchors.deadend.md +0 -0
  78. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0010-git-returncode-128-vs-empty-tracked-set.landmine.md +0 -0
  79. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0011-lint-compile-check-lets-redos-anchors-hang-hotpath.landmine.md +0 -0
  80. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0012-firing-log-readers-need-blanket-guards.landmine.md +0 -0
  81. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0013-docusaurus-future-v4-requires-faster-dep.landmine.md +0 -0
  82. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0014-inject-flag-dest-collides-with-subcommand-dispatch.landmine.md +0 -0
  83. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0015-zero-checkruns-means-approval-gate-not-workflow-bug.deadend.md +0 -0
  84. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0016-hook-ownership-must-be-kind-scoped.landmine.md +0 -0
  85. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0017-codex-pretool-context-can-replay-apply-patch.landmine.md +0 -0
  86. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0018-cli-subparsers-register-through-_add-wrapper.landmine.md +0 -0
  87. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0019-token-in-scar-body-cannot-prove-hook-delivery.deadend.md +0 -0
  88. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0020-one-directional-health-check-leaves-flattering-direction-unwatched.landmine.md +0 -0
  89. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0021-posttool-fix-in-hooks-does-not-reach-codex-or-cascade.landmine.md +0 -0
  90. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0022-codex-hook-delivery-needs-user-file-and-trust.landmine.md +0 -0
  91. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0023-cascade-block-exit-collides-with-argparse.fence.md +0 -0
  92. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0024-host-detection-must-not-read-the-process-home.deadend.md +0 -0
  93. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0025-one-plugin-hook-manifest-two-hosts-two-root-variables.landmine.md +0 -0
  94. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0026-path-anchor-breadth-drives-the-review-due-threshold.landmine.md +0 -0
  95. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0027-slug-and-display-cleaning-are-different-jobs.landmine.md +0 -0
  96. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0028-violation-evidence-must-not-persist-raw-edits.fence.md +0 -0
  97. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0029-compliance-pools-by-repo-and-id.landmine.md +0 -0
  98. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0030-presence-signer-input-canonical-subset.landmine.md +0 -0
  99. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/0031-rich-values-never-in-markup.landmine.md +0 -0
  100. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/README.md +0 -0
  101. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/candidates/.gitkeep +0 -0
  102. {scar_cli-0.34.0 → scar_cli-0.35.0}/.scars/template.md +0 -0
  103. {scar_cli-0.34.0 → scar_cli-0.35.0}/AGENTS.md +0 -0
  104. {scar_cli-0.34.0 → scar_cli-0.35.0}/CONTRIBUTING.md +0 -0
  105. {scar_cli-0.34.0 → scar_cli-0.35.0}/IDEA.md +0 -0
  106. {scar_cli-0.34.0 → scar_cli-0.35.0}/LICENSE +0 -0
  107. {scar_cli-0.34.0 → scar_cli-0.35.0}/ROADMAP.md +0 -0
  108. {scar_cli-0.34.0 → scar_cli-0.35.0}/SCAR-FORMAT.md +0 -0
  109. {scar_cli-0.34.0 → scar_cli-0.35.0}/STRESS-TEST.md +0 -0
  110. {scar_cli-0.34.0 → scar_cli-0.35.0}/codecov.yml +0 -0
  111. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/PROTOCOL.md +0 -0
  112. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/RESULTS.md +0 -0
  113. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/long_replay.py +0 -0
  114. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/replay.py +0 -0
  115. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/replay_shipped.py +0 -0
  116. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/anchor-survival/test_replay_shipped.py +0 -0
  117. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/auto-authorship/FINDINGS.md +0 -0
  118. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/auto-authorship/PROTOCOL.md +0 -0
  119. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/.gitignore +0 -0
  120. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/PROTOCOL.md +0 -0
  121. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/RESULTS.md +0 -0
  122. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/.scars/0001-vendor-retry-window.fence.md +0 -0
  123. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/.scars/0002-evicting-session-store.deadend.md +0 -0
  124. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/.scars/0003-export-column-order.landmine.md +0 -0
  125. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/README.md +0 -0
  126. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/payments/retry.py +0 -0
  127. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/reports/export.py +0 -0
  128. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/fixture/services/sessions.py +0 -0
  129. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/fence-honor/grade.py +0 -0
  130. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/harvest/PROTOCOL.md +0 -0
  131. {scar_cli-0.34.0 → scar_cli-0.35.0}/experiments/harvest/harvest.py +0 -0
  132. {scar_cli-0.34.0 → scar_cli-0.35.0}/hook/scar-hooks.py +0 -0
  133. {scar_cli-0.34.0 → scar_cli-0.35.0}/plugin/skills/scar-authoring/SKILL.md +0 -0
  134. {scar_cli-0.34.0 → scar_cli-0.35.0}/plugin/skills/scar-authoring/assets/template.md +0 -0
  135. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/__init__.py +0 -0
  136. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/agent.py +0 -0
  137. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/atomic.py +0 -0
  138. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/clock.py +0 -0
  139. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/config.py +0 -0
  140. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/draftcheck.py +0 -0
  141. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/evidence.py +0 -0
  142. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/firing_log.py +0 -0
  143. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/gc.py +0 -0
  144. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/harvest.py +0 -0
  145. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/hosts.py +0 -0
  146. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/installer.py +0 -0
  147. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/match.py +0 -0
  148. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/mcp.py +0 -0
  149. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/output.py +0 -0
  150. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/presence.py +0 -0
  151. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/reanchor.py +0 -0
  152. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/record.py +0 -0
  153. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/render.py +0 -0
  154. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/review.py +0 -0
  155. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/skills/scar-authoring/SKILL.md +0 -0
  156. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/skills/scar-authoring/assets/template.md +0 -0
  157. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/symbols.py +0 -0
  158. {scar_cli-0.34.0 → scar_cli-0.35.0}/src/scar/violation_evidence.py +0 -0
  159. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/conformance_fetch.py +0 -0
  160. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/conformance_support.py +0 -0
  161. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/conftest.py +0 -0
  162. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/fixtures/conformance/promote.json +0 -0
  163. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/fixtures/conformance/regenerate.py +0 -0
  164. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/presence_fakes.py +0 -0
  165. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_act_line.py +0 -0
  166. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_atomic.py +0 -0
  167. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_block_capability.py +0 -0
  168. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_cascade.py +0 -0
  169. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_clock.py +0 -0
  170. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_compliance_stats.py +0 -0
  171. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_conformance_round_trip.py +0 -0
  172. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_context_size.py +0 -0
  173. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_draftcheck.py +0 -0
  174. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_evidence.py +0 -0
  175. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_firing_log.py +0 -0
  176. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_gc.py +0 -0
  177. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_git_hook.py +0 -0
  178. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_harvest.py +0 -0
  179. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_hosts.py +0 -0
  180. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_installer.py +0 -0
  181. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_json_contract.py +0 -0
  182. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_lifecycle.py +0 -0
  183. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_lint.py +0 -0
  184. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_match.py +0 -0
  185. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_mcp.py +0 -0
  186. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_model.py +0 -0
  187. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_orphan.py +0 -0
  188. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_output.py +0 -0
  189. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_precommit_hooks.py +0 -0
  190. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_presence.py +0 -0
  191. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_presence_adapters.py +0 -0
  192. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_presence_signer.py +0 -0
  193. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_promote_batch.py +0 -0
  194. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_promote_signed.py +0 -0
  195. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_reanchor.py +0 -0
  196. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_record.py +0 -0
  197. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_render.py +0 -0
  198. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_render_fit.py +0 -0
  199. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_review.py +0 -0
  200. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_review_queue.py +0 -0
  201. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_rich_markup_values.py +0 -0
  202. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_sign_record.py +0 -0
  203. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_signing_refuses_unreadable.py +0 -0
  204. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_skill.py +0 -0
  205. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_store.py +0 -0
  206. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_sweep.py +0 -0
  207. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_symbols.py +0 -0
  208. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_terminal_branches.py +0 -0
  209. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_verify.py +0 -0
  210. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_violation_evidence.py +0 -0
  211. {scar_cli-0.34.0 → scar_cli-0.35.0}/tests/test_write_gate_cli.py +0 -0
  212. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/.gitignore +0 -0
  213. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docs/index.md +0 -0
  214. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docs/methodology.md +0 -0
  215. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/docusaurus.config.ts +0 -0
  216. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/package-lock.json +0 -0
  217. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/package.json +0 -0
  218. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/scripts/sync-changelog.mjs +0 -0
  219. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/sidebars.ts +0 -0
  220. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/src/css/custom.css +0 -0
  221. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/static/img/favicon.svg +0 -0
  222. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/static/img/social-card.png +0 -0
  223. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/static/llms.txt +0 -0
  224. {scar_cli-0.34.0 → scar_cli-0.35.0}/website/tsconfig.json +0 -0
@@ -21,6 +21,8 @@ jobs:
21
21
  python-version: ["3.10", "3.13"]
22
22
  steps:
23
23
  - uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0 # scar lint's evidence-reachability checks need history
24
26
 
25
27
  - name: Install uv
26
28
  uses: astral-sh/setup-uv@v5
@@ -82,9 +84,15 @@ jobs:
82
84
 
83
85
  # Dogfood: the repo's own scar graph must always parse and lint clean.
84
86
  # A malformed scar silently never fires (the daimon 0004 incident) —
85
- # this gate makes that class of rot unmergeable.
87
+ # this gate makes that class of rot unmergeable. It runs the code under
88
+ # review (uv run), not a release, and is at least as strict as the
89
+ # reusable workflow's defaults (.github/workflows/scar.yml, #449): an
90
+ # orphaned scar fails, and every armed violation pattern is swept.
86
91
  - name: scar lint
87
- run: uv run scar lint
92
+ run: uv run scar lint --fail-orphans
93
+
94
+ - name: scar sweep
95
+ run: uv run scar sweep --exit-code
88
96
 
89
97
  lint:
90
98
  name: lint (ruff)
@@ -0,0 +1,21 @@
1
+ # Scar runs its review queue through the reusable workflow it publishes, at the
2
+ # local ref, so the file consumers call is the file this repo exercises (#449).
3
+ name: Scar review queue
4
+ on:
5
+ schedule:
6
+ - cron: '0 7 * * 1'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ issues: write
12
+
13
+ jobs:
14
+ scar:
15
+ uses: ./.github/workflows/scar.yml
16
+ with:
17
+ # No release-managed default exists (GITHUB_TOKEN cannot write workflow
18
+ # files), so this pin is bumped by hand with each release. The workflow
19
+ # installs from PyPI, so it cannot run the checkout's own code.
20
+ scar-version: '0.34.0'
21
+ review-queue: true
@@ -0,0 +1,137 @@
1
+ # Scar's CI gate as a reusable workflow (#449). Call it, do not copy it:
2
+ #
3
+ # jobs:
4
+ # scar:
5
+ # uses: Daily-Nerd/Scar/.github/workflows/scar.yml@vX.Y.Z
6
+ # with:
7
+ # scar-version: X.Y.Z
8
+ #
9
+ # scar-version is required and has no default on purpose: release-please runs
10
+ # with GITHUB_TOKEN, which can never write under .github/workflows/, so a
11
+ # release-managed default here would fail every release. Pin the same release
12
+ # as the ref, and bump both lines together to upgrade.
13
+ #
14
+ # Every input reaches the shell through env:. None is expanded inside a run:
15
+ # script, where its value would be parsed as code.
16
+ name: Scar
17
+
18
+ on:
19
+ workflow_call:
20
+ inputs:
21
+ scar-version:
22
+ description: >-
23
+ scar-cli version to install from PyPI, for example 0.34.0. Use the
24
+ release the @vX.Y.Z ref points at.
25
+ type: string
26
+ required: true
27
+ fail-orphans:
28
+ description: Fail when any scar is orphan-detected (every anchor resolves to nothing).
29
+ type: boolean
30
+ required: false
31
+ default: true
32
+ fail-partial-rot:
33
+ description: Fail when any scar has a dead anchor among live ones.
34
+ type: boolean
35
+ required: false
36
+ default: false
37
+ sweep:
38
+ description: Also run `scar sweep --exit-code`, every armed violation pattern over the whole tree.
39
+ type: boolean
40
+ required: false
41
+ default: false
42
+ review-queue:
43
+ description: >-
44
+ Keep one rolling issue in sync with `scar lint --review-queue`. The
45
+ calling job must grant `issues: write`.
46
+ type: boolean
47
+ required: false
48
+ default: false
49
+ timezone:
50
+ description: >-
51
+ TZ used to compare review_after dates. Empty means the runner's zone,
52
+ which is UTC on GitHub-hosted runners.
53
+ type: string
54
+ required: false
55
+ default: ''
56
+
57
+ jobs:
58
+ lint:
59
+ name: scar lint
60
+ runs-on: ubuntu-latest
61
+ permissions:
62
+ contents: read
63
+ env:
64
+ SCAR_VERSION: ${{ inputs.scar-version }}
65
+ TZ: ${{ inputs.timezone || 'UTC' }}
66
+ steps:
67
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
68
+ with:
69
+ fetch-depth: 0 # evidence-reachability checks need full history
70
+
71
+ - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
72
+
73
+ - name: scar lint
74
+ env:
75
+ FAIL_ORPHANS: ${{ inputs.fail-orphans }}
76
+ FAIL_PARTIAL_ROT: ${{ inputs.fail-partial-rot }}
77
+ run: |
78
+ set -- lint
79
+ if [ "$FAIL_ORPHANS" = "true" ]; then set -- "$@" --fail-orphans; fi
80
+ if [ "$FAIL_PARTIAL_ROT" = "true" ]; then set -- "$@" --fail-partial-rot; fi
81
+ uvx --from "scar-cli==$SCAR_VERSION" scar "$@"
82
+
83
+ # Runs even when lint failed, so one red run reports both.
84
+ - name: scar sweep
85
+ if: ${{ !cancelled() && inputs.sweep }}
86
+ run: uvx --from "scar-cli==$SCAR_VERSION" scar sweep --exit-code
87
+
88
+ review-queue:
89
+ name: scar review queue
90
+ if: ${{ inputs.review-queue }}
91
+ runs-on: ubuntu-latest
92
+ # No permissions: block on purpose. A called workflow can only narrow what
93
+ # the caller grants, and a job that asked for issues: write here would make
94
+ # every caller grant it, queue or not. This job uses the calling job's
95
+ # token as given, so a caller that enables the queue grants issues: write.
96
+ env:
97
+ SCAR_VERSION: ${{ inputs.scar-version }}
98
+ TZ: ${{ inputs.timezone || 'UTC' }}
99
+ steps:
100
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
101
+ with:
102
+ fetch-depth: 0 # evidence-reachability checks need full history
103
+
104
+ - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
105
+
106
+ - name: Build the queue
107
+ # Keep lint's exit code, but let the next step run first: each run
108
+ # step is bash -e, so a bare failure would skip the issue sync.
109
+ run: |
110
+ set +e
111
+ uvx --from "scar-cli==$SCAR_VERSION" scar lint --review-queue > queue.md
112
+ echo "status=$?" >> "$GITHUB_ENV"
113
+ exit 0
114
+
115
+ - name: Sync the rolling issue
116
+ env:
117
+ GH_TOKEN: ${{ github.token }}
118
+ run: |
119
+ label=scar-review-queue
120
+ gh label create "$label" --color BFD4F2 --description "Rolling Scar review queue" --force
121
+ issue=$(gh issue list --label "$label" --state all --limit 1 --json number,state)
122
+ number=$(jq -r '.[0].number // empty' <<<"$issue")
123
+ state=$(jq -r '.[0].state // empty' <<<"$issue")
124
+ if [ -s queue.md ]; then
125
+ if [ -z "$number" ]; then
126
+ gh issue create --title "Scar review queue" --label "$label" --body-file queue.md
127
+ else
128
+ gh issue edit "$number" --body-file queue.md
129
+ if [ "$state" = "CLOSED" ]; then gh issue reopen "$number"; fi
130
+ fi
131
+ elif [ -n "$number" ] && [ "$state" = "OPEN" ]; then
132
+ gh issue close "$number" --comment "Review queue is empty."
133
+ fi
134
+
135
+ - name: Fail the job if lint failed
136
+ if: env.status != '0'
137
+ run: exit 1
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.35.0"
3
+ }
@@ -1,21 +1,25 @@
1
1
  ---
2
+ id: 32
2
3
  type: landmine
3
4
  title: Scar files are read in one place; a direct read_text on a scar path brings back the crash
4
5
  severity: medium
5
6
  confidence: 0.8
6
7
  created: 2026-11-21
7
8
  authors: ["claude-code"]
9
+ promoted_by: Kibukx
10
+ promoted_by_source: git-config-interactive
11
+ promoted_from: candidates/scar-files-have-one-reader.md
8
12
  anchors:
9
13
  - path: src/scar/store.py
10
14
  - pattern: "parse_scar_text\(\w+\.read_text"
11
- violation: "parse_scar_text\(\w+\.read_text"
12
15
  evidence:
13
16
  - issue: 439
14
17
  - url: https://github.com/Daily-Nerd/Scar/issues/439
15
18
  expires:
16
19
  condition: "scar files stop being read as UTF-8 text, or the reader moves out of store.py"
17
20
  review_after: 2027-05-21
18
- status: candidate
21
+ violation: "parse_scar_text\(\w+\.read_text"
22
+ status: active
19
23
  ---
20
24
 
21
25
  store.read_scar_text and store.read_scar are the only code that opens a scar
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: 0
3
+ type: landmine
4
+ title: A tool that rewrites a scar's anchors or status must put its evidence note in the same text it writes, or the write gate refuses it
5
+ severity: medium
6
+ confidence: 0.8
7
+ created: 2026-12-01
8
+ authors: ["claude-code"]
9
+ anchors:
10
+ - path: src/scar/store.py
11
+ - path: src/scar/renames.py
12
+ - pattern: "write_active_scar\("
13
+ evidence:
14
+ - issue: 311
15
+ - note: "orphan --fix-renames moved anchors with no record while reanchor and transition each wrote one; each path decided for itself"
16
+ expires:
17
+ condition: "write_active_scar stops being the one in-place write of a numbered scar"
18
+ review_after: 2027-06-01
19
+ status: candidate
20
+ ---
21
+
22
+ Every tool rewrite of what a scar says (its signed record: anchors, title,
23
+ severity, type, body; or its status) must leave a dated evidence note. Before
24
+ #311 each path chose for itself, and `orphan --fix-renames` chose silence, so
25
+ a rename-followed scar read exactly like one authored at the new path.
26
+
27
+ `store.write_active_scar` now enforces it: a write that changes the record or
28
+ the status must keep every evidence entry, in order, and append at least one.
29
+ Otherwise it raises `UnrecordedRewrite` and nothing is written. Two traps for
30
+ a new rewrite path:
31
+
32
+ - Do not write the anchor change and then append the note in a second write.
33
+ The first write is refused. Build anchors and notes as one text
34
+ (`renames.anchor_rewrites_text`, each rewrite tuple carries its note) and
35
+ write once. Signed scars need this anyway: the note must be in the bytes
36
+ written with the new act.
37
+ - Add the note through `store.with_evidence_note`, which keeps the file's line
38
+ ending. Before #311 it returned mixed CRLF/LF for a CRLF scar, because the
39
+ parsed body kept its `\r` while `to_text` wrote bare `\n`.
40
+
41
+ `UnrecordedRewrite` is a bug in Scar, not a user refusal: do not catch it and
42
+ report it as one.
@@ -0,0 +1,33 @@
1
+ ---
2
+ id: 0
3
+ type: landmine
4
+ title: Cascade's execution_id is one agent turn, and using it as edit_id makes the log reader merge real edits
5
+ severity: high
6
+ confidence: 0.8
7
+ created: 2026-12-01
8
+ authors: ["claude-code"]
9
+ anchors:
10
+ - path: src/scar/cascade.py
11
+ violation: "get\(.execution_id"
12
+ evidence:
13
+ - issue: 310
14
+ - issue: 250
15
+ expires:
16
+ condition: "Cascade hook payloads gain a documented per-tool-call identifier"
17
+ review_after: 2027-06-01
18
+ status: candidate
19
+ ---
20
+
21
+ Windsurf rows carry no `edit_id` (#310). The obvious fill is the Cascade
22
+ payload's `execution_id`, and it is wrong. Per the Cascade hook docs it
23
+ identifies one agent turn, and a single turn can make several writes or
24
+ commands. `trajectory_id` is wider still: the whole conversation.
25
+
26
+ The coupling is with `cli._dedup_key` (#250). It merges firing-log rows that
27
+ share an `edit_id`, repo, target and id lists, because Codex can write the same
28
+ call twice through two hook channels. Two real Cascade edits to one file in one
29
+ turn that fire the same scar would carry the same `execution_id` and be
30
+ collapsed into one row on read, silently deleting a firing.
31
+
32
+ Leave `edit_id` absent on windsurf rows and let `absent_keys` say so
33
+ (`cascade.CALL_SIGNALS`). Only a documented per-call id may fill it.
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: 0
3
+ type: fence
4
+ title: Lint judges a scar's act only for statuses a command can sign or move to signable; archived is skipped on purpose
5
+ severity: medium
6
+ confidence: 0.8
7
+ created: 2026-12-01
8
+ authors: ["claude-code"]
9
+ anchors:
10
+ - path: src/scar/model.py
11
+ - path: src/scar/lint.py
12
+ - pattern: "act_judged"
13
+ evidence:
14
+ - issue: 442
15
+ - note: "before #442 lint reported act-missing on archived scars; archived is terminal and nothing signs it, so CI stayed red with no command to clear it"
16
+ expires:
17
+ condition: "archived stops being terminal, or a command can sign an archived scar"
18
+ review_after: 2027-12-01
19
+ status: candidate
20
+ ---
21
+
22
+ `downgrade_findings` skips the act checks (unreadable, stale, missing at or
23
+ after `signed_from`) for any status whose `act_judged` is false in the
24
+ `LIFECYCLE` table. Archived, candidate and template are skipped. This looks
25
+ like a hole in the downgrade guard. It is intentional.
26
+
27
+ An archived scar never fires and is terminal by owner ruling, so no command
28
+ can return it to active or sign it. An act error on it could never be cleared:
29
+ before #442 the only way to a green CI was to delete the file or edit the
30
+ config. A stale act on a scar that never injects protects nothing.
31
+
32
+ Do not turn `act_judged` on for a status without a path to a signable one.
33
+ `tests/test_lifecycle_policy.py` fails when lint judges a status no command
34
+ can clear, and when an edge in the table has no command. If archived ever
35
+ gains a way back, judge it again and give the error its remedy.
36
+
37
+ The table lives in `model.py`, not `store.py`, because the store imports lint
38
+ and lint reads the table; moving it into the store makes a circular import.
@@ -0,0 +1,32 @@
1
+ ---
2
+ id: 0
3
+ type: landmine
4
+ title: release-please extra-files under .github/workflows/ break every release
5
+ severity: high
6
+ confidence: 0.9
7
+ created: 2026-12-01
8
+ authors: ["claude-code"]
9
+ anchors:
10
+ - path: release-please-config.json
11
+ - path: .github/workflows/scar.yml
12
+ evidence:
13
+ - issue: 449
14
+ - pr: 450
15
+ - note: every release run on main failed with "release-please failed: Error adding to tree" after PR 450 listed scar.yml in extra-files
16
+ expires:
17
+ condition: release-please runs with a token that has the workflows scope, or GitHub lets GITHUB_TOKEN write workflow files
18
+ review_after: 2027-06-01
19
+ status: candidate
20
+ ---
21
+
22
+ Adding `.github/workflows/scar.yml` to `extra-files` so its `scar-version`
23
+ default tracked releases looked harmless. release-please runs with
24
+ GITHUB_TOKEN, and GitHub never lets that token write anything under
25
+ `.github/workflows/`, so every release run failed with `Error adding to tree`
26
+ (issue #449, PR #450).
27
+
28
+ Keep workflow files out of `extra-files`. The reusable workflow takes
29
+ `scar-version` as a required input with no default, so callers pin it
30
+ themselves and no secret is needed. `action.yml` sits at the repo root, so its
31
+ release-managed default is fine. A test in `tests/test_docs.py` fails if any
32
+ extra-files path starts with `.github/`.
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.35.0](https://github.com/Daily-Nerd/Scar/compare/v0.34.0...v0.35.0) (2026-12-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **ci:** ship a versioned reusable workflow so consumers stop copying CI YAML ([#450](https://github.com/Daily-Nerd/Scar/issues/450)) ([9de573a](https://github.com/Daily-Nerd/Scar/commit/9de573a5657fae912d26c4dfac582ff2dc2e1d19)), closes [#449](https://github.com/Daily-Nerd/Scar/issues/449)
9
+ * **lifecycle:** one table owns status policy, and scar reactivate reaches active ([#451](https://github.com/Daily-Nerd/Scar/issues/451)) ([67644a5](https://github.com/Daily-Nerd/Scar/commit/67644a5a23966161406187f6bb31feb38a277dc8))
10
+ * **orphan:** fix-renames records an evidence note, and the write gate requires one ([#446](https://github.com/Daily-Nerd/Scar/issues/446)) ([f10b882](https://github.com/Daily-Nerd/Scar/commit/f10b882f44283c58b8d14285cd846b8d7c29cacf))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **hooks:** make every firing row declare its per-call keys ([#444](https://github.com/Daily-Nerd/Scar/issues/444)) ([a5ffdac](https://github.com/Daily-Nerd/Scar/commit/a5ffdac060d69d6a7e5796015dbd23d1b8071306))
16
+ * **hooks:** route every hook entrypoint through one fail-open wrapper ([#447](https://github.com/Daily-Nerd/Scar/issues/447)) ([4d05f93](https://github.com/Daily-Nerd/Scar/commit/4d05f93be1b959564be8e176fa473b363641ac37))
17
+ * **release:** stop release-please rewriting a workflow file ([#452](https://github.com/Daily-Nerd/Scar/issues/452)) ([effc2b1](https://github.com/Daily-Nerd/Scar/commit/effc2b168408a563e175152d7cae84b058170200))
18
+
3
19
  ## [0.34.0](https://github.com/Daily-Nerd/Scar/compare/v0.33.0...v0.34.0) (2026-11-21)
4
20
 
5
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scar-cli
3
- Version: 0.34.0
3
+ Version: 0.35.0
4
4
  Summary: SCAR — version control for negative knowledge (deadends, fences, landmines)
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -110,26 +110,39 @@ Both hooks assume `.scars/` already exists (`scar init`) and `language: python`
110
110
  installs this package into pre-commit's own isolated venv — no separate
111
111
  `scar` install required on the machine running the hook.
112
112
 
113
- SCAR also ships a composite GitHub Action (`action.yml`, repo root) for
114
- CI without pre-commit:
113
+ For GitHub Actions, call the reusable workflow instead of copying YAML. It runs
114
+ `scar lint --fail-orphans` by default, and can add `scar sweep` and the rolling
115
+ review queue:
115
116
 
116
117
  ```yaml
117
- # .github/workflows/scar.yml
118
- - uses: Daily-Nerd/Scar@main # or pin a tag, e.g. @v0.11.0 (release-please)
118
+ jobs:
119
+ scar:
120
+ uses: Daily-Nerd/Scar/.github/workflows/scar.yml@vX.Y.Z # a release tag, or its full commit SHA
121
+ with:
122
+ scar-version: X.Y.Z # required: the same release as the ref
123
+ ```
124
+
125
+ The ref and `scar-version` are the pin, so the gate only changes when you
126
+ change those two lines. Inputs and permissions
127
+ are in the [CI docs](https://daily-nerd.github.io/Scar/agents#reusable-workflow).
128
+
129
+ To add the lint gate to a job you already own, use the composite action
130
+ (`action.yml`, repo root). Same pin rule, and check out with full history first:
131
+
132
+ ```yaml
133
+ - uses: actions/checkout@v4
134
+ with:
135
+ fetch-depth: 0 # evidence-reachability checks need history
136
+ - uses: Daily-Nerd/Scar@vX.Y.Z
119
137
  with:
120
- fail-orphans: 'true' # default; set 'false' to only fail on parse errors
138
+ fail-orphans: 'true' # default; set 'false' to only fail on parse errors
121
139
  fail-partial-rot: 'false' # opt in; also fail when a scar has a dead anchor among live ones
122
- version: '' # empty = latest scar-cli from PyPI; or pin e.g. '0.11.0'
123
- args: '' # extra args appended to `scar lint`
124
140
  ```
125
141
 
126
- `@main` always tracks the latest commit; releases are tagged `vX.Y.Z` via
127
- release-please, so pin a tag for reproducible CI.
128
-
129
142
  `scar lint --review-queue` prints a markdown checklist of scars that need a human
130
143
  (orphans, partial rot, symbol drift, unreachable evidence, passed `review_after`),
131
144
  empty when there are none. The docs have a scheduled-workflow recipe that keeps
132
- one rolling issue in sync with it: see [CI](https://daily-nerd.github.io/Scar/docs/agents#review-queue).
145
+ one rolling issue in sync with it: see [CI](https://daily-nerd.github.io/Scar/agents#review-queue).
133
146
 
134
147
  ## Quality discipline
135
148
 
@@ -95,26 +95,39 @@ Both hooks assume `.scars/` already exists (`scar init`) and `language: python`
95
95
  installs this package into pre-commit's own isolated venv — no separate
96
96
  `scar` install required on the machine running the hook.
97
97
 
98
- SCAR also ships a composite GitHub Action (`action.yml`, repo root) for
99
- CI without pre-commit:
98
+ For GitHub Actions, call the reusable workflow instead of copying YAML. It runs
99
+ `scar lint --fail-orphans` by default, and can add `scar sweep` and the rolling
100
+ review queue:
100
101
 
101
102
  ```yaml
102
- # .github/workflows/scar.yml
103
- - uses: Daily-Nerd/Scar@main # or pin a tag, e.g. @v0.11.0 (release-please)
103
+ jobs:
104
+ scar:
105
+ uses: Daily-Nerd/Scar/.github/workflows/scar.yml@vX.Y.Z # a release tag, or its full commit SHA
106
+ with:
107
+ scar-version: X.Y.Z # required: the same release as the ref
108
+ ```
109
+
110
+ The ref and `scar-version` are the pin, so the gate only changes when you
111
+ change those two lines. Inputs and permissions
112
+ are in the [CI docs](https://daily-nerd.github.io/Scar/agents#reusable-workflow).
113
+
114
+ To add the lint gate to a job you already own, use the composite action
115
+ (`action.yml`, repo root). Same pin rule, and check out with full history first:
116
+
117
+ ```yaml
118
+ - uses: actions/checkout@v4
119
+ with:
120
+ fetch-depth: 0 # evidence-reachability checks need history
121
+ - uses: Daily-Nerd/Scar@vX.Y.Z
104
122
  with:
105
- fail-orphans: 'true' # default; set 'false' to only fail on parse errors
123
+ fail-orphans: 'true' # default; set 'false' to only fail on parse errors
106
124
  fail-partial-rot: 'false' # opt in; also fail when a scar has a dead anchor among live ones
107
- version: '' # empty = latest scar-cli from PyPI; or pin e.g. '0.11.0'
108
- args: '' # extra args appended to `scar lint`
109
125
  ```
110
126
 
111
- `@main` always tracks the latest commit; releases are tagged `vX.Y.Z` via
112
- release-please, so pin a tag for reproducible CI.
113
-
114
127
  `scar lint --review-queue` prints a markdown checklist of scars that need a human
115
128
  (orphans, partial rot, symbol drift, unreachable evidence, passed `review_after`),
116
129
  empty when there are none. The docs have a scheduled-workflow recipe that keeps
117
- one rolling issue in sync with it: see [CI](https://daily-nerd.github.io/Scar/docs/agents#review-queue).
130
+ one rolling issue in sync with it: see [CI](https://daily-nerd.github.io/Scar/agents#review-queue).
118
131
 
119
132
  ## Quality discipline
120
133
 
@@ -89,6 +89,7 @@ scar check <path|diff> # scars relevant to a path or staged diff; exit code f
89
89
  scar sweep # run every armed violation over the whole tree; read-only, exit 0 unless --exit-code
90
90
  scar why <path> # human-readable history of pain for a file/dir
91
91
  scar challenge <id> # open a challenge: contest staleness with evidence
92
+ scar reactivate <id> # return a challenged or orphaned scar to active (refused while every anchor is dead)
92
93
  scar harvest # mine git history, emit candidate scars to .scars/candidates/
93
94
  scar status # active/orphaned/challenged/expiring counts; repo health
94
95
  scar inject --path <p> # machine mode: top-k scars for one edit as hook JSON
@@ -127,13 +128,27 @@ Hard rule: **max 3 scars injected per edit, max ~120 words each.** A scar system
127
128
 
128
129
  ```
129
130
  candidate ──promote──▶ active ──challenge──▶ challenged
130
- │ │ └────────▶ archived (+tombstone note)
131
- discard anchors drift
132
- ▼
133
- orphaned ──re-anchor──▶ active
134
- └──expire/review──▶ archived
131
+ ▲ │ │
132
+ │ └──orphan --apply──▶ orphaned (every anchor dead)
133
+ │ │
134
+ └──────reactivate────────┘ (from challenged or orphaned)
135
+
136
+ any status but archived ──archive──▶ archived (terminal)
135
137
  ```
136
138
 
139
+ | From | To | Command |
140
+ |---|---|---|
141
+ | candidate | active | `scar promote` |
142
+ | active, orphaned | challenged | `scar challenge` |
143
+ | active, challenged | orphaned | `scar orphan --apply` (every anchor dead) |
144
+ | challenged, orphaned | active | `scar reactivate` (an orphaned scar needs a live anchor) |
145
+ | candidate, active, challenged, orphaned | archived | `scar archive` |
146
+
147
+ Each move writes a dated evidence note. `archived` is terminal. The legal
148
+ moves, and for each status whether it fires, can be signed and has its act
149
+ judged by lint, are one table (`LIFECYCLE` in `model.py`, read through the
150
+ store). `reanchor --apply` rewrites anchors and never changes a status.
151
+
137
152
  - Confidence is a static, human-authored ranking weight (0..1); the tool does not currently mutate it. Dynamic confidence — decay toward a floor without confirmations, an uphold bump on a survived challenge, and an explicit `scar confirm <id>` — is deferred until scar volume and confirmation data can calibrate a decay policy without unvalidated constants (issue #95).
138
153
  - `review_after` forces periodic human contact with old scars; CI can warn on overdue reviews.
139
154
  - `review_after_firings` is the count-based sibling of `review_after`: once a scar has fired N times *since the last commit that touched its file*, `scar status` and `scar lint` escalate it from an ambient warning to an explicit review flag. Revising the scar re-affirms it and restarts the count; archiving it silences the flag because archived scars do not fire. Absent ⇒ per-type default (`landmine` 10, `fence` 15, `deadend` disabled); `0` ⇒ never escalate. Advisory by default — `scar lint --fail-firing-review` opts into a non-zero exit. Escalation reports only; it never archives or challenges a scar (ADR-4 keeps lifecycle transitions human).
@@ -359,6 +374,21 @@ advance, and a field that silently never populates is a blind column rather
359
374
  than a measurement. Check the population rate before drawing any conclusion
360
375
  from the values.
361
376
 
377
+ Omission alone cannot say *why* a key is missing, so every firing row also
378
+ carries `absent_keys`: the per-call keys the writer looked for and the host did
379
+ not supply on this call (`edit_id`, `context_bytes`; a verdict row declares only
380
+ `edit_id`). It is always written, `[]` when nothing is absent. A key listed
381
+ there is a fact about the host. A key missing from a row that has no
382
+ `absent_keys` at all means the row predates the field, the same rule as `armed_ids`.
383
+ Windsurf's payload carries no per-call id and no transcript path (its
384
+ `execution_id` is one agent turn, which can make several edits), so its rows
385
+ list both. Those rows count as `verdicts_unplaceable` and
386
+ `firings_context_unknown`, never as joined.
387
+
388
+ Every row writer requires this declaration. An adapter for a new host cannot
389
+ write a row without stating what its host supplies, so a forgotten key can no
390
+ longer look like a host that had nothing to give.
391
+
362
392
  Nothing reads `context_bytes` to make a decision, and no claim is derived from
363
393
  it here. The analysis that will read it is pre-registered separately and is
364
394
  gated on a real distribution existing first: buckets chosen after seeing a
@@ -789,6 +819,15 @@ So a tool that rewrites a signed scar has two outcomes: it signs the new
789
819
  record, or it refuses. An act that matches its record is never left stale by a
790
820
  tool.
791
821
 
822
+ A second rule holds for every numbered scar, signed or not: a write that
823
+ changes the record or the status keeps every evidence entry, in order, and
824
+ appends at least one. That entry is the dated note saying what the tool did
825
+ (`reanchored ... (tier: high)`, `fix-renames ... (git -M)`, `challenged ...`).
826
+ A write that does not raises `UnrecordedRewrite` and leaves the file untouched.
827
+ It is raised only for a code path that forgot its note, so it is a bug in Scar,
828
+ not a refusal. A file that does not parse, before or after, has no record to
829
+ compare and is not judged by this rule.
830
+
792
831
  The limit: a tool signs only a scar whose act matches its record. A scar with a
793
832
  stale act, or with no act at or after `signed_from`, is written with no touch by
794
833
  `scar reanchor --apply` and `scar orphan --fix-renames`, and lint reports it.
@@ -845,11 +884,12 @@ Only an active scar is ever signed (`check_signable_status`, `resign_target`).
845
884
  | `archived` | no | Refused, and archived is terminal |
846
885
  | `template` | no | Not a scar |
847
886
 
848
- A scar outside `active` that lint reports for a stale or missing act has no
849
- command that signs it. For a challenged or orphaned scar, edit `status:` back to
850
- `active` by hand (status is not in the record, so the act is unaffected), then
851
- run the command. For an archived scar there is no way back: archived is
852
- terminal, and the knowledge returns as a new candidate.
887
+ A challenged or orphaned scar that lint reports for a stale or missing act is
888
+ signed in two steps: `scar reactivate N` returns it to `active` (status is not
889
+ in the record, so an act that matched still matches), then `scar resign --id N`
890
+ signs it. Reactivate prints the lint error it leaves, with that remedy. An
891
+ archived scar is never signed and lint does not judge its act (10.13): archived
892
+ is terminal, and the knowledge returns as a new candidate.
853
893
 
854
894
  ### 10.12 What each command does
855
895
 
@@ -858,8 +898,8 @@ terminal, and the knowledge returns as a new candidate.
858
898
  | `scar promote` (org set) | One touch per candidate, written only after acceptance. A batch is a queue: a failure at k leaves 1 to k-1 promoted | `promote_one`, `_promote_one`, `preflight` | `tests/test_promote_signed.py` |
859
899
  | `scar resign --id N` | Signs the record as it stands and swaps only the act and receipt lines. Refused when the act already matches | `resign_target`, `resign_one`, `_cmd_resign` | `tests/test_resign.py` |
860
900
  | `scar reanchor --apply` | One touch. Anchors, notes and act in one write. Refuses otherwise | `_reanchor_apply`, `_sign_in_place` | `tests/test_sign_in_place.py` |
861
- | `scar orphan --fix-renames` | Unsigned scars first with no touch, then signed scars in id order, one touch each. A cancel stops the asking | `_orphan_fix_renames`, `_sign_in_place` | `tests/test_sign_in_place.py` |
862
- | `scar orphan --apply`, `scar challenge`, `scar archive`, evidence notes | Status and notes only. The record is unchanged, so the act still matches | `transition`, `append_evidence_note`, `write_active_scar` | `tests/test_write_gate.py` |
901
+ | `scar orphan --fix-renames` | Unsigned scars first with no touch, then signed scars in id order, one touch each. Each moved anchor gets a `fix-renames <date>: path <old> -> <new> (git -M)` note in the same write. A cancel stops the asking | `_orphan_fix_renames`, `_sign_in_place` | `tests/test_sign_in_place.py` |
902
+ | `scar orphan --apply`, `scar challenge`, `scar reactivate`, `scar archive`, evidence notes | Status and notes only. The record is unchanged, so the act still matches | `transition`, `append_evidence_note`, `write_active_scar` | `tests/test_write_gate.py` |
863
903
  | hand edit of the record | The act goes stale and lint errors. `scar resign` is the remedy for an active scar | `downgrade_findings` | `tests/test_resign.py` |
864
904
  | `scar lint` | Never signs. Reports the states of 10.13, and with `--verify-promotion` those of 10.14 | `downgrade_findings`, `verify_store` | `tests/test_signing_contract.py` |
865
905
 
@@ -877,9 +917,13 @@ state is an error:
877
917
  | `config-no-signed-from` | The config names an org without `signed_from` | `names an org but not signed_from` |
878
918
  | `config-past-next-id` | `signed_from` is past the next free id | `is beyond the next id` |
879
919
 
880
- For `act-unreadable`, `act-stale` and `act-missing` the message ends with
881
- `scar resign --id N` only when the scar is active (`_resign_hint`), because
882
- resign refuses every other status.
920
+ `act-unreadable`, `act-stale` and `act-missing` are judged only for a status
921
+ whose act lint judges in the lifecycle table (`act_judged`): active, challenged
922
+ and orphaned. An archived scar is not judged: it never fires, is terminal and
923
+ no command can sign it, so an error on it could never be cleared. The message
924
+ ends with the command that clears it (`_resign_hint`): `scar resign --id N` for
925
+ an active scar, and for a challenged or orphaned one `scar reactivate N`, then
926
+ `scar resign --id N`.
883
927
 
884
928
  ### 10.14 Verify states
885
929