methodproof 0.1.1__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 (44) hide show
  1. methodproof-0.1.1/.github/workflows/ci.yml +35 -0
  2. methodproof-0.1.1/.gitignore +10 -0
  3. methodproof-0.1.1/CHANGELOG.md +15 -0
  4. methodproof-0.1.1/LICENSE +190 -0
  5. methodproof-0.1.1/PKG-INFO +177 -0
  6. methodproof-0.1.1/README.md +161 -0
  7. methodproof-0.1.1/methodproof/__init__.py +3 -0
  8. methodproof-0.1.1/methodproof/__main__.py +4 -0
  9. methodproof-0.1.1/methodproof/agents/__init__.py +0 -0
  10. methodproof-0.1.1/methodproof/agents/base.py +136 -0
  11. methodproof-0.1.1/methodproof/agents/music.py +105 -0
  12. methodproof-0.1.1/methodproof/agents/terminal.py +111 -0
  13. methodproof-0.1.1/methodproof/agents/watcher.py +170 -0
  14. methodproof-0.1.1/methodproof/bridge.py +86 -0
  15. methodproof-0.1.1/methodproof/cli.py +620 -0
  16. methodproof-0.1.1/methodproof/config.py +79 -0
  17. methodproof-0.1.1/methodproof/crypto.py +46 -0
  18. methodproof-0.1.1/methodproof/graph.py +163 -0
  19. methodproof-0.1.1/methodproof/hook.py +91 -0
  20. methodproof-0.1.1/methodproof/hooks/__init__.py +0 -0
  21. methodproof-0.1.1/methodproof/hooks/claude_code.py +63 -0
  22. methodproof-0.1.1/methodproof/hooks/claude_code.sh +75 -0
  23. methodproof-0.1.1/methodproof/hooks/install.py +87 -0
  24. methodproof-0.1.1/methodproof/hooks/openclaw/HOOK.md +15 -0
  25. methodproof-0.1.1/methodproof/hooks/openclaw/handler.ts +82 -0
  26. methodproof-0.1.1/methodproof/hooks/openclaw_install.py +80 -0
  27. methodproof-0.1.1/methodproof/hooks/wrappers.py +113 -0
  28. methodproof-0.1.1/methodproof/integrity.py +71 -0
  29. methodproof-0.1.1/methodproof/live.py +79 -0
  30. methodproof-0.1.1/methodproof/mcp.py +128 -0
  31. methodproof-0.1.1/methodproof/repos.py +25 -0
  32. methodproof-0.1.1/methodproof/skills/methodproof/SKILL.md +76 -0
  33. methodproof-0.1.1/methodproof/store.py +272 -0
  34. methodproof-0.1.1/methodproof/sync.py +127 -0
  35. methodproof-0.1.1/methodproof/viewer.py +239 -0
  36. methodproof-0.1.1/pyproject.toml +29 -0
  37. methodproof-0.1.1/test_windows_compat.py +344 -0
  38. methodproof-0.1.1/tests/__init__.py +0 -0
  39. methodproof-0.1.1/tests/test_graph.py +176 -0
  40. methodproof-0.1.1/tests/test_hooks.py +69 -0
  41. methodproof-0.1.1/tests/test_openclaw_hooks.py +79 -0
  42. methodproof-0.1.1/tests/test_store.py +97 -0
  43. methodproof-0.1.1/tests/test_wrappers.py +74 -0
  44. methodproof-0.1.1/uv.lock +274 -0
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ branches: [main]
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v4
16
+ with: { version: "latest" }
17
+ - uses: actions/setup-python@v5
18
+ with: { python-version: "3.12" }
19
+ - run: uv sync --frozen
20
+ - run: uv run pytest tests/ -v --tb=short
21
+
22
+ publish:
23
+ needs: test
24
+ if: startsWith(github.ref, 'refs/tags/v')
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ id-token: write
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: astral-sh/setup-uv@v4
31
+ with: { version: "latest" }
32
+ - uses: actions/setup-python@v5
33
+ with: { python-version: "3.12" }
34
+ - run: uv build
35
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .env
8
+ *.key
9
+ *.pem
10
+ .DS_Store
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 2026-04-02
4
+
5
+ ### Added
6
+ - **`--live` flag on `methodproof start`** — streams events to the platform in
7
+ real-time over WebSocket. Requires login (`methodproof login`). Creates the
8
+ remote session automatically and connects to `WS /sessions/{id}/stream`.
9
+ - **`methodproof/live.py`** — WebSocket client module using `websocket-client`.
10
+ Performs JWT + consent handshake, then drains a thread-safe send queue in a
11
+ background thread. Events are sent to both local SQLite and the live WebSocket.
12
+ - **`live` optional dependency** — `pip install methodproof[live]` adds
13
+ `websocket-client>=1.7`.
14
+ - Free-tier users with full-spectrum consent (all 10 categories enabled) get
15
+ 30-day rolling live stream access. Pro/Team users get unlimited.
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 MethodProof, Inc.
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: methodproof
3
+ Version: 0.1.1
4
+ Summary: See how you code — capture and visualize your engineering process
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: watchdog>=4.0
9
+ Provides-Extra: e2e
10
+ Requires-Dist: cryptography>=43.0; extra == 'e2e'
11
+ Provides-Extra: live
12
+ Requires-Dist: websocket-client>=1.7; extra == 'live'
13
+ Provides-Extra: signing
14
+ Requires-Dist: cryptography>=43.0; extra == 'signing'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # MethodProof
18
+
19
+ See how you code — capture and visualize your engineering process.
20
+
21
+ ```bash
22
+ pip install methodproof
23
+ methodproof init # install hooks, acknowledge data capture
24
+ methodproof start # begin recording
25
+ # ... code ...
26
+ methodproof stop # stop recording, build process graph
27
+ methodproof view # explore session graph in browser
28
+ ```
29
+
30
+ No account required. Fully offline. Your data stays on your machine unless you explicitly `push`.
31
+
32
+ ## Commands
33
+
34
+ | Command | Description |
35
+ |---------|-------------|
36
+ | `init` | Install hooks, create data directory. Interactive consent selector on first run |
37
+ | `start [--dir .] [--repo URL] [--tags t1,t2] [--public]` | Start recording a session |
38
+ | `stop` | Stop recording, build process graph |
39
+ | `view [session_id] [--port 9876]` | View session graph in browser (D3 visualization) |
40
+ | `log` | List local sessions with sync status, visibility, tags |
41
+ | `login [--api-url URL]` | Connect to MethodProof platform (email + password) |
42
+ | `push [session_id]` | Upload session to platform |
43
+ | `tag <session_id> <tags>` | Add comma-separated tags to a session |
44
+ | `publish [session_id]` | Set visibility to public and push |
45
+ | `delete <session_id> [-f]` | Delete a session and all its data (with confirmation) |
46
+ | `consent` | Review or change capture categories at any time |
47
+ | `mcp-serve` | Run MCP server (used by Claude Code integration) |
48
+
49
+ ## Consent & Capture Categories
50
+
51
+ On first `init`, MethodProof shows an interactive consent selector. You choose exactly which categories of data to capture — nothing is recorded without your explicit opt-in.
52
+
53
+ ```
54
+ MethodProof Consent — choose what to capture
55
+
56
+ All data stays local in ~/.methodproof/. Nothing leaves your
57
+ machine unless you explicitly run `methodproof push`.
58
+
59
+ [x] 1. terminal_commands Commands you run and their exit codes
60
+ [x] 2. command_output First 500 chars of command output (secrets auto-filtered)
61
+ [x] 3. test_results Pass/fail counts from pytest, jest, go test, cargo test
62
+ [x] 4. file_changes File create, edit, and delete events with paths and sizes
63
+ [x] 5. git_diffs Diff content of file changes (secrets auto-redacted)
64
+ [x] 6. git_commits Commit hashes, messages, and changed file lists
65
+ [x] 7. ai_prompts Text you send to AI tools (Claude Code, OpenClaw, codex, etc.)
66
+ [x] 8. ai_responses Text AI tools respond with, including tool calls
67
+ [x] 9. browser Page visits, tab switches, searches, copy events (via extension)
68
+
69
+ Toggle: enter number | a = all on | n = all off | done = confirm
70
+ ```
71
+
72
+ Categories are enforced at every level:
73
+ - **Agent level** — disabled agents don't start (no CPU/memory overhead)
74
+ - **Event level** — events from disabled categories are silently dropped
75
+ - **Field level** — `command_output` and `git_diffs` strip specific fields from events that are otherwise captured
76
+
77
+ Change your choices anytime with `methodproof consent`.
78
+
79
+ ### What Each Category Captures
80
+
81
+ | Category | Events | Details |
82
+ |----------|--------|---------|
83
+ | `terminal_commands` | `terminal_cmd` | Command text, exit code, duration. Sensitive commands (passwords, tokens, API keys) are auto-filtered |
84
+ | `command_output` | (field in `terminal_cmd`) | First 500 chars of stdout. Redacted if it contains sensitive patterns |
85
+ | `test_results` | `test_run` | Framework name, pass/fail counts, duration |
86
+ | `file_changes` | `file_create`, `file_edit`, `file_delete` | File paths, sizes, language, line counts |
87
+ | `git_diffs` | (field in `file_edit`) | Diff content (max 2000 chars). Redacted for secret files (`.env`, `.pem`, credentials) |
88
+ | `git_commits` | `git_commit` | Short hash, commit message, changed file list |
89
+ | `ai_prompts` | `llm_prompt`, `agent_prompt` | Model name, prompt text, token count, temperature |
90
+ | `ai_responses` | `llm_completion`, `agent_completion`, tool events | Response text, token count, latency, tool calls |
91
+ | `browser` | `browser_visit`, `browser_search`, `browser_tab_switch`, `browser_copy`, `browser_ai_chat` | Metadata only — no page content, no search query text, no copied text |
92
+
93
+ All data is stored locally in `~/.methodproof/methodproof.db` (SQLite, `chmod 600`).
94
+
95
+ ## Deleting Data
96
+
97
+ ```bash
98
+ # Delete a session and all related data
99
+ methodproof delete <session_id>
100
+
101
+ # Skip confirmation prompt
102
+ methodproof delete <session_id> --force
103
+ ```
104
+
105
+ ## E2E Encryption
106
+
107
+ For company-managed encryption where the platform cannot read your data:
108
+
109
+ ```bash
110
+ pip install methodproof[e2e]
111
+ ```
112
+
113
+ Set your company's encryption key in `~/.methodproof/config.json`:
114
+
115
+ ```json
116
+ {
117
+ "e2e_key": "<64-char-hex-key>"
118
+ }
119
+ ```
120
+
121
+ When set, all sensitive metadata (prompts, completions, commands, output, diffs) is encrypted with AES-256-GCM before storage and before any platform sync. The platform stores ciphertext it cannot decrypt.
122
+
123
+ ## Connecting to Platform
124
+
125
+ ```bash
126
+ methodproof login # authenticate
127
+ methodproof push # upload latest session
128
+ methodproof push abc123 # upload specific session
129
+ methodproof publish # set public + push
130
+ methodproof tag abc123 python,react # add tags
131
+ ```
132
+
133
+ For self-hosted instances:
134
+
135
+ ```bash
136
+ methodproof login --api-url https://mp.company.com/api
137
+ ```
138
+
139
+ ## Integrity Verification
140
+
141
+ MethodProof uses a multi-layer integrity system to ensure session data has not been tampered with.
142
+
143
+ **Hash-chained events:** Every event emitted during a session includes a SHA-256 hash linking it to the previous event, forming a verifiable chain. Hashes are computed at emit time and stored in `event_hashes` in the local database. Any gap or modification breaks the chain and is detectable on the platform via `GET /sessions/{id}/chain/verify`.
144
+
145
+ **Ed25519 attestation on push:** When you run `methodproof push`, the CLI signs a summary of the session (event count, first/last hash, duration) with your Ed25519 private key. The platform stores the signed attestation and exposes it via `GET /sessions/{id}/integrity`. Reviewers can verify the session was pushed by the key holder without modification.
146
+
147
+ **Binary hash self-reporting:** On each push, the CLI reports its own binary hash to the platform. The platform compares this against known release hashes published via `GET /cli/releases` to detect modified or unofficial builds.
148
+
149
+ ### Signing Key
150
+
151
+ A signing key is generated automatically during `methodproof init`. To enable Ed25519 signing, install the signing extra:
152
+
153
+ ```bash
154
+ pip install methodproof[signing]
155
+ ```
156
+
157
+ The private key is stored in `~/.methodproof/config.json` (`chmod 600`). The corresponding public key is registered with the platform on first push via `POST /personal/signing-keys`.
158
+
159
+ ## Integrations
160
+
161
+ `methodproof init` automatically installs hooks for detected tools:
162
+
163
+ - **Shell** — bash/zsh preexec/precmd hooks for command capture
164
+ - **Claude Code** — hooks for prompt/tool/session events
165
+ - **OpenClaw** — hook + skill for agent-level telemetry
166
+ - **AI CLI wrappers** — codex, gemini, aider command wrappers
167
+ - **MCP server** — registered with Claude Code for session/graph queries
168
+
169
+ ## Configuration
170
+
171
+ Data directory: `~/.methodproof/`
172
+
173
+ | File | Purpose |
174
+ |------|---------|
175
+ | `config.json` | API URL, auth token, email, E2E key (`chmod 600`) |
176
+ | `methodproof.db` | SQLite database with sessions, events, graph (`chmod 600`) |
177
+ | `commands.jsonl` | Shell command log (consumed by terminal monitor) |
@@ -0,0 +1,161 @@
1
+ # MethodProof
2
+
3
+ See how you code — capture and visualize your engineering process.
4
+
5
+ ```bash
6
+ pip install methodproof
7
+ methodproof init # install hooks, acknowledge data capture
8
+ methodproof start # begin recording
9
+ # ... code ...
10
+ methodproof stop # stop recording, build process graph
11
+ methodproof view # explore session graph in browser
12
+ ```
13
+
14
+ No account required. Fully offline. Your data stays on your machine unless you explicitly `push`.
15
+
16
+ ## Commands
17
+
18
+ | Command | Description |
19
+ |---------|-------------|
20
+ | `init` | Install hooks, create data directory. Interactive consent selector on first run |
21
+ | `start [--dir .] [--repo URL] [--tags t1,t2] [--public]` | Start recording a session |
22
+ | `stop` | Stop recording, build process graph |
23
+ | `view [session_id] [--port 9876]` | View session graph in browser (D3 visualization) |
24
+ | `log` | List local sessions with sync status, visibility, tags |
25
+ | `login [--api-url URL]` | Connect to MethodProof platform (email + password) |
26
+ | `push [session_id]` | Upload session to platform |
27
+ | `tag <session_id> <tags>` | Add comma-separated tags to a session |
28
+ | `publish [session_id]` | Set visibility to public and push |
29
+ | `delete <session_id> [-f]` | Delete a session and all its data (with confirmation) |
30
+ | `consent` | Review or change capture categories at any time |
31
+ | `mcp-serve` | Run MCP server (used by Claude Code integration) |
32
+
33
+ ## Consent & Capture Categories
34
+
35
+ On first `init`, MethodProof shows an interactive consent selector. You choose exactly which categories of data to capture — nothing is recorded without your explicit opt-in.
36
+
37
+ ```
38
+ MethodProof Consent — choose what to capture
39
+
40
+ All data stays local in ~/.methodproof/. Nothing leaves your
41
+ machine unless you explicitly run `methodproof push`.
42
+
43
+ [x] 1. terminal_commands Commands you run and their exit codes
44
+ [x] 2. command_output First 500 chars of command output (secrets auto-filtered)
45
+ [x] 3. test_results Pass/fail counts from pytest, jest, go test, cargo test
46
+ [x] 4. file_changes File create, edit, and delete events with paths and sizes
47
+ [x] 5. git_diffs Diff content of file changes (secrets auto-redacted)
48
+ [x] 6. git_commits Commit hashes, messages, and changed file lists
49
+ [x] 7. ai_prompts Text you send to AI tools (Claude Code, OpenClaw, codex, etc.)
50
+ [x] 8. ai_responses Text AI tools respond with, including tool calls
51
+ [x] 9. browser Page visits, tab switches, searches, copy events (via extension)
52
+
53
+ Toggle: enter number | a = all on | n = all off | done = confirm
54
+ ```
55
+
56
+ Categories are enforced at every level:
57
+ - **Agent level** — disabled agents don't start (no CPU/memory overhead)
58
+ - **Event level** — events from disabled categories are silently dropped
59
+ - **Field level** — `command_output` and `git_diffs` strip specific fields from events that are otherwise captured
60
+
61
+ Change your choices anytime with `methodproof consent`.
62
+
63
+ ### What Each Category Captures
64
+
65
+ | Category | Events | Details |
66
+ |----------|--------|---------|
67
+ | `terminal_commands` | `terminal_cmd` | Command text, exit code, duration. Sensitive commands (passwords, tokens, API keys) are auto-filtered |
68
+ | `command_output` | (field in `terminal_cmd`) | First 500 chars of stdout. Redacted if it contains sensitive patterns |
69
+ | `test_results` | `test_run` | Framework name, pass/fail counts, duration |
70
+ | `file_changes` | `file_create`, `file_edit`, `file_delete` | File paths, sizes, language, line counts |
71
+ | `git_diffs` | (field in `file_edit`) | Diff content (max 2000 chars). Redacted for secret files (`.env`, `.pem`, credentials) |
72
+ | `git_commits` | `git_commit` | Short hash, commit message, changed file list |
73
+ | `ai_prompts` | `llm_prompt`, `agent_prompt` | Model name, prompt text, token count, temperature |
74
+ | `ai_responses` | `llm_completion`, `agent_completion`, tool events | Response text, token count, latency, tool calls |
75
+ | `browser` | `browser_visit`, `browser_search`, `browser_tab_switch`, `browser_copy`, `browser_ai_chat` | Metadata only — no page content, no search query text, no copied text |
76
+
77
+ All data is stored locally in `~/.methodproof/methodproof.db` (SQLite, `chmod 600`).
78
+
79
+ ## Deleting Data
80
+
81
+ ```bash
82
+ # Delete a session and all related data
83
+ methodproof delete <session_id>
84
+
85
+ # Skip confirmation prompt
86
+ methodproof delete <session_id> --force
87
+ ```
88
+
89
+ ## E2E Encryption
90
+
91
+ For company-managed encryption where the platform cannot read your data:
92
+
93
+ ```bash
94
+ pip install methodproof[e2e]
95
+ ```
96
+
97
+ Set your company's encryption key in `~/.methodproof/config.json`:
98
+
99
+ ```json
100
+ {
101
+ "e2e_key": "<64-char-hex-key>"
102
+ }
103
+ ```
104
+
105
+ When set, all sensitive metadata (prompts, completions, commands, output, diffs) is encrypted with AES-256-GCM before storage and before any platform sync. The platform stores ciphertext it cannot decrypt.
106
+
107
+ ## Connecting to Platform
108
+
109
+ ```bash
110
+ methodproof login # authenticate
111
+ methodproof push # upload latest session
112
+ methodproof push abc123 # upload specific session
113
+ methodproof publish # set public + push
114
+ methodproof tag abc123 python,react # add tags
115
+ ```
116
+
117
+ For self-hosted instances:
118
+
119
+ ```bash
120
+ methodproof login --api-url https://mp.company.com/api
121
+ ```
122
+
123
+ ## Integrity Verification
124
+
125
+ MethodProof uses a multi-layer integrity system to ensure session data has not been tampered with.
126
+
127
+ **Hash-chained events:** Every event emitted during a session includes a SHA-256 hash linking it to the previous event, forming a verifiable chain. Hashes are computed at emit time and stored in `event_hashes` in the local database. Any gap or modification breaks the chain and is detectable on the platform via `GET /sessions/{id}/chain/verify`.
128
+
129
+ **Ed25519 attestation on push:** When you run `methodproof push`, the CLI signs a summary of the session (event count, first/last hash, duration) with your Ed25519 private key. The platform stores the signed attestation and exposes it via `GET /sessions/{id}/integrity`. Reviewers can verify the session was pushed by the key holder without modification.
130
+
131
+ **Binary hash self-reporting:** On each push, the CLI reports its own binary hash to the platform. The platform compares this against known release hashes published via `GET /cli/releases` to detect modified or unofficial builds.
132
+
133
+ ### Signing Key
134
+
135
+ A signing key is generated automatically during `methodproof init`. To enable Ed25519 signing, install the signing extra:
136
+
137
+ ```bash
138
+ pip install methodproof[signing]
139
+ ```
140
+
141
+ The private key is stored in `~/.methodproof/config.json` (`chmod 600`). The corresponding public key is registered with the platform on first push via `POST /personal/signing-keys`.
142
+
143
+ ## Integrations
144
+
145
+ `methodproof init` automatically installs hooks for detected tools:
146
+
147
+ - **Shell** — bash/zsh preexec/precmd hooks for command capture
148
+ - **Claude Code** — hooks for prompt/tool/session events
149
+ - **OpenClaw** — hook + skill for agent-level telemetry
150
+ - **AI CLI wrappers** — codex, gemini, aider command wrappers
151
+ - **MCP server** — registered with Claude Code for session/graph queries
152
+
153
+ ## Configuration
154
+
155
+ Data directory: `~/.methodproof/`
156
+
157
+ | File | Purpose |
158
+ |------|---------|
159
+ | `config.json` | API URL, auth token, email, E2E key (`chmod 600`) |
160
+ | `methodproof.db` | SQLite database with sessions, events, graph (`chmod 600`) |
161
+ | `commands.jsonl` | Shell command log (consumed by terminal monitor) |
@@ -0,0 +1,3 @@
1
+ """MethodProof — see how you code."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ """Allow `python -m methodproof`."""
2
+ from methodproof.cli import main
3
+
4
+ main()
File without changes