invar-tools 1.0.0__tar.gz → 1.3.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 (243) hide show
  1. {invar_tools-1.0.0 → invar_tools-1.3.0}/.aider.conf.yml +5 -7
  2. invar_tools-1.3.0/.claude/commands/audit.md +138 -0
  3. invar_tools-1.3.0/.claude/commands/guard.md +77 -0
  4. invar_tools-1.3.0/.claude/skills/develop/SKILL.md +583 -0
  5. invar_tools-1.3.0/.claude/skills/investigate/SKILL.md +187 -0
  6. invar_tools-1.3.0/.claude/skills/propose/SKILL.md +209 -0
  7. invar_tools-1.3.0/.claude/skills/review/SKILL.md +251 -0
  8. {invar_tools-1.0.0 → invar_tools-1.3.0}/.cursorrules +1 -1
  9. {invar_tools-1.0.0 → invar_tools-1.3.0}/.github/workflows/publish.yml +31 -0
  10. {invar_tools-1.0.0 → invar_tools-1.3.0}/.invar/context.md +328 -7
  11. invar_tools-1.3.0/.invar/examples/conftest.py +3 -0
  12. {invar_tools-1.0.0/src/invar/templates → invar_tools-1.3.0/.invar}/examples/contracts.py +4 -2
  13. {invar_tools-1.0.0/src/invar/templates → invar_tools-1.3.0/.invar}/examples/core_shell.py +10 -4
  14. invar_tools-1.3.0/.invar/examples/workflow.md +159 -0
  15. invar_tools-1.3.0/.invar/project-additions.md +45 -0
  16. {invar_tools-1.0.0 → invar_tools-1.3.0}/.pre-commit-config.yaml +2 -10
  17. invar_tools-1.3.0/CLAUDE.md +239 -0
  18. invar_tools-1.3.0/INVAR.md +210 -0
  19. invar_tools-1.3.0/LICENSE +190 -0
  20. invar_tools-1.3.0/LICENSE-GPL +674 -0
  21. invar_tools-1.3.0/NOTICE +63 -0
  22. invar_tools-1.3.0/PKG-INFO +377 -0
  23. invar_tools-1.3.0/README.md +336 -0
  24. invar_tools-1.0.0/docs/AGENTS.md → invar_tools-1.3.0/docs/agents.md +111 -1
  25. invar_tools-1.0.0/docs/DESIGN.md → invar_tools-1.3.0/docs/design.md +92 -66
  26. invar_tools-1.0.0/docs/INVAR-GUIDE.md → invar_tools-1.3.0/docs/guide.md +1 -1
  27. invar_tools-1.0.0/docs/feedback/INVAR-COMPLIANCE-ANALYSIS.md → invar_tools-1.3.0/docs/history/feedback/compliance-analysis.md +2 -0
  28. invar_tools-1.3.0/docs/history/feedback/feedback-memo.md +459 -0
  29. invar_tools-1.3.0/docs/history/feedback/index.md +11 -0
  30. invar_tools-1.3.0/docs/history/index.md +22 -0
  31. {invar_tools-1.0.0 → invar_tools-1.3.0}/docs/index.html +54 -45
  32. invar_tools-1.3.0/docs/proposals/DX-23-entry-point-detection.md +479 -0
  33. invar_tools-1.3.0/docs/proposals/DX-25-functional-patterns.md +821 -0
  34. invar_tools-1.3.0/docs/proposals/DX-29-pure-content-detection.md +140 -0
  35. invar_tools-1.3.0/docs/proposals/DX-37-coverage-integration.md +322 -0
  36. invar_tools-1.3.0/docs/proposals/DX-38-contract-quality-rules.md +285 -0
  37. invar_tools-1.3.0/docs/proposals/DX-39-workflow-efficiency.md +294 -0
  38. invar_tools-1.3.0/docs/proposals/DX-40-smart-tool-redirect-hook.md +147 -0
  39. invar_tools-1.3.0/docs/proposals/DX-41-automatic-review-orchestration.md +212 -0
  40. invar_tools-1.3.0/docs/proposals/DX-42-workflow-auto-routing.md +325 -0
  41. invar_tools-1.3.0/docs/proposals/DX-43-cross-platform-distribution.md +68 -0
  42. invar_tools-1.3.0/docs/proposals/DX-46-documentation-audit.md +142 -0
  43. invar_tools-1.3.0/docs/proposals/DX-48-code-structure-reorganization.md +498 -0
  44. invar_tools-1.3.0/docs/proposals/DX-49-protocol-distribution-unification.md +741 -0
  45. invar_tools-1.3.0/docs/proposals/DX-50-workflow-enforcement.md +119 -0
  46. invar_tools-1.3.0/docs/proposals/DX-51-workflow-phase-visibility.md +250 -0
  47. invar_tools-1.3.0/docs/proposals/DX-52-venv-dependency-injection.md +836 -0
  48. invar_tools-1.3.0/docs/proposals/DX-53-review-loop-effectiveness.md +420 -0
  49. invar_tools-1.3.0/docs/proposals/DX-54-agent-native-context-management.md +214 -0
  50. invar_tools-1.3.0/docs/proposals/DX-55-claude-init-conflict-resolution.md +792 -0
  51. invar_tools-1.3.0/docs/proposals/DX-56-template-sync-unification.md +542 -0
  52. invar_tools-1.3.0/docs/proposals/LX-01-multi-language-feasibility.md +494 -0
  53. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-11-documentation-restructure.md +14 -1
  54. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-16-agent-tool-enforcement.md +16 -1
  55. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-17-workflow-enforcement.md +6 -1
  56. invar_tools-1.3.0/docs/proposals/completed/DX-22-verification-strategy.md +752 -0
  57. invar_tools-1.3.0/docs/proposals/completed/DX-24-mechanism-documentation.md +823 -0
  58. invar_tools-1.3.0/docs/proposals/completed/DX-26-guard-simplification.md +506 -0
  59. invar_tools-1.3.0/docs/proposals/completed/DX-27-system-prompt-protocol.md +190 -0
  60. invar_tools-1.3.0/docs/proposals/completed/DX-28-semantic-verification.md +784 -0
  61. invar_tools-1.3.0/docs/proposals/completed/DX-30-visible-workflow.md +517 -0
  62. invar_tools-1.3.0/docs/proposals/completed/DX-31-adversarial-reviewer.md +742 -0
  63. invar_tools-1.3.0/docs/proposals/completed/DX-32-workflow-iteration.md +338 -0
  64. invar_tools-1.3.0/docs/proposals/completed/DX-33-verification-blind-spots.md +381 -0
  65. invar_tools-1.3.0/docs/proposals/completed/DX-34-review-cycle.md +255 -0
  66. invar_tools-1.3.0/docs/proposals/completed/DX-35-workflow-phase-separation.md +1276 -0
  67. invar_tools-1.3.0/docs/proposals/completed/DX-36-documentation-restructuring.md +855 -0
  68. invar_tools-1.3.0/docs/proposals/completed/DX-45-template-consistency.md +282 -0
  69. invar_tools-1.3.0/docs/proposals/completed/DX-47-command-skill-naming.md +210 -0
  70. invar_tools-1.3.0/docs/proposals/index.md +287 -0
  71. invar_tools-1.3.0/docs/reference/architecture/index.md +134 -0
  72. invar_tools-1.3.0/docs/reference/contracts/advanced.md +100 -0
  73. invar_tools-1.3.0/docs/reference/contracts/completeness.md +265 -0
  74. invar_tools-1.3.0/docs/reference/contracts/doctests.md +341 -0
  75. invar_tools-1.3.0/docs/reference/contracts/index.md +54 -0
  76. invar_tools-1.3.0/docs/reference/contracts/pre-post.md +304 -0
  77. invar_tools-1.3.0/docs/reference/documentation.md +186 -0
  78. invar_tools-1.3.0/docs/reference/index.md +56 -0
  79. invar_tools-1.3.0/docs/reference/proposal-workflow.md +229 -0
  80. invar_tools-1.3.0/docs/reference/rules/index.md +150 -0
  81. invar_tools-1.3.0/docs/reference/rules/severity.md +251 -0
  82. invar_tools-1.3.0/docs/reference/verification/crosshair-vs-hypothesis.md +147 -0
  83. invar_tools-1.3.0/docs/reference/verification/index.md +152 -0
  84. invar_tools-1.3.0/docs/reference/verification/smart-routing.md +178 -0
  85. invar_tools-1.3.0/docs/reference/workflow/index.md +44 -0
  86. invar_tools-1.3.0/docs/reference/workflow/session-start.md +228 -0
  87. invar_tools-1.3.0/docs/reference/workflow/usbv.md +338 -0
  88. invar_tools-1.3.0/docs/test-reports/DX-55-test-report.md +172 -0
  89. invar_tools-1.3.0/docs/test-reports/DX-56-test-report.md +209 -0
  90. invar_tools-1.0.0/docs/VISION.md → invar_tools-1.3.0/docs/vision.md +9 -8
  91. {invar_tools-1.0.0 → invar_tools-1.3.0}/pyproject.toml +15 -11
  92. invar_tools-1.3.0/runtime/LICENSE +190 -0
  93. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/README.md +23 -2
  94. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/pyproject.toml +3 -3
  95. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/src/invar_runtime/__init__.py +7 -0
  96. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/src/invar_runtime/contracts.py +31 -1
  97. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/src/invar_runtime/decorators.py +37 -14
  98. {invar_tools-1.0.0/src/invar → invar_tools-1.3.0/runtime/src/invar_runtime}/invariant.py +4 -0
  99. invar_tools-1.3.0/runtime/src/invar_runtime/relations.py +190 -0
  100. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/__init__.py +1 -0
  101. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/contracts.py +80 -10
  102. invar_tools-1.3.0/src/invar/core/entry_points.py +367 -0
  103. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/extraction.py +5 -6
  104. invar_tools-1.3.0/src/invar/core/format_specs.py +195 -0
  105. invar_tools-1.3.0/src/invar/core/format_strategies.py +197 -0
  106. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/formatter.py +32 -10
  107. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/hypothesis_strategies.py +50 -10
  108. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/inspect.py +1 -1
  109. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/lambda_helpers.py +3 -2
  110. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/models.py +30 -18
  111. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/must_use.py +2 -1
  112. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/parser.py +13 -6
  113. invar_tools-1.3.0/src/invar/core/postcondition_scope.py +128 -0
  114. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/property_gen.py +86 -42
  115. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/purity.py +13 -7
  116. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/purity_heuristics.py +5 -9
  117. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/references.py +8 -6
  118. invar_tools-1.3.0/src/invar/core/review_trigger.py +370 -0
  119. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/rule_meta.py +69 -2
  120. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/rules.py +91 -28
  121. invar_tools-1.3.0/src/invar/core/shell_analysis.py +247 -0
  122. invar_tools-1.3.0/src/invar/core/shell_architecture.py +171 -0
  123. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/strategies.py +7 -14
  124. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/suggestions.py +92 -0
  125. invar_tools-1.3.0/src/invar/core/sync_helpers.py +238 -0
  126. invar_tools-1.3.0/src/invar/core/tautology.py +203 -0
  127. invar_tools-1.3.0/src/invar/core/template_parser.py +467 -0
  128. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/timeout_inference.py +4 -7
  129. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/utils.py +63 -18
  130. invar_tools-1.3.0/src/invar/core/verification_routing.py +155 -0
  131. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/mcp/server.py +113 -13
  132. invar_tools-1.3.0/src/invar/shell/commands/__init__.py +11 -0
  133. invar_tools-1.0.0/src/invar/shell/cli.py → invar_tools-1.3.0/src/invar/shell/commands/guard.py +152 -44
  134. invar_tools-1.0.0/src/invar/shell/init_cmd.py → invar_tools-1.3.0/src/invar/shell/commands/init.py +200 -28
  135. invar_tools-1.3.0/src/invar/shell/commands/merge.py +256 -0
  136. invar_tools-1.3.0/src/invar/shell/commands/mutate.py +184 -0
  137. {invar_tools-1.0.0/src/invar/shell → invar_tools-1.3.0/src/invar/shell/commands}/perception.py +2 -0
  138. invar_tools-1.3.0/src/invar/shell/commands/sync_self.py +113 -0
  139. invar_tools-1.3.0/src/invar/shell/commands/template_sync.py +366 -0
  140. invar_tools-1.0.0/src/invar/shell/test_cmd.py → invar_tools-1.3.0/src/invar/shell/commands/test.py +3 -1
  141. invar_tools-1.3.0/src/invar/shell/commands/update.py +48 -0
  142. invar_tools-1.3.0/src/invar/shell/config.py +485 -0
  143. invar_tools-1.3.0/src/invar/shell/coverage.py +351 -0
  144. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/fs.py +5 -2
  145. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/git.py +2 -0
  146. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/guard_helpers.py +116 -20
  147. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/guard_output.py +106 -24
  148. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/mcp_config.py +3 -0
  149. invar_tools-1.3.0/src/invar/shell/mutation.py +314 -0
  150. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/property_tests.py +75 -24
  151. invar_tools-1.3.0/src/invar/shell/prove/__init__.py +9 -0
  152. invar_tools-1.3.0/src/invar/shell/prove/accept.py +113 -0
  153. invar_tools-1.0.0/src/invar/shell/prove.py → invar_tools-1.3.0/src/invar/shell/prove/crosshair.py +69 -30
  154. invar_tools-1.3.0/src/invar/shell/prove/hypothesis.py +293 -0
  155. invar_tools-1.3.0/src/invar/shell/subprocess_env.py +393 -0
  156. invar_tools-1.3.0/src/invar/shell/template_engine.py +345 -0
  157. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/templates.py +53 -0
  158. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/testing.py +77 -37
  159. invar_tools-1.3.0/src/invar/templates/CLAUDE.md.template +135 -0
  160. invar_tools-1.3.0/src/invar/templates/aider.conf.yml.template +31 -0
  161. invar_tools-1.3.0/src/invar/templates/commands/audit.md +138 -0
  162. invar_tools-1.3.0/src/invar/templates/commands/guard.md +77 -0
  163. invar_tools-1.3.0/src/invar/templates/config/CLAUDE.md.jinja +206 -0
  164. invar_tools-1.3.0/src/invar/templates/config/context.md.jinja +92 -0
  165. invar_tools-1.3.0/src/invar/templates/config/pre-commit.yaml.jinja +44 -0
  166. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/templates/context.md.template +33 -0
  167. invar_tools-1.3.0/src/invar/templates/cursorrules.template +40 -0
  168. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/templates/examples/README.md +2 -0
  169. invar_tools-1.3.0/src/invar/templates/examples/conftest.py +3 -0
  170. {invar_tools-1.0.0/.invar → invar_tools-1.3.0/src/invar/templates}/examples/contracts.py +4 -2
  171. {invar_tools-1.0.0/.invar → invar_tools-1.3.0/src/invar/templates}/examples/core_shell.py +10 -4
  172. invar_tools-1.3.0/src/invar/templates/examples/workflow.md +81 -0
  173. invar_tools-1.3.0/src/invar/templates/manifest.toml +137 -0
  174. invar_tools-1.3.0/src/invar/templates/protocol/INVAR.md +210 -0
  175. invar_tools-1.3.0/src/invar/templates/skills/develop/SKILL.md.jinja +318 -0
  176. invar_tools-1.3.0/src/invar/templates/skills/investigate/SKILL.md.jinja +106 -0
  177. invar_tools-1.3.0/src/invar/templates/skills/propose/SKILL.md.jinja +104 -0
  178. invar_tools-1.3.0/src/invar/templates/skills/review/SKILL.md.jinja +125 -0
  179. {invar_tools-1.0.0 → invar_tools-1.3.0}/tests/integration/test_cli_flags.py +6 -4
  180. invar_tools-1.3.0/tests/integration/test_dx55_regression.py +404 -0
  181. invar_tools-1.3.0/tests/integration/test_dx56_sync.py +229 -0
  182. invar_tools-1.3.0/tests/test_subprocess_env.py +290 -0
  183. invar_tools-1.3.0/uv.lock +1472 -0
  184. invar_tools-1.0.0/.claude/commands/attack.md +0 -76
  185. invar_tools-1.0.0/.claude/commands/review.md +0 -67
  186. invar_tools-1.0.0/CLAUDE.md +0 -233
  187. invar_tools-1.0.0/INVAR.md +0 -335
  188. invar_tools-1.0.0/LICENSE +0 -21
  189. invar_tools-1.0.0/PKG-INFO +0 -321
  190. invar_tools-1.0.0/README.md +0 -284
  191. invar_tools-1.0.0/RELEASE_NOTES_v0.1.0.md +0 -102
  192. invar_tools-1.0.0/docs/archive/FIRST_PRINCIPLES_REVIEW.md +0 -307
  193. invar_tools-1.0.0/docs/archive/INVAR-DETAILED-v3.16.md +0 -1296
  194. invar_tools-1.0.0/docs/archive/PHASE3_REVIEW.md +0 -347
  195. invar_tools-1.0.0/docs/archive/proposals-P15-P23-2025.md +0 -1573
  196. invar_tools-1.0.0/docs/archive/proposals-phase9-reflection-2025.md +0 -523
  197. invar_tools-1.0.0/runtime/src/invar_runtime/invariant.py +0 -57
  198. invar_tools-1.0.0/src/invar/contracts.py +0 -152
  199. invar_tools-1.0.0/src/invar/core/tautology.py +0 -137
  200. invar_tools-1.0.0/src/invar/decorators.py +0 -94
  201. invar_tools-1.0.0/src/invar/resource.py +0 -99
  202. invar_tools-1.0.0/src/invar/shell/config.py +0 -248
  203. invar_tools-1.0.0/src/invar/shell/prove_fallback.py +0 -183
  204. invar_tools-1.0.0/src/invar/shell/update_cmd.py +0 -191
  205. invar_tools-1.0.0/src/invar/templates/CLAUDE.md.template +0 -58
  206. invar_tools-1.0.0/src/invar/templates/INVAR.md +0 -134
  207. invar_tools-1.0.0/src/invar/templates/aider.conf.yml.template +0 -29
  208. invar_tools-1.0.0/src/invar/templates/cursorrules.template +0 -28
  209. {invar_tools-1.0.0 → invar_tools-1.3.0}/.github/workflows/ci.yml +0 -0
  210. {invar_tools-1.0.0 → invar_tools-1.3.0}/.gitignore +0 -0
  211. {invar_tools-1.0.0 → invar_tools-1.3.0}/.invar/examples/README.md +0 -0
  212. {invar_tools-1.0.0 → invar_tools-1.3.0}/.invar/proposals/TEMPLATE.md +0 -0
  213. {invar_tools-1.0.0 → invar_tools-1.3.0}/.mcp.json +0 -0
  214. {invar_tools-1.0.0 → invar_tools-1.3.0}/.serena/.gitignore +0 -0
  215. {invar_tools-1.0.0 → invar_tools-1.3.0}/.serena/project.yml +0 -0
  216. {invar_tools-1.0.0/docs/archive → invar_tools-1.3.0/docs/history}/decisions-2024.md +0 -0
  217. /invar_tools-1.0.0/docs/archive/VISION-ORIGINAL.md → /invar_tools-1.3.0/docs/history/original-vision.md +0 -0
  218. /invar_tools-1.0.0/docs/archive/PROTOCOL_EVOLUTION.md → /invar_tools-1.3.0/docs/history/protocol-evolution.md +0 -0
  219. {invar_tools-1.0.0/docs → invar_tools-1.3.0/docs/history}/research/cruxeval-quick-validation.md +0 -0
  220. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2024-12-21-guard-enhancements.md +0 -0
  221. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2024-12-21-language-inspired-enhancements.md +0 -0
  222. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2024-12-21-test-first-enhancement.md +0 -0
  223. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2025-12-21-dx-improvements.md +0 -0
  224. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2025-12-23-dx-20-property-testing-enhancements.md +0 -0
  225. {invar_tools-1.0.0/docs/proposals → invar_tools-1.3.0/docs/proposals/completed}/2025-12-23-dx-21-package-and-init.md +0 -0
  226. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/AGENT-IMPROVEMENTS.md +0 -0
  227. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-12-hypothesis-fallback.md +0 -0
  228. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-13-incremental-prove.md +0 -0
  229. {invar_tools-1.0.0/.invar/proposals → invar_tools-1.3.0/docs/proposals/completed}/DX-14-expanded-prove-usage.md +0 -0
  230. {invar_tools-1.0.0 → invar_tools-1.3.0}/runtime/src/invar_runtime/resource.py +0 -0
  231. {invar_tools-1.0.0 → invar_tools-1.3.0}/scripts/smart-guard.sh +0 -0
  232. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/core/__init__.py +0 -0
  233. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/mcp/__init__.py +0 -0
  234. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/mcp/__main__.py +0 -0
  235. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/py.typed +0 -0
  236. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/shell/__init__.py +0 -0
  237. /invar_tools-1.0.0/src/invar/shell/prove_cache.py → /invar_tools-1.3.0/src/invar/shell/prove/cache.py +0 -0
  238. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/templates/__init__.py +0 -0
  239. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/templates/pre-commit-config.yaml.template +0 -0
  240. {invar_tools-1.0.0 → invar_tools-1.3.0}/src/invar/templates/proposal.md.template +0 -0
  241. {invar_tools-1.0.0 → invar_tools-1.3.0}/tests/__init__.py +0 -0
  242. {invar_tools-1.0.0 → invar_tools-1.3.0}/tests/conftest.py +0 -0
  243. {invar_tools-1.0.0 → invar_tools-1.3.0}/tests/integration/__init__.py +0 -0
