scar-cli 0.27.3__tar.gz → 0.29.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 (196) hide show
  1. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/workflows/ci.yml +37 -3
  2. scar_cli-0.29.0/.release-please-manifest.json +3 -0
  3. scar_cli-0.29.0/.scars/0029-compliance-pools-by-repo-and-id.landmine.md +39 -0
  4. scar_cli-0.29.0/.scars/0030-presence-signer-input-canonical-subset.landmine.md +35 -0
  5. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/template.md +2 -1
  6. {scar_cli-0.27.3 → scar_cli-0.29.0}/CHANGELOG.md +25 -0
  7. {scar_cli-0.27.3 → scar_cli-0.29.0}/PKG-INFO +1 -1
  8. {scar_cli-0.27.3 → scar_cli-0.29.0}/SCAR-FORMAT.md +2 -1
  9. {scar_cli-0.27.3 → scar_cli-0.29.0}/SPEC.md +51 -2
  10. {scar_cli-0.27.3 → scar_cli-0.29.0}/plugin/plugin.json +1 -1
  11. {scar_cli-0.27.3/src/scar → scar_cli-0.29.0/plugin}/skills/scar-authoring/SKILL.md +7 -0
  12. {scar_cli-0.27.3 → scar_cli-0.29.0}/plugin/skills/scar-authoring/assets/template.md +2 -1
  13. {scar_cli-0.27.3 → scar_cli-0.29.0}/pyproject.toml +1 -1
  14. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/cli.py +346 -24
  15. scar_cli-0.29.0/src/scar/clock.py +30 -0
  16. scar_cli-0.29.0/src/scar/config.py +69 -0
  17. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/gc.py +1 -1
  18. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/harvest.py +3 -3
  19. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/hooks.py +5 -4
  20. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/lint.py +71 -4
  21. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/mcp.py +27 -4
  22. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/model.py +50 -15
  23. scar_cli-0.29.0/src/scar/presence.py +229 -0
  24. scar_cli-0.29.0/src/scar/record.py +60 -0
  25. scar_cli-0.29.0/src/scar/signedpromote.py +118 -0
  26. {scar_cli-0.27.3/plugin → scar_cli-0.29.0/src/scar}/skills/scar-authoring/SKILL.md +7 -0
  27. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/skills/scar-authoring/assets/template.md +2 -1
  28. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/store.py +195 -12
  29. scar_cli-0.29.0/src/scar/verify.py +87 -0
  30. scar_cli-0.29.0/tests/conformance_fetch.py +109 -0
  31. scar_cli-0.29.0/tests/conformance_support.py +191 -0
  32. scar_cli-0.29.0/tests/fixtures/conformance/promote.json +146 -0
  33. scar_cli-0.29.0/tests/fixtures/conformance/regenerate.py +71 -0
  34. scar_cli-0.29.0/tests/presence_fakes.py +75 -0
  35. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_cli.py +160 -17
  36. scar_cli-0.29.0/tests/test_clock.py +169 -0
  37. scar_cli-0.29.0/tests/test_compliance_stats.py +259 -0
  38. scar_cli-0.29.0/tests/test_conformance_round_trip.py +166 -0
  39. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_json_contract.py +5 -1
  40. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_lifecycle.py +29 -0
  41. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_lint.py +47 -0
  42. scar_cli-0.29.0/tests/test_lint_downgrade.py +181 -0
  43. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_mcp.py +50 -1
  44. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_model.py +98 -0
  45. scar_cli-0.29.0/tests/test_presence.py +27 -0
  46. scar_cli-0.29.0/tests/test_presence_adapters.py +59 -0
  47. scar_cli-0.29.0/tests/test_presence_signer.py +229 -0
  48. scar_cli-0.29.0/tests/test_promote_batch.py +283 -0
  49. scar_cli-0.29.0/tests/test_promote_signed.py +281 -0
  50. scar_cli-0.29.0/tests/test_record.py +164 -0
  51. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_store.py +231 -0
  52. scar_cli-0.29.0/tests/test_verify.py +264 -0
  53. {scar_cli-0.27.3 → scar_cli-0.29.0}/uv.lock +1 -1
  54. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docs/agents.md +44 -0
  55. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docs/concepts.md +3 -0
  56. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docs/methodology.md +14 -0
  57. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docs/quickstart.md +1 -0
  58. scar_cli-0.27.3/.release-please-manifest.json +0 -3
  59. {scar_cli-0.27.3 → scar_cli-0.29.0}/.claude-plugin/marketplace.json +0 -0
  60. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  61. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  62. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  63. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  64. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/workflows/docs.yml +0 -0
  65. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/workflows/pr-validation.yml +0 -0
  66. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/workflows/release.yml +0 -0
  67. {scar_cli-0.27.3 → scar_cli-0.29.0}/.github/workflows/scar-review-queue.yml +0 -0
  68. {scar_cli-0.27.3 → scar_cli-0.29.0}/.gitignore +0 -0
  69. {scar_cli-0.27.3 → scar_cli-0.29.0}/.pre-commit-config.yaml +0 -0
  70. {scar_cli-0.27.3 → scar_cli-0.29.0}/.pre-commit-hooks.yaml +0 -0
  71. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0001-git-grep-ere-pitfalls.landmine.md +0 -0
  72. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0002-agent-direct-hook-install.deadend.md +0 -0
  73. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0003-installer-binds-to-active-venv-scar.landmine.md +0 -0
  74. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0004-promote-roundtrip-drops-expires-evidence.landmine.md +0 -0
  75. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0005-history-rewrite-orphans-commit-evidence.landmine.md +0 -0
  76. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0006-yaml-pattern-anchor-over-escaping.landmine.md +0 -0
  77. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0007-release-please-config-change-skips-open-pr.landmine.md +0 -0
  78. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0008-rich-output-nontty-must-bypass-rich.landmine.md +0 -0
  79. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0009-anchor-survival-harness-measures-symbol-not-path-anchors.deadend.md +0 -0
  80. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0010-git-returncode-128-vs-empty-tracked-set.landmine.md +0 -0
  81. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0011-lint-compile-check-lets-redos-anchors-hang-hotpath.landmine.md +0 -0
  82. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0012-firing-log-readers-need-blanket-guards.landmine.md +0 -0
  83. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0013-docusaurus-future-v4-requires-faster-dep.landmine.md +0 -0
  84. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0014-inject-flag-dest-collides-with-subcommand-dispatch.landmine.md +0 -0
  85. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0015-zero-checkruns-means-approval-gate-not-workflow-bug.deadend.md +0 -0
  86. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0016-hook-ownership-must-be-kind-scoped.landmine.md +0 -0
  87. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0017-codex-pretool-context-can-replay-apply-patch.landmine.md +0 -0
  88. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0018-cli-subparsers-register-through-_add-wrapper.landmine.md +0 -0
  89. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0019-token-in-scar-body-cannot-prove-hook-delivery.deadend.md +0 -0
  90. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0020-one-directional-health-check-leaves-flattering-direction-unwatched.landmine.md +0 -0
  91. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0021-posttool-fix-in-hooks-does-not-reach-codex-or-cascade.landmine.md +0 -0
  92. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0022-codex-hook-delivery-needs-user-file-and-trust.landmine.md +0 -0
  93. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0023-cascade-block-exit-collides-with-argparse.fence.md +0 -0
  94. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0024-host-detection-must-not-read-the-process-home.deadend.md +0 -0
  95. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0025-one-plugin-hook-manifest-two-hosts-two-root-variables.landmine.md +0 -0
  96. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0026-path-anchor-breadth-drives-the-review-due-threshold.landmine.md +0 -0
  97. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0027-slug-and-display-cleaning-are-different-jobs.landmine.md +0 -0
  98. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/0028-violation-evidence-must-not-persist-raw-edits.fence.md +0 -0
  99. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/README.md +0 -0
  100. {scar_cli-0.27.3 → scar_cli-0.29.0}/.scars/candidates/.gitkeep +0 -0
  101. {scar_cli-0.27.3 → scar_cli-0.29.0}/AGENTS.md +0 -0
  102. {scar_cli-0.27.3 → scar_cli-0.29.0}/CONTRIBUTING.md +0 -0
  103. {scar_cli-0.27.3 → scar_cli-0.29.0}/IDEA.md +0 -0
  104. {scar_cli-0.27.3 → scar_cli-0.29.0}/LICENSE +0 -0
  105. {scar_cli-0.27.3 → scar_cli-0.29.0}/README.md +0 -0
  106. {scar_cli-0.27.3 → scar_cli-0.29.0}/ROADMAP.md +0 -0
  107. {scar_cli-0.27.3 → scar_cli-0.29.0}/STRESS-TEST.md +0 -0
  108. {scar_cli-0.27.3 → scar_cli-0.29.0}/action.yml +0 -0
  109. {scar_cli-0.27.3 → scar_cli-0.29.0}/codecov.yml +0 -0
  110. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/PROTOCOL.md +0 -0
  111. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/RESULTS.md +0 -0
  112. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/long_replay.py +0 -0
  113. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/replay.py +0 -0
  114. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/replay_shipped.py +0 -0
  115. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/anchor-survival/test_replay_shipped.py +0 -0
  116. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/auto-authorship/FINDINGS.md +0 -0
  117. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/auto-authorship/PROTOCOL.md +0 -0
  118. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/.gitignore +0 -0
  119. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/PROTOCOL.md +0 -0
  120. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/RESULTS.md +0 -0
  121. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/.scars/0001-vendor-retry-window.fence.md +0 -0
  122. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/.scars/0002-evicting-session-store.deadend.md +0 -0
  123. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/.scars/0003-export-column-order.landmine.md +0 -0
  124. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/README.md +0 -0
  125. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/payments/retry.py +0 -0
  126. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/reports/export.py +0 -0
  127. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/fixture/services/sessions.py +0 -0
  128. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/fence-honor/grade.py +0 -0
  129. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/harvest/PROTOCOL.md +0 -0
  130. {scar_cli-0.27.3 → scar_cli-0.29.0}/experiments/harvest/harvest.py +0 -0
  131. {scar_cli-0.27.3 → scar_cli-0.29.0}/hook/scar-hooks.py +0 -0
  132. {scar_cli-0.27.3 → scar_cli-0.29.0}/plugin/hooks/run.sh +0 -0
  133. {scar_cli-0.27.3 → scar_cli-0.29.0}/release-please-config.json +0 -0
  134. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/__init__.py +0 -0
  135. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/agent.py +0 -0
  136. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/cascade.py +0 -0
  137. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/codex.py +0 -0
  138. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/draftcheck.py +0 -0
  139. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/evidence.py +0 -0
  140. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/firing_log.py +0 -0
  141. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/hosts.py +0 -0
  142. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/installer.py +0 -0
  143. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/match.py +0 -0
  144. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/orphan.py +0 -0
  145. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/output.py +0 -0
  146. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/reanchor.py +0 -0
  147. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/renames.py +0 -0
  148. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/render.py +0 -0
  149. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/review.py +0 -0
  150. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/symbols.py +0 -0
  151. {scar_cli-0.27.3 → scar_cli-0.29.0}/src/scar/violation_evidence.py +0 -0
  152. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/conftest.py +0 -0
  153. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_action_yml.py +0 -0
  154. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_anchor_kind.py +0 -0
  155. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_block_capability.py +0 -0
  156. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_cascade.py +0 -0
  157. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_codex.py +0 -0
  158. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_context_size.py +0 -0
  159. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_docs.py +0 -0
  160. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_draftcheck.py +0 -0
  161. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_evidence.py +0 -0
  162. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_firing_log.py +0 -0
  163. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_gc.py +0 -0
  164. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_git_hook.py +0 -0
  165. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_harvest.py +0 -0
  166. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_hooks.py +0 -0
  167. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_hosts.py +0 -0
  168. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_installer.py +0 -0
  169. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_match.py +0 -0
  170. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_matched_by.py +0 -0
  171. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_orphan.py +0 -0
  172. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_output.py +0 -0
  173. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_plugin.py +0 -0
  174. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_precommit_hooks.py +0 -0
  175. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_reanchor.py +0 -0
  176. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_renames.py +0 -0
  177. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_render.py +0 -0
  178. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_review.py +0 -0
  179. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_review_queue.py +0 -0
  180. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_skill.py +0 -0
  181. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_sweep.py +0 -0
  182. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_symbols.py +0 -0
  183. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_verdict_observability.py +0 -0
  184. {scar_cli-0.27.3 → scar_cli-0.29.0}/tests/test_violation_evidence.py +0 -0
  185. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/.gitignore +0 -0
  186. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docs/index.md +0 -0
  187. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/docusaurus.config.ts +0 -0
  188. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/package-lock.json +0 -0
  189. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/package.json +0 -0
  190. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/scripts/sync-changelog.mjs +0 -0
  191. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/sidebars.ts +0 -0
  192. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/src/css/custom.css +0 -0
  193. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/static/img/favicon.svg +0 -0
  194. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/static/img/social-card.png +0 -0
  195. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/static/llms.txt +0 -0
  196. {scar_cli-0.27.3 → scar_cli-0.29.0}/website/tsconfig.json +0 -0
