verifaied 0.1.0.dev28__tar.gz → 0.1.0.dev30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. verifaied-0.1.0.dev30/LICENSE +21 -0
  2. verifaied-0.1.0.dev30/PKG-INFO +343 -0
  3. verifaied-0.1.0.dev28/PKG-INFO → verifaied-0.1.0.dev30/README.md +136 -36
  4. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/pyproject.toml +5 -4
  5. verifaied-0.1.0.dev30/src/verifaied/analyzer.py +208 -0
  6. verifaied-0.1.0.dev30/src/verifaied/cli.py +618 -0
  7. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/src/verifaied/client.py +45 -1
  8. verifaied-0.1.0.dev30/src/verifaied/prompts.py +193 -0
  9. verifaied-0.1.0.dev30/tests/test_check.py +316 -0
  10. verifaied-0.1.0.dev30/tests/test_check_done.py +196 -0
  11. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/tests/test_client.py +25 -0
  12. verifaied-0.1.0.dev30/tests/test_prompt_parity.py +91 -0
  13. verifaied-0.1.0.dev28/README.md +0 -185
  14. verifaied-0.1.0.dev28/src/verifaied/cli.py +0 -295
  15. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/.gitignore +0 -0
  16. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/src/verifaied/__init__.py +0 -0
  17. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/src/verifaied/__main__.py +0 -0
  18. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/src/verifaied/config.py +0 -0
  19. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/src/verifaied/uploader.py +0 -0
  20. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/tests/__init__.py +0 -0
  21. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/tests/test_cli.py +0 -0
  22. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/tests/test_config.py +0 -0
  23. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/tests/test_uploader.py +0 -0
  24. {verifaied-0.1.0.dev28 → verifaied-0.1.0.dev30}/uv.lock +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kyle Richards
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.
@@ -0,0 +1,343 @@
1
+ Metadata-Version: 2.4
2
+ Name: verifaied
3
+ Version: 0.1.0.dev30
4
+ Summary: Find what's untested in your Python code — locally, no account required
5
+ Project-URL: Homepage, https://pypi.org/project/verifaied/
6
+ Author: Kyle Richards
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 Kyle Richards
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ License-File: LICENSE
29
+ Keywords: agents,ai,coverage,llm,pytest,testing
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Environment :: Console
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Topic :: Software Development :: Testing
35
+ Requires-Python: >=3.10
36
+ Requires-Dist: httpx>=0.27.0
37
+ Requires-Dist: rich>=13.7.0
38
+ Requires-Dist: typer>=0.12.0
39
+ Description-Content-Type: text/markdown
40
+
41
+ # verifaied
42
+
43
+ Find what's untested in your Python code, so you (or your coding agent) can fix
44
+ it without waiting for CI.
45
+
46
+ Two verbs:
47
+
48
+ - **`verifaied check`** — runs entirely on your machine. No account, no API
49
+ token, no network call. Tells you which functions are untested or only
50
+ partially covered, and can hand you a ready-to-paste prompt for each one.
51
+ - **`verifaied upload`** — syncs the same coverage to the [verifAIed](https://verifaied.app)
52
+ app, which adds history, branch diffing against CI, a web UI, and AI-written
53
+ test prompts. Needs a free account.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ uv tool install verifaied # or
59
+ pipx install verifaied
60
+ ```
61
+
62
+ ## `verifaied check` — local, no account
63
+
64
+ ```bash
65
+ pytest --cov --cov-branch --cov-report=json
66
+ verifaied check
67
+ ```
68
+
69
+ ```
70
+ 12 covered 3 partial 2 untested (17 functions)
71
+
72
+ function file missing
73
+ ● apply_topup app/billing.py:41 42-47
74
+ ● refund app/billing.py:60 61-68
75
+ ◐ _resolve_plan app/plans.py:12 18
76
+ ```
77
+
78
+ Nothing leaves your machine — the whole analysis is a local AST pass over the
79
+ source `coverage.json` already points at.
80
+
81
+ Add `--prompt` to get a concrete, ready-to-paste instruction for each one,
82
+ generated from the function's signature and its uncovered lines (no LLM, no
83
+ cost, unlimited):
84
+
85
+ ```bash
86
+ verifaied check --prompt
87
+ ```
88
+
89
+ ```
90
+ Write a pytest test for `apply_topup` in `app/billing.py`.
91
+
92
+ This function is currently **untested** — no line of it executes under the
93
+ existing suite.
94
+
95
+ What to do:
96
+ - Call `apply_topup(user_id, amount)`.
97
+ - Assert on the **return value** — compare it to the exact expected value.
98
+ - Cover the lines that never execute: **42-47**.
99
+ - It raises `ValueError` — cover that path with `pytest.raises(ValueError)`.
100
+ ```
101
+
102
+ Useful flags: `--limit N` (how many to list, `0` for all), `--root <path>` (the
103
+ directory the coverage paths are relative to — pytest's rootdir), and
104
+ `--fail-under <pct>`, which exits `3` when too few functions are fully covered,
105
+ so `check` works as a CI gate.
106
+
107
+ ## `verifaied upload` — sync to the app
108
+
109
+ Mint an API token from the verifAIed app (Settings → Tokens; a free account is
110
+ enough). The CLI ships pointing at the hosted API (`https://api.verifaied.app`);
111
+ point it elsewhere via `VERIFAIED_API_URL` if you're running the backend locally
112
+ or self-hosting:
113
+
114
+ ```bash
115
+ export VERIFAIED_API_TOKEN=vr_live_...
116
+ # Only set this if you're not using the hosted API:
117
+ export VERIFAIED_API_URL=http://localhost:8000 # local dev
118
+ ```
119
+
120
+ From inside any git repo you've connected to verifAIed:
121
+
122
+ ```bash
123
+ pytest --cov --cov-report=json --junitxml=junit.xml
124
+ verifaied upload
125
+ ```
126
+
127
+ That's it — `--repo` is optional. The CLI parses `git remote get-url origin`,
128
+ looks the repo up under your account via `/installations/me`, and uses the
129
+ resulting UUID. You can also be explicit:
130
+
131
+ ```bash
132
+ verifaied upload --repo kyle/verifaied # owner/name slug
133
+ verifaied upload --repo <UUID> # raw UUID, no lookup
134
+ ```
135
+
136
+ The CLI reads `coverage.json`, pulls the source for every file it
137
+ references from your working tree, and posts everything to
138
+ `/repositories/<id>/local-coverage`. The response prints a summary of
139
+ untested / partial / failing functions so you (or your LLM) can fix
140
+ them on the next iteration.
141
+
142
+ ### What gets uploaded
143
+
144
+ The CLI only sends files that appear in `coverage.json`'s `"files"`
145
+ map — i.e. exactly the files `pytest --cov` instrumented. There is no
146
+ directory walk and no glob:
147
+
148
+ - `.env`, build artefacts, vendored libraries, and anything outside
149
+ your coverage scope are never read.
150
+ - Test files themselves are only uploaded if your coverage config
151
+ includes them (e.g. `--cov=tests`).
152
+
153
+ To audit the exact file list (and total bytes) before anything leaves
154
+ your machine, run with `--dry-run`:
155
+
156
+ ```bash
157
+ verifaied upload --dry-run
158
+ ```
159
+
160
+ This prints the resolved branch / commit / file table and exits without
161
+ contacting the backend. Useful when you're about to upload from an
162
+ unfamiliar repo, or when narrowing down where an unexpected file is
163
+ coming from.
164
+
165
+ If a sensitive value did make it into a covered source file (a baked-in
166
+ API key in a fixture, etc.), open the repo in the verifAIed web UI,
167
+ expand **Recently deleted** under the branches grid, and use
168
+ **Permanently delete**. That hard-deletes the analysis row and cascades
169
+ to the uploaded source — the per-card **Delete** is a soft-delete that
170
+ keeps the data around for accidental-deletion recovery.
171
+
172
+ ### `upload` flags
173
+
174
+ - `--repo / -r <UUID|owner/name>` — repository to upload to. If omitted,
175
+ the CLI auto-detects from the GitHub `origin` remote.
176
+ - `--branch / -b <name>` — branch to attach the upload to (default:
177
+ `git branch --show-current`, then `local`)
178
+ - `--coverage <path>` — path to coverage.json (default: `./coverage.json`)
179
+ - `--junit <path>` — optional JUnit XML for failing-test detail
180
+ - `--commit-sha <sha>` — commit sha for display (default: `git rev-parse HEAD`)
181
+ - `--root <path>` — root the coverage paths are relative to (default: cwd)
182
+ - `--api-url <url>` — backend base URL (overrides `VERIFAIED_API_URL`)
183
+ - `--token <token>` — API token (overrides `VERIFAIED_API_TOKEN`)
184
+ - `--dry-run` — print the file list and total bytes that would be
185
+ uploaded, then exit without contacting the backend. Skips the token
186
+ requirement so you can audit without configuring auth.
187
+
188
+ ## `verifaied check-done` — the "am I done?" gate
189
+
190
+ `check-done` is the **stop condition** for an agent's test-writing loop.
191
+ It fetches a verdict for a branch — failing tests plus the coverage of the
192
+ functions you changed — and exits accordingly, so a CI job or an agent can
193
+ gate on it:
194
+
195
+ ```bash
196
+ pytest --cov --cov-report=json --junitxml=junit.xml
197
+ verifaied upload # push the fresh coverage first
198
+ verifaied check-done # then ask: am I done?
199
+ ```
200
+
201
+ The verdict composes into `{done, status, gaps}`:
202
+
203
+ - `done` (bool) — `true` only when there are **no gaps at all**. The
204
+ strict signal to stop.
205
+ - `status` — `done` | `done-with-warnings` | `not-done`.
206
+ `done-with-warnings` means the only gaps left are ones the repo owner
207
+ marked non-blocking (per-repo policy, set in the web UI).
208
+ - `gaps[]` — each remaining problem with a `ref`, whether it's `blocking`,
209
+ and a `next_action` pointing at the free (`get_baseline_prompt`) or paid
210
+ (`fix_branch`) remedy.
211
+ - `not_checked[]` — signals that couldn't be evaluated (e.g. failing tests
212
+ when no `junit.xml` was uploaded), surfaced so a green verdict is never
213
+ silently green.
214
+
215
+ ### Exit codes
216
+
217
+ - `0` — done (or `done-with-warnings` with `--allow-warnings`)
218
+ - `3` — not done: blocking gaps remain (the CI-gate failure code)
219
+ - `2` — HTTP/API error (auth, 404, network)
220
+ - `1` — usage/config error (no token, bad `--repo`)
221
+
222
+ ### `check-done` flags
223
+
224
+ - `--repo / -r <UUID|owner/name>` — repository to check (default:
225
+ auto-detect from the GitHub `origin` remote)
226
+ - `--branch / -b <name>` — branch to judge (default:
227
+ `git branch --show-current`)
228
+ - `--json` — print the raw verdict JSON instead of the human summary
229
+ - `--allow-warnings` — treat `done-with-warnings` as passing (exit 0);
230
+ default is strict (only a clean `done` exits 0)
231
+ - `--api-url <url>` — backend base URL (overrides `VERIFAIED_API_URL`)
232
+ - `--token <token>` — API token (overrides `VERIFAIED_API_TOKEN`)
233
+
234
+ ### As an agent stop condition
235
+
236
+ Drop this loop into your agent's instructions file so it self-corrects
237
+ and knows when to stop:
238
+
239
+ ```text
240
+ Test-coverage loop (run until done):
241
+ 1. Run tests with coverage: pytest --cov --cov-report=json --junitxml=junit.xml
242
+ 2. Push the results: verifaied upload
243
+ 3. Ask if you're done: verifaied check-done
244
+ 4. If exit code is 0, stop — you're done.
245
+ If exit code is 3, fix each gap in the output (use get_baseline_prompt
246
+ for a free test prompt, or fix_branch for an LLM-written one), then
247
+ go back to step 1.
248
+ ```
249
+
250
+ ## Agent loop
251
+
252
+ We've found the most fruitful way to use verifAIed is to put a short
253
+ loop into your coding agent's instructions file (`CLAUDE.md`,
254
+ `AGENTS.md`, `.cursorrules`, `GEMINI.md`,
255
+ `.github/copilot-instructions.md`) so it self-corrects on every change.
256
+
257
+ The easiest way is to let your agent write that loop into the rules
258
+ file for you. Paste the prompt below into your agent — it will inspect
259
+ the repo, find the project's real test command, confirm the CLI is
260
+ installed and `VERIFAIED_API_TOKEN` is set, and write the loop section
261
+ into the matching rules file, tailored to your repo:
262
+
263
+ ```markdown
264
+ We've found that adding a short test-coverage loop to your agent's instructions is the most fruitful way to use verifAIed. I want you to write that loop into this repo's agent-instructions file, tailored to how this repo actually runs its tests.
265
+
266
+ verifAIed is a coverage analysis tool. Its CLI (`verifaied upload`) pushes a local `coverage.json` + `junit.xml` to the server; its MCP server exposes a `check_done` tool that returns a `{done, status, gaps}` verdict for the branch (the loop's stop condition), and a `fix_branch` tool that returns a single prompt describing every untested function, partial branch, and failing test. The agent loop is: run tests → `verifaied upload` → call `check_done` → if `done` is true stop, otherwise fix the gaps (`get_baseline_prompt` per function, or `fix_branch` for one prompt covering everything) → repeat.
267
+
268
+ Do the following, in order:
269
+
270
+ # 1. Detect the project setup
271
+
272
+ - **Test runner & command**: look at `pyproject.toml` (`[tool.pytest.ini_options]`, `[project.scripts]`), `pytest.ini`, `tox.ini`, `setup.cfg`, `Makefile` targets (`test`, `check`), `justfile`, or a top-level `scripts/` directory. Use the test command the project already uses — don't invent a new one.
273
+ - **Coverage flags**: pytest must produce `coverage.json` with branch coverage AND per-test contexts, plus `junit.xml`. If the existing command already does that, reuse it. Otherwise build the command:
274
+ ```
275
+ pytest --cov --cov-branch --cov-context=test --junitxml=junit.xml
276
+ coverage json --show-contexts -o coverage.json
277
+ ```
278
+ The `coverage json --show-contexts` step is non-negotiable — pytest-cov's `--cov-report=json` alone drops the per-test contexts, which makes verifAIed mark the upload "Needs attention".
279
+ - **Agent-instructions file**: pick the one that matches the agent you (the model) are. If unsure, fall back to the project's existing convention.
280
+ - Claude Code: `CLAUDE.md`
281
+ - Codex CLI / OpenAI: `AGENTS.md`
282
+ - Cursor: `.cursorrules` or `.cursor/rules/*.mdc`
283
+ - Gemini CLI: `GEMINI.md`
284
+ - GitHub Copilot: `.github/copilot-instructions.md`
285
+ - If none exists in the repo, create the one matching your own agent.
286
+
287
+ # 2. Verify the CLI is installed and configured
288
+
289
+ - Run `verifaied --help`. If it exits non-zero, install it: `uv tool install verifaied` (preferred) or `pipx install verifaied`.
290
+ - Check `echo $VERIFAIED_API_TOKEN`. If empty, stop and tell the user to mint one from the verifAIed app (Settings → Tokens) and export it: `export VERIFAIED_API_TOKEN=vr_live_...`. Do NOT invent a placeholder and do NOT proceed without it.
291
+
292
+ # 3. Write the loop into the agent-instructions file
293
+
294
+ Append (or create) a section titled `## Test coverage loop with verifAIed` containing:
295
+
296
+ - The exact test command(s) you built in step 1 — so future runs of the agent don't have to re-derive them.
297
+ - The exact upload command (`verifaied upload`, plus any flags this repo needs — e.g. `--coverage path/to/coverage.json` if your test command lands the JSON outside the repo root).
298
+ - An instruction to call the `check_done` tool on the verifAIed MCP server after each upload, and to stop only when it returns `done: true`.
299
+ - An instruction that while `check_done` reports gaps, fix them: call `get_baseline_prompt(function_id)` for a free per-function test prompt, or `fix_branch` with `scope: everything` for a single prompt covering every gap, then apply it.
300
+ - An instruction to repeat from step 1 until `check_done` reports `done: true`.
301
+ - One line: "If `VERIFAIED_API_TOKEN` is unset, stop and ask the user — do not skip this loop."
302
+
303
+ # 4. Confirm with the user
304
+
305
+ Show the user the diff of the file you edited (or created) and the test command you wrote in. Do NOT run the loop yourself yet — let the user review first.
306
+
307
+ # Hard rules
308
+
309
+ - Do NOT change the test command's behavior beyond adding coverage / junit flags.
310
+ - Do NOT add new dependencies if pytest-cov and coverage are already transitive deps.
311
+ - Do NOT write a fallback that skips the loop when the token is missing — the agent must stop and ask.
312
+ - Do NOT enumerate functions yourself or write tests; `check_done` lists the gaps and `fix_branch` / `get_baseline_prompt` return the prompts that close them.
313
+ - Do NOT decide "done" yourself; `check_done` is the stop condition.
314
+ - Do NOT replace an existing agent-instructions file — append a new section.
315
+ ```
316
+
317
+ ### Or paste the instructions in by hand
318
+
319
+ If you'd rather skip the meta-prompt, drop this section into your
320
+ agent's rules file as-is. Swap in your repo's actual test command if
321
+ it differs from the pytest default:
322
+
323
+ ```markdown
324
+ ## Test coverage loop with verifAIed
325
+
326
+ After implementing or modifying any code in this repo, run this loop until verifAIed reports done:
327
+
328
+ 1. Run the test suite with branch coverage and per-test contexts:
329
+ ```
330
+ pytest --cov --cov-branch --cov-context=test --junitxml=junit.xml
331
+ coverage json --show-contexts -o coverage.json
332
+ ```
333
+ 2. Upload the results to verifAIed:
334
+ ```
335
+ verifaied upload
336
+ ```
337
+ 3. Ask if you're done: call the `check_done` tool on the verifAIed MCP server (or run `verifaied check-done`). It returns `{done, status, gaps}` for this branch — failing tests plus untested/partially-covered functions among the ones you changed.
338
+ 4. If `done` is true, stop — the branch is covered.
339
+ 5. Otherwise fix the gaps it lists: call `get_baseline_prompt(function_id)` for a free test prompt per function, or `fix_branch` with `scope: everything` for a single LLM-written prompt covering every gap on the branch.
340
+ 6. Go back to step 1.
341
+
342
+ Stop only when `check_done` reports `done: true`. If `VERIFAIED_API_TOKEN` is not set, stop and ask the user — do not skip this loop.
343
+ ```
@@ -1,24 +1,16 @@
1
- Metadata-Version: 2.4
2
- Name: verifaied
3
- Version: 0.1.0.dev28
4
- Summary: Upload local pytest coverage to verifAIed for instant feedback
5
- Project-URL: Homepage, https://pypi.org/project/verifaied/
6
- Author: Kyle Richards
7
- License: MIT
8
- Keywords: ai,coverage,llm,pytest,testing
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Environment :: Console
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Topic :: Software Development :: Testing
13
- Requires-Python: >=3.10
14
- Requires-Dist: httpx>=0.27.0
15
- Requires-Dist: rich>=13.7.0
16
- Requires-Dist: typer>=0.12.0
17
- Description-Content-Type: text/markdown
18
-
19
1
  # verifaied
20
2
 
21
- CLI for uploading local pytest coverage to verifAIed so an LLM (or you) can see what's untested without waiting for CI.
3
+ Find what's untested in your Python code, so you (or your coding agent) can fix
4
+ it without waiting for CI.
5
+
6
+ Two verbs:
7
+
8
+ - **`verifaied check`** — runs entirely on your machine. No account, no API
9
+ token, no network call. Tells you which functions are untested or only
10
+ partially covered, and can hand you a ready-to-paste prompt for each one.
11
+ - **`verifaied upload`** — syncs the same coverage to the [verifAIed](https://verifaied.app)
12
+ app, which adds history, branch diffing against CI, a web UI, and AI-written
13
+ test prompts. Needs a free account.
22
14
 
23
15
  ## Install
24
16
 
@@ -27,12 +19,57 @@ uv tool install verifaied # or
27
19
  pipx install verifaied
28
20
  ```
29
21
 
30
- ## Configure
22
+ ## `verifaied check` — local, no account
23
+
24
+ ```bash
25
+ pytest --cov --cov-branch --cov-report=json
26
+ verifaied check
27
+ ```
28
+
29
+ ```
30
+ 12 covered 3 partial 2 untested (17 functions)
31
+
32
+ function file missing
33
+ ● apply_topup app/billing.py:41 42-47
34
+ ● refund app/billing.py:60 61-68
35
+ ◐ _resolve_plan app/plans.py:12 18
36
+ ```
37
+
38
+ Nothing leaves your machine — the whole analysis is a local AST pass over the
39
+ source `coverage.json` already points at.
40
+
41
+ Add `--prompt` to get a concrete, ready-to-paste instruction for each one,
42
+ generated from the function's signature and its uncovered lines (no LLM, no
43
+ cost, unlimited):
44
+
45
+ ```bash
46
+ verifaied check --prompt
47
+ ```
48
+
49
+ ```
50
+ Write a pytest test for `apply_topup` in `app/billing.py`.
51
+
52
+ This function is currently **untested** — no line of it executes under the
53
+ existing suite.
31
54
 
32
- Set the API token (mint one from the verifAIed app). The CLI ships
33
- pointing at the hosted verifAIed API (`https://api.verifaied.app`) by
34
- default; point it elsewhere via `VERIFAIED_API_URL` if you're running
35
- the backend locally or self-hosting:
55
+ What to do:
56
+ - Call `apply_topup(user_id, amount)`.
57
+ - Assert on the **return value** — compare it to the exact expected value.
58
+ - Cover the lines that never execute: **42-47**.
59
+ - It raises `ValueError` — cover that path with `pytest.raises(ValueError)`.
60
+ ```
61
+
62
+ Useful flags: `--limit N` (how many to list, `0` for all), `--root <path>` (the
63
+ directory the coverage paths are relative to — pytest's rootdir), and
64
+ `--fail-under <pct>`, which exits `3` when too few functions are fully covered,
65
+ so `check` works as a CI gate.
66
+
67
+ ## `verifaied upload` — sync to the app
68
+
69
+ Mint an API token from the verifAIed app (Settings → Tokens; a free account is
70
+ enough). The CLI ships pointing at the hosted API (`https://api.verifaied.app`);
71
+ point it elsewhere via `VERIFAIED_API_URL` if you're running the backend locally
72
+ or self-hosting:
36
73
 
37
74
  ```bash
38
75
  export VERIFAIED_API_TOKEN=vr_live_...
@@ -40,8 +77,6 @@ export VERIFAIED_API_TOKEN=vr_live_...
40
77
  export VERIFAIED_API_URL=http://localhost:8000 # local dev
41
78
  ```
42
79
 
43
- ## Use
44
-
45
80
  From inside any git repo you've connected to verifAIed:
46
81
 
47
82
  ```bash
@@ -94,7 +129,7 @@ expand **Recently deleted** under the branches grid, and use
94
129
  to the uploaded source — the per-card **Delete** is a soft-delete that
95
130
  keeps the data around for accidental-deletion recovery.
96
131
 
97
- ### Flags
132
+ ### `upload` flags
98
133
 
99
134
  - `--repo / -r <UUID|owner/name>` — repository to upload to. If omitted,
100
135
  the CLI auto-detects from the GitHub `origin` remote.
@@ -110,6 +145,68 @@ keeps the data around for accidental-deletion recovery.
110
145
  uploaded, then exit without contacting the backend. Skips the token
111
146
  requirement so you can audit without configuring auth.
112
147
 
148
+ ## `verifaied check-done` — the "am I done?" gate
149
+
150
+ `check-done` is the **stop condition** for an agent's test-writing loop.
151
+ It fetches a verdict for a branch — failing tests plus the coverage of the
152
+ functions you changed — and exits accordingly, so a CI job or an agent can
153
+ gate on it:
154
+
155
+ ```bash
156
+ pytest --cov --cov-report=json --junitxml=junit.xml
157
+ verifaied upload # push the fresh coverage first
158
+ verifaied check-done # then ask: am I done?
159
+ ```
160
+
161
+ The verdict composes into `{done, status, gaps}`:
162
+
163
+ - `done` (bool) — `true` only when there are **no gaps at all**. The
164
+ strict signal to stop.
165
+ - `status` — `done` | `done-with-warnings` | `not-done`.
166
+ `done-with-warnings` means the only gaps left are ones the repo owner
167
+ marked non-blocking (per-repo policy, set in the web UI).
168
+ - `gaps[]` — each remaining problem with a `ref`, whether it's `blocking`,
169
+ and a `next_action` pointing at the free (`get_baseline_prompt`) or paid
170
+ (`fix_branch`) remedy.
171
+ - `not_checked[]` — signals that couldn't be evaluated (e.g. failing tests
172
+ when no `junit.xml` was uploaded), surfaced so a green verdict is never
173
+ silently green.
174
+
175
+ ### Exit codes
176
+
177
+ - `0` — done (or `done-with-warnings` with `--allow-warnings`)
178
+ - `3` — not done: blocking gaps remain (the CI-gate failure code)
179
+ - `2` — HTTP/API error (auth, 404, network)
180
+ - `1` — usage/config error (no token, bad `--repo`)
181
+
182
+ ### `check-done` flags
183
+
184
+ - `--repo / -r <UUID|owner/name>` — repository to check (default:
185
+ auto-detect from the GitHub `origin` remote)
186
+ - `--branch / -b <name>` — branch to judge (default:
187
+ `git branch --show-current`)
188
+ - `--json` — print the raw verdict JSON instead of the human summary
189
+ - `--allow-warnings` — treat `done-with-warnings` as passing (exit 0);
190
+ default is strict (only a clean `done` exits 0)
191
+ - `--api-url <url>` — backend base URL (overrides `VERIFAIED_API_URL`)
192
+ - `--token <token>` — API token (overrides `VERIFAIED_API_TOKEN`)
193
+
194
+ ### As an agent stop condition
195
+
196
+ Drop this loop into your agent's instructions file so it self-corrects
197
+ and knows when to stop:
198
+
199
+ ```text
200
+ Test-coverage loop (run until done):
201
+ 1. Run tests with coverage: pytest --cov --cov-report=json --junitxml=junit.xml
202
+ 2. Push the results: verifaied upload
203
+ 3. Ask if you're done: verifaied check-done
204
+ 4. If exit code is 0, stop — you're done.
205
+ If exit code is 3, fix each gap in the output (use get_baseline_prompt
206
+ for a free test prompt, or fix_branch for an LLM-written one), then
207
+ go back to step 1.
208
+ ```
209
+
113
210
  ## Agent loop
114
211
 
115
212
  We've found the most fruitful way to use verifAIed is to put a short
@@ -126,7 +223,7 @@ into the matching rules file, tailored to your repo:
126
223
  ```markdown
127
224
  We've found that adding a short test-coverage loop to your agent's instructions is the most fruitful way to use verifAIed. I want you to write that loop into this repo's agent-instructions file, tailored to how this repo actually runs its tests.
128
225
 
129
- verifAIed is a coverage analysis tool. Its CLI (`verifaied upload`) pushes a local `coverage.json` + `junit.xml` to the server; its MCP server exposes a `fix_branch` tool that returns a single prompt describing every untested function, partial branch, and failing test on the current branch. The agent loop is: run tests → `verifaied upload` → call `fix_branch` → apply the returned prompt → repeat until `fix_branch` returns no findings.
226
+ verifAIed is a coverage analysis tool. Its CLI (`verifaied upload`) pushes a local `coverage.json` + `junit.xml` to the server; its MCP server exposes a `check_done` tool that returns a `{done, status, gaps}` verdict for the branch (the loop's stop condition), and a `fix_branch` tool that returns a single prompt describing every untested function, partial branch, and failing test. The agent loop is: run tests → `verifaied upload` → call `check_done` → if `done` is true stop, otherwise fix the gaps (`get_baseline_prompt` per function, or `fix_branch` for one prompt covering everything) → repeat.
130
227
 
131
228
  Do the following, in order:
132
229
 
@@ -158,8 +255,9 @@ Append (or create) a section titled `## Test coverage loop with verifAIed` conta
158
255
 
159
256
  - The exact test command(s) you built in step 1 — so future runs of the agent don't have to re-derive them.
160
257
  - The exact upload command (`verifaied upload`, plus any flags this repo needs — e.g. `--coverage path/to/coverage.json` if your test command lands the JSON outside the repo root).
161
- - An instruction to call the `fix_branch` tool on the verifAIed MCP server with `scope: everything`, then apply the returned prompt.
162
- - An instruction to repeat from step 1 until `fix_branch` returns no findings.
258
+ - An instruction to call the `check_done` tool on the verifAIed MCP server after each upload, and to stop only when it returns `done: true`.
259
+ - An instruction that while `check_done` reports gaps, fix them: call `get_baseline_prompt(function_id)` for a free per-function test prompt, or `fix_branch` with `scope: everything` for a single prompt covering every gap, then apply it.
260
+ - An instruction to repeat from step 1 until `check_done` reports `done: true`.
163
261
  - One line: "If `VERIFAIED_API_TOKEN` is unset, stop and ask the user — do not skip this loop."
164
262
 
165
263
  # 4. Confirm with the user
@@ -171,7 +269,8 @@ Show the user the diff of the file you edited (or created) and the test command
171
269
  - Do NOT change the test command's behavior beyond adding coverage / junit flags.
172
270
  - Do NOT add new dependencies if pytest-cov and coverage are already transitive deps.
173
271
  - Do NOT write a fallback that skips the loop when the token is missing — the agent must stop and ask.
174
- - Do NOT enumerate functions yourself or write tests; `fix_branch` returns the prompt that does that.
272
+ - Do NOT enumerate functions yourself or write tests; `check_done` lists the gaps and `fix_branch` / `get_baseline_prompt` return the prompts that close them.
273
+ - Do NOT decide "done" yourself; `check_done` is the stop condition.
175
274
  - Do NOT replace an existing agent-instructions file — append a new section.
176
275
  ```
177
276
 
@@ -184,7 +283,7 @@ it differs from the pytest default:
184
283
  ```markdown
185
284
  ## Test coverage loop with verifAIed
186
285
 
187
- After implementing or modifying any code in this repo, run this loop until verifAIed reports clean:
286
+ After implementing or modifying any code in this repo, run this loop until verifAIed reports done:
188
287
 
189
288
  1. Run the test suite with branch coverage and per-test contexts:
190
289
  ```
@@ -195,9 +294,10 @@ After implementing or modifying any code in this repo, run this loop until verif
195
294
  ```
196
295
  verifaied upload
197
296
  ```
198
- 3. Call the `fix_branch` tool on the verifAIed MCP server with `scope: everything`. It returns a single prompt describing every untested function, partial branch, and failing test on this branch.
199
- 4. Apply the fixes the prompt describes.
200
- 5. Go back to step 1.
297
+ 3. Ask if you're done: call the `check_done` tool on the verifAIed MCP server (or run `verifaied check-done`). It returns `{done, status, gaps}` for this branch — failing tests plus untested/partially-covered functions among the ones you changed.
298
+ 4. If `done` is true, stop — the branch is covered.
299
+ 5. Otherwise fix the gaps it lists: call `get_baseline_prompt(function_id)` for a free test prompt per function, or `fix_branch` with `scope: everything` for a single LLM-written prompt covering every gap on the branch.
300
+ 6. Go back to step 1.
201
301
 
202
- Stop when `fix_branch` returns no findings. If `VERIFAIED_API_TOKEN` is not set, stop and ask the user — do not skip this loop.
302
+ Stop only when `check_done` reports `done: true`. If `VERIFAIED_API_TOKEN` is not set, stop and ask the user — do not skip this loop.
203
303
  ```
@@ -1,16 +1,17 @@
1
1
  [project]
2
2
  name = "verifaied"
3
- version = "0.1.0.dev28"
4
- description = "Upload local pytest coverage to verifAIed for instant feedback"
3
+ version = "0.1.0.dev30"
4
+ description = "Find what's untested in your Python code — locally, no account required"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
- license = { text = "MIT" }
7
+ license = { file = "LICENSE" }
8
8
  authors = [{ name = "Kyle Richards" }]
9
- keywords = ["pytest", "coverage", "testing", "ai", "llm"]
9
+ keywords = ["pytest", "coverage", "testing", "ai", "llm", "agents"]
10
10
  classifiers = [
11
11
  "Development Status :: 3 - Alpha",
12
12
  "Environment :: Console",
13
13
  "Intended Audience :: Developers",
14
+ "License :: OSI Approved :: MIT License",
14
15
  "Topic :: Software Development :: Testing",
15
16
  ]
16
17
  dependencies = [