ghostrules 0.4.1__tar.gz → 0.5.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 (355) hide show
  1. ghostrules-0.5.0/.ghostrules.lock +31 -0
  2. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/ISSUE_TEMPLATE/false-positive.yml +8 -0
  3. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/ISSUE_TEMPLATE/new-rule.yml +2 -0
  4. ghostrules-0.5.0/.github/dependabot.yml +22 -0
  5. ghostrules-0.5.0/.github/pull_request_template.md +16 -0
  6. ghostrules-0.5.0/.github/workflows/ci.yml +110 -0
  7. ghostrules-0.5.0/.github/workflows/links.yml +23 -0
  8. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/workflows/release.yml +29 -3
  9. ghostrules-0.5.0/.github/workflows/scorecard.yml +32 -0
  10. {ghostrules-0.4.1 → ghostrules-0.5.0}/CHANGELOG.md +100 -0
  11. {ghostrules-0.4.1 → ghostrules-0.5.0}/CLAUDE.md +1 -0
  12. ghostrules-0.5.0/CODE_OF_CONDUCT.md +108 -0
  13. {ghostrules-0.4.1 → ghostrules-0.5.0}/CONTRIBUTING.md +16 -0
  14. ghostrules-0.5.0/GOVERNANCE.md +68 -0
  15. {ghostrules-0.4.1 → ghostrules-0.5.0}/PKG-INFO +23 -46
  16. {ghostrules-0.4.1 → ghostrules-0.5.0}/README.md +21 -45
  17. {ghostrules-0.4.1 → ghostrules-0.5.0}/SECURITY.md +22 -0
  18. {ghostrules-0.4.1 → ghostrules-0.5.0}/action.yml +3 -2
  19. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/README.md +58 -4
  20. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/RESULTS.md +27 -28
  21. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/attacks/prose.toml +110 -10
  22. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/heldout-labels.toml +24 -1
  23. ghostrules-0.5.0/bench/labels-review.csv +60 -0
  24. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/lib.py +24 -0
  25. ghostrules-0.5.0/bench/perf.py +221 -0
  26. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/run.py +174 -25
  27. ghostrules-0.5.0/docs/AI_PROVENANCE.md +28 -0
  28. ghostrules-0.5.0/docs/CLAIMS.md +114 -0
  29. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/DECISIONS.md +144 -0
  30. ghostrules-0.5.0/docs/GITHUB_SETTINGS.md +23 -0
  31. ghostrules-0.5.0/docs/PERFORMANCE.md +29 -0
  32. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/RULES.md +27 -2
  33. ghostrules-0.5.0/docs/THREAT_MODEL.md +94 -0
  34. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/USAGE.md +56 -13
  35. ghostrules-0.5.0/docs/VERSIONING.md +65 -0
  36. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/SPEC.md +1 -1
  37. ghostrules-0.5.0/docs/improvement/BASELINE.md +31 -0
  38. ghostrules-0.5.0/docs/improvement/CLOSEOUT.md +90 -0
  39. ghostrules-0.5.0/docs/improvement/PHASES.md +300 -0
  40. ghostrules-0.5.0/docs/improvement/PLAN.md +84 -0
  41. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/.cursorrules +1 -0
  42. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/README.md +1 -1
  43. ghostrules-0.5.0/lychee.toml +17 -0
  44. {ghostrules-0.4.1 → ghostrules-0.5.0}/pyproject.toml +13 -2
  45. ghostrules-0.5.0/release-notes.md +87 -0
  46. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/make_demo.py +2 -1
  47. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/__init__.py +1 -1
  48. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/base.py +102 -59
  49. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/codex.py +2 -1
  50. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/repo.py +4 -0
  51. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/baseline.py +59 -7
  52. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/cli.py +197 -85
  53. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/config.py +91 -26
  54. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/context.py +2 -1
  55. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/models.py +21 -0
  56. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/common.py +13 -2
  57. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/context.py +2 -0
  58. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/json_.py +9 -2
  59. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/directive.py +3 -0
  60. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/helpers.py +10 -2
  61. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/injection.py +59 -3
  62. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/patterns.py +35 -5
  63. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/scanner_config.py +1 -1
  64. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/scanner.py +161 -84
  65. ghostrules-0.5.0/src/ghostrules/schemas/scan.schema.json +48 -0
  66. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/unicode_utils.py +53 -0
  67. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/visibility.py +45 -9
  68. ghostrules-0.5.0/tests/fixtures/golden/context-clean-repo-json.txt +137 -0
  69. ghostrules-0.5.0/tests/fixtures/golden/context-clean-repo-markdown.txt +26 -0
  70. ghostrules-0.5.0/tests/fixtures/golden/context-clean-repo-text.txt +44 -0
  71. ghostrules-0.5.0/tests/fixtures/golden/context-clean-repo-tree.txt +19 -0
  72. ghostrules-0.5.0/tests/fixtures/golden/context-import-chain-repo-json.txt +601 -0
  73. ghostrules-0.5.0/tests/fixtures/golden/context-import-chain-repo-markdown.txt +48 -0
  74. ghostrules-0.5.0/tests/fixtures/golden/context-import-chain-repo-text.txt +86 -0
  75. ghostrules-0.5.0/tests/fixtures/golden/context-import-chain-repo-tree.txt +47 -0
  76. ghostrules-0.5.0/tests/fixtures/golden/context-poisoned-repo-json.txt +404 -0
  77. ghostrules-0.5.0/tests/fixtures/golden/context-poisoned-repo-markdown.txt +51 -0
  78. ghostrules-0.5.0/tests/fixtures/golden/context-poisoned-repo-text.txt +92 -0
  79. ghostrules-0.5.0/tests/fixtures/golden/context-poisoned-repo-tree.txt +68 -0
  80. ghostrules-0.5.0/tests/fixtures/golden/lock-clean-repo.txt +144 -0
  81. ghostrules-0.5.0/tests/fixtures/golden/lock-import-chain-repo.txt +282 -0
  82. ghostrules-0.5.0/tests/fixtures/golden/lock-poisoned-repo.txt +162 -0
  83. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-fail-on-low.txt +5 -0
  84. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-json.txt +18 -0
  85. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-lenient.txt +18 -0
  86. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-markdown.txt +4 -0
  87. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-sarif.txt +746 -0
  88. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-small-limit.txt +7 -0
  89. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-strict.txt +18 -0
  90. ghostrules-0.5.0/tests/fixtures/golden/scan-clean-repo-table.txt +5 -0
  91. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-fail-on-low.txt +46 -0
  92. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-json.txt +152 -0
  93. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-lenient.txt +152 -0
  94. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-markdown.txt +13 -0
  95. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-sarif.txt +1101 -0
  96. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-small-limit.txt +20 -0
  97. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-strict.txt +152 -0
  98. ghostrules-0.5.0/tests/fixtures/golden/scan-import-chain-repo-table.txt +46 -0
  99. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-fail-on-low.txt +176 -0
  100. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-json.txt +401 -0
  101. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-lenient.txt +401 -0
  102. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-markdown.txt +36 -0
  103. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-sarif.txt +1655 -0
  104. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-small-limit.txt +40 -0
  105. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-strict.txt +401 -0
  106. ghostrules-0.5.0/tests/fixtures/golden/scan-poisoned-repo-table.txt +176 -0
  107. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_bench.py +5 -2
  108. ghostrules-0.5.0/tests/test_bench_honesty.py +133 -0
  109. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_ci_files.py +69 -1
  110. ghostrules-0.5.0/tests/test_config_errors.py +63 -0
  111. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_directive.py +2 -2
  112. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_docs.py +2 -0
  113. ghostrules-0.5.0/tests/test_evasion_regressions.py +193 -0
  114. ghostrules-0.5.0/tests/test_exit_codes.py +78 -0
  115. ghostrules-0.5.0/tests/test_golden_outputs.py +86 -0
  116. ghostrules-0.5.0/tests/test_governance_docs.py +48 -0
  117. ghostrules-0.5.0/tests/test_no_network.py +27 -0
  118. ghostrules-0.5.0/tests/test_output_contract.py +109 -0
  119. ghostrules-0.5.0/tests/test_perf_bench.py +56 -0
  120. ghostrules-0.5.0/tests/test_phase3_detection.py +164 -0
  121. ghostrules-0.5.0/tests/test_platform_files.py +140 -0
  122. ghostrules-0.5.0/tests/test_robustness_limits.py +144 -0
  123. ghostrules-0.5.0/tests/test_robustness_perf.py +36 -0
  124. ghostrules-0.5.0/tests/test_robustness_properties.py +189 -0
  125. ghostrules-0.5.0/tests/test_usage_matches_help.py +78 -0
  126. ghostrules-0.4.1/.ghostrules.lock +0 -31
  127. ghostrules-0.4.1/.github/dependabot.yml +0 -10
  128. ghostrules-0.4.1/.github/workflows/ci.yml +0 -41
  129. ghostrules-0.4.1/release-notes.md +0 -27
  130. {ghostrules-0.4.1 → ghostrules-0.5.0}/.ghostrules.toml +0 -0
  131. {ghostrules-0.4.1 → ghostrules-0.5.0}/.gitattributes +0 -0
  132. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  133. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/workflows/corpus.yml +0 -0
  134. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/workflows/pages.yml +0 -0
  135. {ghostrules-0.4.1 → ghostrules-0.5.0}/.github/workflows/self-test.yml +0 -0
  136. {ghostrules-0.4.1 → ghostrules-0.5.0}/.gitignore +0 -0
  137. {ghostrules-0.4.1 → ghostrules-0.5.0}/.pre-commit-hooks.yaml +0 -0
  138. {ghostrules-0.4.1 → ghostrules-0.5.0}/LICENSE +0 -0
  139. {ghostrules-0.4.1 → ghostrules-0.5.0}/action-requirements.in +0 -0
  140. {ghostrules-0.4.1 → ghostrules-0.5.0}/action-requirements.txt +0 -0
  141. {ghostrules-0.4.1 → ghostrules-0.5.0}/assets/banner-dark.png +0 -0
  142. {ghostrules-0.4.1 → ghostrules-0.5.0}/assets/banner-light.png +0 -0
  143. {ghostrules-0.4.1 → ghostrules-0.5.0}/assets/logo.svg +0 -0
  144. {ghostrules-0.4.1 → ghostrules-0.5.0}/assets/social-preview.png +0 -0
  145. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/.cache-run.log +0 -0
  146. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/attacks/context-and-config.toml +0 -0
  147. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/attacks/sources.toml +0 -0
  148. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/attacks/unicode.toml +0 -0
  149. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/attacks/w5.toml +0 -0
  150. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/heldout-results.json +0 -0
  151. {ghostrules-0.4.1 → ghostrules-0.5.0}/bench/heldout.toml +0 -0
  152. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/README.md +0 -0
  153. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/demo.gif +0 -0
  154. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/demo.tape +0 -0
  155. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/imports.gif +0 -0
  156. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/imports.tape +0 -0
  157. {ghostrules-0.4.1 → ghostrules-0.5.0}/demo/lock.tape +0 -0
  158. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/AGENT_MODELS.md +0 -0
  159. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/PLAN.md +0 -0
  160. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.1.1/GR012-FIX.md +0 -0
  161. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.2/PLAN.md +0 -0
  162. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.2/RULES.md +0 -0
  163. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.2/SPEC.md +0 -0
  164. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.3/CORPUS.md +0 -0
  165. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.3/PLAN.md +0 -0
  166. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.3/PLAYGROUND.md +0 -0
  167. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.3/STUDY.md +0 -0
  168. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/design/v0.4/REMEDIATION.md +0 -0
  169. {ghostrules-0.4.1 → ghostrules-0.5.0}/docs/v0.2.1/FIXES.md +0 -0
  170. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/clean-repo/.claude/settings.json +0 -0
  171. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/clean-repo/.mcp.json +0 -0
  172. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/clean-repo/AGENTS.md +0 -0
  173. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/clean-repo/CLAUDE.md +0 -0
  174. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/clean-repo/README.md +0 -0
  175. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/.claude/rules/api.md +0 -0
  176. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/.env +0 -0
  177. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/AGENTS.md +0 -0
  178. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/CLAUDE.md +0 -0
  179. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/README.md +0 -0
  180. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/docs/setup.md +0 -0
  181. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/docs/style.md +0 -0
  182. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/shared/team-rules.md +0 -0
  183. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/src/api/users.ts +0 -0
  184. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/import-chain-repo/src/legacy/CLAUDE.md +0 -0
  185. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/.claude/settings.json +0 -0
  186. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/.claude/skills/setup/SKILL.md +0 -0
  187. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/.github/copilot-instructions.md +0 -0
  188. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/.mcp.json +0 -0
  189. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/AGENTS.md +0 -0
  190. {ghostrules-0.4.1 → ghostrules-0.5.0}/examples/poisoned-repo/CLAUDE.md +0 -0
  191. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/build_site.py +0 -0
  192. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/changelog_section.py +0 -0
  193. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/gen_rules_table.py +0 -0
  194. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/make_fixtures.py +0 -0
  195. {ghostrules-0.4.1 → ghostrules-0.5.0}/scripts/set_owner.py +0 -0
  196. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/_compat.py +0 -0
  197. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/__init__.py +0 -0
  198. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/claude_code.py +0 -0
  199. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/copilot_cli.py +0 -0
  200. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/cursor.py +0 -0
  201. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/gemini_cli.py +0 -0
  202. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/agents/generic.py +0 -0
  203. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/changeset.py +0 -0
  204. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/clean.py +0 -0
  205. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/context_command.py +0 -0
  206. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/contextscan.py +0 -0
  207. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/firstparty.py +0 -0
  208. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/gitref.py +0 -0
  209. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/globs.py +0 -0
  210. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/ignores.py +0 -0
  211. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/imports.py +0 -0
  212. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/jsonloc.py +0 -0
  213. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/lock.py +0 -0
  214. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/markdown_utils.py +0 -0
  215. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/mcp_config.py +0 -0
  216. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/playground.py +0 -0
  217. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/py.typed +0 -0
  218. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reach.py +0 -0
  219. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/__init__.py +0 -0
  220. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/context_data.py +0 -0
  221. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/lock.py +0 -0
  222. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/markdown.py +0 -0
  223. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/sarif.py +0 -0
  224. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reporters/table.py +0 -0
  225. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reveal.py +0 -0
  226. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/reveal_data.py +0 -0
  227. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/__init__.py +0 -0
  228. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/agent_settings.py +0 -0
  229. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/context_rules.py +0 -0
  230. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/known_installers.py +0 -0
  231. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/mcp.py +0 -0
  232. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/registry.py +0 -0
  233. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/scripts.py +0 -0
  234. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/rules/unicode.py +0 -0
  235. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/scancontext.py +0 -0
  236. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/schemas/context.schema.json +0 -0
  237. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/secrets.py +0 -0
  238. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/sensitive.py +0 -0
  239. {ghostrules-0.4.1 → ghostrules-0.5.0}/src/ghostrules/targets.py +0 -0
  240. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/analyze.py +0 -0
  241. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/01-adoption-dark.svg +0 -0
  242. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/01-adoption-light.svg +0 -0
  243. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/02-tools-per-repo-dark.svg +0 -0
  244. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/02-tools-per-repo-light.svg +0 -0
  245. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/03-claude-agents-dark.svg +0 -0
  246. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/03-claude-agents-light.svg +0 -0
  247. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/04-what-agents-read-dark.svg +0 -0
  248. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/04-what-agents-read-light.svg +0 -0
  249. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/05-risk-dark.svg +0 -0
  250. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/05-risk-light.svg +0 -0
  251. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/06-precision-dark.svg +0 -0
  252. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts/06-precision-light.svg +0 -0
  253. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/charts.py +0 -0
  254. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/adoption_families.csv +0 -0
  255. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/claude_agents_relation.csv +0 -0
  256. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/conditional_rules.csv +0 -0
  257. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/findings_by_rule.csv +0 -0
  258. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/headline.json +0 -0
  259. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/imports.csv +0 -0
  260. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/instruction_file_lines.csv +0 -0
  261. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/numbers.csv +0 -0
  262. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/precision_by_rule.csv +0 -0
  263. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/precision_runs.csv +0 -0
  264. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/risk_indicators.csv +0 -0
  265. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/sample.csv +0 -0
  266. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/skills_concentration.csv +0 -0
  267. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/data/tools_per_repo.csv +0 -0
  268. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/features.py +0 -0
  269. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/label_classes.py +0 -0
  270. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/labels.toml +0 -0
  271. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/report.md +0 -0
  272. {ghostrules-0.4.1 → ghostrules-0.5.0}/study/report.py +0 -0
  273. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/conftest.py +0 -0
  274. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/corpus_fakes.py +0 -0
  275. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/data/sarif-schema-2.1.0.json +0 -0
  276. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr001_flag_forged/AGENTS.md +0 -0
  277. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr001_flag_ok/AGENTS.md +0 -0
  278. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr001_tags/AGENTS.md +0 -0
  279. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr002_bidi/AGENTS.md +0 -0
  280. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr002_rtl_medium/AGENTS.md +0 -0
  281. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_bom_midfile/AGENTS.md +0 -0
  282. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_bom_ok/AGENTS.md +0 -0
  283. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_emoji_zwj_ok/AGENTS.md +0 -0
  284. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_indic_ok/AGENTS.md +0 -0
  285. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_persian_ok/AGENTS.md +0 -0
  286. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_soft_hyphen/AGENTS.md +0 -0
  287. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_zw_file_high/AGENTS.md +0 -0
  288. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_zw_line_high/AGENTS.md +0 -0
  289. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr003_zw_medium/AGENTS.md +0 -0
  290. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr004_vs_bytes/AGENTS.md +0 -0
  291. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr004_vs_ok/AGENTS.md +0 -0
  292. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_benign_ok/CLAUDE.md +0 -0
  293. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_comment_imperative/CLAUDE.md +0 -0
  294. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_comment_injection/CLAUDE.md +0 -0
  295. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_comment_multiline/CLAUDE.md +0 -0
  296. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_in_code_block_ok/CLAUDE.md +0 -0
  297. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_short_ok/CLAUDE.md +0 -0
  298. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr005_unterminated/CLAUDE.md +0 -0
  299. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr006_ok/AGENTS.md +0 -0
  300. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr006_url/AGENTS.md +0 -0
  301. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/fixtures/unicode/gr006_word/AGENTS.md +0 -0
  302. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/pr_helpers.py +0 -0
  303. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/secret_samples.py +0 -0
  304. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_agents_claude.py +0 -0
  305. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_agents_others.py +0 -0
  306. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_agents_repo.py +0 -0
  307. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_baseline.py +0 -0
  308. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_bench_heldout.py +0 -0
  309. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_cli.py +0 -0
  310. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_codex_gemini.py +0 -0
  311. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_config.py +0 -0
  312. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_context_api.py +0 -0
  313. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_context_command.py +0 -0
  314. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_core_without_cli_deps.py +0 -0
  315. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_corpus_packaging.py +0 -0
  316. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_corpus_tools.py +0 -0
  317. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_crlf.py +0 -0
  318. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_cross_sentence.py +0 -0
  319. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_demo.py +0 -0
  320. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_globs.py +0 -0
  321. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_gr030.py +0 -0
  322. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_hidden_ignores.py +0 -0
  323. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_hook_scripts.py +0 -0
  324. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_imports.py +0 -0
  325. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_lock.py +0 -0
  326. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_lock_base.py +0 -0
  327. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_markdown_utils.py +0 -0
  328. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_mcp_config.py +0 -0
  329. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_models.py +0 -0
  330. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_noise_fixes.py +0 -0
  331. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_patterns.py +0 -0
  332. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_playground.py +0 -0
  333. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_pr_mode.py +0 -0
  334. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_precision_study.py +0 -0
  335. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_precision_v021.py +0 -0
  336. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_precision_v030.py +0 -0
  337. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_referenced_files.py +0 -0
  338. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_reporters.py +0 -0
  339. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_rules_config.py +0 -0
  340. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_rules_injection.py +0 -0
  341. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_rules_unicode.py +0 -0
  342. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_scan_imports.py +0 -0
  343. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_scanner.py +0 -0
  344. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_script_own_service.py +0 -0
  345. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_secret_masking.py +0 -0
  346. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_secrets.py +0 -0
  347. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_study.py +0 -0
  348. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_symlink_alias.py +0 -0
  349. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_targets.py +0 -0
  350. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_unicode_utils.py +0 -0
  351. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/test_visibility.py +0 -0
  352. {ghostrules-0.4.1 → ghostrules-0.5.0}/tests/web/test_playground_smoke.py +0 -0
  353. {ghostrules-0.4.1 → ghostrules-0.5.0}/web/app.js +0 -0
  354. {ghostrules-0.4.1 → ghostrules-0.5.0}/web/index.html +0 -0
  355. {ghostrules-0.4.1 → ghostrules-0.5.0}/web/style.css +0 -0
