invaris 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invaris-1.4.0/.github/workflows/ci.yml +103 -0
- invaris-1.4.0/.github/workflows/publish.yml +138 -0
- invaris-1.4.0/.gitignore +49 -0
- invaris-1.4.0/.invaris/contract.toml +43 -0
- invaris-1.4.0/CHANGELOG.md +167 -0
- invaris-1.4.0/LICENSE +21 -0
- invaris-1.4.0/PKG-INFO +315 -0
- invaris-1.4.0/README.md +284 -0
- invaris-1.4.0/action/render_summary.py +161 -0
- invaris-1.4.0/action.yml +132 -0
- invaris-1.4.0/docs/v1/SPEC.md +198 -0
- invaris-1.4.0/docs/v1/ci-github-actions.yml +39 -0
- invaris-1.4.0/docs/v1/m4-1-results.md +241 -0
- invaris-1.4.0/docs/v1/m4-protocol.md +194 -0
- invaris-1.4.0/docs/v1/m4-results.md +184 -0
- invaris-1.4.0/docs/v1/m5-protocol.md +153 -0
- invaris-1.4.0/docs/v1/m5-results.md +498 -0
- invaris-1.4.0/experiments/v1_m4/run_m4.py +1891 -0
- invaris-1.4.0/experiments/v1_m5/run_m5.py +2161 -0
- invaris-1.4.0/experiments/v1_m6/run_m6.py +895 -0
- invaris-1.4.0/pyproject.toml +70 -0
- invaris-1.4.0/src/invaris/__init__.py +3 -0
- invaris-1.4.0/src/invaris/_plugins/_worktree_isolate.py +183 -0
- invaris-1.4.0/src/invaris/_plugins/invaris_gate1_plugin.py +319 -0
- invaris-1.4.0/src/invaris/adapters/__init__.py +31 -0
- invaris-1.4.0/src/invaris/adapters/base.py +232 -0
- invaris-1.4.0/src/invaris/adapters/pytest_cov.py +46 -0
- invaris-1.4.0/src/invaris/adapters/ruff.py +299 -0
- invaris-1.4.0/src/invaris/adapters/tach.py +186 -0
- invaris-1.4.0/src/invaris/adapters/typecheck.py +210 -0
- invaris-1.4.0/src/invaris/artifacts.py +287 -0
- invaris-1.4.0/src/invaris/ast_mutator.py +475 -0
- invaris-1.4.0/src/invaris/base_probe.py +201 -0
- invaris-1.4.0/src/invaris/cli.py +688 -0
- invaris-1.4.0/src/invaris/contract.py +659 -0
- invaris-1.4.0/src/invaris/coverage_sqlite.py +280 -0
- invaris-1.4.0/src/invaris/dedup.py +233 -0
- invaris-1.4.0/src/invaris/evidence/__init__.py +1 -0
- invaris-1.4.0/src/invaris/evidence/caches.py +611 -0
- invaris-1.4.0/src/invaris/evidence/gc.py +471 -0
- invaris-1.4.0/src/invaris/evidence/runs.py +456 -0
- invaris-1.4.0/src/invaris/evidence/schema.py +336 -0
- invaris-1.4.0/src/invaris/evidence/store.py +111 -0
- invaris-1.4.0/src/invaris/evidence_db.py +42 -0
- invaris-1.4.0/src/invaris/evidence_query.py +378 -0
- invaris-1.4.0/src/invaris/final_status.py +105 -0
- invaris-1.4.0/src/invaris/funnel.py +377 -0
- invaris-1.4.0/src/invaris/gate0.py +559 -0
- invaris-1.4.0/src/invaris/gate1/__init__.py +1 -0
- invaris-1.4.0/src/invaris/gate1/base_probe_exec.py +549 -0
- invaris-1.4.0/src/invaris/gate1/base_probe_plan.py +325 -0
- invaris-1.4.0/src/invaris/gate1/coverage.py +357 -0
- invaris-1.4.0/src/invaris/gate1/execution.py +532 -0
- invaris-1.4.0/src/invaris/gate1/runner.py +542 -0
- invaris-1.4.0/src/invaris/gate1/selection.py +266 -0
- invaris-1.4.0/src/invaris/gate2/__init__.py +1 -0
- invaris-1.4.0/src/invaris/gate2/execution.py +422 -0
- invaris-1.4.0/src/invaris/gate2/planning.py +359 -0
- invaris-1.4.0/src/invaris/gate2/reporting.py +319 -0
- invaris-1.4.0/src/invaris/gate2/runner.py +478 -0
- invaris-1.4.0/src/invaris/harness_sync.py +563 -0
- invaris-1.4.0/src/invaris/head_baseline.py +638 -0
- invaris-1.4.0/src/invaris/import_graph.py +287 -0
- invaris-1.4.0/src/invaris/integrity.py +678 -0
- invaris-1.4.0/src/invaris/layout.py +124 -0
- invaris-1.4.0/src/invaris/mcp_server.py +385 -0
- invaris-1.4.0/src/invaris/mutator.py +67 -0
- invaris-1.4.0/src/invaris/paths.py +105 -0
- invaris-1.4.0/src/invaris/primitives.py +145 -0
- invaris-1.4.0/src/invaris/pytest_targets.py +386 -0
- invaris-1.4.0/src/invaris/snapshot.py +407 -0
- invaris-1.4.0/src/invaris/staged_worktree.py +228 -0
- invaris-1.4.0/src/invaris/test_ast_diff.py +477 -0
- invaris-1.4.0/src/invaris/verdict.py +250 -0
- invaris-1.4.0/src/invaris/verdict_assembly.py +313 -0
- invaris-1.4.0/tach.toml +488 -0
- invaris-1.4.0/tests/_helpers.py +57 -0
- invaris-1.4.0/tests/test_v1_1_1_correctness_fixes.py +806 -0
- invaris-1.4.0/tests/test_v1_3_boundaries.py +164 -0
- invaris-1.4.0/tests/test_v1_3_foundations.py +468 -0
- invaris-1.4.0/tests/test_v1_3_staged.py +662 -0
- invaris-1.4.0/tests/test_v1_4_base_ref.py +501 -0
- invaris-1.4.0/tests/test_v1_4_dogfood_layouts.py +628 -0
- invaris-1.4.0/tests/test_v1_4_gc_and_stop_hook.py +691 -0
- invaris-1.4.0/tests/test_v1_4_m6_and_dogfood.py +665 -0
- invaris-1.4.0/tests/test_v1_arg_max.py +279 -0
- invaris-1.4.0/tests/test_v1_base_probe.py +1259 -0
- invaris-1.4.0/tests/test_v1_evidence_db.py +396 -0
- invaris-1.4.0/tests/test_v1_gate0.py +602 -0
- invaris-1.4.0/tests/test_v1_gate1.py +579 -0
- invaris-1.4.0/tests/test_v1_gate1_cache_coverage.py +481 -0
- invaris-1.4.0/tests/test_v1_gate2_cache.py +648 -0
- invaris-1.4.0/tests/test_v1_gate2_sync_mcp.py +624 -0
- invaris-1.4.0/tests/test_v1_m35_telemetry_brownfield.py +645 -0
- invaris-1.4.0/tests/test_v1_release_polish.py +777 -0
- invaris-1.4.0/tests/test_v1_two_phase_survivors.py +399 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
verify:
|
|
18
|
+
name: Python ${{ matrix.python-version }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
python-version: ["3.11", "3.12"]
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Check out repository
|
|
27
|
+
uses: actions/checkout@v6
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v7
|
|
31
|
+
with:
|
|
32
|
+
enable-cache: true
|
|
33
|
+
cache-dependency-glob: "pyproject.toml"
|
|
34
|
+
|
|
35
|
+
- name: Install Python ${{ matrix.python-version }}
|
|
36
|
+
run: uv python install ${{ matrix.python-version }}
|
|
37
|
+
|
|
38
|
+
- name: Create dev virtual environment
|
|
39
|
+
run: |
|
|
40
|
+
uv venv --python ${{ matrix.python-version }} .venv
|
|
41
|
+
uv pip install --python .venv/bin/python -e ".[dev]"
|
|
42
|
+
|
|
43
|
+
- name: Lint and format check (ruff)
|
|
44
|
+
run: |
|
|
45
|
+
.venv/bin/ruff check .
|
|
46
|
+
.venv/bin/ruff format --check .
|
|
47
|
+
|
|
48
|
+
- name: Typecheck (mypy)
|
|
49
|
+
run: .venv/bin/mypy src/invaris/
|
|
50
|
+
|
|
51
|
+
- name: Architecture boundaries (tach)
|
|
52
|
+
run: .venv/bin/tach check
|
|
53
|
+
|
|
54
|
+
- name: Test suite (pytest)
|
|
55
|
+
run: |
|
|
56
|
+
export PATH="$PWD/.venv/bin:$PATH"
|
|
57
|
+
.venv/bin/pytest -q
|
|
58
|
+
|
|
59
|
+
- name: Build wheel and isolated zero-dep install smoke test
|
|
60
|
+
run: |
|
|
61
|
+
rm -rf dist /tmp/invaris-smoke-venv
|
|
62
|
+
uv build --wheel
|
|
63
|
+
uv venv --python ${{ matrix.python-version }} /tmp/invaris-smoke-venv
|
|
64
|
+
uv pip install --python /tmp/invaris-smoke-venv/bin/python --no-deps dist/invaris-*.whl
|
|
65
|
+
/tmp/invaris-smoke-venv/bin/invaris --version
|
|
66
|
+
/tmp/invaris-smoke-venv/bin/python -c '
|
|
67
|
+
import importlib.metadata as m
|
|
68
|
+
import json
|
|
69
|
+
import subprocess
|
|
70
|
+
|
|
71
|
+
reqs = [r for r in (m.requires("invaris") or []) if "extra ==" not in r]
|
|
72
|
+
assert reqs == [], f"unexpected runtime deps: {reqs}"
|
|
73
|
+
|
|
74
|
+
rpc = (
|
|
75
|
+
json.dumps(
|
|
76
|
+
{
|
|
77
|
+
"jsonrpc": "2.0",
|
|
78
|
+
"id": 1,
|
|
79
|
+
"method": "initialize",
|
|
80
|
+
"params": {"protocolVersion": "2025-06-18"},
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
+ "\n"
|
|
84
|
+
+ json.dumps({"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}})
|
|
85
|
+
+ "\n"
|
|
86
|
+
)
|
|
87
|
+
proc = subprocess.run(
|
|
88
|
+
["/tmp/invaris-smoke-venv/bin/invaris", "mcp"],
|
|
89
|
+
input=rpc,
|
|
90
|
+
capture_output=True,
|
|
91
|
+
text=True,
|
|
92
|
+
check=True,
|
|
93
|
+
)
|
|
94
|
+
lines = [json.loads(ln) for ln in proc.stdout.splitlines() if ln.strip()]
|
|
95
|
+
assert len(lines) == 2, lines
|
|
96
|
+
assert lines[0]["result"]["serverInfo"]["name"] == "invaris"
|
|
97
|
+
assert [t["name"] for t in lines[1]["result"]["tools"]] == [
|
|
98
|
+
"verify_patch",
|
|
99
|
+
"query_evidence",
|
|
100
|
+
"get_roi_stats",
|
|
101
|
+
]
|
|
102
|
+
print("Zero-dep wheel + MCP handshake OK:", lines[0]["result"]["serverInfo"])
|
|
103
|
+
'
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
target:
|
|
9
|
+
description: "Package index to publish to"
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- testpypi
|
|
13
|
+
- pypi
|
|
14
|
+
default: testpypi
|
|
15
|
+
|
|
16
|
+
permissions: {}
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: publish-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
build:
|
|
24
|
+
name: Build and smoke test
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Check out repository
|
|
31
|
+
uses: actions/checkout@v6
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
|
|
35
|
+
- name: Install uv
|
|
36
|
+
uses: astral-sh/setup-uv@v7
|
|
37
|
+
|
|
38
|
+
- name: Install Python 3.11
|
|
39
|
+
run: uv python install 3.11
|
|
40
|
+
|
|
41
|
+
- name: Check tag matches package version
|
|
42
|
+
if: github.ref_type == 'tag'
|
|
43
|
+
env:
|
|
44
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
45
|
+
run: |
|
|
46
|
+
python3 - <<'PY'
|
|
47
|
+
import os
|
|
48
|
+
import tomllib
|
|
49
|
+
|
|
50
|
+
with open("pyproject.toml", "rb") as fh:
|
|
51
|
+
version = tomllib.load(fh)["project"]["version"]
|
|
52
|
+
tag = os.environ["TAG_NAME"]
|
|
53
|
+
assert tag == f"v{version}", f"tag {tag} does not match pyproject version {version}"
|
|
54
|
+
PY
|
|
55
|
+
|
|
56
|
+
- name: Build wheel and sdist
|
|
57
|
+
run: |
|
|
58
|
+
rm -rf dist
|
|
59
|
+
uv build --python 3.11
|
|
60
|
+
|
|
61
|
+
- name: Isolated zero-dependency install smoke test
|
|
62
|
+
run: |
|
|
63
|
+
rm -rf /tmp/invaris-smoke-venv
|
|
64
|
+
uv venv --python 3.11 /tmp/invaris-smoke-venv
|
|
65
|
+
uv pip install --python /tmp/invaris-smoke-venv/bin/python --no-deps dist/invaris-*.whl
|
|
66
|
+
/tmp/invaris-smoke-venv/bin/invaris --version
|
|
67
|
+
/tmp/invaris-smoke-venv/bin/invaris verify --help > /dev/null
|
|
68
|
+
/tmp/invaris-smoke-venv/bin/python - <<'PY'
|
|
69
|
+
import importlib.metadata as m
|
|
70
|
+
import json
|
|
71
|
+
import subprocess
|
|
72
|
+
|
|
73
|
+
reqs = [r for r in (m.requires("invaris") or []) if "extra ==" not in r]
|
|
74
|
+
assert reqs == [], f"unexpected runtime deps: {reqs}"
|
|
75
|
+
|
|
76
|
+
rpc = (
|
|
77
|
+
json.dumps(
|
|
78
|
+
{
|
|
79
|
+
"jsonrpc": "2.0",
|
|
80
|
+
"id": 1,
|
|
81
|
+
"method": "initialize",
|
|
82
|
+
"params": {"protocolVersion": "2025-06-18"},
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
+ "\n"
|
|
86
|
+
+ json.dumps({"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}})
|
|
87
|
+
+ "\n"
|
|
88
|
+
)
|
|
89
|
+
proc = subprocess.run(
|
|
90
|
+
["/tmp/invaris-smoke-venv/bin/invaris", "mcp"],
|
|
91
|
+
input=rpc,
|
|
92
|
+
capture_output=True,
|
|
93
|
+
text=True,
|
|
94
|
+
check=True,
|
|
95
|
+
)
|
|
96
|
+
lines = [json.loads(ln) for ln in proc.stdout.splitlines() if ln.strip()]
|
|
97
|
+
assert len(lines) == 2, lines
|
|
98
|
+
assert lines[0]["result"]["serverInfo"]["name"] == "invaris"
|
|
99
|
+
assert [t["name"] for t in lines[1]["result"]["tools"]] == [
|
|
100
|
+
"verify_patch",
|
|
101
|
+
"query_evidence",
|
|
102
|
+
"get_roi_stats",
|
|
103
|
+
]
|
|
104
|
+
print("Zero-dep wheel + MCP handshake OK:", lines[0]["result"]["serverInfo"])
|
|
105
|
+
PY
|
|
106
|
+
|
|
107
|
+
- name: Upload distributions
|
|
108
|
+
uses: actions/upload-artifact@v4
|
|
109
|
+
with:
|
|
110
|
+
name: dist
|
|
111
|
+
path: dist/
|
|
112
|
+
if-no-files-found: error
|
|
113
|
+
|
|
114
|
+
publish:
|
|
115
|
+
name: Publish to ${{ github.event_name == 'workflow_dispatch' && inputs.target || 'pypi' }}
|
|
116
|
+
needs: build
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
environment: ${{ github.event_name == 'workflow_dispatch' && inputs.target || 'pypi' }}
|
|
119
|
+
permissions:
|
|
120
|
+
id-token: write
|
|
121
|
+
|
|
122
|
+
steps:
|
|
123
|
+
- name: Download distributions
|
|
124
|
+
uses: actions/download-artifact@v4
|
|
125
|
+
with:
|
|
126
|
+
name: dist
|
|
127
|
+
path: dist/
|
|
128
|
+
|
|
129
|
+
- name: Install uv
|
|
130
|
+
uses: astral-sh/setup-uv@v7
|
|
131
|
+
|
|
132
|
+
- name: Publish to TestPyPI
|
|
133
|
+
if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi'
|
|
134
|
+
run: uv publish --trusted-publishing always --publish-url https://test.pypi.org/legacy/ dist/*
|
|
135
|
+
|
|
136
|
+
- name: Publish to PyPI
|
|
137
|
+
if: github.event_name != 'workflow_dispatch' || inputs.target == 'pypi'
|
|
138
|
+
run: uv publish --trusted-publishing always dist/*
|
invaris-1.4.0/.gitignore
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Byte-compiled / cache
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Build and packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.eggs/
|
|
11
|
+
wheels/
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
env/
|
|
17
|
+
.python-version
|
|
18
|
+
|
|
19
|
+
# Test, lint and type-check caches
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
.coverage*
|
|
24
|
+
htmlcov/
|
|
25
|
+
.tox/
|
|
26
|
+
.nox/
|
|
27
|
+
|
|
28
|
+
# Verification & evaluation outputs
|
|
29
|
+
results/
|
|
30
|
+
.invaris/evidence.db*
|
|
31
|
+
.invaris/runs/
|
|
32
|
+
.invaris-m4/
|
|
33
|
+
.invaris-m5/
|
|
34
|
+
.invaris-m6-*/
|
|
35
|
+
|
|
36
|
+
# Experiment outputs (keep configs, not results)
|
|
37
|
+
experiments/**/runs/
|
|
38
|
+
experiments/**/cache/
|
|
39
|
+
experiments/**/outputs/
|
|
40
|
+
*.log
|
|
41
|
+
|
|
42
|
+
# Editors / OS
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
|
45
|
+
.DS_Store
|
|
46
|
+
|
|
47
|
+
# Secrets
|
|
48
|
+
.env
|
|
49
|
+
.env.*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "invaris"
|
|
3
|
+
ecosystem = "python"
|
|
4
|
+
python_version = "3.11"
|
|
5
|
+
|
|
6
|
+
[budgets]
|
|
7
|
+
gate0_timeout_s = 60
|
|
8
|
+
gate1_timeout_s = 120
|
|
9
|
+
gate2_timeout_s = 180
|
|
10
|
+
max_mutants_per_run = 25
|
|
11
|
+
cold_start_max_tests = 400
|
|
12
|
+
|
|
13
|
+
[gate1]
|
|
14
|
+
strict_diff_coverage = true
|
|
15
|
+
fail_on_pre_existing = false
|
|
16
|
+
high_min_branch_coverage = 90
|
|
17
|
+
medium_min_branch_coverage = 80
|
|
18
|
+
low_min_branch_coverage = 0
|
|
19
|
+
new_test_base_probe = "advisory"
|
|
20
|
+
|
|
21
|
+
[gate2]
|
|
22
|
+
mutate_medium = false
|
|
23
|
+
strict_medium_mutation = false
|
|
24
|
+
max_workers = 4
|
|
25
|
+
|
|
26
|
+
[integrity]
|
|
27
|
+
protected_paths = [".invaris/contract.toml", "tach.toml", "pyproject.toml", ".github/workflows/**"]
|
|
28
|
+
protected_test_globs = ["tests/**/*.py"]
|
|
29
|
+
forbid_new_skips = true
|
|
30
|
+
forbid_assertion_reduction = true
|
|
31
|
+
forbid_inline_suppressions = ["# noqa", "# type: ignore", "# tach-ignore"]
|
|
32
|
+
|
|
33
|
+
[tools]
|
|
34
|
+
lint = ["ruff", "check", "--output-format=json", "src", "tests", "experiments"]
|
|
35
|
+
format = ["ruff", "format", "--check", "src", "tests", "experiments"]
|
|
36
|
+
typecheck = ["mypy", "--output=json", "--no-error-summary", "src/invaris/"]
|
|
37
|
+
architecture = ["tach", "check", "--exact"]
|
|
38
|
+
test = ["pytest", "-q"]
|
|
39
|
+
|
|
40
|
+
[risk_tiers]
|
|
41
|
+
high = ["src/invaris/funnel.py", "src/invaris/verdict.py", "src/invaris/verdict_assembly.py", "src/invaris/integrity.py", "src/invaris/contract.py", "src/invaris/gate0.py", "src/invaris/snapshot.py", "src/invaris/staged_worktree.py", "src/invaris/gate1/**", "src/invaris/gate2/**", "src/invaris/evidence/**", "src/invaris/adapters/**"]
|
|
42
|
+
medium = ["src/invaris/**"]
|
|
43
|
+
low = ["tests/**", "docs/**", "experiments/**"]
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Invaris are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.4.0] - 2026-12-05
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Arbitrary `--base <ref>` with merge-base pinning.**
|
|
13
|
+
- `invaris verify --base <ref>` (alias of `--base-ref`), `verify_patch(base_ref=...)`, and the MCP `verify_patch` `base_ref` input now pin any non-`HEAD` ref to `git merge-base <ref> HEAD`. A multi-commit PR branch is verified from its fork point (committed branch changes plus uncommitted edits) and is not polluted by commits that landed on the base branch afterward.
|
|
14
|
+
- When no merge-base exists (unrelated histories, truncated shallow history, or unborn `HEAD`), the ref's own commit is used. An unresolvable ref, or one starting with `-`, fails closed as `INCONCLUSIVE` with a `snapshot_error` finding.
|
|
15
|
+
- `--staged` combined with a non-`HEAD` base fails closed with `INCONCLUSIVE`, because staged verification compares the index against `HEAD`.
|
|
16
|
+
- `snapshot.base_sha`, `base_content` blobs, the working-tree diff, Gate 0 static baseline subtraction, the Gate 1 base probe and failure attribution, and all cache keys use the pinned base commit. Base-probe messages now say "base" instead of "HEAD".
|
|
17
|
+
- Gate 0 contract onboarding still checks actual `HEAD`, so edits to an already-committed `.invaris/contract.toml` stay blocked under any `--base`.
|
|
18
|
+
- **Reusable GitHub Action.** `action.yml` installs Python and Invaris, runs `invaris verify --base <ref> --phase <phase> --json` (with `max-gate`, `python-version`, `working-directory`, `install-command`, and `allow-protected-edits` inputs), writes the verdict to the job summary, emits `::error` annotations for findings, and exposes `verdict`, `stopped-at-gate`, `run-id`, `base-sha`, `finding-count`, `exit-code`, and `verdict-json` outputs. An example workflow lives at `docs/v1/ci-github-actions.yml`.
|
|
19
|
+
- **`invaris gc [--dry-run] [--max-runs N] [--max-age-days D] [--max-db-mb M] [--json]`.**
|
|
20
|
+
- Evicts old runs (rows, findings, follow-up events, and `.invaris/runs/<run_id>/` directories), orphaned run directories, and stale cache rows, then runs `wal_checkpoint(TRUNCATE)`, `VACUUM`, and `PRAGMA optimize`. `--dry-run` opens the database read-only and reports exact counts.
|
|
21
|
+
- Always keeps the newest run, the newest `PASS` run, and the newest `PASS` run that ran through Gate 2.
|
|
22
|
+
- **`invaris status [--require-final] [--base REF] [--json]`.** A strictly read-only Stop-hook gate: exits 0 for a clean tree or when an exact-match `PASS` run through Gate 2 exists for the current `candidate_hash`, and exits 2 (fail-closed) otherwise.
|
|
23
|
+
- **Stop-hook wiring in `invaris sync`.** The `claude` target merges a `Stop` hook, the `cursor` target adds `.cursor/hooks.json` plus `.cursor/hooks/invaris-stop.sh`, and the new `opencode` target writes `.opencode/plugins/invaris-stop.js`.
|
|
24
|
+
- **OIDC PyPI publishing, self-dogfooding contract, and Milestone 6 harness plumbing.**
|
|
25
|
+
- Added two-job `.github/workflows/publish.yml` (`build` with zero-dep wheel + MCP smoke test and `publish` using PyPI/TestPyPI OIDC trusted publishing with zero stored credentials).
|
|
26
|
+
- Checked in Invaris's own `.invaris/contract.toml` (protecting `.invaris/contract.toml`, `tach.toml`, `pyproject.toml`, and `.github/workflows/**`) and added `experiments/v1_m6/run_m6.py` for Milestone 6 budget-ladder and advisor evaluations.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Evidence schema v5 adds `runs.max_gate` so a Gate 2 run that was skipped (no high-risk hunks) is still provably a final-phase run. Existing v4 rows are backfilled from `stopped_at_gate`.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **uv workspace monorepos.** Member `src` directories (and flat member directories) from `[tool.uv.workspace]` are now on the `PYTHONPATH` used by Gate 1, Gate 2, and `--staged` runs, so tests of packages that are not installed into the venv are collected instead of failing as `ModuleNotFoundError`. Poetry `packages[].from`, PDM `package-dir`, and setuptools `packages.find.where` roots are honored the same way.
|
|
35
|
+
- **`invaris init` on monorepos.** `protected_test_globs` now covers each workspace member's `tests/` directory, `risk_tiers.medium` and the scaffolded `tach.toml` `source_roots` list every member source root, and `testpaths` is read from `pytest.ini`, `tox.ini`, and `setup.cfg` as well as `pyproject.toml`.
|
|
36
|
+
- **`invaris init` on Poetry projects.** The project name and Python version now come from `[tool.poetry]` when `[project]` is absent.
|
|
37
|
+
- **`invaris init` on namespace-package layouts.** Flat repos whose package directories have no `__init__.py` now get `mypy --explicit-package-bases`, which avoids a `Source file found twice` crash that made Gate 0 `INCONCLUSIVE`.
|
|
38
|
+
|
|
39
|
+
## [1.3.0] - 2026-12-01
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **`--staged` pre-commit verification mode across CLI, Python API, MCP, and Git hooks.**
|
|
44
|
+
- Added `--staged` to `invaris verify`, `staged=True` to `verify_patch(...)`, and a `staged` boolean input to MCP `verify_patch`.
|
|
45
|
+
- Updated `invaris sync` so `.git/hooks/pre-commit` invokes `invaris verify --staged --max-gate 0`, verifying only staged Git index changes without letting unstaged working-tree edits leak into the check.
|
|
46
|
+
- Materializes the Git index in a read-only temporary worktree via `MaterializedIndexWorktree` (`src/invaris/staged_worktree.py`), preserving the user's working tree untouched, supporting unborn `HEAD` repositories, and failing closed when the index contains unmerged conflict entries.
|
|
47
|
+
- **Self-enforced 7-layer module architecture via `tach.toml`.**
|
|
48
|
+
- Added `tach.toml` defining Layers 0 through 6 with `forbid_circular_dependencies = true`, wired `tach check --exact` into `.github/workflows/ci.yml` and `tests/test_v1_3_boundaries.py`, and extracted zero-internal-dependency leaf modules (`src/invaris/paths.py`, `src/invaris/primitives.py`, `src/invaris/artifacts.py`).
|
|
49
|
+
- **Typed evidence cache schema v4.**
|
|
50
|
+
- Upgraded `.invaris/evidence.db` to `PRAGMA user_version = 4` with dedicated `tool_version_cache` and `head_nodeids_cache` tables and non-destructive migration of legacy rows from `check_cache`.
|
|
51
|
+
- **Expanded automated test suite to 183 passing tests.**
|
|
52
|
+
- Added `tests/test_v1_3_foundations.py`, `tests/test_v1_3_boundaries.py`, and `tests/test_v1_3_staged.py`.
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- **Staged module refactor behind backward-compatible facades.**
|
|
57
|
+
- Decomposed the five largest modules (`adapters/pytest_cov.py`, `evidence_db.py`, `mutator.py`, `base_probe.py`, and `funnel.py`) into focused internal modules and subpackages (`evidence/`, `gate0.py`, `gate1/`, `gate2/`, and `verdict_assembly.py`) behind backward-compatible facades with zero CLI, MCP, or `.invaris/contract.toml` breaking changes.
|
|
58
|
+
- **Removed dead Gate 1 JSON contexts fallback.**
|
|
59
|
+
- Deleted the unused `_extract_impact_mapping` JSON contexts fallback in Gate 1 coverage extraction now that per-test contexts are read directly from `.coverage` SQLite.
|
|
60
|
+
- **Pruned redundant `return False` to `return None` mutations in Gate 2.**
|
|
61
|
+
- `src/invaris/ast_mutator.py` skips emitting truthiness-equivalent `return False` to `return None` mutations when `bool_false_to_true` (`return False` to `return True`) already covers the same return value, while preserving `return_none` for `return True`, `return 0`, `return ""`, and non-literal returns.
|
|
62
|
+
|
|
63
|
+
## [1.2.0] - 2026-11-30
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- **Two-phase Gate 1/2 scheduling (`--phase iterate|final`) across CLI and MCP.**
|
|
68
|
+
- Added `--phase iterate` (runs Gates 0 and 1, equivalent to `--max-gate 1`) and `--phase final` (runs Gates 0, 1, and 2, equivalent to `--max-gate 2`) to `invaris verify` (`src/invaris/cli.py`) and MCP `verify_patch` (`src/invaris/mcp_server.py`), backed by `resolve_max_gate()` in `src/invaris/funnel.py`. Existing `--max-gate` usage and default `max_gate = 2` remain backward-compatible; conflicting `phase` and `max_gate` arguments return a clear error.
|
|
69
|
+
- Added a `next_step` hint to compact JSON verdicts, the MCP `verify_patch` output schema, and CLI text output. Passing `--phase iterate` runs remind the agent to run `--phase final` when code and tests are ready, and failing Gate 2 runs instruct the agent to update tests for all uncaught (surviving) mutants in one batch before re-running `--phase final`.
|
|
70
|
+
- **`claude-md` (`CLAUDE.md`) sync target in `invaris sync`.**
|
|
71
|
+
- Added `claude-md` to `src/invaris/harness_sync.py` (`ALL_TARGETS`), auto-detected when `CLAUDE.md` exists in the repository root and selectable explicitly via `--targets claude-md`. Updated synced instructions in `AGENTS.md`, `CLAUDE.md`, and `.cursor/rules/invaris.mdc` to the 3-step two-phase workflow (`iterate`, `final`, and batched mutant fixing).
|
|
72
|
+
- **Milestone 5.1 ablation and paired two-phase evaluation (`docs/v1/m5-results.md` §10).**
|
|
73
|
+
- Completed an 11-task `v1.1.1` Treatment-only ablation (`1ce9610`) and a full 11-task paired M5.1 retest (`83b278c`, 22 runs on `anthropic/claude-sonnet-5-5` across `werkzeug`, `starlette`, and `attrs`).
|
|
74
|
+
- Across `v1.1.0` (uncached), `v1.1.1` (with `mutant_cache`), and `v1.2.0` (two-phase + batched output), Gate 2 mutation runs dropped from 27 to 27 to 16 (`-40.7%`, retries down `68.8%` from 16 to 5), time in Gate 2 dropped from 424.1 s to 323.2 s to 177.2 s (`-58.2%`), total `invaris verify` time dropped from 612.7 s to 493.3 s to 341.2 s (`-44.3%`), and total agent session time dropped from 1,165.2 s to 1,066.0 s to 896.8 s (`-23.0%`).
|
|
75
|
+
- In the paired M5.1 retest, Invaris tied the baseline at 11 of 11 hidden acceptance passes (0 existing-suite regressions, 0 weak tests passing without the fix, 0 runs hitting the turn or time limit, 0 of 40 `INCONCLUSIVE` crashes, 0 extra `query`/`repro` lookups, and 7.08x log compression from 133,986 to 18,913 est. tokens).
|
|
76
|
+
- Gate 0 blocked 9 attempted `# type: ignore` insertions so Invaris shipped 0 net-new ignore comments (1 preserved line, -1 net overall) compared to 21 true net-new ignore comments across tracked baseline patches (23 raw including 1 preserved line and 1 untracked backup file). On frontier models already solving 11 of 11 tasks cleanly, full Gate 2 mutation testing carried a `+$0.31` total (about `$0.03` per task) and `+23.6 s` median task-time verification premium.
|
|
77
|
+
- Expanded the automated test suite to 158 passing tests (including 23 new tests in `tests/test_v1_two_phase_survivors.py`).
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- **Batched Gate 2 surviving-mutant output (`MAX_INLINE_SURVIVING_MUTANTS = 25`).**
|
|
82
|
+
- Raised the inline Gate 2 surviving-mutant limit in `src/invaris/funnel.py` from 5 to 25 (matching the default `max_mutants_per_run = 25` budget) and trimmed `sample_tests` in `src/invaris/mutator.py` to 1 test per mutant so agents see every uncaught mutant in one verdict without extra `invaris query` lookups.
|
|
83
|
+
- **Line-context boolean mutation snippets and distinct same-line `mutant_id`s.**
|
|
84
|
+
- Added `_line_context_snippets()` in `src/invaris/ast_mutator.py` so `True`/`False` mutations (`bool_true_to_false`, `bool_false_to_true`) show up to 120 characters of surrounding before/after line context instead of bare `True`/`False`, and produce distinct `mutant_id` hashes when multiple identical boolean literals appear on the same line.
|
|
85
|
+
- **GitHub Actions CI workflow updates.**
|
|
86
|
+
- Updated `.github/workflows/ci.yml` to `actions/checkout@v6` and `astral-sh/setup-uv@v7` with `cache-dependency-glob: "pyproject.toml"`.
|
|
87
|
+
|
|
88
|
+
## [1.1.1] - 2026-11-28
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **Gate 1 `HEAD` collection-error attribution and base-probe fail-closed guards.**
|
|
93
|
+
- `src/invaris/head_baseline.py` no longer demotes candidate `call`/`setup`/`teardown` test failures to `pre_existing` when `HEAD` fails during `collect` (for example, when gitignored generated files or unbuilt extensions are absent from the detached worktree). Collection-phase demotion now requires a matching `(phase="collect", exc_type)` signature; mismatches remain blocking (`unknown`, uncached) and surface a `head_baseline_error` gap.
|
|
94
|
+
- `src/invaris/_plugins/invaris_gate1_plugin.py` parses exception types and messages from pytest `CollectErrorRepr` text rather than falling back to generic `Error`.
|
|
95
|
+
- `src/invaris/base_probe.py` rejects `HEAD` collection failures (`rc=2`) in `_resolve_head_nodeids` and classifies `HEAD` collection/import errors for modules that are neither changed nor overlaid as uncached `inconclusive` rather than falsely claiming `discriminating` `PASS`.
|
|
96
|
+
- **Non-Python-only patch detection and cache invalidation in Gate 1.**
|
|
97
|
+
- `src/invaris/adapters/pytest_cov.py` tracks changed non-Python runtime/data/config files (exempting pure documentation/metadata files such as `*.md`, `*.rst`, `LICENSE`, and `.invaris/**`), bypasses the empty-`.py` selection shortcut when they change, and folds a repo-wide non-Python runtime digest into Gate 1 per-test-file closure hashes so data/config edits invalidate cached `PASS` entries and run the test suite.
|
|
98
|
+
- **Gate 0 `forbid_new_skips` AST hardening (`invaris-integrity/4`).**
|
|
99
|
+
- `src/invaris/integrity.py` detects module-level `pytest.skip(...)`, `pytest.importorskip(...)` (module and function scope), annotated and augmented `pytestmark` assignments (`AnnAssign`/`AugAssign`), aliased imports and local rebinds (`import pytest as pt`, `from pytest import mark as m`, `from pytest import skip as s`), `add_marker(...)` skip/xfail calls in tests and `conftest.py` (including root `conftest.py`), and `collect_ignore` / `collect_ignore_glob` tampering in `conftest.py`.
|
|
100
|
+
- **Gate 0 import-graph attribution for deleted modules, `.pyi` stubs, and non-`src/` layouts.**
|
|
101
|
+
- `src/invaris/import_graph.py` and `src/invaris/funnel.py` include deleted `HEAD` `.py`/`.pyi` modules when computing reverse importers, map `.pyi` stubs alongside `.py` modules without clobbering, infer package roots for `lib/`, `python/`, `packages/*/`, and `pyproject.toml`-configured paths, and fall back to the `HEAD` static baseline when a changed module resides in an unrecognized non-package subdirectory.
|
|
102
|
+
- **Gate 2 budget exhaustion and advisory medium-tier error isolation.**
|
|
103
|
+
- `src/invaris/mutator.py` separates budget-truncated/unscheduled mutants (`unevaluated`) from genuine per-mutant `timeout` results, refuses to dispatch mutants when remaining time is below `per_mutant_timeout`, and fails closed (`INCONCLUSIVE` with `mutation_budget_exhausted`) when blocking mutants remain unevaluated or 0 mutants are evaluated.
|
|
104
|
+
- Advisory medium-tier mutation errors (`mutate_medium = true`, `strict_medium_mutation = false`, no blocking high-risk files) record explicit `gaps[]` entries with `decisive=False` instead of turning the overall verdict `INCONCLUSIVE`.
|
|
105
|
+
- **Gate 1 `-x` / `--maxfail` partial-run cache protection.**
|
|
106
|
+
- `src/invaris/pytest_targets.py` strips early-exit flags (`-x`, `--exitfirst`, `--maxfail`, `--sw`, `--stepwise`) from Gate 1 extra pytest args, and `src/invaris/adapters/pytest_cov.py` only writes `PASS` cache entries for test files whose requested nodeids all reported completion with at least one passed test.
|
|
107
|
+
- **Path normalization, mirror symlink containment, and subprocess process-group cleanup.**
|
|
108
|
+
- Replaced character-set `.lstrip("./")` with literal `strip_dot_slash` across `contract.py`, `mutator.py`, and `harness_sync.py` so root files like `coverage.py`, `mypy_cache/x.py`, and `invaris/contract.toml` are not misclassified as dot-prefixed artifacts or protected paths.
|
|
109
|
+
- Hardened `src/invaris/mutator.py` mirror creation to never recreate symlinks or follow symlinks escaping the repo root, failing closed with `unsafe_symlink` on external symlinked blocking targets.
|
|
110
|
+
- Updated `src/invaris/adapters/base.py` to launch POSIX subprocesses in their own session (`start_new_session=True`) and `SIGKILL` the full process group on timeout so grandchild workers cannot linger.
|
|
111
|
+
|
|
112
|
+
## [1.1.0] - 2026-11-27
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- **Gate 1 new-test fail-on-base probe (`[gate1].new_test_base_probe`).**
|
|
117
|
+
- Supports `"off"`, `"advisory"` (default), and `"strict"`, backward-compatible with existing `.invaris/contract.toml` files.
|
|
118
|
+
- Runs at the end of Gate 1 only when Gate 1 passed on the candidate tree and both production and test files changed.
|
|
119
|
+
- Selects targets via scoped nodeid diff (`candidate_nodeids - head_nodeids`) with a semantic AST-diff fallback for modified existing tests, skipping when no test logic changed.
|
|
120
|
+
- Checks out `HEAD` in an isolated temporary worktree (guarded cleanup in `finally` with startup-level `sitecustomize.py` isolation against editable `.pth` and PEP 660 `sys.meta_path` installs). Overlays only changed/added/deleted test files, `conftest.py`, and dedicated test-directory helpers while keeping production code at `HEAD`, and runs fail-fast `pytest -x` with forwarded `[tools].test` flags via `INVARIS_NODEIDS_FILE`.
|
|
121
|
+
- Classifies verified target/overlay failures on exit codes `1` and `2` (including `ImportError` for new production symbols) as discriminating `PASS`. Exit code `0` with at least one passed test is classified as `tautological_new_tests` (an advisory `gaps[]` entry capped at 10 sample nodeids, or a blocking Gate 1 `FAIL` with isolated `HEAD` `invaris repro --exec` support in `strict` mode). Exit codes `3`/`4`/`5`, unattributed failures, all-skipped runs, isolation breaches, or timeouts are never cached: `strict` mode returns fail-closed `INCONCLUSIVE`, and `advisory` mode records a `gaps[]` entry.
|
|
122
|
+
- Caches deterministic verdicts in SQLite (`base_probe_cache` keyed by `(base_sha, changed_test_files_hash, target_nodeids_hash)`) so subsequent production-only edits reuse cached results without re-running `HEAD`, and attributes probe subprocess time to `tool_elapsed_ms`.
|
|
123
|
+
- **Gate 0 lazy `HEAD` static baseline attribution (`head_static_cache`).**
|
|
124
|
+
- When `ruff check` or `mypy` reports diagnostics on changed files in brownfield repositories, Gate 0 lazily evaluates the same tool on an isolated `HEAD` worktree, caches per-file signature counts in SQLite (`head_static_cache` keyed by `(base_sha, check_name, tool_version, cmd_hash)`), and attributes matching pre-existing diagnostics to `pre_existing_failures` instead of blocking the patch.
|
|
125
|
+
- **Gate 2 fail-closed two-tier per-mutant cache (`mutant_cache`).**
|
|
126
|
+
- Auto-migrates a `mutant_cache` SQLite table in `.invaris/evidence.db` keyed by `(prod_rel_path, prod_file_hash, mutant_fingerprint, mutator_version, pytest_flags_hash)` (included in `invaris stats` `cache_entries`), decoupling per-mutant caching from `max_mutants_per_run` file truncation.
|
|
127
|
+
- Combines **Tier 1** file-closure caching (reusing killed mutants when the killing test file and its transitive dependencies are unchanged) with **Tier 2** killing-nodeid AST caching (reusing killed mutants across test-file edits when the killing test's exact AST fingerprint, module preamble, and non-test transitive dependencies are unchanged).
|
|
128
|
+
- Enforces fail-closed invalidation: never caches `survived`, `timeout`, or `error` outcomes; invalidates immediately on edits to the mutated production file, transitive imports, `conftest.py` chains, pytest config, module preamble, or the killing test's AST; and falls back to Tier 1 only when `killing_nodeid` cannot be deterministically captured (`-rfE --tb=no`).
|
|
129
|
+
- Exposes `mutants_cached` in `invaris verify --json` verdict telemetry and the MCP `verify_patch` output schema, backed by 120 passing tests (including 8 new Gate 2 cache, anti-cheat, transitive-invalidation, and legacy-DB auto-migration tests).
|
|
130
|
+
- **Milestone 5 evaluation.**
|
|
131
|
+
- Curated 11 multi-file OSS tasks across `werkzeug`, `starlette`, and `attrs`, pre-registered protocol (`docs/v1/m5-protocol.md`), batch evaluation driver (`experiments/v1_m5/run_m5.py`), and transparent `REVISE` results report (`docs/v1/m5-results.md`).
|
|
132
|
+
|
|
133
|
+
### Changed
|
|
134
|
+
|
|
135
|
+
- **Direct SQLite `.coverage` context extraction (`205×` faster on large suites).** `src/invaris/adapters/pytest_cov.py` runs `coverage json` without `--show-contexts`, reads per-test contexts directly from `.coverage` via stdlib `sqlite3` (cutting export time from 55.4 s to 0.27 s on `attrs`'s 1,404-test suite), and fails closed as `INCONCLUSIVE` on export errors or timeouts.
|
|
136
|
+
- **Reduced Gate 0 per-run overhead.** Gate 0 adapters reuse the cached `tool_version` from `funnel.py`, and `is_contract_newly_added()` runs once per verification instead of repeating across checks.
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
|
|
140
|
+
- **Gate 1 cached-test coverage merging.** Persisted per-test coverage payloads in `check_cache` (`coverage_json`) and merged cached test coverage with freshly executed tests so multi-file edit loops preserve accurate diff branch coverage across cache hits.
|
|
141
|
+
- **Clean-tree brownfield attribution.** Fixed `funnel.py` static attribution when verifying clean trees or untouched files with pre-existing linter/typechecker diagnostics.
|
|
142
|
+
- **String `testpaths` support in `pyproject.toml`.** `_detect_test_globs()` in `src/invaris/contract.py` now handles string `testpaths = "tests"` in addition to list form.
|
|
143
|
+
- **First-commit contract onboarding.** Gate 0 integrity checks actual `HEAD` (`git cat-file -e HEAD:.invaris/contract.toml`) rather than `base_ref`. When `.invaris/contract.toml` does not yet exist in `HEAD`, newly added `.invaris/contract.toml`, `.invaris/.gitignore`, and `tach.toml` pass Gate 0 without `--no-verify`. Edits or deletions of already-committed contracts remain blocked, even under older `--base-ref` values.
|
|
144
|
+
- **Adapter package import order.** Made `invaris.adapters` re-export `Gate1Result` and `run_gate1` lazily so importing `invaris.head_baseline` standalone never triggers a circular import.
|
|
145
|
+
|
|
146
|
+
## [1.0.0] - 2026-11-25
|
|
147
|
+
|
|
148
|
+
Initial public release of Invaris, a local verification gateway for Python coding agents with no third-party runtime dependencies.
|
|
149
|
+
|
|
150
|
+
### Added
|
|
151
|
+
|
|
152
|
+
- **Three-gate verification pipeline (`invaris verify`).**
|
|
153
|
+
- Gate 0 runs AST test-integrity checks (detecting deleted tests, reduced assertions, new skip or xfail markers, inline suppressions, and edits to `protected_paths`), changed-file-scoped `ruff format --check` with scoped reproducers, `ruff check`, `pyright` or `mypy`, optional `tach check`, and untouched-file filtering for brownfield repos.
|
|
154
|
+
- Gate 1 runs impact-selected `pytest` using `.invaris/evidence.db` coverage maps with an AST import-graph fallback and `INVARIS_NODEIDS_FILE` selection to avoid `ARG_MAX` errors. It enforces diff branch coverage by risk tier, deduplicates cascading failures, and attributes failures against a `HEAD` worktree (`patch_introduced` vs. `pre_existing`).
|
|
155
|
+
- Gate 2 runs bounded AST mutations on changed high-risk hunks across isolated per-worker temporary mirrors (`gate2.max_workers = 4` by default), with deterministic sorted findings and a shared deadline.
|
|
156
|
+
- **Zero-dependency packaging and repo-venv tool resolution.**
|
|
157
|
+
- Pure Python stdlib runtime (`dependencies = []`, Python 3.11+).
|
|
158
|
+
- Automatic detection and execution of `ruff`, `pyright`, `mypy`, `tach`, and `pytest` from `<repo>/.venv/bin` and `<repo>/venv/bin` before falling back to `PATH`.
|
|
159
|
+
- **SQLite evidence store, edit-loop caching, and ROI telemetry.**
|
|
160
|
+
- Content-hashed cache in `.invaris/evidence.db` that fails closed and never caches `INCONCLUSIVE` results.
|
|
161
|
+
- On-demand evidence inspection (`invaris query`, `invaris repro [--exec]`) and cumulative ROI reporting (`invaris stats`).
|
|
162
|
+
- **Agent and Git integrations.**
|
|
163
|
+
- `invaris init` creates `.invaris/contract.toml`, `.invaris/.gitignore`, and optional `tach.toml`.
|
|
164
|
+
- `invaris sync` compiles contracts into `.git/hooks/pre-commit`, `AGENTS.md`, `.claude/settings.json` (`invaris guard`), and `.cursor/rules/invaris.mdc`.
|
|
165
|
+
- `invaris mcp` runs a stdlib JSON-RPC 2.0 stdio MCP server with `verify_patch`, `query_evidence`, and `get_roi_stats`.
|
|
166
|
+
- **Evaluation.**
|
|
167
|
+
- Milestone 4.1 paired evaluation protocol and results (`docs/v1/m4-protocol.md`, `docs/v1/m4-results.md`, `docs/v1/m4-1-results.md`, `GO` verdict).
|
invaris-1.4.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Peter Tran
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|