Skip to content

Commit 7cbc215

Browse files
committed
Merge chore/portfolio-hardening: CI, tooling, execution-based evaluation oracle, honest cross-model results
Portfolio-hardening pass across 5 workstreams: - WS1: CI (GitHub Actions), LICENSE, ruff/mypy/pre-commit tooling, shared test fixtures, professional README + Makefile - WS2: execution-based ground truth oracle replacing broken exact-string matching, real cross-model evaluation run (llama3.2 + qwen3:8b) - WS3: unified DB base, non-blocking API threadpool config, documented in-memory store limitations - WS4: verification scope reference doc - WS5: case study + architecture diagram Real cross-model run findings documented honestly in docs/PHASE_3_METHODOLOGY.md and README: llama3.2 completed the full benchmark with meaningful accuracy/precision/recall for the first time; qwen3:8b was not reliably runnable on available hardware (timeouts, one server crash) -- reported as a real finding, not hidden.
2 parents 39475c6 + 273fa32 commit 7cbc215

82 files changed

Lines changed: 2970 additions & 839 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Lint, type-check, test (Python ${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
# 3.9 matches requires-python / the environment this project is
17+
# actually developed against; 3.11 is checked too since several
18+
# newer stdlib/typing features are used and assumed compatible.
19+
python-version: ["3.9", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: "pip"
29+
30+
- name: Install dependencies
31+
run: pip install -e ".[dev]"
32+
33+
- name: Lint (ruff check)
34+
run: ruff check src/ tests/
35+
36+
- name: Format check (ruff format)
37+
run: ruff format --check src/ tests/
38+
39+
- name: Type check (mypy)
40+
run: mypy src/verityai
41+
42+
- name: Test with coverage
43+
run: pytest tests/ --cov=verityai --cov-report=term-missing --cov-report=xml --cov-fail-under=85
44+
45+
- name: Upload coverage
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: coverage-${{ matrix.python-version }}
49+
path: coverage.xml
50+
retention-days: 14
51+
52+
docker:
53+
name: Docker build
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Build image
59+
run: docker build -t verityai:ci .
60+
61+
- name: Smoke test the image
62+
run: |
63+
docker run -d --name verityai-ci-smoketest -p 18000:8000 verityai:ci
64+
for i in $(seq 1 15); do
65+
if curl -sf http://localhost:18000/health; then break; fi
66+
sleep 1
67+
done
68+
curl -sf http://localhost:18000/health
69+
curl -sf -o /dev/null http://localhost:18000/dashboard
70+
docker logs verityai-ci-smoketest
71+
docker stop verityai-ci-smoketest

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.6.9
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format
8+
9+
- repo: https://github.com/pre-commit/mirrors-mypy
10+
# Pinned to match the mypy version this project's [tool.mypy] config is
11+
# actually validated against (see pyproject.toml's dev deps) -- an
12+
# older mypy here previously produced spurious errors on z3 arithmetic
13+
# operators that the real (newer) mypy doesn't raise.
14+
rev: v1.19.1
15+
hooks:
16+
- id: mypy
17+
# mypy's pre-commit hook runs in an isolated venv with ONLY these
18+
# packages -- it does not see the project's real dependencies
19+
# unless listed here too. Missing z3-solver in particular causes
20+
# spurious operator-type errors on Z3 expressions that a normal
21+
# `mypy src/verityai` run (with the project's venv active) does
22+
# not produce.
23+
additional_dependencies:
24+
- pydantic>=2.0.0
25+
- types-requests
26+
- z3-solver>=4.12.2
27+
- sqlalchemy>=2.0.0
28+
- fastapi>=0.100.0
29+
- neo4j>=5.15.0
30+
args: [src/verityai]
31+
pass_filenames: false
32+
33+
- repo: https://github.com/pre-commit/pre-commit-hooks
34+
rev: v4.6.0
35+
hooks:
36+
- id: trailing-whitespace
37+
- id: end-of-file-fixer
38+
- id: check-yaml
39+
- id: check-added-large-files
40+
args: [--maxkb=1000]
41+
- id: check-merge-conflict

CLAUDE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Overview
44

55
VerityAI is a neuro-symbolic code verification system that:
6-
1. Generates code using Ollama (llama2:13b) with dynamic context from a Knowledge Graph
6+
1. Generates code using Ollama (model-agnostic; `llama3.2` is the local default, `llama2:13b` the original aspirational target — see README's "Model-agnostic by design") with dynamic context from a Knowledge Graph
77
2. Verifies it formally using Z3 Theorem Prover + symbolic reasoning
88
3. Retries up to 3 times if verification fails (injecting the failure reason into the prompt)
99
4. Returns code + reasoning trace + confidence score
@@ -26,7 +26,7 @@ VerityAI is a neuro-symbolic code verification system that:
2626
├─────────────────────────────────────────────────────┤
2727
│ 2. KNOWLEDGE → Neo4j (patterns, rules, examples) │
2828
├─────────────────────────────────────────────────────┤
29-
│ 1. NEURAL → Ollama (llama2:13b) + prompts
29+
│ 1. NEURAL → Ollama (model-agnostic) + prompts │
3030
└─────────────────────────────────────────────────────┘
3131
```
3232

@@ -184,8 +184,10 @@ cp .env.example .env
184184
# 3. Start services
185185
docker-compose -f docker/docker-compose.yml up -d
186186

187-
# 4. Pull the model (takes ~5-10 min, ~7.4GB)
188-
docker-compose -f docker/docker-compose.yml exec ollama ollama pull llama2:13b
187+
# 4. Pull a model -- llama3.2 is small/fast and needs no special hardware;
188+
# swap for llama2:13b or any other Ollama model (this project is
189+
# model-agnostic, see README)
190+
docker-compose -f docker/docker-compose.yml exec ollama ollama pull llama3.2
189191

190192
# 5. Verify services are healthy
191193
docker-compose -f docker/docker-compose.yml ps
@@ -231,7 +233,7 @@ pytest tests/
231233

232234
## Contact / Questions
233235

234-
Juan Pablo Botero Espinosa
236+
Juan Pablo Botero Espinosa
235237
juanpabloboteroespinosa@gmail.com
236238

237239
Generated with Claude Code (Claude Fable + Sonnet for architecture review)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Juan Pablo Botero Espinosa
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.

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.PHONY: test lint format typecheck docker-build serve clean
2+
3+
# python3 -m ... rather than bare `ruff`/`mypy`/`pytest`: those tools land in
4+
# user site-packages (not necessarily on PATH) when installed via
5+
# `pip install -e ".[dev]"` without a venv, which is exactly how this
6+
# project's dev environment was set up.
7+
test:
8+
python3 -m pytest tests/ --cov=verityai --cov-report=term-missing --cov-fail-under=85
9+
10+
lint:
11+
python3 -m ruff check src/ tests/
12+
python3 -m ruff format --check src/ tests/
13+
14+
format:
15+
python3 -m ruff check --fix src/ tests/
16+
python3 -m ruff format src/ tests/
17+
18+
typecheck:
19+
python3 -m mypy src/verityai
20+
21+
docker-build:
22+
docker build -t verityai:latest .
23+
24+
serve:
25+
python3 -m uvicorn verityai.api.rest:app --reload --host 0.0.0.0 --port 8000
26+
27+
clean:
28+
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
29+
rm -rf .pytest_cache .mypy_cache .ruff_cache .coverage coverage.xml

0 commit comments

Comments
 (0)