@@ -0,0 +1,31 @@
1
+ {
2
+ "agents": {
3
+ "claude-code": [
4
+ {
5
+ "conditions": [],
6
+ "lines": "2a3d3f1fb26381e9 e3b0c44298fc1c14 ddabff43c0a4efe5 6aa552cc1598dcb7 be186e6b970ab643 fb78540ec32b52f9 e3b0c44298fc1c14 662c42577f74cece e3b0c44298fc1c14 85b7ae55df076ab0 2f6995b0ecd75c8d e3b0c44298fc1c14 5f2235a1b010f82c 56a4406ad70b7f0a ba2cd86d7e76eff5 a7b723b74ee03fc8 7cc741f5ca53a7c7 e3b0c44298fc1c14 782729a560418c17 36a8e590ff4c085c e3b0c44298fc1c14 9f4e3cc48918efc0 efeeec23855e4659 2f23b1dcff8841e8 c3abd357eb574eb6 76881ea91e0040bd e3b0c44298fc1c14 36cd3f2bb454f575 ad332335cfaa348c a58865feac87f52b 052081156966d443 5654f9fffd4a2a7a bd0710fd0315ecbb e4d8cec4158bb770 f1b901847390b0ed e3b0c44298fc1c14 966a8946115b377a 5b59b2f749ffabac 9bf96d3c4c385073 43d8bbb16372109c 5226bbb3f5f9e13d add6d744d3ac0c02 3dafca094d79548b 21a3cd5236dfd642 79e12b3b50117933 9cb81024d1184666 f1e7b346d65f35c5 e3b0c44298fc1c14 60ab6be4219694a0 3a1c5dcc5281208a e256f3fb8239bf8c 10d8918d097bebb5 ff85c33a894fab39 10f274c7d25257d2 6216cf539fa87bd8 e3b0c44298fc1c14 7136000e494604c0 aa8d4cf82644ac63 f75f6ee8f0d942eb 1f59b655e6071114 da29957f3e8be475",
7
+ "load": "always",
8
+ "path": "CLAUDE.md",
9
+ "raw_sha256": "eea25059b020f827e5aabef4f61e75220a18323755b2023c710afb73d8c18134",
10
+ "seen_sha256": "eea25059b020f827e5aabef4f61e75220a18323755b2023c710afb73d8c18134",
11
+ "via": []
12
+ }
13
+ ],
14
+ "copilot-cli": [
15
+ {
16
+ "conditions": [],
17
+ "lines": "2a3d3f1fb26381e9 e3b0c44298fc1c14 ddabff43c0a4efe5 6aa552cc1598dcb7 be186e6b970ab643 fb78540ec32b52f9 e3b0c44298fc1c14 662c42577f74cece e3b0c44298fc1c14 85b7ae55df076ab0 2f6995b0ecd75c8d e3b0c44298fc1c14 5f2235a1b010f82c 56a4406ad70b7f0a ba2cd86d7e76eff5 a7b723b74ee03fc8 7cc741f5ca53a7c7 e3b0c44298fc1c14 782729a560418c17 36a8e590ff4c085c e3b0c44298fc1c14 9f4e3cc48918efc0 efeeec23855e4659 2f23b1dcff8841e8 c3abd357eb574eb6 76881ea91e0040bd e3b0c44298fc1c14 36cd3f2bb454f575 ad332335cfaa348c a58865feac87f52b 052081156966d443 5654f9fffd4a2a7a bd0710fd0315ecbb e4d8cec4158bb770 f1b901847390b0ed e3b0c44298fc1c14 966a8946115b377a 5b59b2f749ffabac 9bf96d3c4c385073 43d8bbb16372109c 5226bbb3f5f9e13d add6d744d3ac0c02 3dafca094d79548b 21a3cd5236dfd642 79e12b3b50117933 9cb81024d1184666 f1e7b346d65f35c5 e3b0c44298fc1c14 60ab6be4219694a0 3a1c5dcc5281208a e256f3fb8239bf8c 10d8918d097bebb5 ff85c33a894fab39 10f274c7d25257d2 6216cf539fa87bd8 e3b0c44298fc1c14 7136000e494604c0 aa8d4cf82644ac63 f75f6ee8f0d942eb 1f59b655e6071114 da29957f3e8be475",
18
+ "load": "always",
19
+ "path": "CLAUDE.md",
20
+ "raw_sha256": "eea25059b020f827e5aabef4f61e75220a18323755b2023c710afb73d8c18134",
21
+ "seen_sha256": "eea25059b020f827e5aabef4f61e75220a18323755b2023c710afb73d8c18134",
22
+ "via": []
23
+ }
24
+ ],
25
+ "cursor": [],
26
+ "generic": []
27
+ },
28
+ "configs": [],
29
+ "generator": "ghostrules 0.5.0",
30
+ "lock_version": 1
31
+ }
@@ -47,3 +47,11 @@ body:
47
47
  description: What the text is for, and how a rule could tell it apart from a real problem.
