[build-system]
requires = ["hatchling>=1.25"]
build-backend = "hatchling.build"

[project]
name = "intract"
version = "0.5.13"
description = "Intent contract tagging, validation and semantic mapping for codebases."
readme = "README.md"
requires-python = ">=3.10"
license = "Apache-2.0"
authors = [ {name = "Tom Sapletta",email = "tom@sapletta.com"}]
keywords = ["intent", "contract", "static-analysis", "code-quality", "validation", "refactoring"]
classifiers = [
  "Development Status :: 3 - Alpha",
  "Environment :: Console",
  "Intended Audience :: Developers",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Topic :: Software Development :: Quality Assurance",
]
dependencies = ["pyyaml>=6.0", "typer>=0.12.0", "rich>=13.0"]

[project.optional-dependencies]
dev = ["pytest>=7.0", "ruff>=0.4", "mypy>=1.8",
    "goal>=2.1.0",
    "costs>=0.1.20",
    "pfix>=0.1.60",
]
llm = ["litellm>=1.0"]
watch = ["watchdog>=4.0"]
schema = ["jsonschema>=4.0"]
treesitter = ["tree-sitter>=0.22", "tree-sitter-languages>=1.10.2"]

[project.scripts]
intract = "intract.cli:app"
intract-mcp = "intract.mcp.server:run_server"

[tool.hatch.build.targets.wheel]
packages = ["src/intract"]

[tool.ruff]
line-length = 100
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]


[project.entry-points."intract.parsers"]
inline = "intract.plugins.builtins:InlineContractParserPlugin"
manifest = "intract.plugins.builtins:ManifestParserPlugin"
openapi = "intract.plugins.builtins:OpenAPIParserPlugin"

[project.entry-points."intract.validators"]
basic = "intract.plugins.builtins:BasicContractValidatorPlugin"
artifact = "intract.plugins.builtins:ArtifactStructureValidatorPlugin"

[project.entry-points."intract.reporters"]
json = "intract.plugins.builtins:JsonReporterPlugin"

[project.entry-points."intract.rules"]
input_presence = "intract.validators.input_output:InputPresenceRule"
output_presence = "intract.validators.input_output:OutputPresenceRule"
return_value = "intract.validators.input_output:ReturnValueRule"
no_forbidden_effect = "intract.validators.effects:NoForbiddenEffectRule"

[tool.pfix]
# Self-healing Python configuration
model = "openrouter/qwen/qwen3-coder-next"
auto_apply = true
auto_install_deps = true
auto_restart = false
max_retries = 3
create_backups = false
git_auto_commit = false

[tool.pfix.runtime_todo]
enabled = true
todo_file = "TODO.md"
min_severity = "low"
deduplicate = true

[tool.costs]
# AI Cost tracking configuration
badge = true
update_readme = true
readme_path = "README.md"
default_model = "openrouter/qwen/qwen3-coder-next"
analysis_mode = "byok"
full_history = true
max_commits = 500

# Cost thresholds for badge colors (USD)
badge_color_thresholds = { low = 1.0, medium = 5.0, high = 10.0, critical = 50.0 }