@@ -106,6 +106,39 @@ jobs:
106
106
  - name: ruff check
107
107
  run: uv run ruff check src/scar tests
108
108
 
109
+ # The signed promotion against the real external checker (#397). Every other
110
+ # presence test runs against a fake program. The tools come from one pinned
111
+ # release and one pinned commit (hashes in tests/conformance_support.py), are
112
+ # checked by tests/conformance_fetch.py before use, and are never built here.
113
+ # CONFORMANCE_REQUIRED=1 (set by that script) turns "tools missing" into a
114
+ # test failure, so this job cannot go green by skipping. Upgrading the pinned
115
+ # tag is a deliberate change of the pins, never automatic. No secrets.
116
+ conformance:
117
+ name: conformance round trip
118
+ runs-on: ubuntu-latest
119
+ steps:
120
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
121
+
122
+ # The checker needs Python 3.11 or newer; this job is independent of the
123
+ # 3.10 floor the matrix measures.
124
+ - name: Install uv
125
+ uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
126
+ with:
127
+ python-version: "3.13"
128
+ enable-cache: true
129
+ cache-dependency-glob: uv.lock
130
+
131
+ - name: Sync dependencies
132
+ run: uv sync --locked
133
+
134
+ - name: Fetch and verify the pinned tools
135
+ run: uv run python tests/conformance_fetch.py "$RUNNER_TEMP/conformance-tools"
136
+
137
+ - name: Run the round trip
138
+ run: |
139
+ mkdir -p "$RUNNER_TEMP/fake-home"
140
+ HOME="$RUNNER_TEMP/fake-home" uv run pytest tests/test_conformance_round_trip.py -q -rs
141
+
109
142
  # Aggregator. Branch protection requires the context "Tests + scar lint", so