48
48
  validations:
49
49
  required: true
50
+ - type: checkboxes
51
+ id: checks
52
+ attributes:
53
+ label: Before sending
54
+ options:
55
+ - label: The snippet is defanged (no real secret, domain or private text).
56
+ required: true
57
+ - label: I am willing to have it added as a false-positive test case.
@@ -50,3 +50,5 @@ body:
50
50
  label: Contribution
51
51
  options:
52
52
  - label: I can send a pull request (see CONTRIBUTING.md).
53
+ - label: I will add a positive test and a false-positive (negative) test, with defanged fixtures.
54
+ required: true
@@ -0,0 +1,22 @@
1
+ # Keeps the commit-pinned actions (.github/workflows, action.yml) and the Python dependencies
2
+ # (pyproject.toml, action-requirements.in/.txt) up to date, one grouped weekly pull request each.
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ groups:
10
+ actions:
11
+ patterns: ["*"]
12
+ commit-message:
13
+ prefix: "chore"
14
+ - package-ecosystem: pip
15
+ directory: /
16
+ schedule:
17
+ interval: weekly
18
+ groups:
19
+ python:
20
+ patterns: ["*"]
21
+ commit-message:
22
+ prefix: "chore"
@@ -0,0 +1,16 @@
1
+ ## What and why
2
+
3
+ <!-- One or two sentences. Link the issue if there is one. -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] `pytest -q`, `ruff check .`, `ruff format --check .` and `mypy src` pass
8
+ - [ ] Every new or changed detection has a **positive** test and a **false-positive (negative)** test
9
+ - [ ] If a rule's severity or pattern changed: `docs/RULES.md`, `docs/DECISIONS.md` and the `CHANGELOG.md` (Unreleased) say so, and the effect on `bench/` and `corpus/` is in this description
10
+ - [ ] The bench cases were not tuned on their own misses (new, varied cases were added first)
11
+ - [ ] `examples/poisoned-repo` still triggers every rule and `examples/clean-repo` is still clean
12
+ - [ ] Fixtures are defanged (`*.example`, fake tokens), and invisible characters are generated, not typed
13
+ - [ ] Nothing executes, downloads or evaluates scanned content, and nothing uses the network
14
+ - [ ] If this touches a file an agent reads, `ghostrules lock --update` was run and the lock diff reviewed
15
+ - [ ] If the JSON schema, exit codes, flags or rule IDs changed: `docs/VERSIONING.md` was followed
16
+ - [ ] I read what the assistant (if any) wrote, and I am responsible for it
@@ -0,0 +1,110 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ci-${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest, windows-latest, macos-latest]
22
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
23
+ steps:
24
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
25
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+ - name: Install
29
+ run: pip install -e ".[dev]"
30
+ - name: Lint
31
+ run: ruff check .
32
+ - name: Format check
33
+ run: ruff format --check .
34
+ - name: Test
35
+ run: pytest -q
36
+ - name: Smoke test the demos
37
+ shell: bash
38
+ run: |
39
+ ghostrules scan examples/clean-repo
40
+ code=0
41
+ ghostrules scan examples/poisoned-repo --no-color > /dev/null || code=$?
42
+ test "$code" = "1"
43
+
44
+ typecheck:
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
48
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
49
+ with:
50
+ python-version: "3.12"
51
+ - run: pip install -e ".[dev]"
52
+ - name: mypy (strict)
53
+ run: mypy src
54
+
55
+ audit:
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
59
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
60
+ with:
61
+ python-version: "3.12"
62
+ - name: Install the package and pip-audit
63
+ run: pip install . pip-audit
64
+ - name: Audit the runtime dependencies and the pinned action requirements
65
+ run: |
66
+ pip-audit --skip-editable
67
+ pip-audit --require-hashes -r action-requirements.txt
68
+
69
+ self-scan:
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
73
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
74
+ with:
75
+ python-version: "3.12"
76
+ - run: pip install -e .
77
+ - name: ghostrules scans its own repository
78
+ run: |
79
+ ghostrules scan . --no-color
80
+ ghostrules scan . --all-files --no-color
81
+ ghostrules lock --check --no-color
82
+
83
+ # Speed budget (docs/PERFORMANCE.md): loose on purpose, it catches a rule that turned quadratic.
84
+ perf:
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
88
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
89
+ with:
90
+ python-version: "3.12"
91
+ - name: Install
92
+ run: pip install -e .
93
+ - name: Budget
94
+ run: python bench/perf.py --check
95
+
96
+ # One stable name for the branch ruleset: "test" is a matrix, so its checks are named per
97
+ # combination and no check is called plain "test". This job fails unless every job succeeded.
98
+ ci-ok:
99
+ if: always()
100
+ needs: [test, typecheck, audit, self-scan, perf]
101
+ runs-on: ubuntu-latest
102
+ steps:
103
+ - name: Every required job succeeded
104
+ env:
105
+ RESULTS: ${{ join(needs.*.result, ' ') }}
106
+ run: |
107
+ echo "results: $RESULTS"
108
+ for r in $RESULTS; do
109
+ [ "$r" = "success" ] || { echo "a required job did not succeed: $r"; exit 1; }
110
+ done
@@ -0,0 +1,23 @@
1
+ name: Links
2
+
3
+ # Dead links in the documentation. Not part of the required checks (`ci-ok`): a third-party site
4
+ # being down must not block a merge. It runs on pull requests that touch Markdown, weekly, and by hand.
5
+ on:
6
+ pull_request:
7
+ paths: ["**/*.md", "lychee.toml", ".github/workflows/links.yml"]
8
+ schedule:
9
+ - cron: "41 6 * * 3"
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ lychee:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
20
+ - uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
21
+ with:
22
+ args: --config lychee.toml --no-progress "**/*.md"
23
+ fail: true
@@ -41,6 +41,15 @@ jobs:
41
41
  python -m pip install --disable-pip-version-check --quiet build
