agentproof-cli 0.3.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentProof contributors
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,158 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentproof-cli
3
+ Version: 0.3.0
4
+ Summary: Local evidence, checkpoints, and verification for AI coding tasks
5
+ License: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Dynamic: license-file
10
+
11
+ # AgentProof
12
+
13
+ **Evidence for AI coding tasks. Local checkpoints, real command results, honest handoff reports.**
14
+
15
+ [中文说明](README.zh-CN.md) · [Five-minute start](docs/quickstart.md) · [Example report](examples/report.md) · [Changelog](CHANGELOG.md) · [Security](SECURITY.md) · MIT license
16
+
17
+ AI says “done.” What actually changed? Which checks ran, and do they still match the code?
18
+ AgentProof answers those questions without another model or an API key.
19
+
20
+ ```text
21
+ $ agentproof init --goal "Fix payment retries"
22
+ Task initialized. Baseline: ... (42 files)
23
+ $ agentproof verify --kind test -- python -m unittest discover -s tests
24
+ PASS (exit 0). Log: .agentproof/checks/....log
25
+ $ agentproof report
26
+ /path/to/project/.agentproof/report.md
27
+ ```
28
+
29
+ ## Install
30
+
31
+ Requires Python 3.10+, Git, and macOS, Linux, or Windows.
32
+ This project is not published to PyPI yet.
33
+
34
+ With [pipx installed and on PATH](https://pipx.pypa.io/stable/installation/), install directly from GitHub:
35
+
36
+ ```bash
37
+ pipx install 'git+https://github.com/bzwei58/agentproof.git@main'
38
+ ```
39
+
40
+ Then run `agentproof --version` from any project. If the command is missing, run
41
+ `pipx ensurepath` and reopen your terminal. The package is named `agentproof-cli`, while
42
+ the command is `agentproof`; remove it with `pipx uninstall agentproof-cli`.
43
+ This installs the current main branch, not a versioned release.
44
+
45
+ If you do not use pipx, create a virtual environment and install the same Git URL with its
46
+ Python: `python3 -m venv /your/chosen/venv`, then
47
+ `/your/chosen/venv/bin/python -m pip install 'git+https://github.com/bzwei58/agentproof.git@main'`.
48
+ Use `/your/chosen/venv/bin/agentproof` or activate that environment.
49
+
50
+ Start with the [five-minute walkthrough](docs/quickstart.md): one failing test, a fix,
51
+ a stale check and a report, all in a disposable directory. For a real project, follow the workflow below.
52
+
53
+ ## Workflow
54
+
55
+ Run from any directory inside the Git repository you want to inspect. Commands execute at
56
+ that repository's root. One active task is supported per checkout; use a worktree for another task.
57
+
58
+ 1. **Start before AI edits.** `agentproof init --goal "Fix payment retries"` captures initial
59
+ local changes too, without creating commits or touching the Git index.
60
+ 2. Let your existing coding agent work. AgentProof does not launch or intercept it.
61
+ 3. **Save a milestone.** `agentproof checkpoint --label "first implementation"`.
62
+ 4. **Run real checks.** `agentproof verify --kind test -- python -m unittest discover -s tests`.
63
+ Run each test, lint or build command separately. Shell operators are not interpreted;
64
+ explicitly use `sh -c '...'` if you need shell syntax. Only run commands you trust.
65
+ 5. **Optionally import session signals.** `agentproof import-session /path/to/session.jsonl`.
66
+ 6. **Review AI claims.** `agentproof review --summary ai-summary.txt` (one claim per line), or repeat
67
+ `--claim "All tests passed"`. It reports `OBSERVED`, `UNVERIFIED` and `CONFLICT`; natural-language claims are not certified.
68
+ 7. **Review.** `agentproof status` prints evidence; `agentproof report` writes Markdown.
69
+ 8. **Recover selected snapshot contents.** `agentproof restore CHECKPOINT_ID` previews changes;
70
+ add `--apply` to write them, after an automatic backup checkpoint.
71
+
72
+ `verify --timeout 60 -- COMMAND ...` sets a timeout in seconds (default 300).
73
+ A nonzero command result returns CLI exit code 1; usage/operational errors return 2.
74
+ Command stdout and stderr are retained in `.agentproof/checks/`. On failure, the terminal
75
+ also shows the last 12 lines, capped at 4,000 characters, plus an explicit timeout message
76
+ when applicable. Successful commands stay quiet. The full log is always retained locally.
77
+
78
+ ## What is recorded
79
+
80
+ - SHA-256 fingerprints and modes of captured files, plus full file checkpoints.
81
+ - Added, modified and deleted files relative to the task's initial checkpoint.
82
+ - Actual verification command, exit status, output log and before/after fingerprints.
83
+ - Whether each check still matches the current captured files. Editing code after a check
84
+ or having a check modify files marks it **STALE**.
85
+ - Long or multiline commands have compact report summaries; expand **Full command** to
86
+ inspect the exact recorded invocation.
87
+ - Optional Claude Code JSONL counts: tool calls, error results, compaction boundaries,
88
+ truncation markers and malformed records. Raw imported messages are not copied.
89
+ - Claim review matches completion statements to local file changes and fresh checks using transparent rules.
90
+
91
+ ## Boundaries
92
+
93
+ This is an **evidence recorder and claim-gap detector**, not an automatic correctness judge. A passing check does
94
+ not prove requirements satisfaction, coverage or absence of bugs. There is no model-based
95
+ risk scoring, live session watcher, automatic test discovery or cross-agent correlation yet.
96
+ Claim review never calls a model and cannot decide whether a requirement is substantively correct.
97
+ Session import is best-effort for Claude Code-style `message.content` blocks and
98
+ `system/compact_boundary` records. Other formats and future schema changes may not be counted.
99
+ Truncation text is a heuristic signal, not proof that important context was lost.
100
+
101
+ Snapshots include Git-tracked and non-ignored untracked regular files. Ignored files,
102
+ symlinks, submodule contents, Git index state, external services and environment variables
103
+ are outside the captured scope. Known secret filenames (`.env*`, private-key extensions,
104
+ `credentials.json`) are excluded and listed; **this is not secret detection**. Verification
105
+ logs can contain secrets printed by your own commands. Keep `.agentproof/` private.
106
+ Initialization adds a local Git exclusion, and evidence is stored with a private directory mode.
107
+
108
+ A file over 10 MiB or total captured content over 100 MiB aborts snapshotting. Avoid concurrent
109
+ edits while capturing or verifying. Only one AgentProof command can run per checkout.
110
+ After an interrupted process, inspect and remove a stale `.agentproof/lock` manually.
111
+
112
+ Restore rewrites files present in the target snapshot. **Files added later remain**; this is
113
+ file recovery, not an exact whole-workspace rollback. It leaves Git history and staging alone.
114
+ It rejects symlink paths, verifies snapshot content hashes and preflights file/directory
115
+ conflicts, including blocked parent paths, before changing files.
116
+ It is not a filesystem transaction; concurrent changes or I/O errors can still interrupt writes.
117
+ Restore does not recover excluded files or delete newly created ones. A pre-restore checkpoint lets you
118
+ recover overwritten captured content. Do not manually edit snapshot manifests or files.
119
+
120
+ ## Development
121
+
122
+ ```bash
123
+ git clone https://github.com/bzwei58/agentproof.git
124
+ cd agentproof
125
+ python3 -m venv .venv
126
+ .venv/bin/python -m pip install -e .
127
+ python3 -m unittest discover -s tests -v
128
+ python3 -m agentproof --help
129
+ ```
130
+
131
+ Want to try it on two real tasks? See the [pilot guide and feedback form](docs/pilot.md).
132
+
133
+ Tests use disposable Git repositories and cover stale evidence, nonzero exits, timeout,
134
+ initial uncommitted edits, restoration backups, symlink rejection, secret exclusions and
135
+ partial session logs. GitHub Actions runs them on macOS/Linux and Python 3.10/3.12/3.13.
136
+
137
+ Ideas for later: task history, more session adapters, configurable snapshot scope, optional
138
+ CI handoff artifacts. Contributions should preserve the distinction between observed facts
139
+ and model-generated claims. Please include a reproducible example and tests for behavior changes.
140
+
141
+ ## Evidence matching in 0.3.0
142
+
143
+ Declare each check with `verify --kind test|lint|build|other -- COMMAND`. This is a
144
+ user-supplied category, not a certification. Old records remain usable as command
145
+ history but do not acquire a check category automatically.
146
+
147
+ Natural-language completion claims are never certified as `VERIFIED`. `OBSERVED`
148
+ means a corresponding category of command exited 0 with an intact log and matching
149
+ captured files; inspect the named command and output to confirm scope and test count.
150
+ A build cannot support a test claim. Missing, stale, failed, or modified evidence leaves
151
+ the claim `UNVERIFIED`. Reviews are recalculated on every `status` or `report` call.
152
+ Already exported Markdown is a static snapshot and must be regenerated after changes.
153
+ External services, ignored dependencies and environment changes remain outside the fingerprint.
154
+
155
+ Session import recognizes Claude message blocks and Codex rollout `response_item.payload`
156
+ tool events plus `compacted` records. Opaque outputs do not establish command success.
157
+ Cline and Cursor native formats are not yet validated; generic top-level event counting
158
+ must not be interpreted as full client support.
@@ -0,0 +1,148 @@
1
+ # AgentProof
2
+
3
+ **Evidence for AI coding tasks. Local checkpoints, real command results, honest handoff reports.**
4
+
5
+ [中文说明](README.zh-CN.md) · [Five-minute start](docs/quickstart.md) · [Example report](examples/report.md) · [Changelog](CHANGELOG.md) · [Security](SECURITY.md) · MIT license
6
+
7
+ AI says “done.” What actually changed? Which checks ran, and do they still match the code?
8
+ AgentProof answers those questions without another model or an API key.
9
+
10
+ ```text
11
+ $ agentproof init --goal "Fix payment retries"
12
+ Task initialized. Baseline: ... (42 files)
13
+ $ agentproof verify --kind test -- python -m unittest discover -s tests
14
+ PASS (exit 0). Log: .agentproof/checks/....log
15
+ $ agentproof report
16
+ /path/to/project/.agentproof/report.md
17
+ ```
18
+
19
+ ## Install
20
+
21
+ Requires Python 3.10+, Git, and macOS, Linux, or Windows.
22
+ This project is not published to PyPI yet.
23
+
24
+ With [pipx installed and on PATH](https://pipx.pypa.io/stable/installation/), install directly from GitHub:
25
+
26
+ ```bash
27
+ pipx install 'git+https://github.com/bzwei58/agentproof.git@main'
28
+ ```
29
+
30
+ Then run `agentproof --version` from any project. If the command is missing, run
31
+ `pipx ensurepath` and reopen your terminal. The package is named `agentproof-cli`, while
32
+ the command is `agentproof`; remove it with `pipx uninstall agentproof-cli`.
33
+ This installs the current main branch, not a versioned release.
34
+
35
+ If you do not use pipx, create a virtual environment and install the same Git URL with its
36
+ Python: `python3 -m venv /your/chosen/venv`, then
37
+ `/your/chosen/venv/bin/python -m pip install 'git+https://github.com/bzwei58/agentproof.git@main'`.
38
+ Use `/your/chosen/venv/bin/agentproof` or activate that environment.
39
+
40
+ Start with the [five-minute walkthrough](docs/quickstart.md): one failing test, a fix,
41
+ a stale check and a report, all in a disposable directory. For a real project, follow the workflow below.
42
+
43
+ ## Workflow
44
+
45
+ Run from any directory inside the Git repository you want to inspect. Commands execute at
46
+ that repository's root. One active task is supported per checkout; use a worktree for another task.
47
+
48
+ 1. **Start before AI edits.** `agentproof init --goal "Fix payment retries"` captures initial
49
+ local changes too, without creating commits or touching the Git index.
50
+ 2. Let your existing coding agent work. AgentProof does not launch or intercept it.
51
+ 3. **Save a milestone.** `agentproof checkpoint --label "first implementation"`.
52
+ 4. **Run real checks.** `agentproof verify --kind test -- python -m unittest discover -s tests`.
53
+ Run each test, lint or build command separately. Shell operators are not interpreted;
54
+ explicitly use `sh -c '...'` if you need shell syntax. Only run commands you trust.
55
+ 5. **Optionally import session signals.** `agentproof import-session /path/to/session.jsonl`.
56
+ 6. **Review AI claims.** `agentproof review --summary ai-summary.txt` (one claim per line), or repeat
57
+ `--claim "All tests passed"`. It reports `OBSERVED`, `UNVERIFIED` and `CONFLICT`; natural-language claims are not certified.
58
+ 7. **Review.** `agentproof status` prints evidence; `agentproof report` writes Markdown.
59
+ 8. **Recover selected snapshot contents.** `agentproof restore CHECKPOINT_ID` previews changes;
60
+ add `--apply` to write them, after an automatic backup checkpoint.
61
+
62
+ `verify --timeout 60 -- COMMAND ...` sets a timeout in seconds (default 300).
63
+ A nonzero command result returns CLI exit code 1; usage/operational errors return 2.
64
+ Command stdout and stderr are retained in `.agentproof/checks/`. On failure, the terminal
65
+ also shows the last 12 lines, capped at 4,000 characters, plus an explicit timeout message
66
+ when applicable. Successful commands stay quiet. The full log is always retained locally.
67
+
68
+ ## What is recorded
69
+
70
+ - SHA-256 fingerprints and modes of captured files, plus full file checkpoints.
71
+ - Added, modified and deleted files relative to the task's initial checkpoint.
72
+ - Actual verification command, exit status, output log and before/after fingerprints.
73
+ - Whether each check still matches the current captured files. Editing code after a check
74
+ or having a check modify files marks it **STALE**.
75
+ - Long or multiline commands have compact report summaries; expand **Full command** to
76
+ inspect the exact recorded invocation.
77
+ - Optional Claude Code JSONL counts: tool calls, error results, compaction boundaries,
78
+ truncation markers and malformed records. Raw imported messages are not copied.
79
+ - Claim review matches completion statements to local file changes and fresh checks using transparent rules.
80
+
81
+ ## Boundaries
82
+
83
+ This is an **evidence recorder and claim-gap detector**, not an automatic correctness judge. A passing check does
84
+ not prove requirements satisfaction, coverage or absence of bugs. There is no model-based
85
+ risk scoring, live session watcher, automatic test discovery or cross-agent correlation yet.
86
+ Claim review never calls a model and cannot decide whether a requirement is substantively correct.
87
+ Session import is best-effort for Claude Code-style `message.content` blocks and
88
+ `system/compact_boundary` records. Other formats and future schema changes may not be counted.
89
+ Truncation text is a heuristic signal, not proof that important context was lost.
90
+
91
+ Snapshots include Git-tracked and non-ignored untracked regular files. Ignored files,
92
+ symlinks, submodule contents, Git index state, external services and environment variables
93
+ are outside the captured scope. Known secret filenames (`.env*`, private-key extensions,
94
+ `credentials.json`) are excluded and listed; **this is not secret detection**. Verification
95
+ logs can contain secrets printed by your own commands. Keep `.agentproof/` private.
96
+ Initialization adds a local Git exclusion, and evidence is stored with a private directory mode.
97
+
98
+ A file over 10 MiB or total captured content over 100 MiB aborts snapshotting. Avoid concurrent
99
+ edits while capturing or verifying. Only one AgentProof command can run per checkout.
100
+ After an interrupted process, inspect and remove a stale `.agentproof/lock` manually.
101
+
102
+ Restore rewrites files present in the target snapshot. **Files added later remain**; this is
103
+ file recovery, not an exact whole-workspace rollback. It leaves Git history and staging alone.
104
+ It rejects symlink paths, verifies snapshot content hashes and preflights file/directory
105
+ conflicts, including blocked parent paths, before changing files.
106
+ It is not a filesystem transaction; concurrent changes or I/O errors can still interrupt writes.
107
+ Restore does not recover excluded files or delete newly created ones. A pre-restore checkpoint lets you
108
+ recover overwritten captured content. Do not manually edit snapshot manifests or files.
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ git clone https://github.com/bzwei58/agentproof.git
114
+ cd agentproof
115
+ python3 -m venv .venv
116
+ .venv/bin/python -m pip install -e .
117
+ python3 -m unittest discover -s tests -v
118
+ python3 -m agentproof --help
119
+ ```
120
+
121
+ Want to try it on two real tasks? See the [pilot guide and feedback form](docs/pilot.md).
122
+
123
+ Tests use disposable Git repositories and cover stale evidence, nonzero exits, timeout,
124
+ initial uncommitted edits, restoration backups, symlink rejection, secret exclusions and
125
+ partial session logs. GitHub Actions runs them on macOS/Linux and Python 3.10/3.12/3.13.
126
+
127
+ Ideas for later: task history, more session adapters, configurable snapshot scope, optional
128
+ CI handoff artifacts. Contributions should preserve the distinction between observed facts
129
+ and model-generated claims. Please include a reproducible example and tests for behavior changes.
130
+
131
+ ## Evidence matching in 0.3.0
132
+
133
+ Declare each check with `verify --kind test|lint|build|other -- COMMAND`. This is a
134
+ user-supplied category, not a certification. Old records remain usable as command
135
+ history but do not acquire a check category automatically.
136
+
137
+ Natural-language completion claims are never certified as `VERIFIED`. `OBSERVED`
138
+ means a corresponding category of command exited 0 with an intact log and matching
139
+ captured files; inspect the named command and output to confirm scope and test count.
140
+ A build cannot support a test claim. Missing, stale, failed, or modified evidence leaves
141
+ the claim `UNVERIFIED`. Reviews are recalculated on every `status` or `report` call.
142
+ Already exported Markdown is a static snapshot and must be regenerated after changes.
143
+ External services, ignored dependencies and environment changes remain outside the fingerprint.
144
+
145
+ Session import recognizes Claude message blocks and Codex rollout `response_item.payload`
146
+ tool events plus `compacted` records. Opaque outputs do not establish command success.
147
+ Cline and Cursor native formats are not yet validated; generic top-level event counting
148
+ must not be interpreted as full client support.
@@ -0,0 +1,2 @@
1
+ """AgentProof: evidence for AI coding tasks."""
2
+ __version__ = "0.3.0"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())