scar-cli 0.35.0__tar.gz → 0.37.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 (223) hide show
  1. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/ci.yml +1 -0
  2. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/release.yml +25 -0
  3. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/scar-review-queue.yml +3 -4
  4. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/scar.yml +62 -13
  5. scar_cli-0.37.0/.release-please-manifest.json +3 -0
  6. {scar_cli-0.35.0 → scar_cli-0.37.0}/CHANGELOG.md +14 -0
  7. {scar_cli-0.35.0 → scar_cli-0.37.0}/PKG-INFO +1 -1
  8. {scar_cli-0.35.0 → scar_cli-0.37.0}/SPEC.md +34 -5
  9. {scar_cli-0.35.0 → scar_cli-0.37.0}/action.yml +1 -1
  10. {scar_cli-0.35.0 → scar_cli-0.37.0}/plugin/plugin.json +1 -1
  11. {scar_cli-0.35.0 → scar_cli-0.37.0}/pyproject.toml +1 -1
  12. scar_cli-0.37.0/src/scar/actor.py +78 -0
  13. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/cli.py +55 -37
  14. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/model.py +14 -1
  15. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/orphan.py +3 -3
  16. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/renames.py +7 -6
  17. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/review.py +1 -1
  18. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/store.py +21 -15
  19. scar_cli-0.37.0/tests/test_actor_stamp.py +249 -0
  20. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_cli.py +6 -6
  21. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_docs.py +113 -7
  22. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_lifecycle.py +10 -9
  23. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_lifecycle_policy.py +1 -1
  24. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_lint_downgrade.py +3 -2
  25. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_renames.py +9 -8
  26. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_scar_reader.py +2 -1
  27. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_sign_in_place.py +8 -5
  28. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_store.py +11 -10
  29. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_verify.py +2 -1
  30. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_write_gate.py +17 -16
  31. {scar_cli-0.35.0 → scar_cli-0.37.0}/uv.lock +1 -1
  32. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docs/agents.md +4 -2
  33. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docs/concepts.md +2 -1
  34. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docs/quickstart.md +1 -1
  35. scar_cli-0.35.0/.release-please-manifest.json +0 -3
  36. {scar_cli-0.35.0 → scar_cli-0.37.0}/.claude-plugin/marketplace.json +0 -0
  37. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  38. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  39. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  40. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  41. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/docs.yml +0 -0
  42. {scar_cli-0.35.0 → scar_cli-0.37.0}/.github/workflows/pr-validation.yml +0 -0
  43. {scar_cli-0.35.0 → scar_cli-0.37.0}/.gitignore +0 -0
  44. {scar_cli-0.35.0 → scar_cli-0.37.0}/.pre-commit-config.yaml +0 -0
  45. {scar_cli-0.35.0 → scar_cli-0.37.0}/.pre-commit-hooks.yaml +0 -0
  46. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0001-git-grep-ere-pitfalls.landmine.md +0 -0
  47. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0002-agent-direct-hook-install.deadend.md +0 -0
  48. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0003-installer-binds-to-active-venv-scar.landmine.md +0 -0
  49. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0004-promote-roundtrip-drops-expires-evidence.landmine.md +0 -0
  50. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0005-history-rewrite-orphans-commit-evidence.landmine.md +0 -0
  51. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0006-yaml-pattern-anchor-over-escaping.landmine.md +0 -0
  52. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0007-release-please-config-change-skips-open-pr.landmine.md +0 -0
  53. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0008-rich-output-nontty-must-bypass-rich.landmine.md +0 -0
  54. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0009-anchor-survival-harness-measures-symbol-not-path-anchors.deadend.md +0 -0
  55. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0010-git-returncode-128-vs-empty-tracked-set.landmine.md +0 -0
  56. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0011-lint-compile-check-lets-redos-anchors-hang-hotpath.landmine.md +0 -0
  57. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0012-firing-log-readers-need-blanket-guards.landmine.md +0 -0
  58. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0013-docusaurus-future-v4-requires-faster-dep.landmine.md +0 -0
  59. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0014-inject-flag-dest-collides-with-subcommand-dispatch.landmine.md +0 -0
  60. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0015-zero-checkruns-means-approval-gate-not-workflow-bug.deadend.md +0 -0
  61. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0016-hook-ownership-must-be-kind-scoped.landmine.md +0 -0
  62. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0017-codex-pretool-context-can-replay-apply-patch.landmine.md +0 -0
  63. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0018-cli-subparsers-register-through-_add-wrapper.landmine.md +0 -0
  64. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0019-token-in-scar-body-cannot-prove-hook-delivery.deadend.md +0 -0
  65. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0020-one-directional-health-check-leaves-flattering-direction-unwatched.landmine.md +0 -0
  66. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0021-posttool-fix-in-hooks-does-not-reach-codex-or-cascade.landmine.md +0 -0
  67. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0022-codex-hook-delivery-needs-user-file-and-trust.landmine.md +0 -0
  68. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0023-cascade-block-exit-collides-with-argparse.fence.md +0 -0
  69. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0024-host-detection-must-not-read-the-process-home.deadend.md +0 -0
  70. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0025-one-plugin-hook-manifest-two-hosts-two-root-variables.landmine.md +0 -0
  71. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0026-path-anchor-breadth-drives-the-review-due-threshold.landmine.md +0 -0
  72. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0027-slug-and-display-cleaning-are-different-jobs.landmine.md +0 -0
  73. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0028-violation-evidence-must-not-persist-raw-edits.fence.md +0 -0
  74. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0029-compliance-pools-by-repo-and-id.landmine.md +0 -0
  75. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0030-presence-signer-input-canonical-subset.landmine.md +0 -0
  76. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0031-rich-values-never-in-markup.landmine.md +0 -0
  77. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/0032-scar-files-have-one-reader.landmine.md +0 -0
  78. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/README.md +0 -0
  79. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/candidates/.gitkeep +0 -0
  80. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/candidates/a-scar-rewrite-carries-its-own-note.md +0 -0
  81. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/candidates/cascade-execution-id-is-not-an-edit-id.md +0 -0
  82. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/candidates/lint-judges-an-act-only-where-a-command-can-clear-it.md +0 -0
  83. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/candidates/release-please-cannot-write-workflow-files.md +0 -0
  84. {scar_cli-0.35.0 → scar_cli-0.37.0}/.scars/template.md +0 -0
  85. {scar_cli-0.35.0 → scar_cli-0.37.0}/AGENTS.md +0 -0
  86. {scar_cli-0.35.0 → scar_cli-0.37.0}/CONTRIBUTING.md +0 -0
  87. {scar_cli-0.35.0 → scar_cli-0.37.0}/IDEA.md +0 -0
  88. {scar_cli-0.35.0 → scar_cli-0.37.0}/LICENSE +0 -0
  89. {scar_cli-0.35.0 → scar_cli-0.37.0}/README.md +0 -0
  90. {scar_cli-0.35.0 → scar_cli-0.37.0}/ROADMAP.md +0 -0
  91. {scar_cli-0.35.0 → scar_cli-0.37.0}/SCAR-FORMAT.md +0 -0
  92. {scar_cli-0.35.0 → scar_cli-0.37.0}/STRESS-TEST.md +0 -0
  93. {scar_cli-0.35.0 → scar_cli-0.37.0}/codecov.yml +0 -0
  94. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/PROTOCOL.md +0 -0
  95. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/RESULTS.md +0 -0
  96. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/long_replay.py +0 -0
  97. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/replay.py +0 -0
  98. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/replay_shipped.py +0 -0
  99. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/anchor-survival/test_replay_shipped.py +0 -0
  100. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/auto-authorship/FINDINGS.md +0 -0
  101. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/auto-authorship/PROTOCOL.md +0 -0
  102. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/.gitignore +0 -0
  103. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/PROTOCOL.md +0 -0
  104. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/RESULTS.md +0 -0
  105. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/.scars/0001-vendor-retry-window.fence.md +0 -0
  106. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/.scars/0002-evicting-session-store.deadend.md +0 -0
  107. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/.scars/0003-export-column-order.landmine.md +0 -0
  108. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/README.md +0 -0
  109. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/payments/retry.py +0 -0
  110. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/reports/export.py +0 -0
  111. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/fixture/services/sessions.py +0 -0
  112. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/fence-honor/grade.py +0 -0
  113. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/harvest/PROTOCOL.md +0 -0
  114. {scar_cli-0.35.0 → scar_cli-0.37.0}/experiments/harvest/harvest.py +0 -0
  115. {scar_cli-0.35.0 → scar_cli-0.37.0}/hook/scar-hooks.py +0 -0
  116. {scar_cli-0.35.0 → scar_cli-0.37.0}/plugin/hooks/run.sh +0 -0
  117. {scar_cli-0.35.0 → scar_cli-0.37.0}/plugin/skills/scar-authoring/SKILL.md +0 -0
  118. {scar_cli-0.35.0 → scar_cli-0.37.0}/plugin/skills/scar-authoring/assets/template.md +0 -0
  119. {scar_cli-0.35.0 → scar_cli-0.37.0}/release-please-config.json +0 -0
  120. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/__init__.py +0 -0
  121. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/agent.py +0 -0
  122. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/atomic.py +0 -0
  123. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/cascade.py +0 -0
  124. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/clock.py +0 -0
  125. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/codex.py +0 -0
  126. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/config.py +0 -0
  127. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/draftcheck.py +0 -0
  128. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/evidence.py +0 -0
  129. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/firing_log.py +0 -0
  130. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/gc.py +0 -0
  131. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/harvest.py +0 -0
  132. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/hooks.py +0 -0
  133. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/hosts.py +0 -0
  134. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/installer.py +0 -0
  135. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/lint.py +0 -0
  136. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/match.py +0 -0
  137. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/mcp.py +0 -0
  138. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/output.py +0 -0
  139. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/presence.py +0 -0
  140. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/reanchor.py +0 -0
  141. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/record.py +0 -0
  142. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/render.py +0 -0
  143. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/signedpromote.py +0 -0
  144. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/skills/scar-authoring/SKILL.md +0 -0
  145. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/skills/scar-authoring/assets/template.md +0 -0
  146. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/symbols.py +0 -0
  147. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/verify.py +0 -0
  148. {scar_cli-0.35.0 → scar_cli-0.37.0}/src/scar/violation_evidence.py +0 -0
  149. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/conformance_fetch.py +0 -0
  150. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/conformance_support.py +0 -0
  151. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/conftest.py +0 -0
  152. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/fixtures/conformance/promote.json +0 -0
  153. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/fixtures/conformance/regenerate.py +0 -0
  154. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/presence_fakes.py +0 -0
  155. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_act_line.py +0 -0
  156. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_action_yml.py +0 -0
  157. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_anchor_kind.py +0 -0
  158. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_atomic.py +0 -0
  159. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_block_capability.py +0 -0
  160. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_call_signals.py +0 -0
  161. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_cascade.py +0 -0
  162. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_clock.py +0 -0
  163. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_codex.py +0 -0
  164. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_compliance_stats.py +0 -0
  165. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_conformance_round_trip.py +0 -0
  166. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_context_size.py +0 -0
  167. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_draftcheck.py +0 -0
  168. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_evidence.py +0 -0
  169. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_firing_log.py +0 -0
  170. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_gc.py +0 -0
  171. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_git_hook.py +0 -0
  172. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_harvest.py +0 -0
  173. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_hook_failures.py +0 -0
  174. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_hooks.py +0 -0
  175. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_hosts.py +0 -0
  176. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_installer.py +0 -0
  177. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_json_contract.py +0 -0
  178. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_lint.py +0 -0
  179. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_match.py +0 -0
  180. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_matched_by.py +0 -0
  181. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_mcp.py +0 -0
  182. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_model.py +0 -0
  183. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_orphan.py +0 -0
  184. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_output.py +0 -0
  185. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_plugin.py +0 -0
  186. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_precommit_hooks.py +0 -0
  187. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_presence.py +0 -0
  188. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_presence_adapters.py +0 -0
  189. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_presence_signer.py +0 -0
  190. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_promote_batch.py +0 -0
  191. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_promote_signed.py +0 -0
  192. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_reanchor.py +0 -0
  193. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_record.py +0 -0
  194. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_render.py +0 -0
  195. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_render_fit.py +0 -0
  196. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_resign.py +0 -0
  197. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_review.py +0 -0
  198. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_review_queue.py +0 -0
  199. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_rich_markup_values.py +0 -0
  200. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_sign_record.py +0 -0
  201. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_signing_contract.py +0 -0
  202. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_signing_refuses_unreadable.py +0 -0
  203. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_skill.py +0 -0
  204. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_sweep.py +0 -0
  205. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_symbols.py +0 -0
  206. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_terminal_branches.py +0 -0
  207. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_terminal_plain_parity.py +0 -0
  208. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_verdict_observability.py +0 -0
  209. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_violation_evidence.py +0 -0
  210. {scar_cli-0.35.0 → scar_cli-0.37.0}/tests/test_write_gate_cli.py +0 -0
  211. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/.gitignore +0 -0
  212. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docs/index.md +0 -0
  213. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docs/methodology.md +0 -0
  214. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/docusaurus.config.ts +0 -0
  215. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/package-lock.json +0 -0
  216. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/package.json +0 -0
  217. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/scripts/sync-changelog.mjs +0 -0
  218. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/sidebars.ts +0 -0
  219. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/src/css/custom.css +0 -0
  220. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/static/img/favicon.svg +0 -0
  221. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/static/img/social-card.png +0 -0
  222. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/static/llms.txt +0 -0
  223. {scar_cli-0.35.0 → scar_cli-0.37.0}/website/tsconfig.json +0 -0