42
42
  python -m build
43
43
 
44
+ - name: SBOM (CycloneDX)
45
+ run: |
46
+ # a clean environment, so the SBOM lists ghostrules and its runtime dependencies only
47
+ python -m venv sbom-env
48
+ sbom-env/bin/python -m pip install --disable-pip-version-check --quiet .
49
+ python -m pip install --disable-pip-version-check --quiet cyclonedx-bom
50
+ mkdir sbom
51
+ cyclonedx-py environment --of JSON -o sbom/ghostrules-sbom.cdx.json sbom-env
52
+
44
53
  - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
45
54
  with:
46
55
  name: dist
@@ -48,33 +57,50 @@ jobs:
48
57
  dist/
49
58
  release-notes.md
50
59
 
60
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
61
+ with:
62
+ name: sbom
63
+ path: sbom/
64
+
51
65
  publish-pypi:
52
66
  needs: build
53
67
  runs-on: ubuntu-latest
54
68
  environment: pypi
55
69
  permissions:
56
- id-token: write # Trusted Publishing
70
+ id-token: write # Trusted Publishing and PyPI attestations
57
71
  steps:
58
72
  - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
59
73
  with:
60
74
  name: dist
61
75
  - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
76
+ with:
77
+ attestations: true # PEP 740 attestations, signed with this workflow's OIDC identity
62
78
 