@@ -15,13 +15,11 @@ system-prompt: |
15
15
  1. invar guard --changed
16
16
  2. invar map --top 10
17
17
 
18
- Workflow (ICIDIV):
19
- - Intent: What? Core or Shell?
20
- - Contract: @pre/@post + doctests BEFORE code
21
- - Inspect: invar sig <file>
22
- - Design: Decompose first
23
- - Implement: Pass your doctests
24
- - Verify: invar guard
18
+ Workflow (USBV):
19
+ - Understand: Intent, Inspect (invar sig), Constraints
20
+ - Specify: @pre/@post + doctests, Design decomposition
21
+ - Build: Implement leaves first, Compose
22
+ - Validate: invar guard, Integrate, Reflect
25
23
 
26
24
  Project-specific:
27
25
  - INVAR.md here is the SOURCE, templates are in src/invar/templates/
@@ -0,0 +1,138 @@
1
+ # Audit
2
+
3
+ Read-only code review. Reports issues without fixing them.
4
+
5
+ ---
6
+
7
+ ## Behavior
8
+
9
+ 1. Analyze code for issues (style, bugs, security, architecture)
10
+ 2. Report findings with file:line references
11
+ 3. **Do NOT make any changes** - report only
12
+
13
+ ---
14
+
15
+ ## Adversarial Reviewer Persona
16
+
17
+ You are an **adversarial code reviewer**. Your job is to FIND PROBLEMS.
18
+
19
+ ### Your Mindset
20
+
21
+ Assume:
22
+ - The code has bugs until proven otherwise
23
+ - The contracts may be meaningless ceremony
24
+ - The implementer may have rationalized poor decisions
25
+ - Escape hatches may be abused
26
+
27
+ You are NOT here to:
28
+ - Validate that code works
29
+ - Confirm the implementer did a good job
30
+ - Be nice or diplomatic
31
+
32
+ You ARE here to:
33
+ - Find bugs, logic errors, edge cases
34
+ - Challenge whether contracts have semantic value
35
+ - Identify code smells and duplication
36
+ - Question every escape hatch
37
+ - Check if code matches contracts (not if code "seems right")
38
+
39
+ **Your success is measured by problems found, not code approved.**
40
+
41
+ ---
42
+
43
+ ## Review Checklist
44
+
45
+ > **Principle:** Only items requiring semantic judgment. Mechanical checks are excluded (see bottom).
46
+
47
+ ### A. Contract Semantic Value
48
+ - [ ] Does @pre constrain inputs beyond type checking?
49
+ - Bad: `@pre(lambda x: isinstance(x, int))`
50
+ - Good: `@pre(lambda x: x > 0 and x < MAX_VALUE)`
51
+ - [ ] Does @post verify meaningful output properties?
52
+ - Bad: `@post(lambda result: result is not None)`
53
+ - Good: `@post(lambda result: len(result) == len(input))`
54
+ - [ ] Could someone implement correctly from contracts alone?
55
+ - [ ] Are boundary conditions explicit in contracts?
56
+
57
+ ### B. Doctest Coverage
58
+ - [ ] Do doctests cover normal cases?
59
+ - [ ] Do doctests cover boundary cases?
60
+ - [ ] Do doctests cover error cases?
61
+ - [ ] Are doctests testing behavior, not just syntax?
62
+
63
+ ### C. Code Quality
64
+ - [ ] Is duplicated code worth extracting?
65
+ - [ ] Is naming consistent and clear?
66
+ - [ ] Is complexity justified?
67
+
68
+ ### D. Escape Hatch Audit
69
+ - [ ] Is each @invar:allow justification valid?
70
+ - [ ] Could refactoring eliminate the need?
71
+ - [ ] Is there a pattern suggesting systematic issues?
72
+
73
+ ### E. Logic Verification
74
+ - [ ] Do contracts correctly capture intended behavior?
75
+ - [ ] Are there paths that bypass contract checks?
76
+ - [ ] Are there implicit assumptions not in contracts?
77
+ - [ ] What happens with unexpected inputs?
78
+
79
+ ### F. Security
80
+ - [ ] Are inputs validated against security threats (injection, XSS)?
81
+ - [ ] No hardcoded secrets (API keys, passwords, tokens)?
82
+ - [ ] Are authentication/authorization checks correct?
83
+ - [ ] Is sensitive data properly protected?
84
+
85
+ ### G. Error Handling & Observability
86
+ - [ ] Are exceptions caught at appropriate level?
87
+ - [ ] Are error messages clear without leaking sensitive info?
88
+ - [ ] Are critical operations logged for debugging?
89
+ - [ ] Is there graceful degradation on failure?
90
+
91
+ ---
92
+
93
+ ## Excluded (Covered by Guard)
94
+
95
+ These are checked by Guard or linters - don't duplicate:
96
+ - Core/Shell separation → Guard (forbidden_import, impure_call)
97
+ - Shell returns Result[T,E] → Guard (shell_result)
98
+ - Missing contracts → Guard (missing_contract)
99
+ - File/function size limits → Guard (file_size, function_size)
100
+ - Entry point thickness → Guard (entry_point_too_thick)
101
+ - Escape hatch count → Guard (review_suggested)
102
+
103
+ ---
104
+
105
+ ## Report Format
106
+
107
+ For each issue found, use severity levels:
108
+
109
+ | Severity | Meaning |
110
+ |----------|---------|
111
+ | **CRITICAL** | Must fix before completion |
112
+ | **MAJOR** | Fix or provide written justification |
113
+ | **MINOR** | Optional, can defer |
114
+
115
+ ```markdown
116
+ ### [CRITICAL/MAJOR/MINOR] Issue Title
117
+
118
+ **Location:** file.py:line_number
119
+ **Category:** contract_quality | logic_error | security | escape_hatch | code_smell
120
+ **Problem:** What's wrong
121
+ **Suggestion:** How to fix (but don't implement)
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Instructions
127
+
128
+ 1. Run `invar guard --changed` to see current state
129
+ 2. Go through each checklist category
130
+ 3. For each issue, determine severity (CRITICAL/MAJOR/MINOR)
131
+ 4. Report with structured format above
132
+ 5. Be thorough and adversarial
133
+
134
+ **Remember:** You are READ-ONLY. Report issues, don't fix them.
135
+
136
+ ---
137
+
138
+ Now review the recent changes or the files specified by the user.
@@ -0,0 +1,77 @@
1
+ # Guard
2
+
3
+ Run Invar verification on the project and report results.
4
+
5
+ ---
6
+
7
+ ## Behavior
8
+
9
+ Execute `invar_guard()` and report:
10
+ - Pass/fail status
11
+ - Error count with details
12
+ - Warning count with details
13
+
14
+ **Do NOT fix issues** - just report verification results.
15
+
16
+ ---
17
+
18
+ ## When to Use
19
+
20
+ - Quick verification check
21
+ - Before committing changes
22
+ - After pulling changes
23
+ - To see current project health
24
+
25
+ ---
26
+
27
+ ## Execution
28
+
29
+ Run verification:
30
+
31
+ ```
32
+ invar_guard(changed=true)
33
+ ```
34
+
35
+ Or for full project verification:
36
+
37
+ ```
38
+ invar_guard()
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Report Format
44
+
45
+ ```
46
+ ## Guard Results
47
+
48
+ **Status:** PASS / FAIL
49
+ **Errors:** N
50
+ **Warnings:** N
51
+
52
+ ### Errors (if any)
53
+
54
+ | Rule | File | Line | Message |
55
+ |------|------|------|---------|
56
+ | missing_contract | src/foo.py | 42 | Function 'bar' has no @pre/@post |
57
+
58
+ ### Warnings (if any)
59
+
60
+ | Rule | File | Line | Message |
61
+ |------|------|------|---------|
62
+ | function_size | src/baz.py | 15 | Function exceeds 50 lines |
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Next Steps
68
+
69
+ After reporting results:
70
+ - If PASS: No action needed
71
+ - If FAIL: User decides whether to fix issues
72
+
73
+ **Remember:** You are READ-ONLY. Report results, don't fix them.
74
+
75
+ ---
76
+
77
+ Now run verification on the current project.