@@ -2,6 +2,7 @@ name: CI
2
2
 
3
3
  on:
4
4
  pull_request:
5
+ workflow_dispatch:
5
6
  push:
6
7
  branches: [main]
7
8
 
@@ -12,6 +12,10 @@ permissions:
12
12
  jobs:
13
13
  release-please:
14
14
  runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+ actions: write
15
19
  outputs:
16
20
  release_created: ${{ steps.rp.outputs.release_created }}
17
21
  tag_name: ${{ steps.rp.outputs.tag_name }}
@@ -64,6 +68,27 @@ jobs:
64
68
  git commit -m "chore: sync uv.lock with the release version"
65
69
  git push origin "$BRANCH"
66
70
 
71
+ # Pushes made with GITHUB_TOKEN trigger no workflows, so the release PR
72
+ # never got its required check (#460). workflow_dispatch is the one event
73
+ # that token may start. The run lands on the branch head, which is the
74
+ # sync commit when there is one, so it covers the final SHA.
75
+ - name: Run CI on the release PR branch
76
+ env:
77
+ GH_TOKEN: ${{ github.token }}
78
+ GH_REPO: ${{ github.repository }}
79
+ RELEASE_CREATED: ${{ steps.rp.outputs.release_created }}
80
+ run: |
81
+ BRANCH=release-please--branches--main
82
+ if [ "$RELEASE_CREATED" = "true" ]; then
83
+ echo "A release was just tagged, no release PR to check."
84
+ exit 0
85
+ fi
86
+ if ! gh api "repos/$GH_REPO/branches/$BRANCH" >/dev/null 2>&1; then
87
+ echo "No open release branch, nothing to check."
88
+ exit 0
89
+ fi
90
+ gh workflow run ci.yml --ref "$BRANCH"
91
+
67
92
  publish:
