invar-tools 1.17.1__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 (546) hide show
  1. invar_tools-1.17.1/.aider.conf.yml +27 -0
  2. invar_tools-1.17.1/.claude/commands/audit.md +144 -0
  3. invar_tools-1.17.1/.claude/commands/guard.md +83 -0
  4. invar_tools-1.17.1/.claude/hooks/PostToolUse.sh +10 -0
  5. invar_tools-1.17.1/.claude/hooks/PreToolUse.sh +10 -0
  6. invar_tools-1.17.1/.claude/hooks/Stop.sh +10 -0
  7. invar_tools-1.17.1/.claude/hooks/UserPromptSubmit.sh +10 -0
  8. invar_tools-1.17.1/.claude/hooks/invar.PostToolUse.sh +102 -0
  9. invar_tools-1.17.1/.claude/hooks/invar.PreToolUse.sh +74 -0
  10. invar_tools-1.17.1/.claude/hooks/invar.Stop.sh +23 -0
  11. invar_tools-1.17.1/.claude/hooks/invar.UserPromptSubmit.sh +387 -0
  12. invar_tools-1.17.1/.claude/skills/acceptance/SKILL.md +390 -0
  13. invar_tools-1.17.1/.claude/skills/develop/SKILL.md +434 -0
  14. invar_tools-1.17.1/.claude/skills/invar-onboard/SKILL.md +455 -0
  15. invar_tools-1.17.1/.claude/skills/invar-onboard/patterns/python.md +347 -0
  16. invar_tools-1.17.1/.claude/skills/invar-onboard/patterns/typescript.md +452 -0
  17. invar_tools-1.17.1/.claude/skills/invar-onboard/templates/assessment.md.jinja +214 -0
  18. invar_tools-1.17.1/.claude/skills/invar-onboard/templates/roadmap.md.jinja +168 -0
  19. invar_tools-1.17.1/.claude/skills/invar-reflect/CONFIG.md +355 -0
  20. invar_tools-1.17.1/.claude/skills/invar-reflect/SKILL.md +466 -0
  21. invar_tools-1.17.1/.claude/skills/invar-reflect/template.md +343 -0
  22. invar_tools-1.17.1/.claude/skills/investigate/SKILL.md +104 -0
  23. invar_tools-1.17.1/.claude/skills/propose/SKILL.md +129 -0
  24. invar_tools-1.17.1/.claude/skills/review/SKILL.md +325 -0
  25. invar_tools-1.17.1/.claude/skills/security/SKILL.md +389 -0
  26. invar_tools-1.17.1/.claude/skills/security/patterns/_common.yaml +126 -0
  27. invar_tools-1.17.1/.claude/skills/security/patterns/python.yaml +155 -0
  28. invar_tools-1.17.1/.claude/skills/security/patterns/typescript.yaml +194 -0
  29. invar_tools-1.17.1/.cursorrules +26 -0
  30. invar_tools-1.17.1/.github/workflows/ci.yml +109 -0
  31. invar_tools-1.17.1/.github/workflows/claude-code-review.yml +57 -0
  32. invar_tools-1.17.1/.github/workflows/claude.yml +50 -0
  33. invar_tools-1.17.1/.github/workflows/publish.yml +61 -0
  34. invar_tools-1.17.1/.gitignore +63 -0
  35. invar_tools-1.17.1/.invar/archive/sessions-2025-12.md +147 -0
  36. invar_tools-1.17.1/.invar/context.md +215 -0
  37. invar_tools-1.17.1/.invar/examples/README.md +25 -0
  38. invar_tools-1.17.1/.invar/examples/conftest.py +3 -0
  39. invar_tools-1.17.1/.invar/examples/contracts.py +190 -0
  40. invar_tools-1.17.1/.invar/examples/core_shell.py +227 -0
  41. invar_tools-1.17.1/.invar/examples/functional.py +613 -0
  42. invar_tools-1.17.1/.invar/examples/workflow.md +81 -0
  43. invar_tools-1.17.1/.invar/feedback/feedback-2026-01-03.md +190 -0
  44. invar_tools-1.17.1/.invar/mcp-setup.md +83 -0
  45. invar_tools-1.17.1/.invar/project-additions.md +45 -0
  46. invar_tools-1.17.1/.invar/proposals/TEMPLATE.md +93 -0
  47. invar_tools-1.17.1/.mcp.json +8 -0
  48. invar_tools-1.17.1/.pre-commit-config.yaml +47 -0
  49. invar_tools-1.17.1/.serena/.gitignore +1 -0
  50. invar_tools-1.17.1/.serena/project.yml +84 -0
  51. invar_tools-1.17.1/CHANGELOG.md +447 -0
  52. invar_tools-1.17.1/CLAUDE.md +462 -0
  53. invar_tools-1.17.1/INVAR.md +377 -0
  54. invar_tools-1.17.1/LICENSE +190 -0
  55. invar_tools-1.17.1/LICENSE-GPL +674 -0
  56. invar_tools-1.17.1/NOTICE +63 -0
  57. invar_tools-1.17.1/PKG-INFO +884 -0
  58. invar_tools-1.17.1/README.md +840 -0
  59. invar_tools-1.17.1/docs/.nojekyll +0 -0
  60. invar_tools-1.17.1/docs/agents.md +500 -0
  61. invar_tools-1.17.1/docs/design.md +1091 -0
  62. invar_tools-1.17.1/docs/diagrams.md +200 -0
  63. invar_tools-1.17.1/docs/guide.md +190 -0
  64. invar_tools-1.17.1/docs/guides/aider.md +475 -0
  65. invar_tools-1.17.1/docs/guides/cline.md +355 -0
  66. invar_tools-1.17.1/docs/guides/continue.md +466 -0
  67. invar_tools-1.17.1/docs/guides/cursor.md +442 -0
  68. invar_tools-1.17.1/docs/guides/multi-agent.md +323 -0
  69. invar_tools-1.17.1/docs/guides/pi.md +275 -0
  70. invar_tools-1.17.1/docs/history/decisions-2024.md +157 -0
  71. invar_tools-1.17.1/docs/history/feedback/compliance-analysis.md +503 -0
  72. invar_tools-1.17.1/docs/history/feedback/feedback-memo.md +459 -0
  73. invar_tools-1.17.1/docs/history/feedback/index.md +11 -0
  74. invar_tools-1.17.1/docs/history/index.md +22 -0
  75. invar_tools-1.17.1/docs/history/original-vision.md +190 -0
  76. invar_tools-1.17.1/docs/history/protocol-evolution.md +333 -0
  77. invar_tools-1.17.1/docs/history/research/cruxeval-quick-validation.md +145 -0
  78. invar_tools-1.17.1/docs/index.html +866 -0
  79. invar_tools-1.17.1/docs/logo.svg +8 -0
  80. invar_tools-1.17.1/docs/proposals/DX-23-entry-point-detection.md +479 -0
  81. invar_tools-1.17.1/docs/proposals/DX-25-functional-patterns.md +821 -0
  82. invar_tools-1.17.1/docs/proposals/DX-29-pure-content-detection.md +140 -0
  83. invar_tools-1.17.1/docs/proposals/DX-38-contract-quality-rules.md +285 -0
  84. invar_tools-1.17.1/docs/proposals/DX-60-structured-rules-ssot.md +416 -0
  85. invar_tools-1.17.1/docs/proposals/DX-61-functional-pattern-guidance.md +1139 -0
  86. invar_tools-1.17.1/docs/proposals/DX-61-implementation-design.md +1466 -0
  87. invar_tools-1.17.1/docs/proposals/DX-62-proactive-reference-reading.md +370 -0
  88. invar_tools-1.17.1/docs/proposals/DX-68-agent-behavior-optimization.md +299 -0
  89. invar_tools-1.17.1/docs/proposals/DX-74-experiment-report.md +1585 -0
  90. invar_tools-1.17.1/docs/proposals/DX-75-attention-aware-framework.md +959 -0
  91. invar_tools-1.17.1/docs/proposals/DX-78-mcp-protocol-sync.md +575 -0
  92. invar_tools-1.17.1/docs/proposals/DX-79-invar-usage-feedback.md +1114 -0
  93. invar_tools-1.17.1/docs/proposals/DX-80-guard-cli-mcp-alignment.md +504 -0
  94. invar_tools-1.17.1/docs/proposals/DX-81-multi-agent-init.md +836 -0
  95. invar_tools-1.17.1/docs/proposals/DX-83-multi-agent-subagent-support.md +1238 -0
  96. invar_tools-1.17.1/docs/proposals/DX-84-security-review-backlog.md +162 -0
  97. invar_tools-1.17.1/docs/proposals/LX-01-multi-language-feasibility.md +494 -0
  98. invar_tools-1.17.1/docs/proposals/LX-04-pi-agent-support.md +495 -0
  99. invar_tools-1.17.1/docs/proposals/LX-07-extension-skills.md +1561 -0
  100. invar_tools-1.17.1/docs/proposals/LX-08-extension-skills-future.md +67 -0
  101. invar_tools-1.17.1/docs/proposals/LX-09-legacy-onboarding.md +387 -0
  102. invar_tools-1.17.1/docs/proposals/LX-11-cursor-support.md +570 -0
  103. invar_tools-1.17.1/docs/proposals/LX-13-typescript-runtime-optimization.md +886 -0
  104. invar_tools-1.17.1/docs/proposals/LX-15-typescript-guard-parity.md +517 -0
  105. invar_tools-1.17.1/docs/proposals/LX-16-typescript-guard-remaining-gap.md +420 -0
  106. invar_tools-1.17.1/docs/proposals/completed/2024-12-21-guard-enhancements.md +589 -0
  107. invar_tools-1.17.1/docs/proposals/completed/2024-12-21-language-inspired-enhancements.md +4445 -0
  108. invar_tools-1.17.1/docs/proposals/completed/2024-12-21-test-first-enhancement.md +842 -0
  109. invar_tools-1.17.1/docs/proposals/completed/2025-12-21-dx-improvements.md +1297 -0
  110. invar_tools-1.17.1/docs/proposals/completed/2025-12-23-dx-20-property-testing-enhancements.md +575 -0
  111. invar_tools-1.17.1/docs/proposals/completed/2025-12-23-dx-21-package-and-init.md +401 -0
  112. invar_tools-1.17.1/docs/proposals/completed/AGENT-IMPROVEMENTS.md +94 -0
  113. invar_tools-1.17.1/docs/proposals/completed/DX-11-documentation-restructure.md +875 -0
  114. invar_tools-1.17.1/docs/proposals/completed/DX-12-hypothesis-fallback.md +305 -0
  115. invar_tools-1.17.1/docs/proposals/completed/DX-13-incremental-prove.md +462 -0
  116. invar_tools-1.17.1/docs/proposals/completed/DX-14-expanded-prove-usage.md +249 -0
  117. invar_tools-1.17.1/docs/proposals/completed/DX-16-agent-tool-enforcement.md +181 -0
  118. invar_tools-1.17.1/docs/proposals/completed/DX-17-workflow-enforcement.md +198 -0
  119. invar_tools-1.17.1/docs/proposals/completed/DX-22-verification-strategy.md +752 -0
  120. invar_tools-1.17.1/docs/proposals/completed/DX-24-mechanism-documentation.md +823 -0
  121. invar_tools-1.17.1/docs/proposals/completed/DX-26-guard-simplification.md +506 -0
  122. invar_tools-1.17.1/docs/proposals/completed/DX-27-system-prompt-protocol.md +190 -0
  123. invar_tools-1.17.1/docs/proposals/completed/DX-28-semantic-verification.md +784 -0
  124. invar_tools-1.17.1/docs/proposals/completed/DX-30-visible-workflow.md +517 -0
  125. invar_tools-1.17.1/docs/proposals/completed/DX-31-adversarial-reviewer.md +742 -0
  126. invar_tools-1.17.1/docs/proposals/completed/DX-32-workflow-iteration.md +338 -0
  127. invar_tools-1.17.1/docs/proposals/completed/DX-33-verification-blind-spots.md +381 -0
  128. invar_tools-1.17.1/docs/proposals/completed/DX-34-review-cycle.md +255 -0
  129. invar_tools-1.17.1/docs/proposals/completed/DX-35-workflow-phase-separation.md +1276 -0
  130. invar_tools-1.17.1/docs/proposals/completed/DX-36-documentation-restructuring.md +855 -0
  131. invar_tools-1.17.1/docs/proposals/completed/DX-37-coverage-integration.md +322 -0
  132. invar_tools-1.17.1/docs/proposals/completed/DX-39-workflow-efficiency.md +294 -0
  133. invar_tools-1.17.1/docs/proposals/completed/DX-40-smart-tool-redirect-hook.md +147 -0
  134. invar_tools-1.17.1/docs/proposals/completed/DX-41-automatic-review-orchestration.md +212 -0
  135. invar_tools-1.17.1/docs/proposals/completed/DX-42-workflow-auto-routing.md +325 -0
  136. invar_tools-1.17.1/docs/proposals/completed/DX-43-cross-platform-distribution.md +68 -0
  137. invar_tools-1.17.1/docs/proposals/completed/DX-45-template-consistency.md +282 -0
  138. invar_tools-1.17.1/docs/proposals/completed/DX-46-documentation-audit.md +142 -0
  139. invar_tools-1.17.1/docs/proposals/completed/DX-47-command-skill-naming.md +210 -0
  140. invar_tools-1.17.1/docs/proposals/completed/DX-48-code-structure-reorganization.md +498 -0
  141. invar_tools-1.17.1/docs/proposals/completed/DX-49-protocol-distribution-unification.md +741 -0
  142. invar_tools-1.17.1/docs/proposals/completed/DX-50-workflow-enforcement.md +122 -0
  143. invar_tools-1.17.1/docs/proposals/completed/DX-51-workflow-phase-visibility.md +250 -0
  144. invar_tools-1.17.1/docs/proposals/completed/DX-52-venv-dependency-injection.md +836 -0
  145. invar_tools-1.17.1/docs/proposals/completed/DX-53-review-loop-effectiveness.md +420 -0
  146. invar_tools-1.17.1/docs/proposals/completed/DX-54-agent-native-context-management.md +214 -0
  147. invar_tools-1.17.1/docs/proposals/completed/DX-55-claude-init-conflict-resolution.md +792 -0
  148. invar_tools-1.17.1/docs/proposals/completed/DX-56-template-sync-unification.md +542 -0
  149. invar_tools-1.17.1/docs/proposals/completed/DX-57-claude-code-hooks.md +802 -0
  150. invar_tools-1.17.1/docs/proposals/completed/DX-58-document-structure-optimization.md +453 -0
  151. invar_tools-1.17.1/docs/proposals/completed/DX-63-contracts-first-enforcement.md +512 -0
  152. invar_tools-1.17.1/docs/proposals/completed/DX-64-version-display-unification.md +104 -0
  153. invar_tools-1.17.1/docs/proposals/completed/DX-65-single-file-guard.md +157 -0
  154. invar_tools-1.17.1/docs/proposals/completed/DX-66-escape-hatch-visibility.md +154 -0
  155. invar_tools-1.17.1/docs/proposals/completed/DX-67-explicit-skill-invocation.md +208 -0
  156. invar_tools-1.17.1/docs/proposals/completed/DX-69-project-uninstall.md +181 -0
  157. invar_tools-1.17.1/docs/proposals/completed/DX-70-init-simplification.md +273 -0
  158. invar_tools-1.17.1/docs/proposals/completed/DX-70-review-isolation.md +185 -0
  159. invar_tools-1.17.1/docs/proposals/completed/DX-71-skill-command-simplification.md +152 -0
  160. invar_tools-1.17.1/docs/proposals/completed/DX-72-mandatory-self-review-detection.md +140 -0
  161. invar_tools-1.17.1/docs/proposals/completed/DX-74-tiered-attention-defense.md +913 -0
  162. invar_tools-1.17.1/docs/proposals/completed/DX-76-structured-document-query.md +451 -0
  163. invar_tools-1.17.1/docs/proposals/completed/DX-77-mcp-doc-tools-enhancements.md +404 -0
  164. invar_tools-1.17.1/docs/proposals/completed/LX-02-agent-portability-analysis.md +579 -0
  165. invar_tools-1.17.1/docs/proposals/completed/LX-03-multi-agent-support.md +60 -0
  166. invar_tools-1.17.1/docs/proposals/completed/LX-05-language-agnostic-protocol.md +1237 -0
  167. invar_tools-1.17.1/docs/proposals/completed/LX-06-appendix-guard-comparison.md +499 -0
  168. invar_tools-1.17.1/docs/proposals/completed/LX-06-typescript-tooling.md +956 -0
  169. invar_tools-1.17.1/docs/proposals/completed/LX-09-legacy-onboarding.md +1290 -0
  170. invar_tools-1.17.1/docs/proposals/completed/LX-10-typescript-size-limits.md +267 -0
  171. invar_tools-1.17.1/docs/proposals/completed/LX-12-typescript-contract-enforcement.md +612 -0
  172. invar_tools-1.17.1/docs/proposals/completed/LX-14-typescript-doctest-execution.md +368 -0
  173. invar_tools-1.17.1/docs/proposals/index.md +557 -0
  174. invar_tools-1.17.1/docs/reference/agent-information-hierarchy.md +268 -0
  175. invar_tools-1.17.1/docs/reference/architecture/index.md +134 -0
  176. invar_tools-1.17.1/docs/reference/contracts/advanced.md +100 -0
  177. invar_tools-1.17.1/docs/reference/contracts/completeness.md +265 -0
  178. invar_tools-1.17.1/docs/reference/contracts/doctests.md +341 -0
  179. invar_tools-1.17.1/docs/reference/contracts/index.md +54 -0
  180. invar_tools-1.17.1/docs/reference/contracts/pre-post.md +304 -0
  181. invar_tools-1.17.1/docs/reference/documentation.md +186 -0
  182. invar_tools-1.17.1/docs/reference/index.md +56 -0
  183. invar_tools-1.17.1/docs/reference/proposal-workflow.md +229 -0
  184. invar_tools-1.17.1/docs/reference/rules/index.md +150 -0
  185. invar_tools-1.17.1/docs/reference/rules/severity.md +251 -0
  186. invar_tools-1.17.1/docs/reference/verification/crosshair-vs-hypothesis.md +147 -0
  187. invar_tools-1.17.1/docs/reference/verification/index.md +152 -0
  188. invar_tools-1.17.1/docs/reference/verification/smart-routing.md +178 -0
  189. invar_tools-1.17.1/docs/reference/workflow/index.md +44 -0
  190. invar_tools-1.17.1/docs/reference/workflow/session-start.md +228 -0
  191. invar_tools-1.17.1/docs/reference/workflow/usbv.md +338 -0
  192. invar_tools-1.17.1/docs/rule-severity-comparison.md +389 -0
  193. invar_tools-1.17.1/docs/terminal-gif-guide.md +230 -0
  194. invar_tools-1.17.1/docs/test-reports/DX-55-test-report.md +172 -0
  195. invar_tools-1.17.1/docs/test-reports/DX-56-test-report.md +209 -0
  196. invar_tools-1.17.1/docs/test-reports/DX-58-test-scenario.md +165 -0
  197. invar_tools-1.17.1/docs/testing/v1.5.0-stress-test.md +255 -0
  198. invar_tools-1.17.1/docs/testing/v1.5.0-test-report.md +172 -0
  199. invar_tools-1.17.1/docs/testing/v1.5.0-workflow-compliance.md +167 -0
  200. invar_tools-1.17.1/docs/vision.md +290 -0
  201. invar_tools-1.17.1/pyproject.toml +253 -0
  202. invar_tools-1.17.1/runtime/LICENSE +190 -0
  203. invar_tools-1.17.1/runtime/README.md +108 -0
  204. invar_tools-1.17.1/runtime/pyproject.toml +51 -0
  205. invar_tools-1.17.1/runtime/src/invar_runtime/__init__.py +75 -0
  206. invar_tools-1.17.1/runtime/src/invar_runtime/contracts.py +249 -0
  207. invar_tools-1.17.1/runtime/src/invar_runtime/decorators.py +152 -0
  208. invar_tools-1.17.1/runtime/src/invar_runtime/invariant.py +61 -0
  209. invar_tools-1.17.1/runtime/src/invar_runtime/relations.py +190 -0
  210. invar_tools-1.17.1/runtime/src/invar_runtime/resource.py +99 -0
  211. invar_tools-1.17.1/scripts/embed_node_tools.py +348 -0
  212. invar_tools-1.17.1/scripts/smart-guard.sh +43 -0
  213. invar_tools-1.17.1/src/core/__init__.py +0 -0
  214. invar_tools-1.17.1/src/invar/__init__.py +83 -0
  215. invar_tools-1.17.1/src/invar/core/__init__.py +8 -0
  216. invar_tools-1.17.1/src/invar/core/contracts.py +445 -0
  217. invar_tools-1.17.1/src/invar/core/doc_edit.py +187 -0
  218. invar_tools-1.17.1/src/invar/core/doc_parser.py +563 -0
  219. invar_tools-1.17.1/src/invar/core/entry_points.py +369 -0
  220. invar_tools-1.17.1/src/invar/core/extraction.py +171 -0
  221. invar_tools-1.17.1/src/invar/core/feedback.py +110 -0
  222. invar_tools-1.17.1/src/invar/core/format_specs.py +195 -0
  223. invar_tools-1.17.1/src/invar/core/format_strategies.py +199 -0
  224. invar_tools-1.17.1/src/invar/core/formatter.py +323 -0
  225. invar_tools-1.17.1/src/invar/core/hypothesis_strategies.py +494 -0
  226. invar_tools-1.17.1/src/invar/core/inspect.py +154 -0
  227. invar_tools-1.17.1/src/invar/core/lambda_helpers.py +191 -0
  228. invar_tools-1.17.1/src/invar/core/language.py +88 -0
  229. invar_tools-1.17.1/src/invar/core/models.py +505 -0
  230. invar_tools-1.17.1/src/invar/core/must_use.py +173 -0
  231. invar_tools-1.17.1/src/invar/core/parser.py +283 -0
  232. invar_tools-1.17.1/src/invar/core/patterns/__init__.py +53 -0
  233. invar_tools-1.17.1/src/invar/core/patterns/detector.py +254 -0
  234. invar_tools-1.17.1/src/invar/core/patterns/p0_exhaustive.py +219 -0
  235. invar_tools-1.17.1/src/invar/core/patterns/p0_literal.py +319 -0
  236. invar_tools-1.17.1/src/invar/core/patterns/p0_newtype.py +223 -0
  237. invar_tools-1.17.1/src/invar/core/patterns/p0_nonempty.py +319 -0
  238. invar_tools-1.17.1/src/invar/core/patterns/p0_validation.py +290 -0
  239. invar_tools-1.17.1/src/invar/core/patterns/registry.py +238 -0
  240. invar_tools-1.17.1/src/invar/core/patterns/types.py +171 -0
  241. invar_tools-1.17.1/src/invar/core/postcondition_scope.py +128 -0
  242. invar_tools-1.17.1/src/invar/core/property_gen.py +431 -0
  243. invar_tools-1.17.1/src/invar/core/purity.py +375 -0
  244. invar_tools-1.17.1/src/invar/core/purity_heuristics.py +180 -0
  245. invar_tools-1.17.1/src/invar/core/references.py +182 -0
  246. invar_tools-1.17.1/src/invar/core/review_trigger.py +370 -0
  247. invar_tools-1.17.1/src/invar/core/rule_meta.py +270 -0
  248. invar_tools-1.17.1/src/invar/core/rules.py +564 -0
  249. invar_tools-1.17.1/src/invar/core/shell_analysis.py +247 -0
  250. invar_tools-1.17.1/src/invar/core/shell_architecture.py +171 -0
  251. invar_tools-1.17.1/src/invar/core/strategies.py +260 -0
  252. invar_tools-1.17.1/src/invar/core/suggestions.py +416 -0
  253. invar_tools-1.17.1/src/invar/core/sync_helpers.py +264 -0
  254. invar_tools-1.17.1/src/invar/core/tautology.py +203 -0
  255. invar_tools-1.17.1/src/invar/core/template_helpers.py +32 -0
  256. invar_tools-1.17.1/src/invar/core/template_parser.py +467 -0
  257. invar_tools-1.17.1/src/invar/core/timeout_inference.py +111 -0
  258. invar_tools-1.17.1/src/invar/core/trivial_detection.py +189 -0
  259. invar_tools-1.17.1/src/invar/core/ts_parsers.py +286 -0
  260. invar_tools-1.17.1/src/invar/core/ts_sig_parser.py +310 -0
  261. invar_tools-1.17.1/src/invar/core/utils.py +411 -0
  262. invar_tools-1.17.1/src/invar/core/verification_routing.py +155 -0
  263. invar_tools-1.17.1/src/invar/mcp/__init__.py +10 -0
  264. invar_tools-1.17.1/src/invar/mcp/__main__.py +13 -0
  265. invar_tools-1.17.1/src/invar/mcp/handlers.py +445 -0
  266. invar_tools-1.17.1/src/invar/mcp/server.py +550 -0
  267. invar_tools-1.17.1/src/invar/node_tools/.gitignore +17 -0
  268. invar_tools-1.17.1/src/invar/node_tools/MANIFEST +8 -0
  269. invar_tools-1.17.1/src/invar/node_tools/__init__.py +51 -0
  270. invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/cli.js +160 -0
  271. invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/cli.js.map +1 -0
  272. invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/index.js +105 -0
  273. invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/index.js.map +1 -0
  274. invar_tools-1.17.1/src/invar/node_tools/fc-runner/bundle.js +77 -0
  275. invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.d.ts +12 -0
  276. invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.d.ts.map +1 -0
  277. invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.js +149 -0
  278. invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.js.map +1 -0
  279. invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.d.ts +338 -0
  280. invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.d.ts.map +1 -0
  281. invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.js +260 -0
  282. invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.js.map +1 -0
  283. invar_tools-1.17.1/src/invar/node_tools/quick-check/cli.js +28 -0
  284. invar_tools-1.17.1/src/invar/node_tools/ts-analyzer/cli.js +480 -0
  285. invar_tools-1.17.1/src/invar/node_tools/ts-query.js +396 -0
  286. invar_tools-1.17.1/src/invar/py.typed +0 -0
  287. invar_tools-1.17.1/src/invar/shell/__init__.py +8 -0
  288. invar_tools-1.17.1/src/invar/shell/claude_hooks.py +549 -0
  289. invar_tools-1.17.1/src/invar/shell/commands/__init__.py +11 -0
  290. invar_tools-1.17.1/src/invar/shell/commands/doc.py +409 -0
  291. invar_tools-1.17.1/src/invar/shell/commands/feedback.py +258 -0
  292. invar_tools-1.17.1/src/invar/shell/commands/guard.py +634 -0
  293. invar_tools-1.17.1/src/invar/shell/commands/hooks.py +74 -0
  294. invar_tools-1.17.1/src/invar/shell/commands/init.py +676 -0
  295. invar_tools-1.17.1/src/invar/shell/commands/merge.py +256 -0
  296. invar_tools-1.17.1/src/invar/shell/commands/mutate.py +184 -0
  297. invar_tools-1.17.1/src/invar/shell/commands/perception.py +553 -0
  298. invar_tools-1.17.1/src/invar/shell/commands/skill.py +187 -0
  299. invar_tools-1.17.1/src/invar/shell/commands/sync_self.py +113 -0
  300. invar_tools-1.17.1/src/invar/shell/commands/template_sync.py +449 -0
  301. invar_tools-1.17.1/src/invar/shell/commands/test.py +119 -0
  302. invar_tools-1.17.1/src/invar/shell/commands/uninstall.py +544 -0
  303. invar_tools-1.17.1/src/invar/shell/commands/update.py +40 -0
  304. invar_tools-1.17.1/src/invar/shell/config.py +531 -0
  305. invar_tools-1.17.1/src/invar/shell/contract_coverage.py +362 -0
  306. invar_tools-1.17.1/src/invar/shell/coverage.py +351 -0
  307. invar_tools-1.17.1/src/invar/shell/doc_tools.py +459 -0
  308. invar_tools-1.17.1/src/invar/shell/fs.py +169 -0
  309. invar_tools-1.17.1/src/invar/shell/git.py +87 -0
  310. invar_tools-1.17.1/src/invar/shell/guard_helpers.py +420 -0
  311. invar_tools-1.17.1/src/invar/shell/guard_output.py +332 -0
  312. invar_tools-1.17.1/src/invar/shell/mcp_config.py +174 -0
  313. invar_tools-1.17.1/src/invar/shell/mutation.py +314 -0
  314. invar_tools-1.17.1/src/invar/shell/pattern_integration.py +234 -0
  315. invar_tools-1.17.1/src/invar/shell/pi_hooks.py +213 -0
  316. invar_tools-1.17.1/src/invar/shell/pi_tools.py +127 -0
  317. invar_tools-1.17.1/src/invar/shell/property_tests.py +278 -0
  318. invar_tools-1.17.1/src/invar/shell/prove/__init__.py +9 -0
  319. invar_tools-1.17.1/src/invar/shell/prove/accept.py +113 -0
  320. invar_tools-1.17.1/src/invar/shell/prove/cache.py +133 -0
  321. invar_tools-1.17.1/src/invar/shell/prove/crosshair.py +502 -0
  322. invar_tools-1.17.1/src/invar/shell/prove/guard_ts.py +1004 -0
  323. invar_tools-1.17.1/src/invar/shell/prove/hypothesis.py +293 -0
  324. invar_tools-1.17.1/src/invar/shell/py_refs.py +156 -0
  325. invar_tools-1.17.1/src/invar/shell/skill_manager.py +355 -0
  326. invar_tools-1.17.1/src/invar/shell/subprocess_env.py +393 -0
  327. invar_tools-1.17.1/src/invar/shell/template_engine.py +369 -0
  328. invar_tools-1.17.1/src/invar/shell/templates.py +471 -0
  329. invar_tools-1.17.1/src/invar/shell/testing.py +348 -0
  330. invar_tools-1.17.1/src/invar/shell/ts_compiler.py +238 -0
  331. invar_tools-1.17.1/src/invar/templates/CLAUDE.md.template +163 -0
  332. invar_tools-1.17.1/src/invar/templates/__init__.py +1 -0
  333. invar_tools-1.17.1/src/invar/templates/claude-md/python/critical-rules.md +33 -0
  334. invar_tools-1.17.1/src/invar/templates/claude-md/python/quick-reference.md +24 -0
  335. invar_tools-1.17.1/src/invar/templates/claude-md/typescript/critical-rules.md +40 -0
  336. invar_tools-1.17.1/src/invar/templates/claude-md/typescript/quick-reference.md +24 -0
  337. invar_tools-1.17.1/src/invar/templates/claude-md/universal/check-in.md +25 -0
  338. invar_tools-1.17.1/src/invar/templates/claude-md/universal/skills.md +73 -0
  339. invar_tools-1.17.1/src/invar/templates/claude-md/universal/tool-selection.md +110 -0
  340. invar_tools-1.17.1/src/invar/templates/claude-md/universal/workflow.md +55 -0
  341. invar_tools-1.17.1/src/invar/templates/commands/audit.md.jinja +161 -0
  342. invar_tools-1.17.1/src/invar/templates/commands/guard.md +83 -0
  343. invar_tools-1.17.1/src/invar/templates/config/AGENT.md.jinja +256 -0
  344. invar_tools-1.17.1/src/invar/templates/config/CLAUDE.md.jinja +53 -0
  345. invar_tools-1.17.1/src/invar/templates/config/context.md.jinja +130 -0
  346. invar_tools-1.17.1/src/invar/templates/config/pre-commit.yaml.jinja +46 -0
  347. invar_tools-1.17.1/src/invar/templates/context.md.template +101 -0
  348. invar_tools-1.17.1/src/invar/templates/examples/python/README.md +25 -0
  349. invar_tools-1.17.1/src/invar/templates/examples/python/conftest.py +3 -0
  350. invar_tools-1.17.1/src/invar/templates/examples/python/contracts.py +190 -0
  351. invar_tools-1.17.1/src/invar/templates/examples/python/core_shell.py +227 -0
  352. invar_tools-1.17.1/src/invar/templates/examples/python/functional.py +613 -0
  353. invar_tools-1.17.1/src/invar/templates/examples/python/workflow.md +81 -0
  354. invar_tools-1.17.1/src/invar/templates/examples/typescript/README.md +31 -0
  355. invar_tools-1.17.1/src/invar/templates/examples/typescript/contracts.ts +163 -0
  356. invar_tools-1.17.1/src/invar/templates/examples/typescript/core_shell.ts +374 -0
  357. invar_tools-1.17.1/src/invar/templates/examples/typescript/functional.ts +601 -0
  358. invar_tools-1.17.1/src/invar/templates/examples/typescript/patterns.md +193 -0
  359. invar_tools-1.17.1/src/invar/templates/examples/typescript/workflow.md +95 -0
  360. invar_tools-1.17.1/src/invar/templates/hooks/PostToolUse.sh.jinja +111 -0
  361. invar_tools-1.17.1/src/invar/templates/hooks/PreToolUse.sh.jinja +112 -0
  362. invar_tools-1.17.1/src/invar/templates/hooks/Stop.sh.jinja +23 -0
  363. invar_tools-1.17.1/src/invar/templates/hooks/UserPromptSubmit.sh.jinja +115 -0
  364. invar_tools-1.17.1/src/invar/templates/hooks/__init__.py +1 -0
  365. invar_tools-1.17.1/src/invar/templates/hooks/pi/invar.ts.jinja +116 -0
  366. invar_tools-1.17.1/src/invar/templates/manifest.toml +147 -0
  367. invar_tools-1.17.1/src/invar/templates/onboard/assessment.md.jinja +214 -0
  368. invar_tools-1.17.1/src/invar/templates/onboard/patterns/python.md +347 -0
  369. invar_tools-1.17.1/src/invar/templates/onboard/patterns/typescript.md +452 -0
  370. invar_tools-1.17.1/src/invar/templates/onboard/roadmap.md.jinja +168 -0
  371. invar_tools-1.17.1/src/invar/templates/pi-tools/invar/index.ts +691 -0
  372. invar_tools-1.17.1/src/invar/templates/proposal.md.template +93 -0
  373. invar_tools-1.17.1/src/invar/templates/protocol/INVAR.md.jinja +51 -0
  374. invar_tools-1.17.1/src/invar/templates/protocol/python/architecture-examples.md +41 -0
  375. invar_tools-1.17.1/src/invar/templates/protocol/python/contracts-syntax.md +56 -0
  376. invar_tools-1.17.1/src/invar/templates/protocol/python/markers.md +44 -0
  377. invar_tools-1.17.1/src/invar/templates/protocol/python/tools.md +27 -0
  378. invar_tools-1.17.1/src/invar/templates/protocol/python/troubleshooting.md +38 -0
  379. invar_tools-1.17.1/src/invar/templates/protocol/typescript/architecture-examples.md +52 -0
  380. invar_tools-1.17.1/src/invar/templates/protocol/typescript/contracts-syntax.md +73 -0
  381. invar_tools-1.17.1/src/invar/templates/protocol/typescript/markers.md +48 -0
  382. invar_tools-1.17.1/src/invar/templates/protocol/typescript/tools.md +68 -0
  383. invar_tools-1.17.1/src/invar/templates/protocol/typescript/troubleshooting.md +104 -0
  384. invar_tools-1.17.1/src/invar/templates/protocol/universal/architecture.md +36 -0
  385. invar_tools-1.17.1/src/invar/templates/protocol/universal/completion.md +14 -0
  386. invar_tools-1.17.1/src/invar/templates/protocol/universal/contracts-concept.md +37 -0
  387. invar_tools-1.17.1/src/invar/templates/protocol/universal/header.md +17 -0
  388. invar_tools-1.17.1/src/invar/templates/protocol/universal/session.md +17 -0
  389. invar_tools-1.17.1/src/invar/templates/protocol/universal/six-laws.md +10 -0
  390. invar_tools-1.17.1/src/invar/templates/protocol/universal/usbv.md +14 -0
  391. invar_tools-1.17.1/src/invar/templates/protocol/universal/visible-workflow.md +25 -0
  392. invar_tools-1.17.1/src/invar/templates/skills/develop/SKILL.md.jinja +506 -0
  393. invar_tools-1.17.1/src/invar/templates/skills/extensions/_registry.yaml +93 -0
  394. invar_tools-1.17.1/src/invar/templates/skills/extensions/acceptance/SKILL.md +383 -0
  395. invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/SKILL.md +448 -0
  396. invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/patterns/python.md +347 -0
  397. invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/patterns/typescript.md +452 -0
  398. invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/templates/assessment.md.jinja +214 -0
  399. invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/templates/roadmap.md.jinja +168 -0
  400. invar_tools-1.17.1/src/invar/templates/skills/extensions/security/SKILL.md +382 -0
  401. invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/_common.yaml +126 -0
  402. invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/python.yaml +155 -0
  403. invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/typescript.yaml +194 -0
  404. invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/CONFIG.md +480 -0
  405. invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/SKILL.md +466 -0
  406. invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/template.md +343 -0
  407. invar_tools-1.17.1/src/invar/templates/skills/investigate/SKILL.md.jinja +118 -0
  408. invar_tools-1.17.1/src/invar/templates/skills/propose/SKILL.md.jinja +134 -0
  409. invar_tools-1.17.1/src/invar/templates/skills/review/SKILL.md.jinja +325 -0
  410. invar_tools-1.17.1/src/shell/__init__.py +0 -0
  411. invar_tools-1.17.1/tests/__init__.py +1 -0
  412. invar_tools-1.17.1/tests/conftest.py +58 -0
  413. invar_tools-1.17.1/tests/experiments/conftest.py +7 -0
  414. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/README.md +150 -0
  415. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS.md +75 -0
  416. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS_V2.md +342 -0
  417. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS_V4.md +710 -0
  418. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/ground_truth.yaml +428 -0
  419. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/prompts.yaml +105 -0
  420. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/api_client.py +104 -0
  421. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/auth_service.py +87 -0
  422. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/config_manager.py +141 -0
  423. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/data_processor.py +118 -0
  424. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/file_handler.py +132 -0
  425. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/utils.py +156 -0
  426. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/analytics_engine.py +825 -0
  427. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/ground_truth.yaml +282 -0
  428. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/inventory_manager.py +730 -0
  429. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/notification_service.py +736 -0
  430. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/order_processor.py +760 -0
  431. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/payment_gateway.py +634 -0
  432. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/user_service.py +700 -0
  433. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/README.md +60 -0
  434. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/cache_service.py +323 -0
  435. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/calculator.py +327 -0
  436. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/data_processor.py +337 -0
  437. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/ground_truth.yaml +454 -0
  438. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/user_manager.py +352 -0
  439. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/validator.py +347 -0
  440. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/.serena/.gitignore +1 -0
  441. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/.serena/project.yml +84 -0
  442. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/README.md +83 -0
  443. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/config_manager.py +243 -0
  444. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/data_service.py +306 -0
  445. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/ground_truth.yaml +530 -0
  446. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/math_utils.py +291 -0
  447. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/report_generator.py +346 -0
  448. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/user_auth.py +319 -0
  449. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/api_gateway.py +285 -0
  450. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/auth_service.py +279 -0
  451. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/cache_handler.py +270 -0
  452. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/config_loader.py +248 -0
  453. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/data_validator.py +283 -0
  454. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/ground_truth.yaml +888 -0
  455. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/metrics_collector.py +266 -0
  456. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/notification_service.py +261 -0
  457. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/payment_processor.py +343 -0
  458. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/report_builder.py +336 -0
  459. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/task_scheduler.py +296 -0
  460. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/user_manager.py +266 -0
  461. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/utils.py +308 -0
  462. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/api_gateway.py +270 -0
  463. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/auth_service.py +264 -0
  464. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/cache_handler.py +257 -0
  465. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/config_loader.py +239 -0
  466. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/data_validator.py +270 -0
  467. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/ground_truth.yaml +888 -0
  468. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/metrics_collector.py +256 -0
  469. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/notification_service.py +251 -0
  470. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/payment_processor.py +326 -0
  471. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/report_builder.py +324 -0
  472. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/task_scheduler.py +285 -0
  473. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/user_manager.py +252 -0
  474. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/utils.py +308 -0
  475. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/api_service.py +712 -0
  476. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/auth_manager.py +598 -0
  477. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/data_processor.py +602 -0
  478. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/ground_truth.yaml +239 -0
  479. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/report_engine.py +904 -0
  480. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/storage_handler.py +818 -0
  481. invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/utils.py +417 -0
  482. invar_tools-1.17.1/tests/integration/__init__.py +0 -0
  483. invar_tools-1.17.1/tests/integration/test_cli_flags.py +196 -0
  484. invar_tools-1.17.1/tests/integration/test_dx55_regression.py +401 -0
  485. invar_tools-1.17.1/tests/integration/test_dx56_sync.py +226 -0
  486. invar_tools-1.17.1/tests/integration/test_dx78_ts_compiler.py +572 -0
  487. invar_tools-1.17.1/tests/integration/test_lx05_detection.py +130 -0
  488. invar_tools-1.17.1/tests/integration/test_lx05_integration.py +495 -0
  489. invar_tools-1.17.1/tests/integration/test_lx05_templates.py +227 -0
  490. invar_tools-1.17.1/tests/integration/test_lx06_typescript.py +406 -0
  491. invar_tools-1.17.1/tests/integration/test_lx07_skills.py +491 -0
  492. invar_tools-1.17.1/tests/integration/test_mcp_doc_tools.py +535 -0
  493. invar_tools-1.17.1/tests/test_subprocess_env.py +287 -0
  494. invar_tools-1.17.1/typescript/.gitignore +30 -0
  495. invar_tools-1.17.1/typescript/README.md +105 -0
  496. invar_tools-1.17.1/typescript/doctest.config.json +7 -0
  497. invar_tools-1.17.1/typescript/package.json +35 -0
  498. invar_tools-1.17.1/typescript/packages/eslint-plugin/CONFIGURATION.md +726 -0
  499. invar_tools-1.17.1/typescript/packages/eslint-plugin/EXAMPLES.md +932 -0
  500. invar_tools-1.17.1/typescript/packages/eslint-plugin/package.json +48 -0
  501. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/cli.ts +179 -0
  502. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/index.ts +111 -0
  503. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/behavior.test.ts +1391 -0
  504. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/e2e-scenarios.test.ts +450 -0
  505. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/function-lengths.ts +143 -0
  506. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/has-io-imports.ts +19 -0
  507. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/valid-small.ts +29 -0
  508. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/exported-functions.ts +48 -0
  509. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/shell/with-io.ts +31 -0
  510. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/tests/large.test.ts +262 -0
  511. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/max-file-lines.ts +119 -0
  512. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/max-function-lines.ts +152 -0
  513. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-any-in-schema.ts +47 -0
  514. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-empty-schema.ts +83 -0
  515. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-impure-calls-in-core.ts +62 -0
  516. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-io-in-core.ts +112 -0
  517. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-pure-logic-in-shell.ts +226 -0
  518. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-redundant-type-schema.ts +114 -0
  519. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-runtime-imports.ts +82 -0
  520. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-complete-validation.ts +127 -0
  521. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-jsdoc-example.ts +101 -0
  522. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-schema-validation.ts +348 -0
  523. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/shell-complexity.ts +328 -0
  524. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/shell-result-type.ts +166 -0
  525. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/thin-entry-points.ts +207 -0
  526. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/utils/layer-detection.ts +110 -0
  527. invar_tools-1.17.1/typescript/packages/eslint-plugin/src/utils/math-example.ts +31 -0
  528. invar_tools-1.17.1/typescript/packages/eslint-plugin/tsconfig.json +9 -0
  529. invar_tools-1.17.1/typescript/packages/fc-runner/package.json +42 -0
  530. invar_tools-1.17.1/typescript/packages/fc-runner/src/cli.ts +163 -0
  531. invar_tools-1.17.1/typescript/packages/fc-runner/src/index.ts +328 -0
  532. invar_tools-1.17.1/typescript/packages/fc-runner/tsconfig.json +8 -0
  533. invar_tools-1.17.1/typescript/packages/quick-check/package.json +47 -0
  534. invar_tools-1.17.1/typescript/packages/quick-check/src/cli.ts +123 -0
  535. invar_tools-1.17.1/typescript/packages/quick-check/src/index.ts +279 -0
  536. invar_tools-1.17.1/typescript/packages/quick-check/tsconfig.json +8 -0
  537. invar_tools-1.17.1/typescript/packages/ts-analyzer/package.json +42 -0
  538. invar_tools-1.17.1/typescript/packages/ts-analyzer/src/cli.ts +131 -0
  539. invar_tools-1.17.1/typescript/packages/ts-analyzer/src/index.ts +622 -0
  540. invar_tools-1.17.1/typescript/packages/ts-analyzer/tsconfig.json +8 -0
  541. invar_tools-1.17.1/typescript/pnpm-workspace.yaml +2 -0
  542. invar_tools-1.17.1/typescript/scripts/bundle.mjs +65 -0
  543. invar_tools-1.17.1/typescript/scripts/generate-doctests.mjs +307 -0
  544. invar_tools-1.17.1/typescript/tsconfig.base.json +24 -0
  545. invar_tools-1.17.1/typescript/vitest.config.ts +16 -0
  546. invar_tools-1.17.1/uv.lock +1597 -0
