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.
- invar_tools-1.17.1/.aider.conf.yml +27 -0
- invar_tools-1.17.1/.claude/commands/audit.md +144 -0
- invar_tools-1.17.1/.claude/commands/guard.md +83 -0
- invar_tools-1.17.1/.claude/hooks/PostToolUse.sh +10 -0
- invar_tools-1.17.1/.claude/hooks/PreToolUse.sh +10 -0
- invar_tools-1.17.1/.claude/hooks/Stop.sh +10 -0
- invar_tools-1.17.1/.claude/hooks/UserPromptSubmit.sh +10 -0
- invar_tools-1.17.1/.claude/hooks/invar.PostToolUse.sh +102 -0
- invar_tools-1.17.1/.claude/hooks/invar.PreToolUse.sh +74 -0
- invar_tools-1.17.1/.claude/hooks/invar.Stop.sh +23 -0
- invar_tools-1.17.1/.claude/hooks/invar.UserPromptSubmit.sh +387 -0
- invar_tools-1.17.1/.claude/skills/acceptance/SKILL.md +390 -0
- invar_tools-1.17.1/.claude/skills/develop/SKILL.md +434 -0
- invar_tools-1.17.1/.claude/skills/invar-onboard/SKILL.md +455 -0
- invar_tools-1.17.1/.claude/skills/invar-onboard/patterns/python.md +347 -0
- invar_tools-1.17.1/.claude/skills/invar-onboard/patterns/typescript.md +452 -0
- invar_tools-1.17.1/.claude/skills/invar-onboard/templates/assessment.md.jinja +214 -0
- invar_tools-1.17.1/.claude/skills/invar-onboard/templates/roadmap.md.jinja +168 -0
- invar_tools-1.17.1/.claude/skills/invar-reflect/CONFIG.md +355 -0
- invar_tools-1.17.1/.claude/skills/invar-reflect/SKILL.md +466 -0
- invar_tools-1.17.1/.claude/skills/invar-reflect/template.md +343 -0
- invar_tools-1.17.1/.claude/skills/investigate/SKILL.md +104 -0
- invar_tools-1.17.1/.claude/skills/propose/SKILL.md +129 -0
- invar_tools-1.17.1/.claude/skills/review/SKILL.md +325 -0
- invar_tools-1.17.1/.claude/skills/security/SKILL.md +389 -0
- invar_tools-1.17.1/.claude/skills/security/patterns/_common.yaml +126 -0
- invar_tools-1.17.1/.claude/skills/security/patterns/python.yaml +155 -0
- invar_tools-1.17.1/.claude/skills/security/patterns/typescript.yaml +194 -0
- invar_tools-1.17.1/.cursorrules +26 -0
- invar_tools-1.17.1/.github/workflows/ci.yml +109 -0
- invar_tools-1.17.1/.github/workflows/claude-code-review.yml +57 -0
- invar_tools-1.17.1/.github/workflows/claude.yml +50 -0
- invar_tools-1.17.1/.github/workflows/publish.yml +61 -0
- invar_tools-1.17.1/.gitignore +63 -0
- invar_tools-1.17.1/.invar/archive/sessions-2025-12.md +147 -0
- invar_tools-1.17.1/.invar/context.md +215 -0
- invar_tools-1.17.1/.invar/examples/README.md +25 -0
- invar_tools-1.17.1/.invar/examples/conftest.py +3 -0
- invar_tools-1.17.1/.invar/examples/contracts.py +190 -0
- invar_tools-1.17.1/.invar/examples/core_shell.py +227 -0
- invar_tools-1.17.1/.invar/examples/functional.py +613 -0
- invar_tools-1.17.1/.invar/examples/workflow.md +81 -0
- invar_tools-1.17.1/.invar/feedback/feedback-2026-01-03.md +190 -0
- invar_tools-1.17.1/.invar/mcp-setup.md +83 -0
- invar_tools-1.17.1/.invar/project-additions.md +45 -0
- invar_tools-1.17.1/.invar/proposals/TEMPLATE.md +93 -0
- invar_tools-1.17.1/.mcp.json +8 -0
- invar_tools-1.17.1/.pre-commit-config.yaml +47 -0
- invar_tools-1.17.1/.serena/.gitignore +1 -0
- invar_tools-1.17.1/.serena/project.yml +84 -0
- invar_tools-1.17.1/CHANGELOG.md +447 -0
- invar_tools-1.17.1/CLAUDE.md +462 -0
- invar_tools-1.17.1/INVAR.md +377 -0
- invar_tools-1.17.1/LICENSE +190 -0
- invar_tools-1.17.1/LICENSE-GPL +674 -0
- invar_tools-1.17.1/NOTICE +63 -0
- invar_tools-1.17.1/PKG-INFO +884 -0
- invar_tools-1.17.1/README.md +840 -0
- invar_tools-1.17.1/docs/.nojekyll +0 -0
- invar_tools-1.17.1/docs/agents.md +500 -0
- invar_tools-1.17.1/docs/design.md +1091 -0
- invar_tools-1.17.1/docs/diagrams.md +200 -0
- invar_tools-1.17.1/docs/guide.md +190 -0
- invar_tools-1.17.1/docs/guides/aider.md +475 -0
- invar_tools-1.17.1/docs/guides/cline.md +355 -0
- invar_tools-1.17.1/docs/guides/continue.md +466 -0
- invar_tools-1.17.1/docs/guides/cursor.md +442 -0
- invar_tools-1.17.1/docs/guides/multi-agent.md +323 -0
- invar_tools-1.17.1/docs/guides/pi.md +275 -0
- invar_tools-1.17.1/docs/history/decisions-2024.md +157 -0
- invar_tools-1.17.1/docs/history/feedback/compliance-analysis.md +503 -0
- invar_tools-1.17.1/docs/history/feedback/feedback-memo.md +459 -0
- invar_tools-1.17.1/docs/history/feedback/index.md +11 -0
- invar_tools-1.17.1/docs/history/index.md +22 -0
- invar_tools-1.17.1/docs/history/original-vision.md +190 -0
- invar_tools-1.17.1/docs/history/protocol-evolution.md +333 -0
- invar_tools-1.17.1/docs/history/research/cruxeval-quick-validation.md +145 -0
- invar_tools-1.17.1/docs/index.html +866 -0
- invar_tools-1.17.1/docs/logo.svg +8 -0
- invar_tools-1.17.1/docs/proposals/DX-23-entry-point-detection.md +479 -0
- invar_tools-1.17.1/docs/proposals/DX-25-functional-patterns.md +821 -0
- invar_tools-1.17.1/docs/proposals/DX-29-pure-content-detection.md +140 -0
- invar_tools-1.17.1/docs/proposals/DX-38-contract-quality-rules.md +285 -0
- invar_tools-1.17.1/docs/proposals/DX-60-structured-rules-ssot.md +416 -0
- invar_tools-1.17.1/docs/proposals/DX-61-functional-pattern-guidance.md +1139 -0
- invar_tools-1.17.1/docs/proposals/DX-61-implementation-design.md +1466 -0
- invar_tools-1.17.1/docs/proposals/DX-62-proactive-reference-reading.md +370 -0
- invar_tools-1.17.1/docs/proposals/DX-68-agent-behavior-optimization.md +299 -0
- invar_tools-1.17.1/docs/proposals/DX-74-experiment-report.md +1585 -0
- invar_tools-1.17.1/docs/proposals/DX-75-attention-aware-framework.md +959 -0
- invar_tools-1.17.1/docs/proposals/DX-78-mcp-protocol-sync.md +575 -0
- invar_tools-1.17.1/docs/proposals/DX-79-invar-usage-feedback.md +1114 -0
- invar_tools-1.17.1/docs/proposals/DX-80-guard-cli-mcp-alignment.md +504 -0
- invar_tools-1.17.1/docs/proposals/DX-81-multi-agent-init.md +836 -0
- invar_tools-1.17.1/docs/proposals/DX-83-multi-agent-subagent-support.md +1238 -0
- invar_tools-1.17.1/docs/proposals/DX-84-security-review-backlog.md +162 -0
- invar_tools-1.17.1/docs/proposals/LX-01-multi-language-feasibility.md +494 -0
- invar_tools-1.17.1/docs/proposals/LX-04-pi-agent-support.md +495 -0
- invar_tools-1.17.1/docs/proposals/LX-07-extension-skills.md +1561 -0
- invar_tools-1.17.1/docs/proposals/LX-08-extension-skills-future.md +67 -0
- invar_tools-1.17.1/docs/proposals/LX-09-legacy-onboarding.md +387 -0
- invar_tools-1.17.1/docs/proposals/LX-11-cursor-support.md +570 -0
- invar_tools-1.17.1/docs/proposals/LX-13-typescript-runtime-optimization.md +886 -0
- invar_tools-1.17.1/docs/proposals/LX-15-typescript-guard-parity.md +517 -0
- invar_tools-1.17.1/docs/proposals/LX-16-typescript-guard-remaining-gap.md +420 -0
- invar_tools-1.17.1/docs/proposals/completed/2024-12-21-guard-enhancements.md +589 -0
- invar_tools-1.17.1/docs/proposals/completed/2024-12-21-language-inspired-enhancements.md +4445 -0
- invar_tools-1.17.1/docs/proposals/completed/2024-12-21-test-first-enhancement.md +842 -0
- invar_tools-1.17.1/docs/proposals/completed/2025-12-21-dx-improvements.md +1297 -0
- invar_tools-1.17.1/docs/proposals/completed/2025-12-23-dx-20-property-testing-enhancements.md +575 -0
- invar_tools-1.17.1/docs/proposals/completed/2025-12-23-dx-21-package-and-init.md +401 -0
- invar_tools-1.17.1/docs/proposals/completed/AGENT-IMPROVEMENTS.md +94 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-11-documentation-restructure.md +875 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-12-hypothesis-fallback.md +305 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-13-incremental-prove.md +462 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-14-expanded-prove-usage.md +249 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-16-agent-tool-enforcement.md +181 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-17-workflow-enforcement.md +198 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-22-verification-strategy.md +752 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-24-mechanism-documentation.md +823 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-26-guard-simplification.md +506 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-27-system-prompt-protocol.md +190 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-28-semantic-verification.md +784 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-30-visible-workflow.md +517 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-31-adversarial-reviewer.md +742 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-32-workflow-iteration.md +338 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-33-verification-blind-spots.md +381 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-34-review-cycle.md +255 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-35-workflow-phase-separation.md +1276 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-36-documentation-restructuring.md +855 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-37-coverage-integration.md +322 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-39-workflow-efficiency.md +294 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-40-smart-tool-redirect-hook.md +147 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-41-automatic-review-orchestration.md +212 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-42-workflow-auto-routing.md +325 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-43-cross-platform-distribution.md +68 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-45-template-consistency.md +282 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-46-documentation-audit.md +142 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-47-command-skill-naming.md +210 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-48-code-structure-reorganization.md +498 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-49-protocol-distribution-unification.md +741 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-50-workflow-enforcement.md +122 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-51-workflow-phase-visibility.md +250 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-52-venv-dependency-injection.md +836 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-53-review-loop-effectiveness.md +420 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-54-agent-native-context-management.md +214 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-55-claude-init-conflict-resolution.md +792 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-56-template-sync-unification.md +542 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-57-claude-code-hooks.md +802 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-58-document-structure-optimization.md +453 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-63-contracts-first-enforcement.md +512 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-64-version-display-unification.md +104 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-65-single-file-guard.md +157 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-66-escape-hatch-visibility.md +154 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-67-explicit-skill-invocation.md +208 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-69-project-uninstall.md +181 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-70-init-simplification.md +273 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-70-review-isolation.md +185 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-71-skill-command-simplification.md +152 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-72-mandatory-self-review-detection.md +140 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-74-tiered-attention-defense.md +913 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-76-structured-document-query.md +451 -0
- invar_tools-1.17.1/docs/proposals/completed/DX-77-mcp-doc-tools-enhancements.md +404 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-02-agent-portability-analysis.md +579 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-03-multi-agent-support.md +60 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-05-language-agnostic-protocol.md +1237 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-06-appendix-guard-comparison.md +499 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-06-typescript-tooling.md +956 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-09-legacy-onboarding.md +1290 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-10-typescript-size-limits.md +267 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-12-typescript-contract-enforcement.md +612 -0
- invar_tools-1.17.1/docs/proposals/completed/LX-14-typescript-doctest-execution.md +368 -0
- invar_tools-1.17.1/docs/proposals/index.md +557 -0
- invar_tools-1.17.1/docs/reference/agent-information-hierarchy.md +268 -0
- invar_tools-1.17.1/docs/reference/architecture/index.md +134 -0
- invar_tools-1.17.1/docs/reference/contracts/advanced.md +100 -0
- invar_tools-1.17.1/docs/reference/contracts/completeness.md +265 -0
- invar_tools-1.17.1/docs/reference/contracts/doctests.md +341 -0
- invar_tools-1.17.1/docs/reference/contracts/index.md +54 -0
- invar_tools-1.17.1/docs/reference/contracts/pre-post.md +304 -0
- invar_tools-1.17.1/docs/reference/documentation.md +186 -0
- invar_tools-1.17.1/docs/reference/index.md +56 -0
- invar_tools-1.17.1/docs/reference/proposal-workflow.md +229 -0
- invar_tools-1.17.1/docs/reference/rules/index.md +150 -0
- invar_tools-1.17.1/docs/reference/rules/severity.md +251 -0
- invar_tools-1.17.1/docs/reference/verification/crosshair-vs-hypothesis.md +147 -0
- invar_tools-1.17.1/docs/reference/verification/index.md +152 -0
- invar_tools-1.17.1/docs/reference/verification/smart-routing.md +178 -0
- invar_tools-1.17.1/docs/reference/workflow/index.md +44 -0
- invar_tools-1.17.1/docs/reference/workflow/session-start.md +228 -0
- invar_tools-1.17.1/docs/reference/workflow/usbv.md +338 -0
- invar_tools-1.17.1/docs/rule-severity-comparison.md +389 -0
- invar_tools-1.17.1/docs/terminal-gif-guide.md +230 -0
- invar_tools-1.17.1/docs/test-reports/DX-55-test-report.md +172 -0
- invar_tools-1.17.1/docs/test-reports/DX-56-test-report.md +209 -0
- invar_tools-1.17.1/docs/test-reports/DX-58-test-scenario.md +165 -0
- invar_tools-1.17.1/docs/testing/v1.5.0-stress-test.md +255 -0
- invar_tools-1.17.1/docs/testing/v1.5.0-test-report.md +172 -0
- invar_tools-1.17.1/docs/testing/v1.5.0-workflow-compliance.md +167 -0
- invar_tools-1.17.1/docs/vision.md +290 -0
- invar_tools-1.17.1/pyproject.toml +253 -0
- invar_tools-1.17.1/runtime/LICENSE +190 -0
- invar_tools-1.17.1/runtime/README.md +108 -0
- invar_tools-1.17.1/runtime/pyproject.toml +51 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/__init__.py +75 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/contracts.py +249 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/decorators.py +152 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/invariant.py +61 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/relations.py +190 -0
- invar_tools-1.17.1/runtime/src/invar_runtime/resource.py +99 -0
- invar_tools-1.17.1/scripts/embed_node_tools.py +348 -0
- invar_tools-1.17.1/scripts/smart-guard.sh +43 -0
- invar_tools-1.17.1/src/core/__init__.py +0 -0
- invar_tools-1.17.1/src/invar/__init__.py +83 -0
- invar_tools-1.17.1/src/invar/core/__init__.py +8 -0
- invar_tools-1.17.1/src/invar/core/contracts.py +445 -0
- invar_tools-1.17.1/src/invar/core/doc_edit.py +187 -0
- invar_tools-1.17.1/src/invar/core/doc_parser.py +563 -0
- invar_tools-1.17.1/src/invar/core/entry_points.py +369 -0
- invar_tools-1.17.1/src/invar/core/extraction.py +171 -0
- invar_tools-1.17.1/src/invar/core/feedback.py +110 -0
- invar_tools-1.17.1/src/invar/core/format_specs.py +195 -0
- invar_tools-1.17.1/src/invar/core/format_strategies.py +199 -0
- invar_tools-1.17.1/src/invar/core/formatter.py +323 -0
- invar_tools-1.17.1/src/invar/core/hypothesis_strategies.py +494 -0
- invar_tools-1.17.1/src/invar/core/inspect.py +154 -0
- invar_tools-1.17.1/src/invar/core/lambda_helpers.py +191 -0
- invar_tools-1.17.1/src/invar/core/language.py +88 -0
- invar_tools-1.17.1/src/invar/core/models.py +505 -0
- invar_tools-1.17.1/src/invar/core/must_use.py +173 -0
- invar_tools-1.17.1/src/invar/core/parser.py +283 -0
- invar_tools-1.17.1/src/invar/core/patterns/__init__.py +53 -0
- invar_tools-1.17.1/src/invar/core/patterns/detector.py +254 -0
- invar_tools-1.17.1/src/invar/core/patterns/p0_exhaustive.py +219 -0
- invar_tools-1.17.1/src/invar/core/patterns/p0_literal.py +319 -0
- invar_tools-1.17.1/src/invar/core/patterns/p0_newtype.py +223 -0
- invar_tools-1.17.1/src/invar/core/patterns/p0_nonempty.py +319 -0
- invar_tools-1.17.1/src/invar/core/patterns/p0_validation.py +290 -0
- invar_tools-1.17.1/src/invar/core/patterns/registry.py +238 -0
- invar_tools-1.17.1/src/invar/core/patterns/types.py +171 -0
- invar_tools-1.17.1/src/invar/core/postcondition_scope.py +128 -0
- invar_tools-1.17.1/src/invar/core/property_gen.py +431 -0
- invar_tools-1.17.1/src/invar/core/purity.py +375 -0
- invar_tools-1.17.1/src/invar/core/purity_heuristics.py +180 -0
- invar_tools-1.17.1/src/invar/core/references.py +182 -0
- invar_tools-1.17.1/src/invar/core/review_trigger.py +370 -0
- invar_tools-1.17.1/src/invar/core/rule_meta.py +270 -0
- invar_tools-1.17.1/src/invar/core/rules.py +564 -0
- invar_tools-1.17.1/src/invar/core/shell_analysis.py +247 -0
- invar_tools-1.17.1/src/invar/core/shell_architecture.py +171 -0
- invar_tools-1.17.1/src/invar/core/strategies.py +260 -0
- invar_tools-1.17.1/src/invar/core/suggestions.py +416 -0
- invar_tools-1.17.1/src/invar/core/sync_helpers.py +264 -0
- invar_tools-1.17.1/src/invar/core/tautology.py +203 -0
- invar_tools-1.17.1/src/invar/core/template_helpers.py +32 -0
- invar_tools-1.17.1/src/invar/core/template_parser.py +467 -0
- invar_tools-1.17.1/src/invar/core/timeout_inference.py +111 -0
- invar_tools-1.17.1/src/invar/core/trivial_detection.py +189 -0
- invar_tools-1.17.1/src/invar/core/ts_parsers.py +286 -0
- invar_tools-1.17.1/src/invar/core/ts_sig_parser.py +310 -0
- invar_tools-1.17.1/src/invar/core/utils.py +411 -0
- invar_tools-1.17.1/src/invar/core/verification_routing.py +155 -0
- invar_tools-1.17.1/src/invar/mcp/__init__.py +10 -0
- invar_tools-1.17.1/src/invar/mcp/__main__.py +13 -0
- invar_tools-1.17.1/src/invar/mcp/handlers.py +445 -0
- invar_tools-1.17.1/src/invar/mcp/server.py +550 -0
- invar_tools-1.17.1/src/invar/node_tools/.gitignore +17 -0
- invar_tools-1.17.1/src/invar/node_tools/MANIFEST +8 -0
- invar_tools-1.17.1/src/invar/node_tools/__init__.py +51 -0
- invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/cli.js +160 -0
- invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/cli.js.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/index.js +105 -0
- invar_tools-1.17.1/src/invar/node_tools/eslint-plugin/index.js.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/bundle.js +77 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.d.ts +12 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.d.ts.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.js +149 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/cli.js.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.d.ts +338 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.d.ts.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.js +260 -0
- invar_tools-1.17.1/src/invar/node_tools/fc-runner/index.js.map +1 -0
- invar_tools-1.17.1/src/invar/node_tools/quick-check/cli.js +28 -0
- invar_tools-1.17.1/src/invar/node_tools/ts-analyzer/cli.js +480 -0
- invar_tools-1.17.1/src/invar/node_tools/ts-query.js +396 -0
- invar_tools-1.17.1/src/invar/py.typed +0 -0
- invar_tools-1.17.1/src/invar/shell/__init__.py +8 -0
- invar_tools-1.17.1/src/invar/shell/claude_hooks.py +549 -0
- invar_tools-1.17.1/src/invar/shell/commands/__init__.py +11 -0
- invar_tools-1.17.1/src/invar/shell/commands/doc.py +409 -0
- invar_tools-1.17.1/src/invar/shell/commands/feedback.py +258 -0
- invar_tools-1.17.1/src/invar/shell/commands/guard.py +634 -0
- invar_tools-1.17.1/src/invar/shell/commands/hooks.py +74 -0
- invar_tools-1.17.1/src/invar/shell/commands/init.py +676 -0
- invar_tools-1.17.1/src/invar/shell/commands/merge.py +256 -0
- invar_tools-1.17.1/src/invar/shell/commands/mutate.py +184 -0
- invar_tools-1.17.1/src/invar/shell/commands/perception.py +553 -0
- invar_tools-1.17.1/src/invar/shell/commands/skill.py +187 -0
- invar_tools-1.17.1/src/invar/shell/commands/sync_self.py +113 -0
- invar_tools-1.17.1/src/invar/shell/commands/template_sync.py +449 -0
- invar_tools-1.17.1/src/invar/shell/commands/test.py +119 -0
- invar_tools-1.17.1/src/invar/shell/commands/uninstall.py +544 -0
- invar_tools-1.17.1/src/invar/shell/commands/update.py +40 -0
- invar_tools-1.17.1/src/invar/shell/config.py +531 -0
- invar_tools-1.17.1/src/invar/shell/contract_coverage.py +362 -0
- invar_tools-1.17.1/src/invar/shell/coverage.py +351 -0
- invar_tools-1.17.1/src/invar/shell/doc_tools.py +459 -0
- invar_tools-1.17.1/src/invar/shell/fs.py +169 -0
- invar_tools-1.17.1/src/invar/shell/git.py +87 -0
- invar_tools-1.17.1/src/invar/shell/guard_helpers.py +420 -0
- invar_tools-1.17.1/src/invar/shell/guard_output.py +332 -0
- invar_tools-1.17.1/src/invar/shell/mcp_config.py +174 -0
- invar_tools-1.17.1/src/invar/shell/mutation.py +314 -0
- invar_tools-1.17.1/src/invar/shell/pattern_integration.py +234 -0
- invar_tools-1.17.1/src/invar/shell/pi_hooks.py +213 -0
- invar_tools-1.17.1/src/invar/shell/pi_tools.py +127 -0
- invar_tools-1.17.1/src/invar/shell/property_tests.py +278 -0
- invar_tools-1.17.1/src/invar/shell/prove/__init__.py +9 -0
- invar_tools-1.17.1/src/invar/shell/prove/accept.py +113 -0
- invar_tools-1.17.1/src/invar/shell/prove/cache.py +133 -0
- invar_tools-1.17.1/src/invar/shell/prove/crosshair.py +502 -0
- invar_tools-1.17.1/src/invar/shell/prove/guard_ts.py +1004 -0
- invar_tools-1.17.1/src/invar/shell/prove/hypothesis.py +293 -0
- invar_tools-1.17.1/src/invar/shell/py_refs.py +156 -0
- invar_tools-1.17.1/src/invar/shell/skill_manager.py +355 -0
- invar_tools-1.17.1/src/invar/shell/subprocess_env.py +393 -0
- invar_tools-1.17.1/src/invar/shell/template_engine.py +369 -0
- invar_tools-1.17.1/src/invar/shell/templates.py +471 -0
- invar_tools-1.17.1/src/invar/shell/testing.py +348 -0
- invar_tools-1.17.1/src/invar/shell/ts_compiler.py +238 -0
- invar_tools-1.17.1/src/invar/templates/CLAUDE.md.template +163 -0
- invar_tools-1.17.1/src/invar/templates/__init__.py +1 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/python/critical-rules.md +33 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/python/quick-reference.md +24 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/typescript/critical-rules.md +40 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/typescript/quick-reference.md +24 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/universal/check-in.md +25 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/universal/skills.md +73 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/universal/tool-selection.md +110 -0
- invar_tools-1.17.1/src/invar/templates/claude-md/universal/workflow.md +55 -0
- invar_tools-1.17.1/src/invar/templates/commands/audit.md.jinja +161 -0
- invar_tools-1.17.1/src/invar/templates/commands/guard.md +83 -0
- invar_tools-1.17.1/src/invar/templates/config/AGENT.md.jinja +256 -0
- invar_tools-1.17.1/src/invar/templates/config/CLAUDE.md.jinja +53 -0
- invar_tools-1.17.1/src/invar/templates/config/context.md.jinja +130 -0
- invar_tools-1.17.1/src/invar/templates/config/pre-commit.yaml.jinja +46 -0
- invar_tools-1.17.1/src/invar/templates/context.md.template +101 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/README.md +25 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/conftest.py +3 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/contracts.py +190 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/core_shell.py +227 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/functional.py +613 -0
- invar_tools-1.17.1/src/invar/templates/examples/python/workflow.md +81 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/README.md +31 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/contracts.ts +163 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/core_shell.ts +374 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/functional.ts +601 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/patterns.md +193 -0
- invar_tools-1.17.1/src/invar/templates/examples/typescript/workflow.md +95 -0
- invar_tools-1.17.1/src/invar/templates/hooks/PostToolUse.sh.jinja +111 -0
- invar_tools-1.17.1/src/invar/templates/hooks/PreToolUse.sh.jinja +112 -0
- invar_tools-1.17.1/src/invar/templates/hooks/Stop.sh.jinja +23 -0
- invar_tools-1.17.1/src/invar/templates/hooks/UserPromptSubmit.sh.jinja +115 -0
- invar_tools-1.17.1/src/invar/templates/hooks/__init__.py +1 -0
- invar_tools-1.17.1/src/invar/templates/hooks/pi/invar.ts.jinja +116 -0
- invar_tools-1.17.1/src/invar/templates/manifest.toml +147 -0
- invar_tools-1.17.1/src/invar/templates/onboard/assessment.md.jinja +214 -0
- invar_tools-1.17.1/src/invar/templates/onboard/patterns/python.md +347 -0
- invar_tools-1.17.1/src/invar/templates/onboard/patterns/typescript.md +452 -0
- invar_tools-1.17.1/src/invar/templates/onboard/roadmap.md.jinja +168 -0
- invar_tools-1.17.1/src/invar/templates/pi-tools/invar/index.ts +691 -0
- invar_tools-1.17.1/src/invar/templates/proposal.md.template +93 -0
- invar_tools-1.17.1/src/invar/templates/protocol/INVAR.md.jinja +51 -0
- invar_tools-1.17.1/src/invar/templates/protocol/python/architecture-examples.md +41 -0
- invar_tools-1.17.1/src/invar/templates/protocol/python/contracts-syntax.md +56 -0
- invar_tools-1.17.1/src/invar/templates/protocol/python/markers.md +44 -0
- invar_tools-1.17.1/src/invar/templates/protocol/python/tools.md +27 -0
- invar_tools-1.17.1/src/invar/templates/protocol/python/troubleshooting.md +38 -0
- invar_tools-1.17.1/src/invar/templates/protocol/typescript/architecture-examples.md +52 -0
- invar_tools-1.17.1/src/invar/templates/protocol/typescript/contracts-syntax.md +73 -0
- invar_tools-1.17.1/src/invar/templates/protocol/typescript/markers.md +48 -0
- invar_tools-1.17.1/src/invar/templates/protocol/typescript/tools.md +68 -0
- invar_tools-1.17.1/src/invar/templates/protocol/typescript/troubleshooting.md +104 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/architecture.md +36 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/completion.md +14 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/contracts-concept.md +37 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/header.md +17 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/session.md +17 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/six-laws.md +10 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/usbv.md +14 -0
- invar_tools-1.17.1/src/invar/templates/protocol/universal/visible-workflow.md +25 -0
- invar_tools-1.17.1/src/invar/templates/skills/develop/SKILL.md.jinja +506 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/_registry.yaml +93 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/acceptance/SKILL.md +383 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/SKILL.md +448 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/patterns/python.md +347 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/patterns/typescript.md +452 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/templates/assessment.md.jinja +214 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/invar-onboard/templates/roadmap.md.jinja +168 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/security/SKILL.md +382 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/_common.yaml +126 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/python.yaml +155 -0
- invar_tools-1.17.1/src/invar/templates/skills/extensions/security/patterns/typescript.yaml +194 -0
- invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/CONFIG.md +480 -0
- invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/SKILL.md +466 -0
- invar_tools-1.17.1/src/invar/templates/skills/invar-reflect/template.md +343 -0
- invar_tools-1.17.1/src/invar/templates/skills/investigate/SKILL.md.jinja +118 -0
- invar_tools-1.17.1/src/invar/templates/skills/propose/SKILL.md.jinja +134 -0
- invar_tools-1.17.1/src/invar/templates/skills/review/SKILL.md.jinja +325 -0
- invar_tools-1.17.1/src/shell/__init__.py +0 -0
- invar_tools-1.17.1/tests/__init__.py +1 -0
- invar_tools-1.17.1/tests/conftest.py +58 -0
- invar_tools-1.17.1/tests/experiments/conftest.py +7 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/README.md +150 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS.md +75 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS_V2.md +342 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/RESULTS_V4.md +710 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/ground_truth.yaml +428 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/prompts.yaml +105 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/api_client.py +104 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/auth_service.py +87 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/config_manager.py +141 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/data_processor.py +118 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/file_handler.py +132 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario/utils.py +156 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/analytics_engine.py +825 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/ground_truth.yaml +282 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/inventory_manager.py +730 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/notification_service.py +736 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/order_processor.py +760 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/payment_gateway.py +634 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v2/user_service.py +700 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/README.md +60 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/cache_service.py +323 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/calculator.py +327 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/data_processor.py +337 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/ground_truth.yaml +454 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/user_manager.py +352 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v3/validator.py +347 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/.serena/.gitignore +1 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/.serena/project.yml +84 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/README.md +83 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/config_manager.py +243 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/data_service.py +306 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/ground_truth.yaml +530 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/math_utils.py +291 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/report_generator.py +346 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v4/user_auth.py +319 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/api_gateway.py +285 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/auth_service.py +279 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/cache_handler.py +270 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/config_loader.py +248 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/data_validator.py +283 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/ground_truth.yaml +888 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/metrics_collector.py +266 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/notification_service.py +261 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/payment_processor.py +343 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/report_builder.py +336 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/task_scheduler.py +296 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/user_manager.py +266 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v5/utils.py +308 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/api_gateway.py +270 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/auth_service.py +264 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/cache_handler.py +257 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/config_loader.py +239 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/data_validator.py +270 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/ground_truth.yaml +888 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/metrics_collector.py +256 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/notification_service.py +251 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/payment_processor.py +326 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/report_builder.py +324 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/task_scheduler.py +285 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/user_manager.py +252 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v6/utils.py +308 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/api_service.py +712 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/auth_manager.py +598 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/data_processor.py +602 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/ground_truth.yaml +239 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/report_engine.py +904 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/storage_handler.py +818 -0
- invar_tools-1.17.1/tests/experiments/dx74_attention_drift/scenario_v7/utils.py +417 -0
- invar_tools-1.17.1/tests/integration/__init__.py +0 -0
- invar_tools-1.17.1/tests/integration/test_cli_flags.py +196 -0
- invar_tools-1.17.1/tests/integration/test_dx55_regression.py +401 -0
- invar_tools-1.17.1/tests/integration/test_dx56_sync.py +226 -0
- invar_tools-1.17.1/tests/integration/test_dx78_ts_compiler.py +572 -0
- invar_tools-1.17.1/tests/integration/test_lx05_detection.py +130 -0
- invar_tools-1.17.1/tests/integration/test_lx05_integration.py +495 -0
- invar_tools-1.17.1/tests/integration/test_lx05_templates.py +227 -0
- invar_tools-1.17.1/tests/integration/test_lx06_typescript.py +406 -0
- invar_tools-1.17.1/tests/integration/test_lx07_skills.py +491 -0
- invar_tools-1.17.1/tests/integration/test_mcp_doc_tools.py +535 -0
- invar_tools-1.17.1/tests/test_subprocess_env.py +287 -0
- invar_tools-1.17.1/typescript/.gitignore +30 -0
- invar_tools-1.17.1/typescript/README.md +105 -0
- invar_tools-1.17.1/typescript/doctest.config.json +7 -0
- invar_tools-1.17.1/typescript/package.json +35 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/CONFIGURATION.md +726 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/EXAMPLES.md +932 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/package.json +48 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/cli.ts +179 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/index.ts +111 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/behavior.test.ts +1391 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/e2e-scenarios.test.ts +450 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/function-lengths.ts +143 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/has-io-imports.ts +19 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/core/valid-small.ts +29 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/exported-functions.ts +48 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/shell/with-io.ts +31 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/__tests__/fixtures/tests/large.test.ts +262 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/max-file-lines.ts +119 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/max-function-lines.ts +152 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-any-in-schema.ts +47 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-empty-schema.ts +83 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-impure-calls-in-core.ts +62 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-io-in-core.ts +112 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-pure-logic-in-shell.ts +226 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-redundant-type-schema.ts +114 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/no-runtime-imports.ts +82 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-complete-validation.ts +127 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-jsdoc-example.ts +101 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/require-schema-validation.ts +348 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/shell-complexity.ts +328 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/shell-result-type.ts +166 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/rules/thin-entry-points.ts +207 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/utils/layer-detection.ts +110 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/src/utils/math-example.ts +31 -0
- invar_tools-1.17.1/typescript/packages/eslint-plugin/tsconfig.json +9 -0
- invar_tools-1.17.1/typescript/packages/fc-runner/package.json +42 -0
- invar_tools-1.17.1/typescript/packages/fc-runner/src/cli.ts +163 -0
- invar_tools-1.17.1/typescript/packages/fc-runner/src/index.ts +328 -0
- invar_tools-1.17.1/typescript/packages/fc-runner/tsconfig.json +8 -0
- invar_tools-1.17.1/typescript/packages/quick-check/package.json +47 -0
- invar_tools-1.17.1/typescript/packages/quick-check/src/cli.ts +123 -0
- invar_tools-1.17.1/typescript/packages/quick-check/src/index.ts +279 -0
- invar_tools-1.17.1/typescript/packages/quick-check/tsconfig.json +8 -0
- invar_tools-1.17.1/typescript/packages/ts-analyzer/package.json +42 -0
- invar_tools-1.17.1/typescript/packages/ts-analyzer/src/cli.ts +131 -0
- invar_tools-1.17.1/typescript/packages/ts-analyzer/src/index.ts +622 -0
- invar_tools-1.17.1/typescript/packages/ts-analyzer/tsconfig.json +8 -0
- invar_tools-1.17.1/typescript/pnpm-workspace.yaml +2 -0
- invar_tools-1.17.1/typescript/scripts/bundle.mjs +65 -0
- invar_tools-1.17.1/typescript/scripts/generate-doctests.mjs +307 -0
- invar_tools-1.17.1/typescript/tsconfig.base.json +24 -0
- invar_tools-1.17.1/typescript/vitest.config.ts +16 -0
- 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
|