68
93
  needs: release-please
69
94
  if: needs.release-please.outputs.release_created == 'true'
@@ -14,8 +14,7 @@ jobs:
14
14
  scar:
15
15
  uses: ./.github/workflows/scar.yml
16
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'
17
+ # Scar gates itself with its own HEAD, so no version number exists to
18
+ # bump per release.
19
+ from-checkout: true
21
20
  review-queue: true
@@ -6,10 +6,12 @@
6
6
  # with:
7
7
  # scar-version: X.Y.Z
8
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.
9
+ # Give exactly one of scar-version or from-checkout. scar-version has no
10
+ # default on purpose: release-please runs with GITHUB_TOKEN, which can never
11
+ # write under .github/workflows/, so a release-managed default here would fail
12
+ # every release. Consumers pin the same release as the ref, and bump both lines
13
+ # together to upgrade. from-checkout is for Scar itself or a fork: it installs
14
+ # the checked-out source, so no version number exists to bump.
13
15
  #
14
16
  # Every input reaches the shell through env:. None is expanded inside a run:
15
17
  # script, where its value would be parsed as code.
@@ -21,9 +23,18 @@ on:
21
23
  scar-version:
22
24
  description: >-
23
25
  scar-cli version to install from PyPI, for example 0.34.0. Use the
24
- release the @vX.Y.Z ref points at.
26
+ release the @vX.Y.Z ref points at. Give this or from-checkout, not
27
+ both.
25
28
  type: string
26
- required: true
29
+ required: false
30
+ from-checkout:
31
+ description: >-
32
+ Install scar from the checked-out repository instead of PyPI. For
33
+ running a checkout of Scar itself or a fork. Give this or
34
+ scar-version, not both.
35
+ type: boolean
36
+ required: false
37
+ default: false
27
38
  fail-orphans:
28
39
  description: Fail when any scar is orphan-detected (every anchor resolves to nothing).
29
40
  type: boolean
@@ -53,15 +64,52 @@ on:
53
64
  type: string
54
65
  required: false
55
66
  default: ''
67
+ runs-on:
68
+ description: >-
69
+ Runner for every job, as a JSON value: a single label such as
70
+ '"self-hosted"' or a list such as '["self-hosted", "linux"]'.
71
+ type: string
72
+ required: false
73
+ default: '"ubuntu-latest"'
56
74
 
57
75
  jobs:
76
+ # One owner for the install spec. Every other job reads it from here, so
77
+ # the exactly-one rule and the spec cannot drift between jobs.
78
+ source:
79
+ name: scar source
80
+ runs-on: ${{ fromJSON(inputs.runs-on) }}
81
+ permissions: {}
82
+ env:
83
+ SCAR_VERSION: ${{ inputs.scar-version }}
84
+ FROM_CHECKOUT: ${{ inputs.from-checkout }}
85
+ outputs:
86
+ from: ${{ steps.pick.outputs.from }}
87
+ steps:
88
+ - name: Choose the scar source
89
+ id: pick
90
+ run: |
91
+ if [ -n "$SCAR_VERSION" ] && [ "$FROM_CHECKOUT" = "true" ]; then
92
+ echo "::error::give exactly one of scar-version or from-checkout, not both"
93
+ exit 1
94
+ fi
95
+ if [ -z "$SCAR_VERSION" ] && [ "$FROM_CHECKOUT" != "true" ]; then
96
+ echo "::error::give exactly one of scar-version or from-checkout, got neither"
97
+ exit 1
98
+ fi
99
+ if [ "$FROM_CHECKOUT" = "true" ]; then
100
+ echo "from=." >> "$GITHUB_OUTPUT"
101
+ else
102
+ echo "from=scar-cli==$SCAR_VERSION" >> "$GITHUB_OUTPUT"
103
+ fi
104
+
58
105
  lint:
59
106
  name: scar lint
60
- runs-on: ubuntu-latest
107
+ needs: source
108
+ runs-on: ${{ fromJSON(inputs.runs-on) }}
61
109
  permissions:
62
110
  contents: read
63
111
  env:
64
- SCAR_VERSION: ${{ inputs.scar-version }}
112
+ SCAR_FROM: ${{ needs.source.outputs.from }}
65
113
  TZ: ${{ inputs.timezone || 'UTC' }}
66
114
  steps:
67
115
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
@@ -78,23 +126,24 @@ jobs:
78
126
  set -- lint
79
127
  if [ "$FAIL_ORPHANS" = "true" ]; then set -- "$@" --fail-orphans; fi
80
128
  if [ "$FAIL_PARTIAL_ROT" = "true" ]; then set -- "$@" --fail-partial-rot; fi
81
- uvx --from "scar-cli==$SCAR_VERSION" scar "$@"
129
+ uvx --from "$SCAR_FROM" scar "$@"
82
130
 
83
131
  # Runs even when lint failed, so one red run reports both.
84
132
  - name: scar sweep
85
133
  if: ${{ !cancelled() && inputs.sweep }}
86
- run: uvx --from "scar-cli==$SCAR_VERSION" scar sweep --exit-code
134
+ run: uvx --from "$SCAR_FROM" scar sweep --exit-code
87
135
 
88
136
  review-queue:
89
137
  name: scar review queue
138
+ needs: source
90
139
  if: ${{ inputs.review-queue }}
91
- runs-on: ubuntu-latest
140
+ runs-on: ${{ fromJSON(inputs.runs-on) }}
92
141
  # No permissions: block on purpose. A called workflow can only narrow what
93
142
  # the caller grants, and a job that asked for issues: write here would make
94
143
  # every caller grant it, queue or not. This job uses the calling job's
95
144
  # token as given, so a caller that enables the queue grants issues: write.
96
145
  env:
97
- SCAR_VERSION: ${{ inputs.scar-version }}
146
+ SCAR_FROM: ${{ needs.source.outputs.from }}
98
147
  TZ: ${{ inputs.timezone || 'UTC' }}
99
148
  steps:
100
149
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
@@ -108,7 +157,7 @@ jobs:
108
157
  # step is bash -e, so a bare failure would skip the issue sync.
109
158
  run: |
110
159
  set +e
111
- uvx --from "scar-cli==$SCAR_VERSION" scar lint --review-queue > queue.md
160
+ uvx --from "$SCAR_FROM" scar lint --review-queue > queue.md
112
161
  echo "status=$?" >> "$GITHUB_ENV"
113
162
  exit 0
