cauterule 0.1.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 (212) hide show
  1. cauterule-0.1.0/LICENSE +21 -0
  2. cauterule-0.1.0/PKG-INFO +272 -0
  3. cauterule-0.1.0/README.md +229 -0
  4. cauterule-0.1.0/pyproject.toml +132 -0
  5. cauterule-0.1.0/setup.cfg +4 -0
  6. cauterule-0.1.0/src/cauterule/__init__.py +10 -0
  7. cauterule-0.1.0/src/cauterule/adapter/__init__.py +6 -0
  8. cauterule-0.1.0/src/cauterule/adapter/decorator.py +95 -0
  9. cauterule-0.1.0/src/cauterule/adapter/inject.py +49 -0
  10. cauterule-0.1.0/src/cauterule/badge.py +59 -0
  11. cauterule-0.1.0/src/cauterule/benchmark/__init__.py +1 -0
  12. cauterule-0.1.0/src/cauterule/benchmark/bakeoff.py +88 -0
  13. cauterule-0.1.0/src/cauterule/benchmark/calibration_loop.py +44 -0
  14. cauterule-0.1.0/src/cauterule/benchmark/leaderboard.py +68 -0
  15. cauterule-0.1.0/src/cauterule/benchmark/prompts.py +59 -0
  16. cauterule-0.1.0/src/cauterule/capture/__init__.py +18 -0
  17. cauterule-0.1.0/src/cauterule/capture/failure.py +40 -0
  18. cauterule-0.1.0/src/cauterule/capture/metadata.py +97 -0
  19. cauterule-0.1.0/src/cauterule/capture/step.py +63 -0
  20. cauterule-0.1.0/src/cauterule/capture/taxonomy.py +40 -0
  21. cauterule-0.1.0/src/cauterule/capture/writer.py +49 -0
  22. cauterule-0.1.0/src/cauterule/cli/__init__.py +3 -0
  23. cauterule-0.1.0/src/cauterule/cli/app.py +69 -0
  24. cauterule-0.1.0/src/cauterule/cli/audit.py +27 -0
  25. cauterule-0.1.0/src/cauterule/cli/config.py +21 -0
  26. cauterule-0.1.0/src/cauterule/cli/conflicts.py +25 -0
  27. cauterule-0.1.0/src/cauterule/cli/counterfactual.py +33 -0
  28. cauterule-0.1.0/src/cauterule/cli/demo.py +74 -0
  29. cauterule-0.1.0/src/cauterule/cli/diff.py +20 -0
  30. cauterule-0.1.0/src/cauterule/cli/explain.py +18 -0
  31. cauterule-0.1.0/src/cauterule/cli/extract.py +58 -0
  32. cauterule-0.1.0/src/cauterule/cli/health.py +18 -0
  33. cauterule-0.1.0/src/cauterule/cli/history.py +20 -0
  34. cauterule-0.1.0/src/cauterule/cli/init.py +25 -0
  35. cauterule-0.1.0/src/cauterule/cli/inject.py +24 -0
  36. cauterule-0.1.0/src/cauterule/cli/list.py +22 -0
  37. cauterule-0.1.0/src/cauterule/cli/mcp.py +14 -0
  38. cauterule-0.1.0/src/cauterule/cli/metrics.py +17 -0
  39. cauterule-0.1.0/src/cauterule/cli/pack.py +35 -0
  40. cauterule-0.1.0/src/cauterule/cli/promote.py +20 -0
  41. cauterule-0.1.0/src/cauterule/cli/report.py +33 -0
  42. cauterule-0.1.0/src/cauterule/cli/retire.py +18 -0
  43. cauterule-0.1.0/src/cauterule/cli/review.py +12 -0
  44. cauterule-0.1.0/src/cauterule/cli/search.py +21 -0
  45. cauterule-0.1.0/src/cauterule/cli/show.py +30 -0
  46. cauterule-0.1.0/src/cauterule/cli/story.py +27 -0
  47. cauterule-0.1.0/src/cauterule/cli/test.py +55 -0
  48. cauterule-0.1.0/src/cauterule/cli/validate.py +18 -0
  49. cauterule-0.1.0/src/cauterule/config.py +279 -0
  50. cauterule-0.1.0/src/cauterule/conflict/__init__.py +13 -0
  51. cauterule-0.1.0/src/cauterule/conflict/consolidation.py +101 -0
  52. cauterule-0.1.0/src/cauterule/conflict/contradiction.py +33 -0
  53. cauterule-0.1.0/src/cauterule/conflict/overlap.py +43 -0
  54. cauterule-0.1.0/src/cauterule/conflict/report.py +61 -0
  55. cauterule-0.1.0/src/cauterule/conflict/specificity.py +65 -0
  56. cauterule-0.1.0/src/cauterule/corpus/__init__.py +26 -0
  57. cauterule-0.1.0/src/cauterule/corpus/counterexample.py +74 -0
  58. cauterule-0.1.0/src/cauterule/corpus/domains/__init__.py +15 -0
  59. cauterule-0.1.0/src/cauterule/corpus/domains/browser_automation.py +39 -0
  60. cauterule-0.1.0/src/cauterule/corpus/domains/coding.py +46 -0
  61. cauterule-0.1.0/src/cauterule/corpus/domains/devops.py +39 -0
  62. cauterule-0.1.0/src/cauterule/corpus/domains/research.py +39 -0
  63. cauterule-0.1.0/src/cauterule/corpus/domains/support.py +39 -0
  64. cauterule-0.1.0/src/cauterule/corpus/format.py +67 -0
  65. cauterule-0.1.0/src/cauterule/corpus/gold.py +61 -0
  66. cauterule-0.1.0/src/cauterule/corpus/labels.py +33 -0
  67. cauterule-0.1.0/src/cauterule/corpus/nearmiss.py +79 -0
  68. cauterule-0.1.0/src/cauterule/corpus/private.py +78 -0
  69. cauterule-0.1.0/src/cauterule/corpus/public.py +35 -0
  70. cauterule-0.1.0/src/cauterule/corpus/staleness.py +76 -0
  71. cauterule-0.1.0/src/cauterule/corpus/tiers.py +130 -0
  72. cauterule-0.1.0/src/cauterule/export/__init__.py +1 -0
  73. cauterule-0.1.0/src/cauterule/export/agents_md.py +37 -0
  74. cauterule-0.1.0/src/cauterule/export/aider.py +37 -0
  75. cauterule-0.1.0/src/cauterule/export/claude_md.py +36 -0
  76. cauterule-0.1.0/src/cauterule/export/cli.py +60 -0
  77. cauterule-0.1.0/src/cauterule/export/cursorrules.py +32 -0
  78. cauterule-0.1.0/src/cauterule/export/generic.py +72 -0
  79. cauterule-0.1.0/src/cauterule/export/redaction.py +20 -0
  80. cauterule-0.1.0/src/cauterule/export/windsurf.py +31 -0
  81. cauterule-0.1.0/src/cauterule/extraction/closecall.py +30 -0
  82. cauterule-0.1.0/src/cauterule/extraction/clustering/clusterer.py +47 -0
  83. cauterule-0.1.0/src/cauterule/extraction/clustering/config.py +17 -0
  84. cauterule-0.1.0/src/cauterule/extraction/clustering/similarity.py +61 -0
  85. cauterule-0.1.0/src/cauterule/extraction/dedup.py +28 -0
  86. cauterule-0.1.0/src/cauterule/extraction/dryrun.py +29 -0
  87. cauterule-0.1.0/src/cauterule/extraction/extractor.py +132 -0
  88. cauterule-0.1.0/src/cauterule/extraction/fallback.py +42 -0
  89. cauterule-0.1.0/src/cauterule/extraction/human_correction.py +85 -0
  90. cauterule-0.1.0/src/cauterule/extraction/multipass.py +40 -0
  91. cauterule-0.1.0/src/cauterule/extraction/patterns.py +56 -0
  92. cauterule-0.1.0/src/cauterule/extraction/prompt.py +57 -0
  93. cauterule-0.1.0/src/cauterule/extraction/quality.py +56 -0
  94. cauterule-0.1.0/src/cauterule/extraction/ranking.py +49 -0
  95. cauterule-0.1.0/src/cauterule/extraction/tournament.py +36 -0
  96. cauterule-0.1.0/src/cauterule/import_/__init__.py +1 -0
  97. cauterule-0.1.0/src/cauterule/import_/chat_history.py +47 -0
  98. cauterule-0.1.0/src/cauterule/import_/conventions.py +101 -0
  99. cauterule-0.1.0/src/cauterule/injection/__init__.py +24 -0
  100. cauterule-0.1.0/src/cauterule/injection/budget.py +88 -0
  101. cauterule-0.1.0/src/cauterule/injection/explainer.py +33 -0
  102. cauterule-0.1.0/src/cauterule/injection/fallback.py +21 -0
  103. cauterule-0.1.0/src/cauterule/injection/formatter.py +46 -0
  104. cauterule-0.1.0/src/cauterule/injection/matcher.py +107 -0
  105. cauterule-0.1.0/src/cauterule/injection/ordering.py +35 -0
  106. cauterule-0.1.0/src/cauterule/injection/portfolio.py +32 -0
  107. cauterule-0.1.0/src/cauterule/injection/preflight.py +25 -0
  108. cauterule-0.1.0/src/cauterule/injection/templates.py +60 -0
  109. cauterule-0.1.0/src/cauterule/integrations/__init__.py +3 -0
  110. cauterule-0.1.0/src/cauterule/integrations/otel.py +92 -0
  111. cauterule-0.1.0/src/cauterule/integrations/webhook.py +62 -0
  112. cauterule-0.1.0/src/cauterule/linter/__init__.py +5 -0
  113. cauterule-0.1.0/src/cauterule/linter/contradiction.py +22 -0
  114. cauterule-0.1.0/src/cauterule/linter/duplicate.py +19 -0
  115. cauterule-0.1.0/src/cauterule/linter/orchestrator.py +55 -0
  116. cauterule-0.1.0/src/cauterule/linter/tautology.py +17 -0
  117. cauterule-0.1.0/src/cauterule/linter/unsafe.py +22 -0
  118. cauterule-0.1.0/src/cauterule/linter/untestable.py +17 -0
  119. cauterule-0.1.0/src/cauterule/linter/vagueness.py +16 -0
  120. cauterule-0.1.0/src/cauterule/llm/__init__.py +19 -0
  121. cauterule-0.1.0/src/cauterule/llm/factory.py +48 -0
  122. cauterule-0.1.0/src/cauterule/llm/provider.py +151 -0
  123. cauterule-0.1.0/src/cauterule/log.py +142 -0
  124. cauterule-0.1.0/src/cauterule/loop/__init__.py +19 -0
  125. cauterule-0.1.0/src/cauterule/loop/errors.py +67 -0
  126. cauterule-0.1.0/src/cauterule/loop/orchestrator.py +112 -0
  127. cauterule-0.1.0/src/cauterule/mcp/__init__.py +24 -0
  128. cauterule-0.1.0/src/cauterule/mcp/launch.py +31 -0
  129. cauterule-0.1.0/src/cauterule/mcp/server.py +90 -0
  130. cauterule-0.1.0/src/cauterule/mcp/tools/__init__.py +15 -0
  131. cauterule-0.1.0/src/cauterule/mcp/tools/get_rule.py +15 -0
  132. cauterule-0.1.0/src/cauterule/mcp/tools/list_rules.py +35 -0
  133. cauterule-0.1.0/src/cauterule/mcp/tools/matching.py +29 -0
  134. cauterule-0.1.0/src/cauterule/mcp/tools/report_failure.py +55 -0
  135. cauterule-0.1.0/src/cauterule/models/__init__.py +30 -0
  136. cauterule-0.1.0/src/cauterule/models/candidate.py +61 -0
  137. cauterule-0.1.0/src/cauterule/models/conflict.py +58 -0
  138. cauterule-0.1.0/src/cauterule/models/decision.py +50 -0
  139. cauterule-0.1.0/src/cauterule/models/evidence.py +58 -0
  140. cauterule-0.1.0/src/cauterule/models/rule.py +249 -0
  141. cauterule-0.1.0/src/cauterule/models/trajectory.py +193 -0
  142. cauterule-0.1.0/src/cauterule/observe/__init__.py +27 -0
  143. cauterule-0.1.0/src/cauterule/observe/class_coverage.py +42 -0
  144. cauterule-0.1.0/src/cauterule/observe/coverage_frontier.py +36 -0
  145. cauterule-0.1.0/src/cauterule/observe/coverage_gap.py +35 -0
  146. cauterule-0.1.0/src/cauterule/observe/coverage_score.py +38 -0
  147. cauterule-0.1.0/src/cauterule/observe/domain_coverage.py +31 -0
  148. cauterule-0.1.0/src/cauterule/observe/hits.py +10 -0
  149. cauterule-0.1.0/src/cauterule/observe/journal.py +37 -0
  150. cauterule-0.1.0/src/cauterule/observe/leaderboard.py +43 -0
  151. cauterule-0.1.0/src/cauterule/observe/monthly_report.py +70 -0
  152. cauterule-0.1.0/src/cauterule/observe/timestamps.py +48 -0
  153. cauterule-0.1.0/src/cauterule/packs/__init__.py +16 -0
  154. cauterule-0.1.0/src/cauterule/packs/certification.py +83 -0
  155. cauterule-0.1.0/src/cauterule/packs/format.py +82 -0
  156. cauterule-0.1.0/src/cauterule/packs/loader.py +64 -0
  157. cauterule-0.1.0/src/cauterule/packs/manager.py +57 -0
  158. cauterule-0.1.0/src/cauterule/packs/readonly.py +26 -0
  159. cauterule-0.1.0/src/cauterule/promotion/__init__.py +15 -0
  160. cauterule-0.1.0/src/cauterule/promotion/auto.py +62 -0
  161. cauterule-0.1.0/src/cauterule/promotion/executor.py +121 -0
  162. cauterule-0.1.0/src/cauterule/promotion/human.py +59 -0
  163. cauterule-0.1.0/src/cauterule/promotion/hybrid.py +54 -0
  164. cauterule-0.1.0/src/cauterule/promotion/thresholds.py +53 -0
  165. cauterule-0.1.0/src/cauterule/redaction/__init__.py +18 -0
  166. cauterule-0.1.0/src/cauterule/redaction/config.py +25 -0
  167. cauterule-0.1.0/src/cauterule/redaction/engine.py +117 -0
  168. cauterule-0.1.0/src/cauterule/redaction/flag.py +35 -0
  169. cauterule-0.1.0/src/cauterule/redaction/patterns.py +41 -0
  170. cauterule-0.1.0/src/cauterule/replay/__init__.py +20 -0
  171. cauterule-0.1.0/src/cauterule/replay/cache.py +55 -0
  172. cauterule-0.1.0/src/cauterule/replay/determinism.py +32 -0
  173. cauterule-0.1.0/src/cauterule/replay/diff.py +27 -0
  174. cauterule-0.1.0/src/cauterule/replay/history_check.py +26 -0
  175. cauterule-0.1.0/src/cauterule/replay/loader.py +42 -0
  176. cauterule-0.1.0/src/cauterule/replay/matcher.py +104 -0
  177. cauterule-0.1.0/src/cauterule/replay/nearmiss.py +31 -0
  178. cauterule-0.1.0/src/cauterule/replay/parallel.py +39 -0
  179. cauterule-0.1.0/src/cauterule/replay/report.py +53 -0
  180. cauterule-0.1.0/src/cauterule/replay/rewind.py +54 -0
  181. cauterule-0.1.0/src/cauterule/replay/scorer.py +49 -0
  182. cauterule-0.1.0/src/cauterule/replay/simulator.py +30 -0
  183. cauterule-0.1.0/src/cauterule/replay/trace.py +26 -0
  184. cauterule-0.1.0/src/cauterule/replay/whatif.py +50 -0
  185. cauterule-0.1.0/src/cauterule/serialization/__init__.py +25 -0
  186. cauterule-0.1.0/src/cauterule/serialization/rule_yaml.py +57 -0
  187. cauterule-0.1.0/src/cauterule/serialization/trajectory_jsonl.py +56 -0
  188. cauterule-0.1.0/src/cauterule/store/__init__.py +19 -0
  189. cauterule-0.1.0/src/cauterule/store/archive.py +37 -0
  190. cauterule-0.1.0/src/cauterule/store/git.py +69 -0
  191. cauterule-0.1.0/src/cauterule/store/health.py +78 -0
  192. cauterule-0.1.0/src/cauterule/store/index.py +121 -0
  193. cauterule-0.1.0/src/cauterule/store/manager.py +146 -0
  194. cauterule-0.1.0/src/cauterule/store/rollback.py +39 -0
  195. cauterule-0.1.0/src/cauterule/store/validator.py +82 -0
  196. cauterule-0.1.0/src/cauterule/tui/__init__.py +0 -0
  197. cauterule-0.1.0/src/cauterule/tui/annotate.py +75 -0
  198. cauterule-0.1.0/src/cauterule/tui/app.py +53 -0
  199. cauterule-0.1.0/src/cauterule/tui/batch.py +64 -0
  200. cauterule-0.1.0/src/cauterule/tui/cards.py +45 -0
  201. cauterule-0.1.0/src/cauterule/tui/confidence.py +48 -0
  202. cauterule-0.1.0/src/cauterule/tui/filter.py +105 -0
  203. cauterule-0.1.0/src/cauterule/tui/review.py +138 -0
  204. cauterule-0.1.0/src/cauterule.egg-info/PKG-INFO +272 -0
  205. cauterule-0.1.0/src/cauterule.egg-info/SOURCES.txt +210 -0
  206. cauterule-0.1.0/src/cauterule.egg-info/dependency_links.txt +1 -0
  207. cauterule-0.1.0/src/cauterule.egg-info/entry_points.txt +2 -0
  208. cauterule-0.1.0/src/cauterule.egg-info/requires.txt +21 -0
  209. cauterule-0.1.0/src/cauterule.egg-info/top_level.txt +1 -0
  210. cauterule-0.1.0/tests/test_config.py +177 -0
  211. cauterule-0.1.0/tests/test_init.py +24 -0
  212. cauterule-0.1.0/tests/test_log.py +214 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Debashish Ghosal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,272 @@