63
79
  github-release:
64
80
  needs: publish-pypi
65
81
  runs-on: ubuntu-latest
66
82
  permissions:
67
83
  contents: write
84
+ id-token: write # sign the build provenance
85
+ attestations: write
68
86
  steps:
69
87
  - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
70
88
  with:
71
89
  name: dist
72
- - name: Create the GitHub release
90
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
91
+ with:
92
+ name: sbom
93
+ path: sbom
94
+ - name: Attest the build provenance of the distributions
95
+ uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
96
+ with:
97
+ subject-path: dist/*
98
+ - name: Create the GitHub release (distributions and SBOM)
73
99
  env:
74
100
  GH_TOKEN: ${{ github.token }}
75
101
  TAG: ${{ github.ref_name }}
76
102
  REPO: ${{ github.repository }}
77
- run: gh release create "$TAG" dist/* --repo "$REPO" --title "$TAG" --notes-file release-notes.md
103
+ run: gh release create "$TAG" dist/* sbom/ghostrules-sbom.cdx.json --repo "$REPO" --title "$TAG" --notes-file release-notes.md
78
104
 
79
105
  move-major-tag:
80
106
  # Users pin BardLaudian/ghostrules@v0 (or an exact tag). Only a stable x.y.z release moves it.
@@ -0,0 +1,32 @@
1
+ name: Scorecard
2
+
3
+ # OpenSSF Scorecard: scores the repository's supply-chain practices and publishes the result
4
+ # (the badge in the README is added once a result exists). Runs weekly and when main changes.
5
+ on:
6
+ schedule:
7
+ - cron: "23 5 * * 2"
8
+ push:
9
+ branches: [main]
10
+
11
+ permissions: read-all
12
+
13
+ jobs:
14
+ analysis:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ security-events: write # upload the SARIF to code scanning
18
+ id-token: write # publish the result to the OpenSSF API
19
+ contents: read
20
+ actions: read
21
+ steps:
22
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
23
+ with:
24
+ persist-credentials: false
25
+ - uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
26
+ with:
27
+ results_file: results.sarif
28
+ results_format: sarif
29
+ publish_results: true
30
+ - uses: github/codeql-action/upload-sarif@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
31
+ with:
32
+ sarif_file: results.sarif
@@ -5,6 +5,96 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.5.0] - 2026-11-24
9
+
10
+ ### Added
11
+
12
+ - **A bad configuration says where.** An invalid `.ghostrules.toml` or `[tool.ghostrules]` table
13
+ fails with `file:line: 'key' ...` (exit 2); an unknown key also lists the known ones.
14
+ - **Exit code 3** for an internal failure (an unexpected exception). It used to leave as `1`, which a
15
+ CI job reads as "findings". The four codes are documented in the usage guide and fixed by a test.
16
+ The console script is now `ghostrules.cli:main`; `ghostrules.cli:app` still works.
17
+ - **`schema_version` in the JSON report**, a JSON Schema for it (`schemas/scan.schema.json`) and a
18
+ written compatibility promise: fields are only added within a schema version.
19
+ `summary.baseline_stale` is new.
20
+ - **Baselines record `created`, `generator` and `count`, and go stale visibly.** A whole-directory
21
+ scan warns when entries match no finding any more (it never changes the exit code). How a baseline
22
+ expires is documented.
23
+ - **`bench/perf.py`**: a reproducible speed benchmark (3,000 files, 30 CLAUDE.md, a 20,000-file repo,
24
+ a 1 MiB file) with a loose time budget checked in CI (job `perf`); figures in `docs/PERFORMANCE.md`.
25
+ - **Tests** for CRLF, a UTF-8 BOM, mixed-case names, path separators and platforms without symlinks,
26
+ and a test that `scan --help` and the option table of the usage guide list the same options.
27
+ - **`--max-file-size` / `max_file_size` (default 1 MiB, `0` = no limit).** A larger file is skipped
28
+ with a warning naming it and its size, shown in every output format. It is never skipped
29
+ silently.
30
+ - Property tests (`hypothesis`, new `dev` extra) for the normaliser, `@path` resolution, the JSON
31
+ locator and the reporters, and `slow` time-budget tests on hostile input (`pytest -m slow`;
32
+ excluded from the normal run).
33
+
34
+ - **GR017, a known-format secret written in an instruction file.** `ghp_`, `github_pat_`,
35
+ `sk-ant-`, `sk-`, `AKIA`, `xox*`, `AIza`, `glpat-`, `hf_`, `npm_` and webhook URLs in `AGENTS.md`,
36
+ `CLAUDE.md`, `.cursorrules` and the other instruction files are `critical` and always masked.
37
+ - **GR012:** a download tool kept in a variable then a shell (`c=curl; $c … && sh`),
38
+ `python -c` / `node -e` that `exec`/`eval` what `urlopen`, `requests.get` or `fetch` returns, and
39
+ `sh|zsh|source <(curl …)`.
40
+ - **GR014:** the verb `open`, `.git-credentials`, `~/.config/gh/hosts.yml`, and a low-severity
41
+ heuristic for `private key` + `ssh` in one sentence.
42
+ - **French patterns** for GR010, GR011 and GR013, and Spanish for GR013.
43
+ - Nine bench cases (origin `author`) for the above; four former known misses are now detected.
44
+ - Unicode-evasion cases (zero-width, soft hyphen, fullwidth, Cyrillic, mixed) now pass; added legitimate emoji ZWJ, Arabic, Persian, Hindi and Russian text as no-escalation tests.
45
+ - Regression net for the evasion and false-positive audit (`tests/test_evasion_regressions.py`): strict-xfail evasion cases plus six legitimate-content cases that must stay clean.
46
+ - `docs/improvement/BASELINE.md`: measured baseline before the improvement plan.
47
+ - **Documentation and governance.** `docs/THREAT_MODEL.md` (assets, attackers, trust boundaries, attacks on the scanner, non-goals), `docs/VERSIONING.md` (the stable surface, deprecation policy, criteria for 1.0), `GOVERNANCE.md`, `CODE_OF_CONDUCT.md`, a pull request template with a false-positive checkbox, and a link check in CI.
48
+ - `docs/improvement/BASELINE.md`: measured baseline before the improvement plan.
49
+
50
+ ### Changed
51
+
52
+ - **Benchmark honesty.** Every recall and precision figure the benchmark prints now carries
53
+ its sample size and a 95 % Wilson interval. Labels record who gave them (`assistant` or `human`)
54
+ and the report keeps the two apart. `python bench/run.py review-sheet` writes
55
+ `bench/labels-review.csv` (blind, `human_label` empty) for a person to label; nothing was filled
56
+ in. `docs/CLAIMS.md` maps each README claim to its evidence. `docs/AI_PROVENANCE.md` lays out the
57
+ options for the AI co-author trailers; the maintainer chose to keep the history and declare AI
58
+ use in general (no history was touched). All 21 held-out findings now have a human label
59
+ (4 of 21 true positives, 19 %, 95 % CI 8–40 %).
60
+ - **Type checking is strict and runs in CI.** `mypy src` passes with `strict = true`
61
+ and is a CI step. The long functions behind `scan`, `lock`, `scan_paths`, the context builder
62
+ and the symlink resolver are split into steps with one job each, with no change in output
63
+ (pinned by golden tests of `scan`, `context` and `lock` on `examples/*`). Ruff now fails the build
64
+ on a function over 15 branches or 60 statements.
65
+ - **An imperative remote-code command in prose now fails the default check.** GR012 on a line
66
+ such as `Run: curl URL | bash` in plain prose of an agent file keeps its own severity instead of
67
+ being lowered to `low`. Code blocks, code spans, quotations and descriptions are unchanged, and
68
+ the other visible-prose rules (GR010, GR011, GR013, GR014, GR016) keep the 0.4 policy.
69
+ **Migration:** if the new exit code breaks a pipeline, pass `--lenient` or set
70
+ `profile = "lenient"` to get the 0.4 behaviour; review the finding rather than silencing it.
71
+ - The README is shorter: the benchmark detail lives in `bench/README.md`, and a "How this was built" section declares the use of AI assistants.
72
+ - This changelog: Keep a Changelog categories only, internal tracking labels removed, comparison links between tags.
73
+
74
+ ### Fixed
75
+
76
+ - **Terminal escape sequences in the table report.** A control character in a scanned file
77
+ (ESC, CSI, CR, BS...) reached the terminal through the snippet or message. Every report now
78
+ prints control characters as `⟦U+XXXX⟧`. Found by the new property tests.
79
+ - **Quadratic cost on a line with many findings.** 60,000 repetitions of one sentence took
80
+ minutes (masking the whole line and counting quotes from the start of the paragraph for each
81
+ finding); it is now linear (about 21 s for a 2 MB file, which the default size limit skips).
82
+ - **Unicode evasion of the injection patterns.** GR010-GR016 now also match a de-obfuscated
83
+ view of the text (invisible characters dropped, NFKC, Cyrillic/Greek look-alikes folded to
84
+ Latin) and report against the original line and column. A match that only appears after
85
+ de-obfuscation is raised to at least `high`, is not lowered by the visible-prose policy, and says
86
+ the text was obfuscated. Plain ASCII and single-script text skip the extra pass (no measurable
87
+ cost on a 3,000-file tree).
88
+
89
+ ### Security
90
+
91
+ - **CI and release supply chain.** `ci.yml` has read-only `permissions` and cancels
92
+ obsolete runs, and `mypy`, `pip-audit` and the self-scan run as their own jobs. Dependabot also
93
+ watches the Python dependencies, grouped weekly. Releases publish PyPI attestations, a GitHub
94
+ build-provenance attestation and a CycloneDX SBOM. An OpenSSF Scorecard workflow was added and its badge shown in the README.
95
+ The README and usage guide show the Action pinned by commit SHA. Settings that need a
96
+ maintainer are listed in `docs/GITHUB_SETTINGS.md`.
97
+
8
98
  ## [0.4.1] - 2026-10-29
9
99
 
10
100
  Follow-up to 0.4.0: fewer false positives on scripts, fewer misses on visible attacks, and a
@@ -342,3 +432,13 @@ First release.
342
432
  and the tool makes no network requests. Symbolic links are not followed.
343
433
  - Secrets are never printed: every finding, warning and error passes through one masking step
344
434
  (`ghp_****…a1b2`), and a test fails if a secret appears in any report format.
435
+
436
+ [Unreleased]: https://github.com/BardLaudian/ghostrules/compare/v0.5.0...HEAD
437
+ [0.5.0]: https://github.com/BardLaudian/ghostrules/compare/v0.4.1...v0.5.0
438
+ [0.4.1]: https://github.com/BardLaudian/ghostrules/compare/v0.4.0...v0.4.1
439
+ [0.4.0]: https://github.com/BardLaudian/ghostrules/compare/v0.3.0...v0.4.0
440
+ [0.3.0]: https://github.com/BardLaudian/ghostrules/compare/v0.2.1...v0.3.0
441
+ [0.2.1]: https://github.com/BardLaudian/ghostrules/compare/v0.2.0...v0.2.1
442
+ [0.2.0]: https://github.com/BardLaudian/ghostrules/compare/v0.1.1...v0.2.0
443
+ [0.1.1]: https://github.com/BardLaudian/ghostrules/compare/v0.1.0...v0.1.1
444
+ [0.1.0]: https://github.com/BardLaudian/ghostrules/releases/tag/v0.1.0
@@ -14,6 +14,7 @@ anything it finds, never makes network requests, and never phones home.
14
14
  - `docs/design/SPEC.md` — features, CLI, file targets, output formats, config. **The contract.**
15
15
  - `docs/RULES.md` — every detection rule: ID, severity, logic, true/false positive examples.
16
16
  - `docs/design/PLAN.md` — build order, phase by phase, with acceptance criteria.
17
+ - `docs/improvement/PLAN.md` — improvement plan (v0.4.1 → v1.0): working rules, findings H1–H14, phase report format.
17
18
 
18
19
  If something in the code disagrees with these docs, the docs win unless the user says otherwise.
19
20
  If a doc is ambiguous, pick the simplest reasonable option and note it in `docs/DECISIONS.md`.
@@ -0,0 +1,108 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a
6
+ harassment-free experience for everyone, regardless of age, body size, visible or invisible
7
+ disability, ethnicity, sex characteristics, gender identity and expression, level of experience,
8
+ education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or
9
+ sexual identity and orientation.
10
+
11
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and
12
+ healthy community.
13
+
14
+ ## Our Standards
15
+
16
+ Examples of behavior that contributes to a positive environment for our community include:
17
+
18
+ * Demonstrating empathy and kindness toward other people
19
+ * Being respectful of differing opinions, viewpoints, and experiences
20
+ * Giving and gracefully accepting constructive feedback
21
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the
22
+ experience
23
+ * Focusing on what is best not just for us as individuals, but for the overall community
24
+
25
+ Examples of unacceptable behavior include:
26
+
27
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
28
+ * Trolling, insulting or derogatory comments, and personal or political attacks
29
+ * Public or private harassment
30
+ * Publishing others' private information, such as a physical or email address, without their
31
+ explicit permission
32
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
33
+
34
+ ## Enforcement Responsibilities
35
+
36
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior
37
+ and will take appropriate and fair corrective action in response to any behavior that they deem
38
+ inappropriate, threatening, offensive, or harmful.
39
+
40
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits,
41
+ code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and
42
+ will communicate reasons for moderation decisions when appropriate.
43
+
44
+ ## Scope
45
+
46
+ This Code of Conduct applies within all community spaces, and also applies when an individual is
47
+ officially representing the community in public spaces. Examples of representing our community
48
+ include using an official email address, posting via an official social media account, or acting as
49
+ an appointed representative at an online or offline event.
50
+
51
+ ## Enforcement
52
+
53
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community
54
+ leaders responsible for enforcement through GitHub's
55
+ [private reporting](https://github.com/BardLaudian/ghostrules/security/advisories/new) (choose
56
+ "conduct" in the title). All complaints will be reviewed and investigated promptly and fairly.
57
+
58
+ All community leaders are obligated to respect the privacy and security of the reporter of any
59
+ incident.
60
+
61
+ ## Enforcement Guidelines
62
+
63
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for
64
+ any action they deem in violation of this Code of Conduct:
65
+
66
+ ### 1. Correction
67
+
68
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or
69
+ unwelcome in the community.
70
+
71
+ **Consequence**: A private, written warning from community leaders, providing clarity around the
72
+ nature of the violation and an explanation of why the behavior was inappropriate. A public apology
73
+ may be requested.
74
+
75
+ ### 2. Warning
76
+
77
+ **Community Impact**: A violation through a single incident or series of actions.
78
+
79
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people
80
+ involved, including unsolicited interaction with those enforcing the Code of Conduct, for a
81
+ specified period of time. This includes avoiding interactions in community spaces as well as
82
+ external channels like social media. Violating these terms may lead to a temporary or permanent ban.
83
+
84
+ ### 3. Temporary Ban
85
+
86
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate
87
+ behavior.
88
+
89
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the
90
+ community for a specified period of time. No public or private interaction with the people involved,
91
+ including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this
92
+ period. Violating these terms may lead to a permanent ban.
93
+
94
+ ### 4. Permanent Ban
95
+
96
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including
97
+ sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement
98
+ of classes of individuals.
99
+
100
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
101
+
102
+ ## Attribution
103
+
104
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at
105
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
106
+
107
+ [homepage]: https://www.contributor-covenant.org
108
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
@@ -115,6 +115,22 @@ model is one module, one section of `docs/AGENT_MODELS.md` and its tests:
115
115
  - Type hints everywhere, small functions, docstrings on public functions, English README.
116
116
  - Conventional commits (`feat:`, `fix:`, `test:`, `docs:`...).
117
117
 
118
+ ## How this project is built (AI assistance)
119
+
120
+ ghostrules is maintained by one person who works with an AI coding assistant for code, tests and
121
+ documentation. The maintainer reads and decides what is merged; the assistant does not publish,
122
+ push or release.
123
+
124
+ - **Commits carry no AI trailer from now on.** Use of an assistant is declared here, for the whole
125
+ project, instead of commit by commit. The 80 commits made before this decision (up to
126
+ 2026-11-23) keep their `Co-Authored-By` trailer: history is not rewritten, because that would
127
+ change every commit hash and break the release tags and their attestations.
128
+ - **A commit without a trailer does not mean no AI was involved.** Read it with this section.
129
+ - **Anything no person has reviewed is labelled as such**: the benchmark's labels (assistant or
130
+ human, reported separately in `bench/RESULTS.md`), generated tables and README numbers.
131
+ - **Contributors** may use an assistant too. You remain responsible for what you submit: tests
132
+ pass, fixtures are defanged, and nothing you add runs, downloads or evaluates scanned content.
133
+
118
134
  ## Pull request checklist
119
135
 
120
136
  - [ ] `pytest -q`, `ruff check .`, `ruff format --check .` and `mypy src` pass
@@ -0,0 +1,68 @@
1
+ # Governance
2
+
3
+ `ghostrules` is a small project with one maintainer. This file says how decisions are made so that
4
+ they are predictable, and what changes if more people join.
5
+
6
+ ## Who decides
7
+
8
+ The **maintainer** (currently Pablo Seoane Temprano) merges, releases and has the final word. Every
9
+ change goes through a pull request and the required checks (`ci-ok`); nothing is pushed directly to
10
+ `main`. An AI coding assistant is used for code, tests and documentation, and the maintainer
11
+ reviews and merges everything ([CONTRIBUTING.md](CONTRIBUTING.md#how-this-project-is-built-ai-assistance)).
12
+ Contributors can propose, review and comment; reviews from anyone are welcome and recorded in the
13
+ pull request.
14
+
15
+ Decisions that need judgement (a rule's severity, a trade-off between recall and noise) are written
16
+ in [docs/DECISIONS.md](docs/DECISIONS.md) with the reason, so they can be questioned later.
17
+
18
+ ## Adding a rule
19
+
20
+ A new rule is accepted when **all** hold:
21
+
22
+ 1. It is described in [docs/RULES.md](docs/RULES.md): ID, severity, logic, true and false positive
23
+ examples.
24
+ 2. It has at least one **positive and one negative (false positive) test**, and the defanged
25
+ fixtures follow [CONTRIBUTING.md](CONTRIBUTING.md).
26
+ 3. It names a real technique with a public reference or a reproducible case, not a hunch.
27
+ 4. It has been run on `corpus/` and the 100-repository precision set, and the new findings are
28
+ listed in the pull request. A rule that adds noise on clean repositories starts at a lower
29
+ severity.
30
+ 5. It does not make the existing bench or golden outputs worse without an explanation. The bench
31
+ cases are not tuned on their own misses: a fix for a miss adds new, varied cases first.
32
+
33
+ A rule ships in a minor version and is listed under **Added**.
34
+
35
+ ## Changing or retiring a rule
36
+
37
+ - **Severity or pattern change:** a **Changed** entry; see [docs/VERSIONING.md](docs/VERSIONING.md).
38
+ - **Too many false positives.** Any issue that uses the "False positive" template counts. A rule is
39
+ reviewed when it has reached either of these:
40
+ - 3 independent reports of false positives on real repositories, or
41
+ - a measured precision under 50 % on the labelled set with at least 10 findings.
42
+
43
+ The review ends in one of: narrow the pattern, lower the default severity, make it opt-in, or
44
+ **retire** it. The maintainer decides within a release cycle and writes the reason in DECISIONS.md.
45
+ - **Retiring** a rule: it is deprecated for two minor releases, then removed; its ID stays reserved
46
+ and marked retired in the index.
47
+ - An urgent false positive that blocks users may be fixed in a patch release by lowering severity.
48
+
49
+ ## Security reports
50
+
51
+ Privately, through [SECURITY.md](SECURITY.md). Fixes are released as soon as ready, and reporters are
52
+ credited unless they prefer not to be.
53
+
54
+ ## Releases
55
+
56
+ Tagged `vX.Y.Z` from `main` by the maintainer, published to PyPI with Trusted Publishing. A tag is
57
+ never moved after a release, except the moving `v0` major tag documented in the README.
58
+
59
+ ## Becoming a maintainer
60
+
61
+ Someone who has contributed several accepted changes and reviews can be invited. Merge rights come
62
+ with the branch protection settings in [docs/GITHUB_SETTINGS.md](docs/GITHUB_SETTINGS.md).
63
+ If the maintainer is unreachable for 6 months, an active contributor may ask for a fork to be
64
+ linked from the README.
65
+
66
+ ## Conduct
67
+
68
+ [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) applies in issues, pull requests and discussions.