114
163
 
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.37.0"
3
+ }
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.37.0](https://github.com/Daily-Nerd/Scar/compare/v0.36.0...v0.37.0) (2026-12-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * **lifecycle:** stamp the actor on every status change and record rewrite ([#458](https://github.com/Daily-Nerd/Scar/issues/458)) ([37fecda](https://github.com/Daily-Nerd/Scar/commit/37fecda1731edebc7b74eb9292170472f584dc4a))
9
+
10
+ ## [0.36.0](https://github.com/Daily-Nerd/Scar/compare/v0.35.0...v0.36.0) (2026-12-02)
11
+
12
+
13
+ ### Features
14
+
15
+ * **ci:** let callers of the reusable workflow choose the runner ([#455](https://github.com/Daily-Nerd/Scar/issues/455)) ([204b24e](https://github.com/Daily-Nerd/Scar/commit/204b24ec84ee58579f175e0683e14969a210b020))
16
+
3
17
  ## [0.35.0](https://github.com/Daily-Nerd/Scar/compare/v0.34.0...v0.35.0) (2026-12-01)
4
18
 
5
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scar-cli
3
- Version: 0.35.0
3
+ Version: 0.37.0
4
4
  Summary: SCAR — version control for negative knowledge (deadends, fences, landmines)
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -144,14 +144,40 @@ any status but archived ──archive──▶ archived (terminal)
144
144
  | challenged, orphaned | active | `scar reactivate` (an orphaned scar needs a live anchor) |
145
145
  | candidate, active, challenged, orphaned | archived | `scar archive` |
146
146
 
147
- Each move writes a dated evidence note. `archived` is terminal. The legal
147
+ Each move writes a dated evidence note that names who made it (see
148
+ "Who did it" below). `archived` is terminal. The legal
148
149
  moves, and for each status whether it fires, can be signed and has its act
149
150
  judged by lint, are one table (`LIFECYCLE` in `model.py`, read through the
150
151
  store). `reanchor --apply` rewrites anchors and never changes a status.
151
152
 
153
+ **Who did it.** Every write that changes a scar's status or record (`challenge`,
154
+ `reactivate`, `archive`, `orphan --apply`, `orphan --fix-renames`,
155
+ `reanchor --apply`) ends the evidence note it appends with an actor stamp:
156
+
157
+ ```
158
+ note: challenged 2026-12-01: vendor fixed it (by Ana, explicit)
159
+ note: "reanchored 2026-12-01: path a -> b (tier: high) (by Ana, explicit)"
160
+ ```
161
+
162
+ The stamp is `(by <name>, <source>)`, last in the note, inside the closing
163
+ quote of a quoted note. The name is resolved the way `scar promote` resolves
164
+ `promoted_by`: `--reviewer` if given (source `explicit`), else `git config
165
+ user.name` (source `git-config-interactive` when stdin is a terminal,
166
+ `git-config` otherwise, the same two values as `promoted_by_source`). With
167
+ neither, the note says `(by unknown, unresolved)`. One helper decides this for
168
+ promote and for every note. The store's write gate refuses a status or record
169
+ change whose added notes carry no stamp (`UnrecordedRewrite`), so a new command
170
+ cannot skip it. Notes written before this existed have no stamp and still parse
171
+ and lint clean.
172
+
173
+ This is a record, not a check. What is enforced is narrow: a signed scar needs a
174
+ presence touch to be rewritten. Everything else records the actor and is
175
+ advisory; nothing verifies that the name is a person, and CI is kept away from
176
+ these commands by not passing them, not by a gate.
177
+
152
178
  - 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).
153
179
  - `review_after` forces periodic human contact with old scars; CI can warn on overdue reviews.
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).
180
+ - `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: escalation reports, it does not move a scar's status).
155
181
  - Partial rot (a dead anchor on a scar whose other anchors still live) is advisory by default. `scar lint --fail-partial-rot` opts into a non-zero exit when any is found, and the GitHub Action exposes it as the `fail-partial-rot` input (default `false`). It is independent of `--fail-orphans`: neither implies the other. Partial rot is computed from git, so when git is unavailable the list is empty and the gate passes, matching `--fail-orphans` (#91).
156
182
  - When the reset point cannot be determined (untracked scar file, or no git history), the count reported is a **lifetime** count and says so. A since-revision count and a lifetime count are different quantities and must never share one label.
157
183
  - Archive keeps everything: SCAR's own history is negative knowledge.
@@ -411,8 +437,9 @@ verdict", never as a parse error. When it does emit, `message` is present only
411
437
  on `triggered: true`; there is no message to carry otherwise.
412
438
 
413
439
  `reanchor --json` lists proposals; `reanchor --apply --id N --json` emits the
414
- result of the apply (`fixed`, `skipped`, `refused`). `--apply` is
415
- human-review-only and never CI. `orphan --json` covers the list, `--apply` and
440
+ result of the apply (`fixed`, `skipped`, `refused`). `--apply` records
441
+ who ran it and is advisory: only a signed scar needs a presence touch, and
442
+ CI is simply not given the flag. `orphan --json` covers the list, `--apply` and
416
443
  `--fix-renames`: `orphan --apply --id N --json` emits `orphaned` (true),
417
444
  `scar_id`, `path` and `reason`.
418
445
 
@@ -823,7 +850,9 @@ A second rule holds for every numbered scar, signed or not: a write that
823
850
  changes the record or the status keeps every evidence entry, in order, and
824
851
  appends at least one. That entry is the dated note saying what the tool did
825
852
  (`reanchored ... (tier: high)`, `fix-renames ... (git -M)`, `challenged ...`).
826
- A write that does not raises `UnrecordedRewrite` and leaves the file untouched.
853
+ That entry names who did it (see "Who did it" below); a note with no actor
854
+ stamp does not count. A write that does not raises `UnrecordedRewrite` and
855
+ leaves the file untouched.
827
856
  It is raised only for a code path that forgot its note, so it is a bug in Scar,
828
857
  not a refusal. A file that does not parse, before or after, has no record to
829
858
  compare and is not judged by this rule.
@@ -22,7 +22,7 @@ inputs:
22
22
  version:
23
23
  description: "scar-cli version to install. Defaults to the release this action ships in, so the ref you pin decides the version."
24
24
  required: false
25
- default: '0.35.0' # x-release-please-version
25
+ default: '0.37.0' # x-release-please-version
26
26
  args:
27
27
  description: "Extra `scar lint` flags, split on whitespace with no quoting and no glob expansion. The CI flags have their own inputs, so most callers leave this empty."
28
28
  required: false
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scar",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
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.35.0"
3
+ version = "0.37.0"
4
4
  description = "SCAR — version control for negative knowledge (deadends, fences, landmines)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -0,0 +1,78 @@
1
+ """Who did it (#442). One place decides who the actor of a lifecycle write is,
2
+ and one place says how that is written into an evidence note.
3
+
4
+ Promote records `promoted_by` and `promoted_by_source`. Every other write that
5
+ changes a scar's status or record (challenge, reactivate, archive, orphan
6
+ --apply, reanchor --apply, orphan --fix-renames) records the same two facts in
7
+ the evidence note it already appends, as a trailing stamp:
8
+
9
+ (by <name>, <source>)
10
+
11
+ `source` is one of the values promoted_by_source has: `explicit` (the name was
12
+ typed with --reviewer), `git-config-interactive` (read from git config while
13
+ stdin is a terminal) or `git-config` (read from git config with no terminal,
14
+ which may be an unattended run), plus `unresolved` when no name could be had.
15
+ The stamp is a record, not a check: only a signed scar needs a presence touch.
16
+
17
+ Stdlib only: the parser and the hooks import the store, which imports this.
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import re
22
+ from dataclasses import dataclass
23
+
24
+ SOURCES = ("explicit", "git-config-interactive", "git-config", "unresolved")
25
+
26
+ # A stamp as written: "(by <name>, <source>)" at the end of the note text, or
27
+ # just before the closing quote of a quoted note.
28
+ STAMP_RE = re.compile(r"\(by [^()]+, (?:" + "|".join(SOURCES) + r")\)\"?\s*$")
29
+
30
+
31
+ @dataclass(frozen=True)
32
+ class Actor:
33
+ """Who a write is attributed to. `name` is "" and `source` None when
34
+ neither --reviewer nor git config gave a name (promote's old behavior:
35
+ no reviewer recorded); a note still stamps that case, as unresolved."""
36
+ name: str = ""
37
+ source: str | None = None
38
+
39
+ @property
40
+ def from_git(self) -> bool:
41
+ return self.source in ("git-config", "git-config-interactive")
42
+
43
+ @property
44
+ def label(self) -> str:
45
+ """The text inside the stamp. A name is flattened to one line with
46
+ nothing in it that the note's own syntax would read: quotes, a
47
+ comment marker, parentheses."""
48
+ name = " ".join(self.name.replace('"', "'").replace("#", "").split())
49
+ name = name.translate({ord("("): "[", ord(")"): "]"}).strip(", ")
50
+ return f"by {name or 'unknown'}, {self.source or 'unresolved'}"
51
+
52
+
53
+ def resolve_actor(explicit: str, git_name: str, *, interactive: bool) -> Actor:
54
+ """The one rule for "who": the explicit name if given, else the git
55
+ identity (git-config-interactive when a person is at a terminal,
56
+ git-config otherwise), else nobody. The caller reads git and the terminal;
57
+ this only decides."""
58
+ if explicit:
59
+ return Actor(explicit, "explicit")
60
+ if git_name:
61
+ return Actor(git_name, "git-config-interactive" if interactive else "git-config")
62
+ return Actor()
63
+
64
+
65
+ def stamp_note(note: str, actor: Actor) -> str:
66
+ """*note* with the actor stamp at its end. A quoted note keeps its closing
67
+ quote last, so `note: "x"` becomes `note: "x (by A, explicit)"`. A note that
68
+ already ends in a stamp is returned as it is, so stamping twice is not a
69
+ second claim."""
70
+ if STAMP_RE.search(note):
71
+ return note
72
+ if note.endswith('"') and note.count('"') >= 2:
73
+ return f'{note[:-1]} ({actor.label})"'
74
+ return f"{note} ({actor.label})"
75
+
76
+
77
+ def has_stamp(entry: str) -> bool:
78
+ return STAMP_RE.search(entry) is not None
@@ -54,6 +54,7 @@ from .reanchor import (
54
54
  from .render import injection_context, label_line, rule_line
55
55
  from .renames import (anchor_rewrites_text, apply_anchor_rewrites, apply_rename_fix,
56
56
  rename_rewrites)
57
+ from .actor import Actor, resolve_actor
57
58
  from .store import (ScarStore, SignedRecordWouldChange, init_scars, read_scar,
58
59
  read_scar_text, sanitize_signal_text, slugify)
59
60
  from .violation_evidence import is_violation_summary
@@ -434,7 +435,7 @@ def _lint_report(data: dict) -> _Report:
434
435
  lines.append(f"HINT partial-rot: scar #{pr['scar_id']} \u2014 {pr['reason']} "
435
436
  "\u2014 re-anchor to restore full coverage")
436
437
  # revives_if (#205): an ARCHIVED scar whose resurrection condition
437
- # matches the tree again. Advisory and human-gated: lint reports it
438
+ # matches the tree again. Advisory: lint reports it
438
439
  # and never re-arms the scar itself.
439
440
  for r in data["revivals"]:
440
441
  lines.append(f"HINT revives-if: scar #{r['scar_id']} is archived but its "
@@ -1159,6 +1160,20 @@ def _stdin_is_a_terminal() -> bool:
1159
1160
  return False
1160
1161
 
1161
1162
 
1163
+ def _resolve_actor(store: ScarStore, explicit: str | None) -> Actor:
1164
+ """Who is running this command: the one resolution promote's reviewer and
1165
+ every lifecycle note stamp share (#442). --reviewer if given, else the git
1166
+ identity of whoever runs it. The source says how the name was had; a git
1167
+ identity with a terminal on stdin counts as a person at a keyboard (#308).
1168
+ stdin only, deliberately: `scar promote x > log` is still a human at a
1169
+ keyboard, so a redirected stdout must not read as unattended. An unset git
1170
+ identity resolves to nobody (promote then records no reviewer; a note is
1171
+ stamped unresolved). Nothing here checks anything: only a signed scar needs
1172
+ a presence touch, and the actor is a record, not a gate."""
1173
+ git_name = "" if explicit else _git(store.root, "config", "user.name").stdout.strip()
1174
+ return resolve_actor(explicit or "", git_name, interactive=_stdin_is_a_terminal())
1175
+
1176
+
1162
1177
  def _resolve_candidate(store: ScarStore, arg: str) -> tuple[Path | None, str]:
1163
1178
  """An existing file path is taken as given (the store then refuses it if
1164
1179
  it lives outside candidates/); otherwise *arg* is a filename or unique
@@ -1217,25 +1232,10 @@ def _cmd_promote(args) -> int:
1217
1232
  if problem:
1218
1233
  print(f"refusing to promote: {problem}")
1219
1234
  return 1
1220
- # Promote is human-run by contract; when --reviewer is omitted the git
1221
- # identity of whoever runs it is the reviewer. Unset identity degrades to
1222
- # the old behavior (no reviewer appended).
1223
- reviewer = args.reviewer
1224
- from_git = False
1225
- if not reviewer:
1226
- reviewer = _git(store.root, "config", "user.name").stdout.strip()
1227
- from_git = bool(reviewer)
1228
- # #295 gave promoted_by_source two values; #308 splits the git-config one,
1229
- # because "the name came from git config" answered the wrong question. The
1230
- # question lint actually asks is whether a PERSON vouched, and a human
1231
- # running promote at a terminal is a person whether or not they retyped
1232
- # their own name. stdin only, deliberately: `scar promote x > log` is still
1233
- # a human at a keyboard, so a redirected stdout must not read as unattended.
1234
- if reviewer and from_git:
1235
- reviewer_source = ("git-config-interactive" if _stdin_is_a_terminal()
1236
- else "git-config")
1237
- else:
1238
- reviewer_source = "explicit" if reviewer else None
1235
+ # Who vouches is resolved in one place (_resolve_actor), the same one every
1236
+ # other lifecycle write uses to say who did it (#442).
1237
+ actor = _resolve_actor(store, args.reviewer)
1238
+ reviewer, from_git, reviewer_source = actor.name, actor.from_git, actor.source
1239
1239
  if org is not None:
1240
1240
  # Nothing that can be refused without a person is left for mid-batch.
1241
1241
  try:
@@ -1507,8 +1507,8 @@ def _archive_candidate(args) -> int:
1507
1507
  print(err)
1508
1508
  return 1
1509
1509
  try:
1510
- store.archive_candidate(path, reason=args.reason,
1511
- date=clock.today())
1510
+ store.archive_candidate(path, reason=args.reason, date=clock.today(),
1511
+ actor=_resolve_actor(store, getattr(args, "reviewer", "")))
1512
1512
  except ValueError as exc:
1513
1513
  print(str(exc))
1514
1514
  return 1
@@ -1570,7 +1570,8 @@ def _cmd_transition(args, new_status: str) -> int:
1570
1570
  return 1
1571
1571
  try:
1572
1572
  path = store.transition(args.id, new_status, reason=args.reason,
1573
- date=clock.today())
1573
+ date=clock.today(),
1574
+ actor=_resolve_actor(store, getattr(args, "reviewer", "")))
1574
1575
  except ValueError as exc:
1575
1576
  print(str(exc))
1576
1577
  return 1
@@ -1715,6 +1716,7 @@ def _orphan_fix_renames(store: ScarStore, findings, args) -> int:
1715
1716
  signed_targets: dict[int, _SignTarget] = {}
1716
1717
  renamed_of: dict[int, dict[str, str]] = {}
1717
1718
  fix_date = clock.today()
1719
+ actor = _resolve_actor(store, getattr(args, "reviewer", ""))
1718
1720
  for of in findings:
1719
1721
  path = id_to_path.get(of.scar_id)
1720
1722
  if not of.renamed or path is None:
@@ -1724,7 +1726,7 @@ def _orphan_fix_renames(store: ScarStore, findings, args) -> int:
1724
1726
  scar = id_to_scar[of.scar_id]
1725
1727
  if signedpromote.is_signed(scar):
1726
1728
  original = read_scar_text(path, keep_newlines=True)
1727
- new_text = anchor_rewrites_text(original, rename_rewrites(of.renamed, fix_date))
1729
+ new_text = anchor_rewrites_text(original, rename_rewrites(of.renamed, fix_date), actor)
1728
1730
  if new_text == original:
1729
1731
  skipped.append(of.scar_id)
1730
1732
  else:
@@ -1732,7 +1734,7 @@ def _orphan_fix_renames(store: ScarStore, findings, args) -> int:
1732
1734
  renamed_of[of.scar_id] = of.renamed
1733
1735
  continue
1734
1736
  try:
1735
- changed = apply_rename_fix(path, of.renamed, fix_date)
1737
+ changed = apply_rename_fix(path, of.renamed, fix_date, actor)
1736
1738
  except SignedRecordWouldChange as exc:
1737
1739
  refused.append((of.scar_id, str(exc), False))
1738
1740
  continue
@@ -1760,9 +1762,10 @@ def _orphan_fix_renames(store: ScarStore, findings, args) -> int:
1760
1762
 
1761
1763
  def _cmd_orphan(args) -> int:
1762
1764
  """List firing scars whose every anchor is dead. Read-only by default;
1763
- --apply persists status: orphaned via store.transition() (human-only);
1764
- --fix-renames rewrites dead-but-renamed anchor lines (also human-only,
1765
- also opt-in — #109)."""
1765
+ --apply persists status: orphaned via store.transition(), recording the
1766
+ actor; --fix-renames rewrites dead-but-renamed anchor lines (also opt-in,
1767
+ also recording the actor, #109). Neither is gated on a person: only a
1768
+ signed scar needs a presence touch, and CI is simply not given the flag."""
1766
1769
  store = _require_store(json_flag=getattr(args, "json", False))
1767
1770
  if store is None:
1768
1771
  return 1
@@ -1806,7 +1809,7 @@ def _cmd_orphan(args) -> int:
1806
1809
  tty=lambda: _orphan_rich(findings, partial), plain=plain)
1807
1810
  return 0
1808
1811
 
1809
- # --apply: persist. Human-only (never wire into CI/lint).
1812
+ # --apply: persist. Records the actor; never wire into CI/lint (advisory).
1810
1813
  if args.id is None:
1811
1814
  return _refuse(args, "--apply requires --id N (persist one reviewed orphan at a time)")
1812
1815
  target = next((of for of in findings if of.scar_id == args.id), None)
@@ -1815,8 +1818,8 @@ def _cmd_orphan(args) -> int:
1815
1818
  return _refuse(args, f"scar #{args.id} is not orphan-detected; detected ids: {ids}")
1816
1819
  note = f"{args.reason} [orphan: {_orphan_reason(target)}]"
1817
1820
  try:
1818
- path = store.transition(args.id, "orphaned", reason=note,
1819
- date=clock.today())
1821
+ path = store.transition(args.id, "orphaned", reason=note, date=clock.today(),
1822
+ actor=_resolve_actor(store, getattr(args, "reviewer", "")))
1820
1823
  except ValueError as exc:
1821
1824
  return _refuse(args, str(exc))
1822
1825
  rel = path.relative_to(store.root)
@@ -2006,6 +2009,7 @@ def _reanchor_apply(store: ScarStore, ctx, repo: Path, args) -> int:
2006
2009
  # touched so the confidence tier is read off the proposal, not re-derived.
2007
2010
  rewrites: list[tuple[str, str, str, str]] = []
2008
2011
  apply_date = clock.today()
2012
+ actor = _resolve_actor(store, getattr(args, "reviewer", ""))
2009
2013
  for kind, dead in dead_anchors:
2010
2014
  plist = groups.get((kind, dead), [])
2011
2015
  if not plist:
@@ -2032,7 +2036,7 @@ def _reanchor_apply(store: ScarStore, ctx, repo: Path, args) -> int:
2032
2036
  signed = False
2033
2037
  if fixed and signedpromote.is_signed(scar):
2034
2038
  original = read_scar_text(scar_file, keep_newlines=True)
2035
- new_text = anchor_rewrites_text(original, rewrites)
2039
+ new_text = anchor_rewrites_text(original, rewrites, actor)
2036
2040
  signed_ids, signed_refused = _sign_in_place(
2037
2041
  store, [_SignTarget(scar, scar_file, original, new_text)])
2038
2042
  signed = bool(signed_ids)
@@ -2043,7 +2047,7 @@ def _reanchor_apply(store: ScarStore, ctx, repo: Path, args) -> int:
2043
2047
  try:
2044
2048
  # Anchors and their notes in one write, the same text the signed
2045
2049
  # branch builds, so no anchor change ever lands without its note.
2046
- apply_anchor_rewrites(scar_file, rewrites)
2050
+ apply_anchor_rewrites(scar_file, rewrites, actor)
2047
2051
  except SignedRecordWouldChange as exc:
2048
2052
  refusal = str(exc)
2049
2053
  fixed = []
@@ -2065,7 +2069,7 @@ def _reanchor_apply(store: ScarStore, ctx, repo: Path, args) -> int:
2065
2069
  def _cmd_reanchor(args) -> int:
2066
2070
  """List (default) or apply (--apply --id N) reanchor proposals for
2067
2071
  orphaned/partial-rot scars — orphan recovery v1 (#111). Read-only by
2068
- default; --apply is human-only, one reviewed scar at a time, and never
2072
+ default; --apply records the actor, rewrites one reviewed scar at a time, and never
2069
2073
  touches status (same posture as `orphan --fix-renames`)."""
2070
2074
  store = _require_store(json_flag=getattr(args, "json", False))
2071
2075
  if store is None:
@@ -3858,6 +3862,14 @@ def build_parser() -> argparse.ArgumentParser:
3858
3862
  one place instead of repeating it per command.
3859
3863
  """
3860
3864
 
3865
+ def _add_reviewer(p) -> None:
3866
+ """The one --reviewer flag every lifecycle write takes (#442): promote
3867
+ records it as promoted_by, the others stamp it into the note they
3868
+ append."""
3869
+ p.add_argument("--reviewer", default="",
3870
+ help="who is making this change, recorded in the evidence "
3871
+ "note (default: git config user.name)")
3872
+
3861
3873
  def _add(subparsers, name, func, **kw):
3862
3874
  # set_defaults(func=...) is the dispatch mechanism (#180): keying on
3863
3875
  # args.command let any flag whose dest resolved to "command" shadow
@@ -3902,7 +3914,7 @@ def build_parser() -> argparse.ArgumentParser:
3902
3914
  help="candidate filename (or unique substring); several are "
3903
3915
  "validated together and promoted all-or-nothing")
3904
3916
  p.add_argument("--reviewer", default="",
3905
- help="the human vouching for this scar, recorded as promoted_by "
3917
+ help="who vouches for this scar, recorded as promoted_by "
3906
3918
  "(default: git config user.name)")
3907
3919
 
3908
3920
  p = _add(sub, "resign", _cmd_resign,
@@ -3963,20 +3975,25 @@ def build_parser() -> argparse.ArgumentParser:
3963
3975
  p = _add(sub, "challenge", _cmd_challenge, help="dispute a scar (still fires, marked challenged)")
3964
3976
  p.add_argument("id", type=int)
3965
3977
  p.add_argument("--reason", required=True, help="why the scar may no longer hold")
3978
+ _add_reviewer(p)
3966
3979
 
3967
3980
  p = _add(sub, "reactivate", _cmd_reactivate,
3968
3981
  help="return a challenged or orphaned scar to active (fires again)")
3969
3982
  p.add_argument("id", type=int)
3970
3983
  p.add_argument("--reason", required=True,
3971
3984
  help="why the scar holds again (e.g. challenge resolved, anchors back)")
3985
+ _add_reviewer(p)
3972
3986
 
3973
3987
  p = _add(sub, "archive", _cmd_archive, help="retire a scar or a candidate (never fires; history kept)")
3974
3988
  p.add_argument("id", help="scar id, or a candidate file/name to archive in place")
3975
3989
  p.add_argument("--reason", required=True, help="why it is retired (e.g. expiry condition met)")
3990
+ _add_reviewer(p)
3976
3991
 
3977
3992
  p = _add(sub, "orphan", _cmd_orphan, help="list scars whose anchors all went dead")
3978
3993
  p.add_argument("--apply", action="store_true",
3979
- help="persist status: orphaned (human review only — never CI)")
3994
+ help="persist status: orphaned (records who ran it; advisory, "
3995
+ "only a signed scar needs a presence touch)")
3996
+ _add_reviewer(p)
3980
3997
  p.add_argument("--id", type=int, default=None,
3981
3998
  help="with --apply: the detected scar id to persist")
3982
3999
  p.add_argument("--reason", default="anchors no longer resolve",
@@ -3994,7 +4011,8 @@ def build_parser() -> argparse.ArgumentParser:
3994
4011
  help="with --apply: the scar id whose eligible anchors to rewrite")
3995
4012
  p.add_argument("--apply", action="store_true",
3996
4013
  help="rewrite ONE scar's single-high-confidence dead anchors "
3997
- "(human review only — never CI; never flips status)")
4014
+ "(records who ran it; never flips status)")
4015
+ _add_reviewer(p)
3998
4016
  p.add_argument("--json", action="store_true",
3999
4017
  help="emit machine-readable JSON (list and --apply; a refusal is "
4000
4018
  "{\"error\": ...})")