1
+ Metadata-Version: 2.4
2
+ Name: cauterule
3
+ Version: 0.1.0
4
+ Summary: Automated standing-rule extraction from agent failures — extract, test, promote.
5
+ Author: Debashish Ghosal
6
+ Maintainer: Debashish Ghosal
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/deghosal-2026/CauterRule
9
+ Project-URL: Repository, https://github.com/deghosal-2026/CauterRule.git
10
+ Project-URL: Issues, https://github.com/deghosal-2026/CauterRule/issues
11
+ Keywords: agent,llm,rules,learning,memory,automation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: textual>=1.0
27
+ Requires-Dist: mcp<2,>=1.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.8; extra == "dev"
32
+ Requires-Dist: mypy>=1.13; extra == "dev"
33
+ Requires-Dist: types-PyYAML>=6.0; extra == "dev"
34
+ Requires-Dist: build>=1.0; extra == "dev"
35
+ Requires-Dist: twine>=4.0; extra == "dev"
36
+ Provides-Extra: llm
37
+ Requires-Dist: openai>=1.0; extra == "llm"
38
+ Requires-Dist: anthropic>=0.25; extra == "llm"
39
+ Provides-Extra: all
40
+ Requires-Dist: openai>=1.0; extra == "all"
41
+ Requires-Dist: anthropic>=0.25; extra == "all"
42
+ Dynamic: license-file
43
+
44
+ # CauterRule
45
+
46
+ **Automated standing-rule extraction from agent failures.**
47
+
48
+ Every agent fails. CauterRule ensures they never make the *same* failure twice.
49
+
50
+ After every failure, CauterRule:
51
+ 1. **Extracts** a structured *when X, do Y* standing rule from the execution trajectory (multi-pass with draft tournament)
52
+ 2. **Tests** that candidate rule against historical scenarios (past failures + past successes — deterministic replay)
53
+ 3. **Promotes** only rules that survive replay into the agent's permanent rule store (with linter, conflict detection, provenance)
54
+
55
+ No more corrections dying in chat. No more hand-written standing rules. No more vague reflection paragraphs nobody re-reads. Rules are actionable, tested, and permanent.
56
+
57
+ **Status:** v0.1.0 — Field test complete. [Read the full report](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md).
58
+
59
+ ---
60
+
61
+ ## Why
62
+
63
+ The current state of "learning from mistakes" in agent systems is reflection-as-a-paragraph — prose that bloats the context window and is never read again. The manual alternative is standing rules maintained by hand. Both are broken.
64
+
65
+ CauterRule automates the extract → test → promote loop. Same pattern as CI/CD for code, but for agent behavior: test a rule against the historical regression suite before merging it in.
66
+
67
+ ---
68
+
69
+ ## What Makes It Different
70
+
71
+ | Existing | CauterRule |
72
+ |----------|-----------|
73
+ | Reflection produces prose nobody re-reads | Produces structured *when X, do Y* rules that are testable and injectable |
74
+ | Memory stores hold raw text (Letta/MemGPT) | Rules are tested against history before promotion — evidence-based, not append-only |
75
+ | Framework memory is unstructured (LangGraph) | Rules have provenance, versioning, conflict detection, linter, and retirement |
76
+ | Standing rules maintained by hand | The agent writes its own rules, tests them, and promotes only what survives |
77
+ | `.cursorrules` / `CLAUDE.md` are static files | Rules are living artifacts that grow from real failures, not guesses |
78
+ | No OSS tool ships a corpus or benchmarks | 13 corpus types, 394 trajectories, golden set, safety corpora, field test runner |
79
+
80
+ ---
81
+
82
+ ## Quick Start
83
+
84
+ ```bash
85
+ pip install cauterule
86
+
87
+ # Run the demo — seeded failures, full loop in 60s
88
+ cauterule demo
89
+
90
+ # Extract a rule from a trajectory
91
+ cauterule extract trajectory.jsonl
92
+
93
+ # Replay-test a candidate rule
94
+ cauterule test R-001
95
+
96
+ # Promote to the permanent store
97
+ cauterule promote R-001
98
+
99
+ # Browse rules
100
+ cauterule list
101
+ cauterule health
102
+ cauterule validate
103
+
104
+ # Export rules to your agent's format
105
+ cauterule export --format agents
106
+ ```
107
+
108
+ ---
109
+
110
+ ## What's Shipped in v0.1.0
111
+
112
+ ### Core Loop
113
+ - Trajectory capture with secret redaction
114
+ - Multi-pass LLM extraction (3x, temperature variation, draft tournament)
115
+ - Failure clustering — one extraction per failure cluster, not per failure
116
+ - Historical replay engine with deterministic evidence reports
117
+ - Promotion gate — auto, human-review, or hybrid mode
118
+ - Rule linter (vagueness, tautology, duplicate, contradiction, untestable, unsafe)
119
+ - Conflict detection and rule consolidation
120
+ - Versioned YAML rule store with git provenance
121
+
122
+ ### CLI (25+ Commands)
123
+ - `cauterule init` | `demo` | `extract` (`--dry-run`) | `test` (`--ci`) | `promote` | `inject` | `list` | `show` | `search`
124
+ - `cauterule audit` | `diff` | `retire` | `history` | `conflicts` | `health` | `validate`
125
+ - `cauterule counterfactual` | `story` | `explain` | `config` | `metrics` | `report` | `pack list` | `pack info`
126
+ - `cauterule rewind` (Failure Time Machine) | `cauterule mcp` (MCP server)
127
+
128
+ ### Replay Engine
129
+ - Replay harness with evidence reports (failures prevented, successes broken, precision, recall, verdict)
130
+ - "What if?" mode — apply a hypothetical rule and simulate the outcome
131
+ - Failure Time Machine — `cauterule rewind <trajectory>` with rule overlay
132
+ - Rule Draft Tournament — generate candidates, replay all, rank, promote the winner
133
+
134
+ ### Rule Store
135
+ - YAML rule files with provenance metadata and tags
136
+ - Auto-classified failure taxonomy (`git/push`, `python/import`, `docker/network`)
137
+ - Git-based versioning, rollback, archive directory
138
+ - Rule consolidation — merge overlapping triggers
139
+
140
+ ### Rule Injection
141
+ - Structured matching by trigger, tool, error type, context, tags, taxonomy
142
+ - Specificity ordering — more specific rules injected first
143
+ - Rule explanations, templating (retry, verify-then-act, check-preconditions)
144
+ - Context budget optimizer, preflight mode
145
+
146
+ ### Rule Packs (Bundled)
147
+ - `pack-git` — 10+ pre-built git rules (push, merge, rebase, conflicts)
148
+ - Zero cold-start: rules work out of the box, zero LLM cost
149
+
150
+ ### Export & Import (Day-One Interop)
151
+ - Export to `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.windsurfrules`, `aider.conf.yml`, markdown, JSON
152
+ - Import from `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, and chat history
153
+
154
+ ### MCP Server
155
+ - 4 tools: `get_matching_rules`, `get_rule`, `list_rules`, `report_failure`
156
+ - Any MCP-compatible agent (Claude, etc.) consumes rules with zero code changes
157
+
158
+ ### Custom Agent Adapter
159
+ - `@cauterule.watch` decorator — wrap any agent function, auto-captures trajectories on failure
160
+ - `cauterule.inject()` context manager — prep context with matching rules before task execution
161
+ - Works with any Python agent — no framework lock-in
162
+
163
+ ### Corpus & Field Test Infrastructure
164
+ - 13 corpus types totaling 394 trajectories (curated + raw)
165
+ - Golden trajectory set with known expected rules
166
+ - Safety corpora: `successes`, `failures/negative`, `nearmiss`, `noisy`, `corrections`
167
+ - Raw corpora: OpenCode sessions, synthetic scenarios, CI failure logs, sibling-repo runs
168
+ - Field test runner supporting local OMLX and cloud OpenRouter LLMs
169
+ - 844+ deterministic tests passing, 104 Docker tests passing
170
+
171
+ ### Configuration
172
+ - `cauterule.toml` — LLM provider, model, thresholds, mode, paths, redaction patterns
173
+ - Environment variable support — `CAUTERULE_LLM_PROVIDER`, `CAUTERULE_MODEL`, etc.
174
+ - LLM provider abstraction — OpenAI, Anthropic, Ollama, LiteLLM
175
+ - Promotion mode — auto, human-review, hybrid
176
+
177
+ ---
178
+
179
+ ## Field Test Results
180
+
181
+ The full v0.1.0 field test evaluated 4 models across 13 corpus types (394 trajectories):
182
+
183
+ | Model | Type | Candidates | Pass | Inconclusive | Fail |
184
+ |---|---|---:|---:|---:|---:|
185
+ | Llama-3.2-3B-Instruct-4bit | Local OMLX | 379 | 72 | 189 | 118 |
186
+ | Qwen3-4B-Instruct-2507-4bit | Local OMLX | 373 | 93 | 209 | 71 |
187
+ | openai/gpt-4o-mini | Cloud OpenRouter | 394 | 77 | 248 | 69 |
188
+ | meta-llama/llama-3.1-8b-instruct | Cloud OpenRouter | 392 | 123 | 168 | 101 |
189
+
190
+ Key findings:
191
+ - Parser and prompt fixes improved local-model parse reliability from ~30% to near 100%
192
+ - `meta-llama/llama-3.1-8b-instruct` was the strongest cost-effective model tested
193
+ - Safety corpora remain the hardest unsolved area across all models
194
+
195
+ Full report: [`docs/field-test/v0.1.0/FIELD_TEST_REPORT.md`](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md)
196
+
197
+ ---
198
+
199
+ ## Architecture
200
+
201
+ ```
202
+ ┌──────────────────────────────────────────┐
203
+ │ CLI / MCP │
204
+ │ cauterule demo | extract | mcp │
205
+ └──────┬───────────────────────────┬───────┘
206
+ │ │
207
+ ▼ ▼
208
+ ┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
209
+ │ Trajectory │ ──> │ Rule Extractor │ ──> │ Historical Replay │
210
+ │ Capture + Redact│ │ (multi-pass LLM) │ │ Engine + Viz │
211
+ └─────────────────┘ └──────────────────┘ └───────────────────┘
212
+ │ │ │
213
+ ▼ ▼ ▼
214
+ ┌─────────────────┐ ┌──────────────┐ ┌───────────────────┐
215
+ │ Rule Injection │ <── │ Standing-Rules│ <── ─── │ Promotion Gate │
216
+ │ + Explanations │ │ Store (YAML) │ │ │ + Linter + Conflicts│
217
+ └─────────────────┘ └──────┬───────┘ │
218
+ │ │
219
+ ▼ ▼
220
+ ┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
221
+ │ Export / Import │ │ Corpus & Field │ │ Basic Observability│
222
+ │ 7 formats │ │ Test Runner │ │ Metrics + Report │
223
+ │ MCP server │ │ 394 trajectories │ │ Health + Validate │
224
+ └─────────────────┘ └──────────────────┘ └───────────────────┘
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Roadmap
230
+
231
+ | Version | Theme | Key Deliverable |
232
+ |---------|-------|-----------------|
233
+ | **v0.1.0** ✅ | Core Loop + DX | Full loop, 25+ CLI commands, MCP, export/import, packs, corpus, field tests |
234
+ | **v0.2.0** | Distribution + Polish | TUI review, observability, adversarial corpora, Homebrew, GitHub Action, webhook, OTEL |
235
+ | **v0.3.0** | Rule Pack Ecosystem | pack install/create/publish, official packs (docker, deploy, testing, python) |
236
+ | **v0.4.0** | Deep Integrations | AgentObservatory, AgentEvalForge, LangSmith/Phoenix |
237
+ | **v0.5.0** | Observability & Analytics | Web dashboard, trend lines, weekly digest |
238
+ | **v0.6.0** | Advanced Retrieval | Semantic matching, hybrid matching, rule embedding index |
239
+ | **v0.7.0** | Multi-Agent | Cross-agent transfer, shared registry, rule governance |
240
+
241
+ ---
242
+
243
+ ## Related Ecosystem
244
+
245
+ CauterRule is the **learning layer** in an open-source agent infrastructure stack:
246
+
247
+ | Project | Layer | How it relates |
248
+ |---------|-------|----------------|
249
+ | [planner-critic-engine](https://github.com/deghosal-2026/planner-critic-engine) | Prevention | Catches flawed plans *before* execution |
250
+ | [agent-self-edit](https://github.com/deghosal-2026/agent-self-edit) | Prompt Learning | Twin learning engine — extracts *prompt edits* from failures |
251
+ | [agent-tooltrust](https://github.com/deghosal-2026/agent-tooltrust) | Tool Safety | Runtime permission engine |
252
+ | [agent-eval-forge](https://github.com/deghosal-2026/agent-eval-forge) | Evaluation | "pytest for agents" |
253
+ | [ai-loopguard](https://github.com/deghosal-2026/ai-loopguard) | Circuit Breaker | Real-time failure handling |
254
+
255
+ ---
256
+
257
+ ## Documentation
258
+
259
+ - [User Guide](docs/USER_GUIDE.md)
260
+ - [Field Test Report](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md)
261
+ - [Release Notes](docs/release/v0.1.0/release-notes.md)
262
+ - [Changelog](CHANGELOG.md)
263
+ - [Docs Index](docs/README.md)
264
+ - [PRD: Why](docs/design/prd/01-why.md)
265
+ - [Architecture](docs/design/prd/02-architecture.md)
266
+ - [WBS v0.1.0](docs/wbs/v0.1.0/wbs-v0.1.0-index.md)
267
+
268
+ ---
269
+
270
+ ## License
271
+
272
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,229 @@
1
+ # CauterRule
2
+
3
+ **Automated standing-rule extraction from agent failures.**
4
+
5
+ Every agent fails. CauterRule ensures they never make the *same* failure twice.
6
+
7
+ After every failure, CauterRule:
8
+ 1. **Extracts** a structured *when X, do Y* standing rule from the execution trajectory (multi-pass with draft tournament)
9
+ 2. **Tests** that candidate rule against historical scenarios (past failures + past successes — deterministic replay)
10
+ 3. **Promotes** only rules that survive replay into the agent's permanent rule store (with linter, conflict detection, provenance)
11
+
12
+ No more corrections dying in chat. No more hand-written standing rules. No more vague reflection paragraphs nobody re-reads. Rules are actionable, tested, and permanent.
13
+
14
+ **Status:** v0.1.0 — Field test complete. [Read the full report](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md).
15
+
16
+ ---
17
+
18
+ ## Why
19
+
20
+ The current state of "learning from mistakes" in agent systems is reflection-as-a-paragraph — prose that bloats the context window and is never read again. The manual alternative is standing rules maintained by hand. Both are broken.
21
+
22
+ CauterRule automates the extract → test → promote loop. Same pattern as CI/CD for code, but for agent behavior: test a rule against the historical regression suite before merging it in.
23
+
24
+ ---
25
+
26
+ ## What Makes It Different
27
+
28
+ | Existing | CauterRule |
29
+ |----------|-----------|
30
+ | Reflection produces prose nobody re-reads | Produces structured *when X, do Y* rules that are testable and injectable |
31
+ | Memory stores hold raw text (Letta/MemGPT) | Rules are tested against history before promotion — evidence-based, not append-only |
32
+ | Framework memory is unstructured (LangGraph) | Rules have provenance, versioning, conflict detection, linter, and retirement |
33
+ | Standing rules maintained by hand | The agent writes its own rules, tests them, and promotes only what survives |
34
+ | `.cursorrules` / `CLAUDE.md` are static files | Rules are living artifacts that grow from real failures, not guesses |
35
+ | No OSS tool ships a corpus or benchmarks | 13 corpus types, 394 trajectories, golden set, safety corpora, field test runner |
36
+
37
+ ---
38
+
39
+ ## Quick Start
40
+
41
+ ```bash
42
+ pip install cauterule
43
+
44
+ # Run the demo — seeded failures, full loop in 60s
45
+ cauterule demo
46
+
47
+ # Extract a rule from a trajectory
48
+ cauterule extract trajectory.jsonl
49
+
50
+ # Replay-test a candidate rule
51
+ cauterule test R-001
52
+
53
+ # Promote to the permanent store
54
+ cauterule promote R-001
55
+
56
+ # Browse rules
57
+ cauterule list
58
+ cauterule health
59
+ cauterule validate
60
+
61
+ # Export rules to your agent's format
62
+ cauterule export --format agents
63
+ ```
64
+
65
+ ---
66
+
67
+ ## What's Shipped in v0.1.0
68
+
69
+ ### Core Loop
70
+ - Trajectory capture with secret redaction
71
+ - Multi-pass LLM extraction (3x, temperature variation, draft tournament)
72
+ - Failure clustering — one extraction per failure cluster, not per failure
73
+ - Historical replay engine with deterministic evidence reports
74
+ - Promotion gate — auto, human-review, or hybrid mode
75
+ - Rule linter (vagueness, tautology, duplicate, contradiction, untestable, unsafe)
76
+ - Conflict detection and rule consolidation
77
+ - Versioned YAML rule store with git provenance
78
+
79
+ ### CLI (25+ Commands)
80
+ - `cauterule init` | `demo` | `extract` (`--dry-run`) | `test` (`--ci`) | `promote` | `inject` | `list` | `show` | `search`
81
+ - `cauterule audit` | `diff` | `retire` | `history` | `conflicts` | `health` | `validate`
82
+ - `cauterule counterfactual` | `story` | `explain` | `config` | `metrics` | `report` | `pack list` | `pack info`
83
+ - `cauterule rewind` (Failure Time Machine) | `cauterule mcp` (MCP server)
84
+
85
+ ### Replay Engine
86
+ - Replay harness with evidence reports (failures prevented, successes broken, precision, recall, verdict)
87
+ - "What if?" mode — apply a hypothetical rule and simulate the outcome
88
+ - Failure Time Machine — `cauterule rewind <trajectory>` with rule overlay
89
+ - Rule Draft Tournament — generate candidates, replay all, rank, promote the winner
90
+
91
+ ### Rule Store
92
+ - YAML rule files with provenance metadata and tags
93
+ - Auto-classified failure taxonomy (`git/push`, `python/import`, `docker/network`)
94
+ - Git-based versioning, rollback, archive directory
95
+ - Rule consolidation — merge overlapping triggers
96
+
97
+ ### Rule Injection
98
+ - Structured matching by trigger, tool, error type, context, tags, taxonomy
99
+ - Specificity ordering — more specific rules injected first
100
+ - Rule explanations, templating (retry, verify-then-act, check-preconditions)
101
+ - Context budget optimizer, preflight mode
102
+
103
+ ### Rule Packs (Bundled)
104
+ - `pack-git` — 10+ pre-built git rules (push, merge, rebase, conflicts)
105
+ - Zero cold-start: rules work out of the box, zero LLM cost
106
+
107
+ ### Export & Import (Day-One Interop)
108
+ - Export to `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.windsurfrules`, `aider.conf.yml`, markdown, JSON
109
+ - Import from `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, and chat history
110
+
111
+ ### MCP Server
112
+ - 4 tools: `get_matching_rules`, `get_rule`, `list_rules`, `report_failure`
113
+ - Any MCP-compatible agent (Claude, etc.) consumes rules with zero code changes
114
+
115
+ ### Custom Agent Adapter
116
+ - `@cauterule.watch` decorator — wrap any agent function, auto-captures trajectories on failure
117
+ - `cauterule.inject()` context manager — prep context with matching rules before task execution
118
+ - Works with any Python agent — no framework lock-in
119
+
120
+ ### Corpus & Field Test Infrastructure
121
+ - 13 corpus types totaling 394 trajectories (curated + raw)
122
+ - Golden trajectory set with known expected rules
123
+ - Safety corpora: `successes`, `failures/negative`, `nearmiss`, `noisy`, `corrections`
124
+ - Raw corpora: OpenCode sessions, synthetic scenarios, CI failure logs, sibling-repo runs
125
+ - Field test runner supporting local OMLX and cloud OpenRouter LLMs
126
+ - 844+ deterministic tests passing, 104 Docker tests passing
127
+
128
+ ### Configuration
129
+ - `cauterule.toml` — LLM provider, model, thresholds, mode, paths, redaction patterns
130
+ - Environment variable support — `CAUTERULE_LLM_PROVIDER`, `CAUTERULE_MODEL`, etc.
131
+ - LLM provider abstraction — OpenAI, Anthropic, Ollama, LiteLLM
132
+ - Promotion mode — auto, human-review, hybrid
133
+
134
+ ---
135
+
136
+ ## Field Test Results
137
+
138
+ The full v0.1.0 field test evaluated 4 models across 13 corpus types (394 trajectories):
139
+
140
+ | Model | Type | Candidates | Pass | Inconclusive | Fail |
141
+ |---|---|---:|---:|---:|---:|
142
+ | Llama-3.2-3B-Instruct-4bit | Local OMLX | 379 | 72 | 189 | 118 |
143
+ | Qwen3-4B-Instruct-2507-4bit | Local OMLX | 373 | 93 | 209 | 71 |
144
+ | openai/gpt-4o-mini | Cloud OpenRouter | 394 | 77 | 248 | 69 |
145
+ | meta-llama/llama-3.1-8b-instruct | Cloud OpenRouter | 392 | 123 | 168 | 101 |
146
+
147
+ Key findings:
148
+ - Parser and prompt fixes improved local-model parse reliability from ~30% to near 100%
149
+ - `meta-llama/llama-3.1-8b-instruct` was the strongest cost-effective model tested
150
+ - Safety corpora remain the hardest unsolved area across all models
151
+
152
+ Full report: [`docs/field-test/v0.1.0/FIELD_TEST_REPORT.md`](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md)
153
+
154
+ ---
155
+
156
+ ## Architecture
157
+
158
+ ```
159
+ ┌──────────────────────────────────────────┐
160
+ │ CLI / MCP │
161
+ │ cauterule demo | extract | mcp │
162
+ └──────┬───────────────────────────┬───────┘
163
+ │ │
164
+ ▼ ▼
165
+ ┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
166
+ │ Trajectory │ ──> │ Rule Extractor │ ──> │ Historical Replay │
167
+ │ Capture + Redact│ │ (multi-pass LLM) │ │ Engine + Viz │
168
+ └─────────────────┘ └──────────────────┘ └───────────────────┘
169
+ │ │ │
170
+ ▼ ▼ ▼
171
+ ┌─────────────────┐ ┌──────────────┐ ┌───────────────────┐
172
+ │ Rule Injection │ <── │ Standing-Rules│ <── ─── │ Promotion Gate │
173
+ │ + Explanations │ │ Store (YAML) │ │ │ + Linter + Conflicts│
174
+ └─────────────────┘ └──────┬───────┘ │
175
+ │ │
176
+ ▼ ▼
177
+ ┌─────────────────┐ ┌──────────────────┐ ┌───────────────────┐
178
+ │ Export / Import │ │ Corpus & Field │ │ Basic Observability│
179
+ │ 7 formats │ │ Test Runner │ │ Metrics + Report │
180
+ │ MCP server │ │ 394 trajectories │ │ Health + Validate │
181
+ └─────────────────┘ └──────────────────┘ └───────────────────┘
182
+ ```
183
+
184
+ ---
185
+
186
+ ## Roadmap
187
+
188
+ | Version | Theme | Key Deliverable |
189
+ |---------|-------|-----------------|
190
+ | **v0.1.0** ✅ | Core Loop + DX | Full loop, 25+ CLI commands, MCP, export/import, packs, corpus, field tests |
191
+ | **v0.2.0** | Distribution + Polish | TUI review, observability, adversarial corpora, Homebrew, GitHub Action, webhook, OTEL |
192
+ | **v0.3.0** | Rule Pack Ecosystem | pack install/create/publish, official packs (docker, deploy, testing, python) |
193
+ | **v0.4.0** | Deep Integrations | AgentObservatory, AgentEvalForge, LangSmith/Phoenix |
194
+ | **v0.5.0** | Observability & Analytics | Web dashboard, trend lines, weekly digest |
195
+ | **v0.6.0** | Advanced Retrieval | Semantic matching, hybrid matching, rule embedding index |
196
+ | **v0.7.0** | Multi-Agent | Cross-agent transfer, shared registry, rule governance |
197
+
198
+ ---
199
+
200
+ ## Related Ecosystem
201
+
202
+ CauterRule is the **learning layer** in an open-source agent infrastructure stack:
203
+
204
+ | Project | Layer | How it relates |
205
+ |---------|-------|----------------|
206
+ | [planner-critic-engine](https://github.com/deghosal-2026/planner-critic-engine) | Prevention | Catches flawed plans *before* execution |
207
+ | [agent-self-edit](https://github.com/deghosal-2026/agent-self-edit) | Prompt Learning | Twin learning engine — extracts *prompt edits* from failures |
208
+ | [agent-tooltrust](https://github.com/deghosal-2026/agent-tooltrust) | Tool Safety | Runtime permission engine |
209
+ | [agent-eval-forge](https://github.com/deghosal-2026/agent-eval-forge) | Evaluation | "pytest for agents" |
210
+ | [ai-loopguard](https://github.com/deghosal-2026/ai-loopguard) | Circuit Breaker | Real-time failure handling |
211
+
212
+ ---
213
+
214
+ ## Documentation
215
+
216
+ - [User Guide](docs/USER_GUIDE.md)
217
+ - [Field Test Report](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md)
218
+ - [Release Notes](docs/release/v0.1.0/release-notes.md)
219
+ - [Changelog](CHANGELOG.md)
220
+ - [Docs Index](docs/README.md)
221
+ - [PRD: Why](docs/design/prd/01-why.md)
222
+ - [Architecture](docs/design/prd/02-architecture.md)
223
+ - [WBS v0.1.0](docs/wbs/v0.1.0/wbs-v0.1.0-index.md)
224
+
225
+ ---
226
+
227
+ ## License
228
+
229
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,132 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cauterule"
7
+ version = "0.1.0"
8
+ description = "Automated standing-rule extraction from agent failures — extract, test, promote."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [{name = "Debashish Ghosal"}]
12
+ maintainers = [{name = "Debashish Ghosal"}]
13
+ requires-python = ">=3.11"
14
+ keywords = ["agent", "llm", "rules", "learning", "memory", "automation"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "click>=8.1",
28
+ "pyyaml>=6.0",
29
+ "textual>=1.0",
30
+ "mcp>=1.0,<2",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "pytest>=8.0",
36
+ "pytest-cov>=5.0",
37
+ "ruff>=0.8",
38
+ "mypy>=1.13",
39
+ "types-PyYAML>=6.0",
40
+ "build>=1.0",
41
+ "twine>=4.0",
42
+ ]
43
+ llm = [
44
+ "openai>=1.0",
45
+ "anthropic>=0.25",
46
+ ]
47
+ all = [
48
+ "openai>=1.0",
49
+ "anthropic>=0.25",
50
+ ]
51
+
52
+ [project.urls]
53
+ Homepage = "https://github.com/deghosal-2026/CauterRule"
54
+ Repository = "https://github.com/deghosal-2026/CauterRule.git"
55
+ Issues = "https://github.com/deghosal-2026/CauterRule/issues"
56
+
57
+ [project.scripts]
58
+ cauterule = "cauterule.cli.app:main"
59
+
60
+ [tool.setuptools.packages.find]
61
+ where = ["src"]
62
+
63
+ [tool.ruff]
64
+ line-length = 100
65
+ target-version = "py311"
66
+ src = ["src", "tests"]
67
+
68
+ [tool.ruff.lint]
69
+ select = ["E", "F", "W", "I", "N", "UP", "B", "C4", "SIM", "RET", "ARG", "PTH", "TRY", "ANN", "D", "RUF"]
70
+ ignore = []
71
+
72
+ [tool.ruff.lint.pydocstyle]
73
+ convention = "google"
74
+
75
+ [tool.ruff.lint.per-file-ignores]
76
+ "tests/**" = ["D", "ANN", "S101", "ARG", "PLR2004", "TRY003", "E501", "RUF043"]
77
+ "src/cauterule/models/**" = ["D105", "TRY003"]
78
+ "src/cauterule/config.py" = ["TRY003", "TRY004", "E501"]
79
+ "src/cauterule/serialization/**" = ["TRY003", "TRY004"]
80
+ "src/cauterule/llm/**" = ["TRY003", "E501", "ANN401", "D"]
81
+ "src/cauterule/capture/**" = ["ANN401", "D", "TRY003", "TRY004", "TRY300", "UP", "SIM", "I", "RUF"]
82
+ "src/cauterule/adapter/**" = ["ANN401", "D", "D301", "UP035", "TRY300", "TRY003", "E501"]
83
+ "src/cauterule/redaction/**" = ["ANN401", "D", "E501", "SIM", "TRY003", "TRY004"]
84
+ "src/cauterule/extraction/**" = ["ANN401", "D", "TRY003", "TRY004", "TRY300", "SIM", "E501", "B007", "I001", "ARG001"]
85
+ "src/cauterule/replay/**" = ["ANN401", "D", "SIM", "RUF", "ARG001", "TRY003", "E501"]
86
+ "src/cauterule/linter/**" = ["ANN401", "D", "TRY003", "E501", "W292"]
87
+ "src/cauterule/promotion/**" = ["ANN401", "D", "TRY003", "E501", "W292"]
88
+ "src/cauterule/packs/**" = ["D105", "TRY003", "TRY004", "ANN401"]
89
+ "src/cauterule/injection/**" = ["ANN401", "D", "TRY003", "E501"]
90
+ "src/cauterule/observe/**" = ["D", "TRY003", "E501"]
91
+ "src/cauterule/loop/**" = ["ANN401", "D", "TRY003", "E501"]
92
+ "src/cauterule/corpus/**" = ["D105", "D107", "TRY003", "E501", "ANN401", "ARG001"]
93
+ "src/cauterule/cli/**" = ["D"]
94
+ "src/cauterule/benchmark/**" = ["D", "TRY003", "E501", "W292"]
95
+ "src/cauterule/integrations/**" = ["D", "TRY003", "E501"]
96
+ "src/cauterule/tui/**" = ["D"]
97
+
98
+ [tool.mypy]
99
+ strict = true
100
+ python_version = "3.11"
101
+ files = ["src", "tests"]
102
+ ignore_missing_imports = true
103
+ disallow_untyped_defs = true
104
+ warn_return_any = true
105
+ warn_unused_configs = true
106
+
107
+ [[tool.mypy.overrides]]
108
+ module = ["yaml"]
109
+ ignore_missing_imports = true
110
+
111
+ [tool.pytest.ini_options]
112
+ testpaths = ["tests"]
113
+ addopts = "-q --strict-config --strict-markers"
114
+ markers = [
115
+ "slow: marks tests as slow",
116
+ "docker: marks tests that require Docker",
117
+ ]
118
+
119
+ [tool.coverage.run]
120
+ source = ["cauterule"]
121
+ branch = true
122
+ omit = ["*/tui/*"]
123
+
124
+ [tool.coverage.report]
125
+ fail_under = 95
126
+ show_missing = true
127
+ skip_covered = false
128
+ exclude_also = [
129
+ "if TYPE_CHECKING:",
130
+ "raise NotImplementedError",
131
+ "@abstractmethod",
132
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,10 @@
1
+ """CauterRule — Automated standing-rule extraction from agent failures."""
2
+
3
+ from importlib.metadata import version as _version
4
+
5
+ try:
6
+ __version__ = _version("cauterule")
7
+ except Exception:
8
+ __version__ = "0.1.0"
9
+
10
+ __all__ = ["__version__"]