110
143
  # that name must survive: renaming it would leave every PR waiting on a check
111
144
  # that no longer exists, and giving both matrix legs the same name would let a
@@ -114,7 +147,7 @@ jobs:
114
147
  # required check can be treated as satisfied.
115
148
  test:
116
149
  name: Tests + scar lint
117
- needs: [matrix-tests, lint]
150
+ needs: [matrix-tests, lint, conformance]
118
151
  if: always()
119
152
  runs-on: ubuntu-latest
120
153
  steps:
@@ -122,5 +155,6 @@ jobs:
122
155
  run: |
123
156
  tests="${{ needs.matrix-tests.result }}"
124
157
  lint="${{ needs.lint.result }}"
125
- echo "matrix-tests: $tests / lint: $lint"
126
- [ "$tests" = "success" ] && [ "$lint" = "success" ] || exit 1
158
+ conformance="${{ needs.conformance.result }}"
159
+ echo "matrix-tests: $tests / lint: $lint / conformance: $conformance"
160
+ [ "$tests" = "success" ] && [ "$lint" = "success" ] && [ "$conformance" = "success" ] || exit 1
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.29.0"
3
+ }
@@ -0,0 +1,39 @@
1
+ ---
2
+ id: 29
3
+ type: landmine
4
+ title: Pooled stats must key a scar by (repo, id); a bare id fuses different scars and a pooled rate must be recomputed, never averaged
5
+ severity: high
6
+ confidence: 0.8
7
+ created: 2026-11-07
8
+ authors: ["claude-code"]
9
+ promoted_by: Kibukx
10
+ promoted_by_source: git-config-interactive
11
+ anchors:
12
+ - path: src/scar/cli.py
13
+ - pattern: "def _compliance_block"
14
+ evidence:
15
+ - issue: 373
16
+ - issue: 137
17
+ expires:
18
+ condition: "compliance pooling stops spanning more than one repository"
19
+ review_after: 2027-05-07
20
+ status: active
21
+ ---
22
+
23
+ Scar ids are per-repo sequential integers, so #1 in one repo is a different
24
+ scar from #1 in another. `--repo` pools several repos into one compliance block,
25
+ and the dominant-scar cut picks the single largest scar. Keyed by bare id, two
26
+ unrelated scars merge into one and the "top scar" share is invented. It is the
27
+ same defect as the original --all-repos double count (#137), reached through a
28
+ new door.
29
+
30
+ Two rules hold the block together. Identify a scar by (repo, id) everywhere in
31
+ `_compliance_block`. And pool by summing F, V and the verdict counts, then
32
+ computing the rate once; averaging per-repo rates weights a one-firing repo the
33
+ same as a thousand-firing one. Scope filters (window, repo set) run on records
34
+ before any metric, exactly like `_filter_window`, so a set of two repos equals a
35
+ log that contains only those two.
36
+
37
+ V is "fired then violated": a violation counts only if that scar has an armed
38
+ firing on the same target at or before it. The rest are retrieval misses and
39
+ are reported as `violations_unmatched`, not folded into V (#373).
@@ -0,0 +1,35 @@
1
+ ---
2
+ id: 30
3
+ type: landmine
4
+ title: The presence signer reads a canonical subset of JSON, so a draft with a number, a boolean or default json.dumps whitespace is refused
5
+ severity: medium
6
+ confidence: 0.8
7
+ created: 2026-11-18
8
+ authors: ["claude-code"]
9
+ promoted_by: Kibukx
10
+ promoted_by_source: git-config-interactive
11
+ promoted_from: candidates/presence-signer-input-canonical-subset.md
12
+ anchors:
13
+ - path: src/scar/presence.py
14
+ - pattern: "expires_in_s"
15
+ evidence:
16
+ - issue: 392
17
+ - note: Profile ACT-04 and SG-04 (signer v0.4.0): no numbers, no true/false, no whitespace outside strings; expires_in_s is a decimal string.
18
+ expires:
19
+ condition: "the signer accepts general JSON on stdin"
20
+ review_after: 2027-05-18
21
+ status: active
22
+ ---
23
+
24
+ The signer and the checker are fed through one canonical-subset recognizer.
25
+ A JSON number, a `true` or `false`, or the spaces `json.dumps` adds after
26
+ separators makes the input `schema_refused` before any prompt. That is why
27
+ `presence.EXPIRES_IN_S` is the string `"3600"` and not an int, and why
28
+ `presence._canonical` writes compact sorted ASCII.
29
+
30
+ Changing the window to a number, or building a request with plain
31
+ `json.dumps`, still looks fine in a unit test against a fake that parses
32
+ loosely. It fails only against the real signer, after the person has been
33
+ asked nothing, as `schema_refused`. Keep every value a string, an object or
34
+ an array, and keep the fake in tests/presence_fakes.py as strict as the
35
+ profile when you add a field.
@@ -10,7 +10,8 @@ title: One line, searchable, says the constraint
10
10
  severity: medium # low | medium | high | critical
11
11
  confidence: 0.7 # 0..1 — how sure are we this still holds
12
12
  created: 1970-01-01
13
- authors: ["claude-code"] # who DRAFTED it; the promoting human goes in promoted_by, written by promote
13
+ # authors = the RUNTIME that DRAFTED it (claude-code, codex, cursor...). Replace the placeholder; never the human reviewer (promoted_by, written by promote).
14
+ authors: ["<your-runtime>"]
14
15
  anchors:
15
16
  - path: src/module/ # file or directory this protects
16
17
  - pattern: "regex" # optional: fires when matching code appears in ANY new/edited file
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.29.0](https://github.com/Daily-Nerd/Scar/compare/v0.28.0...v0.29.0) (2026-11-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * **lint:** --verify-promotion checks each active scar's promotion act ([#387](https://github.com/Daily-Nerd/Scar/issues/387)) ([ce1f3ba](https://github.com/Daily-Nerd/Scar/commit/ce1f3ba46c5f9ad15428590395b23f4a40457555))
9
+ * **promote:** record the source candidate as promoted_from ([#390](https://github.com/Daily-Nerd/Scar/issues/390)) ([c1e337e](https://github.com/Daily-Nerd/Scar/commit/c1e337eefc01a0e9be8ed92a36b6c67b13bf70e5))
10
+ * **promote:** sign each promotion with the presence signer when the config names an org ([#393](https://github.com/Daily-Nerd/Scar/issues/393)) ([92ebd72](https://github.com/Daily-Nerd/Scar/commit/92ebd72c7368eeff838e3b86cf6fbf7d623ecc20))
11
+ * **record:** one function builds the bytes of a promoted scar ([#384](https://github.com/Daily-Nerd/Scar/issues/384)) ([e73caf0](https://github.com/Daily-Nerd/Scar/commit/e73caf0636e83e026b121c329da5274b788ea2d4)), closes [#382](https://github.com/Daily-Nerd/Scar/issues/382)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **authors:** record the drafting runtime, refuse placeholders and role words ([#391](https://github.com/Daily-Nerd/Scar/issues/391)) ([55dae17](https://github.com/Daily-Nerd/Scar/commit/55dae17ee987cc28f364d48fbb9a0b29354a9cbf))
17
+ * **model:** every frontmatter scalar drops its YAML quotes ([#385](https://github.com/Daily-Nerd/Scar/issues/385)) ([5fc62fc](https://github.com/Daily-Nerd/Scar/commit/5fc62fc7fcc65baef5c0e251e896574d744ebfa5))
18
+ * **promote:** accept the candidate path however it is typed ([#396](https://github.com/Daily-Nerd/Scar/issues/396)) ([474bcf3](https://github.com/Daily-Nerd/Scar/commit/474bcf3c15a81c37a548b90eeefc065894fd4a82)), closes [#394](https://github.com/Daily-Nerd/Scar/issues/394)
19
+ * **store:** one lifecycle table gates promote and transition ([#378](https://github.com/Daily-Nerd/Scar/issues/378)) ([8773a6b](https://github.com/Daily-Nerd/Scar/commit/8773a6b85706815281f2bd5f7a3e19507c2dc304)), closes [#377](https://github.com/Daily-Nerd/Scar/issues/377)
20
+
21
+ ## [0.28.0](https://github.com/Daily-Nerd/Scar/compare/v0.27.3...v0.28.0) (2026-11-07)
22
+
23
+
24
+ ### Features
25
+
26
+ * **stats:** compute the compliance result natively ([#374](https://github.com/Daily-Nerd/Scar/issues/374)) ([131a640](https://github.com/Daily-Nerd/Scar/commit/131a6400da7770d2a319155e2f0364c60260e3d1))
27
+
3
28
  ## [0.27.3](https://github.com/Daily-Nerd/Scar/compare/v0.27.2...v0.27.3) (2026-11-07)
4
29
 
5
30
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scar-cli
3
- Version: 0.27.3
3
+ Version: 0.29.0
4
4
  Summary: SCAR — version control for negative knowledge (deadends, fences, landmines)
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -45,9 +45,10 @@ is deliberate: consumers in hook hot-paths parse with zero dependencies.
45
45
  | `severity` | yes | `low` \| `medium` \| `high` \| `critical` | ranking input |
46
46
  | `confidence` | yes | float 0..1 | static authored ranking weight; dynamic decay deferred (SPEC §5, issue #95) |
47
47
  | `created` | yes | ISO date | |
48
- | `authors` | yes | inline list | who drafted it: agents as `"claude-code"` etc. The reviewer is no longer appended here |
48
+ | `authors` | yes | inline list | the runtime that drafted it, e.g. `"claude-code"`, `"codex"`, `"cursor"`. Never the human reviewer (that is `promoted_by`) and never a role word such as `agent` or `maintainer`. The template carries the placeholder `"<your-runtime>"`; `scar lint` refuses a candidate that still holds it or a role word. `scar_draft` fills it from the connected MCP client |
49
49
  | `promoted_by` | active scars | string | the human who promoted it. Written only by `scar promote`, which overwrites anything a candidate carried. Empty on scars promoted before the field existed, and never inferred from `authors` |
50
50
  | `promoted_by_source` | optional | `explicit` \| `git-config-interactive` \| `git-config` | how strongly `promoted_by` is evidenced. `explicit` = a name was typed with `--reviewer`. `git-config-interactive` = no name typed, but `promote` ran at a terminal, so a person was there. `git-config` = no name typed and no terminal recorded, which is the unattended shape `lint` warns on. Written only alongside `promoted_by`, never on its own. Absent on scars promoted before the field existed, and plain `git-config` on scars promoted before interactivity was recorded, so neither absence proves an agent did it |
51
+ | `promoted_from` | active scars | path relative to `.scars/` | the candidate file this scar was promoted from, e.g. `candidates/tried-x.md`. Written only by `scar promote`, which overwrites anything a candidate carried, so a reader links scar to candidate without re-deriving the active filename. Part of the promotion record when present. Absent on scars promoted before the field existed, which are not rewritten |
51
52
  | `anchors` | yes, ≥1 | list of `- path:`, `- pattern:`, `- symbol:`, and/or `- command:` | §4 |
52
53
  | `evidence` | recommended | list of `- commit:`/`- pr:`/`- issue:`/`- incident:`/`- note:`/`- url:` | absent ⇒ challengeable on sight; `issue:`/`url:` are durable forms that survive squash-merge |
53
54
  | `expires.condition` | recommended | quoted string | what change obsoletes this scar |
@@ -231,7 +231,7 @@ Top-level keys, and the keys of each object inside the listed arrays.
231
231
  | `check` | `paths` array of str, `scars` array | `scars[]`: `id`, `type`, `severity`, `confidence`, `status`, `title`, `body` |
232
232
  | `sweep` | `files` int (tracked files swept), `skipped` int (tracked files with no readable content: oversized or binary), `scars` int (scars armed on at least one swept file), `hits` array | `hits[]`: `id` int, `type`, `severity`, `title`, `source` (scar file, repo-relative), `path`, `line` int (1-based), `excerpt` |
233
233
  | `why` | `path` str, `records` array | `records[]`: `id`, `type`, `status`, `title`, `file`, `body` |
234
- | `stats` | `repo` str, `total_firings` int, `per_scar` array, `most_fired` int, `last_fired` str, `never_fired` array of int, `demotions` int, `demotions_path_only` int, `demotions_cooldown` int, `demotions_reason_unknown` int, `census_known` int, `census_unknown` int, `cofires_per_edit` float **or null**, `edits_multi_fire` int, `path_only_ratio` float **or null**, `edits_observed` int, `injection_rate` float **or null**, `retrieval_misses` int **or null**, `instrument_disconnected` bool, `posttool_silent` bool, `last_fired_age_days` int, `armed_firings` int, `armed_unknown` int, `verdicts_expected` int, `verdicts_observed` int, `verdicts_unresolved` int, `verdicts_unplaceable` int, `firings_block_capable` int, `firings_advisory` int, `firings_block_unknown` int, `all_firings_advisory` bool, `firings_context_known` int, `firings_context_unknown` int, `command_firings` int, `firings_kind_unknown` int, `advisories` array. `window` object **only when `--since`/`--until` is given** | `per_scar[]`: `id`, `count`, `violations`. `window`: `since`, `until`, `excluded_undated` |
234
+ | `stats` | `repo` str, `total_firings` int, `per_scar` array, `most_fired` int, `last_fired` str, `never_fired` array of int, `demotions` int, `demotions_path_only` int, `demotions_cooldown` int, `demotions_reason_unknown` int, `census_known` int, `census_unknown` int, `cofires_per_edit` float **or null**, `edits_multi_fire` int, `path_only_ratio` float **or null**, `edits_observed` int, `injection_rate` float **or null**, `retrieval_misses` int **or null**, `instrument_disconnected` bool, `posttool_silent` bool, `last_fired_age_days` int, `armed_firings` int, `armed_unknown` int, `verdicts_expected` int, `verdicts_observed` int, `verdicts_unresolved` int, `verdicts_unplaceable` int, `firings_block_capable` int, `firings_advisory` int, `firings_block_unknown` int, `all_firings_advisory` bool, `firings_context_known` int, `firings_context_unknown` int, `command_firings` int, `firings_kind_unknown` int, `advisories` array, `compliance` object (§9.12). `window` object **only when `--since`/`--until` is given** | `per_scar[]`: `id`, `count`, `violations`. `window`: `since`, `until`, `excluded_undated`. `compliance`: `F`, `V`, `rate`, `violations_unmatched`, `verdicts_expected`, `verdicts_observed`, `verdicts_resolved`, `verdict_completeness`, `top_scar` (`repo`, `id`, `share`, `F`, `V`, `rate`) |
235
235
  | `gc` | `removed_markers` int, `dropped_firings` int, `dry_run` bool, `candidates` array, `fp_log` object | `candidates[]`: `name`, `age_days`. `fp_log`: `present`, `size`, `lines`, `path` (the state-dir log, #341), `legacy` (`null`, or `path` + `lines` of a leftover `.scars/candidates/fp-log.txt`) |
236
236
  | `orphan` | `orphan_detected`, `partial_rot` arrays | — |
237
237
  | `reanchor` | `proposals`, `pattern_diagnostics` arrays | — |
@@ -365,7 +365,8 @@ result are how a result gets laundered into a finding.
365
365
 
366
366
  `stats --since` / `--until` filter records **before** any metric is computed,
367
367
  so every number is window-scoped by the same code that computes it unwindowed.
368
- Timestamps in the firing log are **naive local time** (`time.strftime`), and the
368
+ Timestamps in the firing log are **naive local time** (read through `scar.clock`,
369
+ the one owner of the wall clock), and the
369
370
  bounds are interpreted in that same frame — a window is therefore local-time,
370
371
  never UTC. A bare date means `00:00:00` as `--since` and the END of that day as
371
372
  `--until`, so `--since D --until D` is the whole of day D. Records whose `ts` is
@@ -554,3 +555,51 @@ map for each target. Files under `.scars/` remain eligible for matching other
554
555
  scars; there is no blanket directory exclusion. Logging remains best-effort:
555
556
  failure to append cannot block an edit, and a failed write does not claim that
556
557
  evidence was recorded.
558
+
559
+ ### 9.12 The compliance result is computed by `stats`
560
+
561
+ `stats.compliance` is the published enforcement result, computed by the same
562
+ code that computes every other `stats` field, over the same filtered records.
563
+ The keys are additive; no existing key changed.
564
+
565
+ | Key | Meaning |
566
+ |---|---|
567
+ | `F` | Armed firings: the sum of `armed_ids` over the filtered rows (same count as `armed_firings`) |
568
+ | `V` | Violations that followed an armed firing (definition below) |
569
+ | `rate` | `V / F`, rounded to 3 places; **`null` when `F` is 0, never 0** |
570
+ | `violations_unmatched` | Violations excluded from `V` because no earlier armed firing of that scar on that target is in the filtered records. Retrieval misses, reported apart, never dropped |
571
+ | `verdicts_expected` | Same as `stats.verdicts_expected` |
572
+ | `verdicts_observed` | Same as `stats.verdicts_observed` |
573
+ | `verdicts_resolved` | Expected verdicts that were observed (joined on `edit_id`) |
574
+ | `verdict_completeness` | `verdicts_resolved / verdicts_expected`; `null` when nothing was expected. Resolved, not observed, so a verdict that joins to nothing cannot push it past 1 |
575
+ | `top_scar` | The scar with the largest `F`: `repo`, `id`, `share` (its share of `F`), and `F`, `V`, `rate` **with that scar excluded**. All six fields are `null` when `F` is 0, and `rate` is `null` when the excluded `F` is 0 |
576
+
577
+ **Definition of V.** A violation row counts toward `V` when the violated scar
578
+ has an armed firing (`armed_ids` on the firing row itself, never today's
579
+ `.scars/`) on the same `target` at or before the violation's `ts`. This is
580
+ "fired, then violated". A violation with no such firing is a retrieval miss
581
+ (`retrieval_misses`), and counting it in `V` would let a retrieval failure
582
+ inflate an enforcement rate. Rows that predate `armed_ids` place no armed
583
+ firing, so a window made only of such rows has `F` 0 and a `null` rate.
584
+
585
+ **Top scar ties** go to the lowest `id`, then the lexicographically lowest
586
+ `repo`. A scar is identified by `(repo, id)`, because ids are per-repo.
587
+
588
+ **No threshold is a parameter.** `stats` always reports the top scar's share and
589
+ the excluded figures. What counts as dominant, and what completeness is enough,
590
+ belongs to a pre-registration written before the data is read.
591
+
592
+ **Scope.** `--repo PATH` (repeatable) restricts the records to a set of
593
+ repositories before any metric runs, exactly like `--since`/`--until`. Paths
594
+ resolve the way the hook stamps a record (the enclosing `.scars/` root, else the
595
+ resolved path). A path with no records is not an error: the block reports zeros
596
+ and nulls. `--repo` and `--all-repos` are mutually exclusive. The output is one
597
+ block with `repo_set: true`, `repos` (the selected repo keys), `total_firings`,
598
+ `last_fired`, `compliance` and `window` when given; the per-repo stage fields
599
+ are not pooled because their ids are not comparable. `F`, `V` and the verdict
600
+ counts are summed and the rate is computed once from the sums; per-repo rates
601
+ are never averaged. `--all-repos` carries one `compliance` block per repo group.
602
+
603
+ **`injection_rate` is coverage, not a retrieval rate.** It is the share of
604
+ observed edits where any scar fired. It does not say whether the right scar was
605
+ shown, and it must not be given a retrieval threshold.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scar",
3
- "version": "0.27.3",
3
+ "version": "0.29.0",
4
4
  "description": "SCAR — version control for negative knowledge (deadends, fences, landmines)",
5
5
  "hooks": {
6
6
  "PreToolUse": [
@@ -75,6 +75,13 @@ A file without `---`-fenced YAML frontmatter is **not a scar at all** — it nev
75
75
  fires. Minimum valid block: `type`, `title`, `severity`, `confidence`,
76
76
  `created`, `authors`, at least one `anchors` entry, and `status: candidate`.
77
77
 
78
+ `authors` is the runtime that drafted the scar (`claude-code`, `codex`,
79
+ `cursor`, `windsurf`, `opencode`), replacing the template's `<your-runtime>`
80
+ placeholder. It must never hold the human reviewer: the reviewer is recorded
81
+ in `promoted_by` by `scar promote`. Role words such as `agent` or
82
+ `maintainer` name no runtime. `scar lint` rejects a candidate that keeps the
83
+ placeholder or uses a role word.
84
+
78
85
  Write `anchors` as a block list, one `- kind: value` line per anchor. A flow-style
79
86
  list (`anchors: [...]`) is not read, so the scar loads with no anchors.
80
87
 
@@ -10,7 +10,8 @@ title: One line, searchable, says the constraint
10
10
  severity: medium # low | medium | high | critical
11
11
  confidence: 0.7 # 0..1 — how sure are we this still holds
12
12
  created: 1970-01-01
13
- authors: ["claude-code"] # who DRAFTED it; the promoting human goes in promoted_by, written by promote
13
+ # authors = the RUNTIME that DRAFTED it (claude-code, codex, cursor...). Replace the placeholder; never the human reviewer (promoted_by, written by promote).
14
+ authors: ["<your-runtime>"]
14
15
  anchors:
15
16
  - path: src/module/ # file or directory this protects
16
17
  - pattern: "regex" # optional: fires when matching code appears in ANY new/edited file
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scar-cli"
3
- version = "0.27.3"
3
+ version = "0.29.0"
4
4
  description = "SCAR — version control for negative knowledge (deadends, fences, landmines)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"