@@ -0,0 +1,27 @@
1
+ # Invar Project Configuration for Aider
2
+ # This is the Invar project itself
3
+
4
+ # Auto-read protocol files at session start
5
+ read:
6
+ - INVAR.md
7
+ - CLAUDE.md
8
+ - .invar/context.md
9
+
10
+ # System prompt addition
11
+ system-prompt: |
12
+ This is the Invar project itself. Follow INVAR.md and CLAUDE.md.
13
+
14
+ Before writing code, execute:
15
+ 1. invar guard --changed
16
+ 2. invar map --top 10
17
+
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
23
+
24
+ Project-specific:
25
+ - INVAR.md here is the SOURCE, templates are in src/invar/templates/
26
+ - Do NOT run invar update on this project
27
+ - Task complete only when final invar guard passes.
@@ -0,0 +1,144 @@
1
+ ---
2
+ _invar:
3
+ version: "5.0"
4
+ type: command
5
+ ---
6
+
7
+ # Audit
8
+
9
+ Read-only code review. Reports issues without fixing them.
10
+
11
+ ---
12
+
13
+ ## Behavior
14
+
15
+ 1. Analyze code for issues (style, bugs, security, architecture)
16
+ 2. Report findings with file:line references
17
+ 3. **Do NOT make any changes** - report only
18
+
19
+ ---
20
+
21
+ ## Adversarial Reviewer Persona
22
+
23
+ You are an **adversarial code reviewer**. Your job is to FIND PROBLEMS.
24
+
25
+ ### Your Mindset
26
+
27
+ Assume:
28
+ - The code has bugs until proven otherwise
29
+ - The contracts may be meaningless ceremony
30
+ - The implementer may have rationalized poor decisions
31
+ - Escape hatches may be abused
32
+
33
+ You are NOT here to:
34
+ - Validate that code works
35
+ - Confirm the implementer did a good job
36
+ - Be nice or diplomatic
37
+
38
+ You ARE here to:
39
+ - Find bugs, logic errors, edge cases
40
+ - Challenge whether contracts have semantic value
41
+ - Identify code smells and duplication
42
+ - Question every escape hatch
43
+ - Check if code matches contracts (not if code "seems right")
44
+
45
+ **Your success is measured by problems found, not code approved.**
46
+
47
+ ---
48
+
49
+ ## Review Checklist
50
+
51
+ > **Principle:** Only items requiring semantic judgment. Mechanical checks are excluded (see bottom).
52
+
53
+ ### A. Contract Semantic Value
54
+ - [ ] Does @pre constrain inputs beyond type checking?
55
+ - Bad: `@pre(lambda x: isinstance(x, int))`
56
+ - Good: `@pre(lambda x: x > 0 and x < MAX_VALUE)`
57
+ - [ ] Does @post verify meaningful output properties?
58
+ - Bad: `@post(lambda result: result is not None)`
59
+ - Good: `@post(lambda result: len(result) == len(input))`
60
+ - [ ] Could someone implement correctly from contracts alone?
61
+ - [ ] Are boundary conditions explicit in contracts?
62
+
63
+ ### B. Doctest Coverage
64
+ - [ ] Do doctests cover normal cases?
65
+ - [ ] Do doctests cover boundary cases?
66
+ - [ ] Do doctests cover error cases?
67
+ - [ ] Are doctests testing behavior, not just syntax?
68
+
69
+ ### C. Code Quality
70
+ - [ ] Is duplicated code worth extracting?
71
+ - [ ] Is naming consistent and clear?
72
+ - [ ] Is complexity justified?
73
+
74
+ ### D. Escape Hatch Audit
75
+ - [ ] Is each @invar:allow justification valid?
76
+ - [ ] Could refactoring eliminate the need?
77
+ - [ ] Is there a pattern suggesting systematic issues?
78
+
79
+ ### E. Logic Verification
80
+ - [ ] Do contracts correctly capture intended behavior?
81
+ - [ ] Are there paths that bypass contract checks?
82
+ - [ ] Are there implicit assumptions not in contracts?
83
+ - [ ] What happens with unexpected inputs?
84
+
85
+ ### F. Security
86
+ - [ ] Are inputs validated against security threats (injection, XSS)?
87
+ - [ ] No hardcoded secrets (API keys, passwords, tokens)?
88
+ - [ ] Are authentication/authorization checks correct?
89
+ - [ ] Is sensitive data properly protected?
90
+
91
+ ### G. Error Handling & Observability
92
+ - [ ] Are exceptions caught at appropriate level?
93
+ - [ ] Are error messages clear without leaking sensitive info?
94
+ - [ ] Are critical operations logged for debugging?
95
+ - [ ] Is there graceful degradation on failure?
96
+
97
+ ---
98
+
99
+ ## Excluded (Covered by Guard)
100
+
101
+ These are checked by Guard or linters - don't duplicate:
102
+ - Core/Shell separation → Guard (forbidden_import, impure_call)
103
+ - Shell returns Result[T,E] → Guard (shell_result)
104
+ - Missing contracts → Guard (missing_contract)
105
+ - File/function size limits → Guard (file_size, function_size)
106
+ - Entry point thickness → Guard (entry_point_too_thick)
107
+ - Escape hatch count → Guard (review_suggested)
108
+
109
+ ---
110
+
111
+ ## Report Format
112
+
113
+ For each issue found, use severity levels:
114
+
115
+ | Severity | Meaning |
116
+ |----------|---------|
117
+ | **CRITICAL** | Must fix before completion |
118
+ | **MAJOR** | Fix or provide written justification |
119
+ | **MINOR** | Optional, can defer |
120
+
121
+ ```markdown
122
+ ### [CRITICAL/MAJOR/MINOR] Issue Title
123
+
124
+ **Location:** file.py:line_number
125
+ **Category:** contract_quality | logic_error | security | escape_hatch | code_smell
126
+ **Problem:** What's wrong
127
+ **Suggestion:** How to fix (but don't implement)
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Instructions
133
+
134
+ 1. Run `invar guard --changed` to see current state
135
+ 2. Go through each checklist category
136
+ 3. For each issue, determine severity (CRITICAL/MAJOR/MINOR)
137
+ 4. Report with structured format above
138
+ 5. Be thorough and adversarial
139
+
140
+ **Remember:** You are READ-ONLY. Report issues, don't fix them.
141
+
142
+ ---
143
+
144
+ Now review the recent changes or the files specified by the user.
@@ -0,0 +1,83 @@
1
+ ---
2
+ _invar:
3
+ version: "5.0"
4
+ type: command
5
+ ---
6
+
7
+ # Guard
8
+
9
+ Run Invar verification on the project and report results.
10
+
11
+ ---
12
+
13
+ ## Behavior
14
+
15
+ Execute `invar_guard()` and report:
16
+ - Pass/fail status
17
+ - Error count with details
18
+ - Warning count with details
19
+
20
+ **Do NOT fix issues** - just report verification results.
21
+
22
+ ---
23
+
24
+ ## When to Use
25
+
26
+ - Quick verification check
27
+ - Before committing changes
28
+ - After pulling changes
29
+ - To see current project health
30
+
31
+ ---
32
+
33
+ ## Execution
34
+
35
+ Run verification:
36
+
37
+ ```
38
+ invar_guard(changed=true)
39
+ ```
40
+
41
+ Or for full project verification:
42
+
43
+ ```
44
+ invar_guard()
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Report Format
50
+
51
+ ```
52
+ ## Guard Results
53
+
54
+ **Status:** PASS / FAIL
55
+ **Errors:** N
56
+ **Warnings:** N
57
+
58
+ ### Errors (if any)
59
+
60
+ | Rule | File | Line | Message |
61
+ |------|------|------|---------|
62
+ | missing_contract | src/foo.py | 42 | Function 'bar' has no @pre/@post |
63
+
64
+ ### Warnings (if any)
65
+
66
+ | Rule | File | Line | Message |
67
+ |------|------|------|---------|
68
+ | function_size | src/baz.py | 15 | Function exceeds 50 lines |
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Next Steps
74
+
75
+ After reporting results:
76
+ - If PASS: No action needed
77
+ - If FAIL: User decides whether to fix issues
78
+
79
+ **Remember:** You are READ-ONLY. Report results, don't fix them.
80
+
81
+ ---
82
+
83
+ Now run verification on the current project.
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ # Invar hook wrapper (DX-57)
3
+ # Ensure correct working directory regardless of where Claude Code invokes from
4
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6
+ if ! cd "$PROJECT_ROOT" 2>/dev/null; then
7
+ echo "[invar] Warning: Could not cd to $PROJECT_ROOT" >&2
8
+ exit 0 # Don't block Claude Code
9
+ fi
10
+ source "$SCRIPT_DIR/invar.PostToolUse.sh" "$@"
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ # Invar hook wrapper (DX-57)
3
+ # Ensure correct working directory regardless of where Claude Code invokes from
4
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6
+ if ! cd "$PROJECT_ROOT" 2>/dev/null; then
7
+ echo "[invar] Warning: Could not cd to $PROJECT_ROOT" >&2
8
+ exit 0 # Don't block Claude Code
9
+ fi
10
+ source "$SCRIPT_DIR/invar.PreToolUse.sh" "$@"
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ # Invar hook wrapper (DX-57)
3
+ # Ensure correct working directory regardless of where Claude Code invokes from
4
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6
+ if ! cd "$PROJECT_ROOT" 2>/dev/null; then
7
+ echo "[invar] Warning: Could not cd to $PROJECT_ROOT" >&2
8
+ exit 0 # Don't block Claude Code
9
+ fi
10
+ source "$SCRIPT_DIR/invar.Stop.sh" "$@"
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ # Invar hook wrapper (DX-57)
3
+ # Ensure correct working directory regardless of where Claude Code invokes from
4
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6
+ if ! cd "$PROJECT_ROOT" 2>/dev/null; then
7
+ echo "[invar] Warning: Could not cd to $PROJECT_ROOT" >&2
8
+ exit 0 # Don't block Claude Code
9
+ fi
10
+ source "$SCRIPT_DIR/invar.UserPromptSubmit.sh" "$@"
@@ -0,0 +1,102 @@
1
+ #!/bin/bash
2
+ # Invar PostToolUse Hook
3
+ # Protocol: v5.0 | Generated: 2025-12-30
4
+ # DX-57: Git-based change detection with fallback
5
+
6
+ TOOL_NAME="$1"
7
+
8
+ # Check if hooks are disabled
9
+ [[ -f ".claude/hooks/.invar_disabled" ]] && exit 0
10
+
11
+ # Use session-specific state directory
12
+ STATE_DIR="${CLAUDE_STATE_DIR:-/tmp/invar_hooks_$(id -u)}"
13
+ mkdir -p "$STATE_DIR" 2>/dev/null
14
+
15
+ CHANGES_FILE="$STATE_DIR/changes"
16
+ LAST_GUARD="$STATE_DIR/last_guard"
17
+ LAST_CHECK_MARKER="$STATE_DIR/last_check"
18
+
19
+ # ============================================
20
+ # Reset state on guard run (MCP or CLI)
21
+ # ============================================
22
+ # MCP: invar_guard tool call
23
+ if [[ "$TOOL_NAME" == "mcp__invar__invar_guard" ]]; then
24
+ date +%s > "$LAST_GUARD"
25
+ rm -f "$CHANGES_FILE"
26
+ touch "$LAST_CHECK_MARKER"
27
+ exit 0
28
+ fi
29
+
30
+ # CLI: Bash command containing "invar guard"
31
+ if [[ "$TOOL_NAME" == "Bash" ]]; then
32
+ TOOL_INPUT="$2"
33
+ if echo "$TOOL_INPUT" | grep -qE '"command"[^}]*invar\s+guard'; then
34
+ date +%s > "$LAST_GUARD"
35
+ rm -f "$CHANGES_FILE"
36
+ touch "$LAST_CHECK_MARKER"
37
+ exit 0
38
+ fi
39
+ fi
40
+
41
+ # ============================================
42
+ # Detect changes (git with fallback)
43
+ # ============================================
44
+ is_git_repo() {
45
+ git rev-parse --git-dir >/dev/null 2>&1
46
+ }
47
+
48
+ detect_changes() {
49
+ if is_git_repo; then
50
+ # Primary: Git-based detection (includes staged + unstaged)
51
+ { git diff --name-only -- '*.py' 2>/dev/null; git diff --cached --name-only -- '*.py' 2>/dev/null; } | sort -u
52
+ elif [[ -f "$LAST_CHECK_MARKER" ]]; then
53
+ # Fallback: Timestamp-based detection (approximate)
54
+ find . -name "*.py" -newer "$LAST_CHECK_MARKER" -type f 2>/dev/null | \
55
+ grep -v __pycache__ | grep -v '.venv' | head -20
56
+ fi
57
+ # Update marker for next check
58
+ touch "$LAST_CHECK_MARKER" 2>/dev/null
59
+ }
60
+
61
+ # Track changes
62
+ CHANGED=$(detect_changes)
63
+ if [[ -n "$CHANGED" ]]; then
64
+ echo "$CHANGED" >> "$CHANGES_FILE"
65
+ sort -u "$CHANGES_FILE" -o "$CHANGES_FILE" 2>/dev/null
66
+ fi
67
+
68
+ # ============================================
69
+ # Smart trigger evaluation
70
+ # ============================================
71
+ CHANGE_COUNT=$(wc -l < "$CHANGES_FILE" 2>/dev/null | tr -d ' ' || echo 0)
72
+ LAST_TIME=$(cat "$LAST_GUARD" 2>/dev/null || echo 0)
73
+ NOW=$(date +%s)
74
+ ELAPSED=$((NOW - LAST_TIME))
75
+
76
+ SHOULD_REMIND=false
77
+ REASON=""
78
+
79
+ # Trigger 1: Accumulated changes (3+ files)
80
+ if [[ $CHANGE_COUNT -ge 3 ]]; then
81
+ SHOULD_REMIND=true
82
+ REASON="$CHANGE_COUNT files changed"
83
+ fi
84
+
85
+ # Trigger 2: Core file changed (high priority)
86
+ if grep -qE "/core/|/contracts/" "$CHANGES_FILE" 2>/dev/null; then
87
+ SHOULD_REMIND=true
88
+ REASON="core/ files modified"
89
+ fi
90
+
91
+ # Trigger 3: Time threshold (>5 min with changes)
92
+ if [[ $ELAPSED -gt 300 && $CHANGE_COUNT -gt 0 ]]; then
93
+ SHOULD_REMIND=true
94
+ REASON=">5 min since last guard"
95
+ fi
96
+
97
+ # Output reminder if triggered
98
+ if [[ "$SHOULD_REMIND" == "true" ]]; then
99
+ echo ""
100
+ echo "⚠️ Verification suggested: $REASON"
101
+ echo " Run: invar_guard --changed"
102
+ fi
@@ -0,0 +1,74 @@
1
+ #!/bin/bash
2
+ # Invar PreToolUse Hook
3
+ # Protocol: v5.0 | Generated: 2025-12-30
4
+ # DX-57: Smart blocking with auto-escape for pytest/crosshair
5
+
6
+ TOOL_NAME="$1"
7
+ TOOL_INPUT="$2"
8
+
9
+ # Check if hooks are disabled
10
+ [[ -f ".claude/hooks/.invar_disabled" ]] && exit 0
11
+
12
+ # Only process Bash commands
13
+ [[ "$TOOL_NAME" != "Bash" ]] && exit 0
14
+
15
+ # Parse command from JSON input
16
+ # Primary: jq (accurate), Fallback: grep/sed (basic)
17
+ if command -v jq &>/dev/null; then
18
+ CMD=$(echo "$TOOL_INPUT" | jq -r '.command // empty' 2>/dev/null)
19
+ else
20
+ # Fallback: Extract command field using grep/sed (handles simple cases)
21
+ CMD=$(echo "$TOOL_INPUT" | grep -o '"command"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*: *"\(.*\)"/\1/')
22
+ fi
23
+ [[ -z "$CMD" ]] && exit 0
24
+
25
+ # ============================================
26
+ # pytest blocking with smart escape
27
+ # ============================================
28
+ if echo "$CMD" | grep -qE '\bpytest\b|python.*-m\s+pytest\b'; then
29
+
30
+ # Auto-escape 1: Debugging mode (--pdb, --debug, --tb=long)
31
+ if echo "$CMD" | grep -qE '\-\-pdb|\-\-debug|\-\-tb='; then
32
+ echo "⚠️ pytest debugging allowed. Run invar_guard after."
33
+ exit 0
34
+ fi
35
+
36
+ # Auto-escape 2: External/vendor tests
37
+ if echo "$CMD" | grep -qE 'vendor/|third_party/|external/|node_modules/'; then
38
+ exit 0
39
+ fi
40
+
41
+ # Auto-escape 3: Explicit coverage collection
42
+ if echo "$CMD" | grep -qE '\-\-cov'; then
43
+ echo "⚠️ pytest coverage allowed. Run invar_guard for contract verification."
44
+ exit 0
45
+ fi
46
+
47
+ # Auto-escape 4: Environment variable override
48
+ if [[ "$INVAR_ALLOW_PYTEST" == "1" ]]; then
49
+ exit 0
50
+ fi
51
+
52
+ # Default: Block with helpful message
53
+ echo "❌ Use invar_guard instead of pytest"
54
+ echo " invar_guard = static + doctests + CrossHair + Hypothesis"
55
+ echo ""
56
+ echo " Auto-allowed: pytest --pdb (debug), pytest --cov (coverage)"
57
+ echo " Manual escape: INVAR_ALLOW_PYTEST=1 pytest ..."
58
+ exit 1
59
+ fi
60
+
61
+ # ============================================
62
+ # crosshair blocking (always redirect)
63
+ # ============================================
64
+ if echo "$CMD" | grep -qE '\bcrosshair\b'; then
65
+ if [[ "$INVAR_ALLOW_CROSSHAIR" == "1" ]]; then
66
+ exit 0
67
+ fi
68
+
69
+ echo "❌ Use invar_guard (includes CrossHair by default)"
70
+ echo " Manual escape: INVAR_ALLOW_CROSSHAIR=1 crosshair ..."
71
+ exit 1
72
+ fi
73
+
74
+ exit 0
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+ # Invar Stop Hook
3
+ # Protocol: v5.0 | Generated: 2025-12-30
4
+ # DX-57: Session cleanup and unverified changes warning
5
+
6
+ # Use session-specific state
7
+ STATE_DIR="${CLAUDE_STATE_DIR:-/tmp/invar_hooks_$(id -u)}"
8
+ CHANGES_FILE="$STATE_DIR/changes"
9
+
10
+ # Check for unverified changes
11
+ if [[ -f "$CHANGES_FILE" ]]; then
12
+ CHANGE_COUNT=$(wc -l < "$CHANGES_FILE" 2>/dev/null | tr -d ' ' || echo 0)
13
+ if [[ $CHANGE_COUNT -gt 0 ]]; then
14
+ echo ""
15
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
16
+ echo "⚠️ Invar: $CHANGE_COUNT Python files not verified"
17
+ echo " Run before commit: invar_guard --changed"
18
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
19
+ fi
20
+ fi
21
+
22
+ # Cleanup session state
23
+ rm -rf "$STATE_DIR" 2>/dev/null