runspecimen 0.2.0rc9__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 (78) hide show
  1. runspecimen-0.2.0rc9/.agents/plugins/marketplace.json +20 -0
  2. runspecimen-0.2.0rc9/.cursor/rules/runspecimen.mdc +20 -0
  3. runspecimen-0.2.0rc9/.cursor-plugin/marketplace.json +21 -0
  4. runspecimen-0.2.0rc9/CHANGELOG.md +103 -0
  5. runspecimen-0.2.0rc9/LICENSE +188 -0
  6. runspecimen-0.2.0rc9/MANIFEST.in +24 -0
  7. runspecimen-0.2.0rc9/PKG-INFO +260 -0
  8. runspecimen-0.2.0rc9/README.md +241 -0
  9. runspecimen-0.2.0rc9/SECURITY.md +15 -0
  10. runspecimen-0.2.0rc9/docs/ABOUT.md +45 -0
  11. runspecimen-0.2.0rc9/docs/FAQ.md +98 -0
  12. runspecimen-0.2.0rc9/docs/MARKET_AND_DISTRIBUTION.md +188 -0
  13. runspecimen-0.2.0rc9/docs/PRODUCT_PLAN.md +90 -0
  14. runspecimen-0.2.0rc9/docs/RELEASE_CHECKLIST.md +31 -0
  15. runspecimen-0.2.0rc9/docs/THREAT_MODEL.md +31 -0
  16. runspecimen-0.2.0rc9/docs/USER_GUIDE.md +332 -0
  17. runspecimen-0.2.0rc9/examples/demo_contract.json +36 -0
  18. runspecimen-0.2.0rc9/examples/showcase/README.md +23 -0
  19. runspecimen-0.2.0rc9/examples/showcase/contract.json +46 -0
  20. runspecimen-0.2.0rc9/examples/showcase/work/compute.py +13 -0
  21. runspecimen-0.2.0rc9/plugins/runspecimen/.codex-plugin/plugin.json +26 -0
  22. runspecimen-0.2.0rc9/plugins/runspecimen/.cursor-plugin/plugin.json +13 -0
  23. runspecimen-0.2.0rc9/plugins/runspecimen/README.md +44 -0
  24. runspecimen-0.2.0rc9/plugins/runspecimen/assets/runspecimen-logo.png +0 -0
  25. runspecimen-0.2.0rc9/plugins/runspecimen/rules/runspecimen.mdc +20 -0
  26. runspecimen-0.2.0rc9/plugins/runspecimen/scripts/runspecimen_adapter.py +59 -0
  27. runspecimen-0.2.0rc9/plugins/runspecimen/skills/runspecimen/SKILL.md +63 -0
  28. runspecimen-0.2.0rc9/pyproject.toml +32 -0
  29. runspecimen-0.2.0rc9/scripts/bootstrap_dev.sh +24 -0
  30. runspecimen-0.2.0rc9/scripts/demo_rc.sh +38 -0
  31. runspecimen-0.2.0rc9/scripts/refresh_showcase.py +161 -0
  32. runspecimen-0.2.0rc9/scripts/release_check.py +367 -0
  33. runspecimen-0.2.0rc9/setup.cfg +4 -0
  34. runspecimen-0.2.0rc9/src/runspecimen/__init__.py +14 -0
  35. runspecimen-0.2.0rc9/src/runspecimen/__main__.py +4 -0
  36. runspecimen-0.2.0rc9/src/runspecimen/approve.py +218 -0
  37. runspecimen-0.2.0rc9/src/runspecimen/atomic.py +50 -0
  38. runspecimen-0.2.0rc9/src/runspecimen/certificate.py +272 -0
  39. runspecimen-0.2.0rc9/src/runspecimen/cli.py +601 -0
  40. runspecimen-0.2.0rc9/src/runspecimen/contract.py +421 -0
  41. runspecimen-0.2.0rc9/src/runspecimen/dashboard.py +494 -0
  42. runspecimen-0.2.0rc9/src/runspecimen/demo.py +50 -0
  43. runspecimen-0.2.0rc9/src/runspecimen/errors.py +51 -0
  44. runspecimen-0.2.0rc9/src/runspecimen/events.py +177 -0
  45. runspecimen-0.2.0rc9/src/runspecimen/hashutil.py +168 -0
  46. runspecimen-0.2.0rc9/src/runspecimen/lease.py +154 -0
  47. runspecimen-0.2.0rc9/src/runspecimen/paths.py +85 -0
  48. runspecimen-0.2.0rc9/src/runspecimen/postflight.py +218 -0
  49. runspecimen-0.2.0rc9/src/runspecimen/preflight.py +148 -0
  50. runspecimen-0.2.0rc9/src/runspecimen/py.typed +0 -0
  51. runspecimen-0.2.0rc9/src/runspecimen/recovery.py +251 -0
  52. runspecimen-0.2.0rc9/src/runspecimen/run.py +303 -0
  53. runspecimen-0.2.0rc9/src/runspecimen/runtime.py +329 -0
  54. runspecimen-0.2.0rc9/src/runspecimen/signing.py +616 -0
  55. runspecimen-0.2.0rc9/src/runspecimen/state.py +36 -0
  56. runspecimen-0.2.0rc9/src/runspecimen/status.py +74 -0
  57. runspecimen-0.2.0rc9/src/runspecimen.egg-info/PKG-INFO +260 -0
  58. runspecimen-0.2.0rc9/src/runspecimen.egg-info/SOURCES.txt +76 -0
  59. runspecimen-0.2.0rc9/src/runspecimen.egg-info/dependency_links.txt +1 -0
  60. runspecimen-0.2.0rc9/src/runspecimen.egg-info/entry_points.txt +2 -0
  61. runspecimen-0.2.0rc9/src/runspecimen.egg-info/top_level.txt +1 -0
  62. runspecimen-0.2.0rc9/tests/__init__.py +0 -0
  63. runspecimen-0.2.0rc9/tests/helpers.py +133 -0
  64. runspecimen-0.2.0rc9/tests/test_adversarial.py +293 -0
  65. runspecimen-0.2.0rc9/tests/test_approval_paths.py +174 -0
  66. runspecimen-0.2.0rc9/tests/test_cli_signing.py +384 -0
  67. runspecimen-0.2.0rc9/tests/test_core_hardening.py +118 -0
  68. runspecimen-0.2.0rc9/tests/test_dashboard.py +385 -0
  69. runspecimen-0.2.0rc9/tests/test_demo_cli.py +49 -0
  70. runspecimen-0.2.0rc9/tests/test_hash_status.py +194 -0
  71. runspecimen-0.2.0rc9/tests/test_lease.py +111 -0
  72. runspecimen-0.2.0rc9/tests/test_predecessor_postflight.py +197 -0
  73. runspecimen-0.2.0rc9/tests/test_recovery.py +638 -0
  74. runspecimen-0.2.0rc9/tests/test_runtime_provenance.py +618 -0
  75. runspecimen-0.2.0rc9/tests/test_signing.py +624 -0
  76. runspecimen-0.2.0rc9/tests/test_tamper.py +92 -0
  77. runspecimen-0.2.0rc9/tests/test_timeout_run.py +187 -0
  78. runspecimen-0.2.0rc9/work/compute.py +13 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "personal",
3
+ "interface": {
4
+ "displayName": "Personal"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "runspecimen",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/runspecimen"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Productivity"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Guard consequential local commands with RunSpecimen
3
+ alwaysApply: false
4
+ ---
5
+
6
+ When a user asks for a consequential, long-running, expensive, or provenance-
7
+ sensitive local command, use the installed `runspecimen` CLI on `PATH`. Start
8
+ with `doctor` and `validate`. Never type or pipe the `APPROVE` phrase; the user
9
+ must complete `runspecimen approve --workspace … --contract …` in a real
10
+ terminal. After approval, invoke `preflight`, `run`, `postflight`, then
11
+ `runspecimen verify --workspace … --contract … --campaign-id … --run-id …`
12
+ sequentially and stop on any refusal. Never bypass the CLI with RunSpecimen's
13
+ internal test helpers. Explain that RunSpecimen is an orchestration/evidence
14
+ layer and not an OS sandbox.
15
+
16
+ When the user requests a visual view, launch only the loopback, read-only
17
+ dashboard with `runspecimen dashboard --workspace … --contract … --open`.
18
+ `dashboard` blocks in the foreground; background or detach it so the agent can
19
+ keep running lifecycle commands. The dashboard cannot replace the real-terminal
20
+ approval step.
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "runspecimen",
3
+ "owner": {
4
+ "name": "RunSpecimen Contributors"
5
+ },
6
+ "metadata": {
7
+ "description": "Run assurance for consequential local agent workloads",
8
+ "version": "0.2.0-rc.9"
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "runspecimen",
13
+ "source": "plugins/runspecimen",
14
+ "description": "Guard serious local agent runs with approval, bounds, provenance, and receipts.",
15
+ "version": "0.2.0-rc.9",
16
+ "logo": "plugins/runspecimen/assets/runspecimen-logo.png",
17
+ "category": "Agent Orchestration",
18
+ "tags": ["safety", "provenance", "local automation"]
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,103 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0rc9 - 2026-09-13
4
+
5
+ ### Security Hardening
6
+
7
+ - **Abandoned runs are permanently terminal**: Abandoned run IDs cannot be
8
+ re-approved, preflighted, or executed. Predecessors with `refuse_if_failed`
9
+ now reject abandoned predecessors.
10
+
11
+ - **Recovery status checks active leases**: `needs_recovery` is only true when
12
+ `phase=running` AND no active workspace lease exists. Prevents abandoning
13
+ runs that are still executing.
14
+
15
+ - **Key storage hardening**: Key IDs are validated against a strict safe-ID
16
+ grammar. Path traversal attacks are blocked. Keys cannot be overwritten
17
+ without explicit rotation.
18
+
19
+ - **Certificate validation before signing**: Sign command validates certificate
20
+ schema and recomputes `certificate_id` before signing. Rejects malformed or
21
+ tampered certificates.
22
+
23
+ - **HMAC terminology corrected**: Documentation and CLI now accurately describe
24
+ HMAC-SHA256 as shared-secret authentication (not digital signatures). Anyone
25
+ with the key can both create and verify MACs.
26
+
27
+ - **Interpreter provenance is truthful**: Configured interpreters must resolve
28
+ to executables and are fingerprinted. Missing or non-executable interpreters
29
+ cause hard failures. Library capture uses the interpreter (not the script).
30
+
31
+ - **Environment values not persisted**: Raw environment variable values are
32
+ never stored in artifacts. Only variable names and domain-separated hashes
33
+ are recorded.
34
+
35
+ - **Portable path identity**: Added helper for macOS /var vs /private/var
36
+ symlink aliasing in path comparisons.
37
+
38
+ ### Bug Fixes
39
+
40
+ - Fixed macOS path-alias test failures using `os.path.realpath` comparisons.
41
+ - Library capture explicitly reports unsupported platforms (non-Linux).
42
+
43
+ ## 0.2.0rc8 - 2026-09-10
44
+
45
+ - Package the RunSpecimen logo in source and plugin archives and reference it
46
+ from the Cursor plugin and marketplace manifests.
47
+ - Extend the release gate so missing plugin branding fails before publication.
48
+
49
+ ## 0.2.0rc7 - 2026-09-08
50
+
51
+ - Made the installed-dashboard release smoke deterministic on macOS runners by hosting and probing the loopback server in one process.
52
+
53
+ ## 0.2.0rc6 - 2026-09-08
54
+
55
+ - Replaced the release-gate dashboard startup log dependency with direct loopback HTTP readiness verification for reliable macOS checks.
56
+
57
+ ## 0.2.0rc5 - 2026-09-08
58
+
59
+ - Make the offline release gate wait for dashboard startup without relying on
60
+ platform-specific pipe readiness notifications.
61
+
62
+ ## 0.2.0rc4 - 2026-09-07
63
+
64
+ - Harden lifecycle supervision so inherited output pipes, timeouts, and
65
+ interruption all leave bounded captures and a terminal recorded state.
66
+ - Bind approvals and receipts to the exact parsed contract bytes, reject unsafe
67
+ source-root symlinks, and recheck expiry at launch.
68
+ - Make the local dashboard honest about recorded evidence versus live receipt
69
+ verification; reject cross-origin access, contract drift, and write requests.
70
+ - Add a dashboard About panel plus User guide / FAQ links, `docs/ABOUT.md`, and
71
+ a `runspecimen about` command (docs URLs also appear in `doctor` and `--help`).
72
+ - Add a fresh `init-demo` onboarding command and a clean-install release gate
73
+ for source archives, wheels, the dashboard, and the plugin package.
74
+
75
+ ## 0.2.0rc3 - 2026-09-04
76
+
77
+ - Add a contract-scoped, loopback-only local dashboard that renders phase,
78
+ evidence, and the exact lifecycle commands for Codex and Cursor users.
79
+ - Keep the dashboard read-only: it cannot approve or execute commands, so the
80
+ real-TTY approval and CLI enforcement boundaries remain intact.
81
+ - Teach the Codex and Cursor adapters to launch the dashboard on request.
82
+
83
+ ## 0.2.0rc2 - 2026-09-03
84
+
85
+ - Execute the exact absolute executable whose digest was approved, including
86
+ correct resolution of relative `PATH` entries against the contract working directory.
87
+ - Reject unknown and duplicate contract fields so misspelled safety controls fail closed.
88
+ - Add a native Cursor plugin manifest, marketplace metadata, packaged rule, and local-test docs.
89
+ - Expand release checks to keep the Python, Codex, and Cursor package versions aligned.
90
+
91
+ ## 0.2.0rc1 - 2026-09-01
92
+
93
+ - Bind approvals and receipts to the resolved executable SHA-256.
94
+ - Remove stale lease-owner metadata and make status report only active holders.
95
+ - Add `doctor` and `validate` readiness commands.
96
+ - Add Codex plugin and Cursor rule adapters that preserve the TTY approval gate.
97
+ - Add threat model, security policy, CI, release checks, and clean-install smoke tests.
98
+ - Declare Apache-2.0 licensing and Python 3.9+ support.
99
+
100
+ ## 0.1.0 - 2026-08-24
101
+
102
+ - Initial bounded-run engine with TTY approval, workspace lease, atomic state,
103
+ predecessor gating, postflight assertions, and tamper-evident receipts.
@@ -0,0 +1,188 @@
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
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. "Submitted" means any form of electronic, verbal,
53
+ or written communication sent to the Licensor or its representatives,
54
+ including but not limited to communication on electronic mailing lists,
55
+ source code control systems, and issue tracking systems that are managed
56
+ by, or on behalf of, the Licensor for the purpose of discussing and
57
+ improving the Work, but excluding communication that is conspicuously
58
+ marked or otherwise designated in writing by the copyright owner as
59
+ "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ (except as stated in this section) patent license to make, have made,
76
+ use, offer to sell, sell, import, and otherwise transfer the Work,
77
+ where such license applies only to those patent claims licensable
78
+ by such Contributor that are necessarily infringed by their
79
+ Contribution(s) alone or by combination of their Contribution(s)
80
+ with the Work to which such Contribution(s) was submitted. If You
81
+ institute patent litigation against any entity alleging that the Work
82
+ or a Contribution incorporated within the Work constitutes direct
83
+ or contributory patent infringement, then any patent licenses
84
+ granted to You under this License for that Work shall terminate
85
+ as of the date such litigation is filed.
86
+
87
+ 4. Redistribution. You may reproduce and distribute copies of the
88
+ Work or Derivative Works thereof in any medium, with or without
89
+ modifications, and in Source or Object form, provided that You
90
+ meet the following conditions:
91
+
92
+ (a) You must give any other recipients of the Work or
93
+ Derivative Works a copy of this License; and
94
+
95
+ (b) You must cause any modified files to carry prominent notices
96
+ stating that You changed the files; and
97
+
98
+ (c) You must retain, in the Source form of any Derivative Works
99
+ that You distribute, all copyright, patent, trademark, and
100
+ attribution notices from the Source form of the Work,
101
+ excluding those notices that do not pertain to any part of
102
+ the Derivative Works; and
103
+
104
+ (d) If the Work includes a "NOTICE" text file as part of its
105
+ distribution, then any Derivative Works that You distribute must
106
+ include a readable copy of the attribution notices contained
107
+ within such NOTICE file, excluding those notices that do not
108
+ pertain to any part of the Derivative Works, in at least one
109
+ of the following places: within a NOTICE text file distributed
110
+ as part of the Derivative Works; within the Source form or
111
+ documentation, if provided along with the Derivative Works; or,
112
+ within a display generated by the Derivative Works, if and
113
+ wherever such third-party notices normally appear. The contents
114
+ of the NOTICE file are for informational purposes only and
115
+ do not modify the License. You may add Your own attribution
116
+ notices within Derivative Works that You distribute, alongside
117
+ or as an addendum to the NOTICE text from the Work, provided
118
+ that such additional attribution notices cannot be construed
119
+ as modifying the License.
120
+
121
+ You may add Your own copyright statement to Your modifications and
122
+ may provide additional or different license terms and conditions
123
+ for use, reproduction, or distribution of Your modifications, or
124
+ for any such Derivative Works as a whole, provided Your use,
125
+ reproduction, and distribution of the Work otherwise complies with
126
+ the conditions stated in this License.
127
+
128
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
129
+ any Contribution intentionally submitted for inclusion in the Work
130
+ by You to the Licensor shall be under the terms and conditions of
131
+ this License, without any additional terms or conditions.
132
+ Notwithstanding the above, nothing herein shall supersede or modify
133
+ the terms of any separate license agreement you may have executed
134
+ with Licensor regarding such Contributions.
135
+
136
+ 6. Trademarks. This License does not grant permission to use the trade
137
+ names, trademarks, service marks, or product names of the Licensor,
138
+ except as required for reasonable and customary use in describing the
139
+ origin of the Work and reproducing the content of the NOTICE file.
140
+
141
+ 7. Disclaimer of Warranty. Unless required by applicable law or
142
+ agreed to in writing, Licensor provides the Work (and each
143
+ Contributor provides its Contributions) on an "AS IS" BASIS,
144
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
145
+ implied, including, without limitation, any warranties or conditions
146
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
147
+ PARTICULAR PURPOSE. You are solely responsible for determining the
148
+ appropriateness of using or redistributing the Work and assume any
149
+ risks associated with Your exercise of permissions under this License.
150
+
151
+ 8. Limitation of Liability. In no event and under no legal theory,
152
+ whether in tort (including negligence), contract, or otherwise,
153
+ unless required by applicable law (such as deliberate and grossly
154
+ negligent acts) or agreed to in writing, shall any Contributor be
155
+ liable to You for damages, including any direct, indirect, special,
156
+ incidental, or consequential damages of any character arising as a
157
+ result of this License or out of the use or inability to use the
158
+ Work (including but not limited to damages for loss of goodwill,
159
+ work stoppage, computer failure or malfunction, or any and all
160
+ other commercial damages or losses), even if such Contributor
161
+ has been advised of the possibility of such damages.
162
+
163
+ 9. Accepting Warranty or Additional Liability. While redistributing
164
+ the Work or Derivative Works thereof, You may choose to offer,
165
+ and charge a fee for, acceptance of support, warranty, indemnity,
166
+ or other liability obligations and/or rights consistent with this
167
+ License. However, in accepting such obligations, You may act only
168
+ on Your own behalf and on Your sole responsibility, not on behalf
169
+ of any other Contributor, and only if You agree to indemnify,
170
+ defend, and hold each Contributor harmless for any liability
171
+ incurred by, or claims asserted against, such Contributor by reason
172
+ of your accepting any such warranty or additional liability.
173
+
174
+ END OF TERMS AND CONDITIONS
175
+
176
+ Copyright 2026 RunSpecimen Contributors
177
+
178
+ Licensed under the Apache License, Version 2.0 (the "License");
179
+ you may not use this file except in compliance with the License.
180
+ You may obtain a copy of the License at
181
+
182
+ http://www.apache.org/licenses/LICENSE-2.0
183
+
184
+ Unless required by applicable law or agreed to in writing, software
185
+ distributed under the License is distributed on an "AS IS" BASIS,
186
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
187
+ See the License for the specific language governing permissions and
188
+ limitations under the License.
@@ -0,0 +1,24 @@
1
+ include LICENSE
2
+ include CHANGELOG.md
3
+ include SECURITY.md
4
+ include docs/ABOUT.md
5
+ include docs/FAQ.md
6
+ include docs/MARKET_AND_DISTRIBUTION.md
7
+ include docs/PRODUCT_PLAN.md
8
+ include docs/RELEASE_CHECKLIST.md
9
+ include docs/THREAT_MODEL.md
10
+ include docs/USER_GUIDE.md
11
+ include examples/demo_contract.json
12
+ include examples/showcase/README.md
13
+ include examples/showcase/contract.json
14
+ include examples/showcase/work/compute.py
15
+ include work/compute.py
16
+ include plugins/runspecimen/assets/runspecimen-logo.png
17
+ recursive-include scripts *.py *.sh
18
+ recursive-include tests *.py
19
+ recursive-include plugins *.json *.md *.mdc *.py
20
+ recursive-include .cursor *.mdc
21
+ recursive-include .cursor-plugin *.json
22
+ recursive-include .agents *.json
23
+ prune examples/showcase/.runspecimen
24
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,260 @@
1
+ Metadata-Version: 2.4
2
+ Name: runspecimen
3
+ Version: 0.2.0rc9
4
+ Summary: Bounded, approved, tamper-evident local research/engineering runs
5
+ Author: RunSpecimen Contributors
6
+ License: Apache-2.0
7
+ Keywords: agents,automation,provenance,safety,local-first
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Topic :: Software Development :: Build Tools
14
+ Classifier: Topic :: System :: Systems Administration
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # RunSpecimen
21
+
22
+ RunSpecimen is a local safety and evidence layer for consequential agent-driven
23
+ research and engineering commands. This repository contains the `0.2.0rc9`
24
+ release candidate.
25
+
26
+ ## Core promise
27
+
28
+ Exactly **one** approved, bounded run at a time, with:
29
+
30
+ 1. **Approved provenance** — interactive TTY approval binds contract, source, and resolved executable hashes with expiry
31
+ 2. **Crash-safe state** — atomic JSON state writes
32
+ 3. **Mandatory postflight** — successor runs refuse an unpostflighted / failed predecessor
33
+ 4. **Tamper-evident receipts** — append-only SHA-256 hash-chained event log + verifiable certificate
34
+
35
+ No watchers, no recurring scheduler, no parallel workers.
36
+
37
+ ## Requirements
38
+
39
+ - Python 3.9+
40
+ - POSIX (`fcntl` leases)
41
+ - Stdlib only (no third-party dependencies)
42
+
43
+ ## Docs
44
+
45
+ - [About](docs/ABOUT.md) — what RunSpecimen does, lifecycle, safety model, dashboard role
46
+ - [User guide](docs/USER_GUIDE.md) — install, lifecycle, contracts, dashboard, plugins, troubleshooting
47
+ - [FAQ](docs/FAQ.md) — vs CI/sandbox/agents, TTY approval, verify-after-clone, parallelism, receipts
48
+ - [Product plan](docs/PRODUCT_PLAN.md) — invariants and roadmap
49
+ - [Market and distribution](docs/MARKET_AND_DISTRIBUTION.md) — wedge, channels, commercial sequence
50
+ - [Marketing pitches](docs/MARKETING_PITCHES.md) — honest one-liners, elevators, CTAs
51
+ - [Grok tandem](docs/GROK_TANDEM.md) — external xAI Grok review log (Composio `GROK_*`)
52
+ - [Threat model](docs/THREAT_MODEL.md) — trusted boundary and residual risks
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ python3 -m pip install .
58
+ ```
59
+
60
+ For development, prefer the bootstrap. It pins `setuptools>=77` and performs
61
+ a regular local install; this avoids an editable-install edge case in some
62
+ Python builds where the command is created but cannot import the package:
63
+
64
+ ```bash
65
+ sh scripts/bootstrap_dev.sh
66
+ ```
67
+
68
+ Or manually: `python3 -m pip install --upgrade 'setuptools>=77' wheel` then
69
+ `python3 -m pip install --no-build-isolation .`. Stock setuptools before 77
70
+ rejects the project metadata used by `scripts/release_check.py`. Re-run the
71
+ install after source edits.
72
+
73
+ Check the host and contract before approval:
74
+
75
+ ```bash
76
+ runspecimen doctor --workspace .
77
+ runspecimen validate --workspace . --contract examples/demo_contract.json
78
+ ```
79
+
80
+ Create a fresh, unapproved demo workspace without modifying an existing
81
+ directory:
82
+
83
+ ```bash
84
+ runspecimen init-demo --workspace ./runspecimen-demo
85
+ ```
86
+
87
+ ## Typical sequence
88
+
89
+ ```bash
90
+ # 1) Bind approval on a real TTY (refuses pipes/CI without a TTY)
91
+ runspecimen approve --workspace . --contract examples/demo_contract.json
92
+
93
+ # 2) Optional explicit preflight
94
+ runspecimen preflight --workspace . --contract examples/demo_contract.json
95
+
96
+ # 3) Execute one bounded run (reacquires lease + rechecks under lease)
97
+ runspecimen run --workspace . --contract examples/demo_contract.json
98
+
99
+ # 4) Assert outcomes and issue certificate (required before a successor)
100
+ runspecimen postflight --workspace . --contract examples/demo_contract.json
101
+
102
+ # 5) Verify receipts (requires contract; rehashes live contract+source+runtime)
103
+ runspecimen verify --workspace . --contract examples/demo_contract.json \
104
+ --campaign-id demo-campaign --run-id run-001
105
+ runspecimen status --workspace . --campaign-id demo-campaign --run-id run-001
106
+ ```
107
+
108
+ ## Local dashboard for Codex and Cursor users
109
+
110
+ Open a contract-scoped dashboard from a terminal, or ask the installed Codex or
111
+ Cursor RunSpecimen integration to do so:
112
+
113
+ ```bash
114
+ runspecimen dashboard --workspace . --contract examples/demo_contract.json --open
115
+ ```
116
+
117
+ `dashboard` blocks in the foreground while it serves HTTP. Background it
118
+ (`&`), detach it, or use a separate terminal if you still need the shell for
119
+ `approve` / lifecycle commands (agents should not wait on it in the main turn).
120
+
121
+ It binds only to `127.0.0.1`, has no remote service or telemetry, and is
122
+ read-only: it shows an About overview, the current phase, approval/lease/receipt
123
+ evidence, and the exact lifecycle commands. It cannot approve or execute a run.
124
+ This keeps the real-TTY approval gate and the CLI enforcement boundary intact
125
+ while making the workflow visible in the browser. Docs links open the published
126
+ About, User guide, and FAQ on GitHub. CLI shortcut: `runspecimen about`.
127
+
128
+ ### Showcase receipt
129
+
130
+ `examples/showcase/` holds a regeneratable postflight receipt with
131
+ `outputs/result.json`. Verify it with:
132
+
133
+ ```bash
134
+ runspecimen verify --workspace examples/showcase \
135
+ --contract examples/showcase/contract.json \
136
+ --campaign-id showcase-campaign --run-id run-001
137
+ ```
138
+
139
+ Refresh without a TTY (uses the library test hook `skip_tty_check`; not for
140
+ production approvals): `python3 scripts/refresh_showcase.py`. Interactive TTY
141
+ path: `scripts/demo_rc.sh`.
142
+
143
+ Any local `/.runspecimen/runs/demo-campaign/run-001` left from earlier RCs is
144
+ **historical / pre-`runtime` certificate** and is **not** verifiable on rc2.
145
+
146
+ ## Contract surface (v1)
147
+
148
+ See `examples/demo_contract.json`. Important fields:
149
+
150
+ | Field | Role |
151
+ | --- | --- |
152
+ | `argv` | Executed as an argument vector (`shell=False` always) |
153
+ | `source.roots` / `excludes` | Deterministic source hashing / provenance |
154
+ | `outputs.required` | Must be absent at preflight; present at postflight when required |
155
+ | `caps.*` | Wall timeout + bounded stdout/stderr capture (hard tool maxima apply) |
156
+ | `approval.ttl_sec` | Approval expiry bound into the approval document |
157
+ | `predecessor` | Gate on prior run postflight / failure |
158
+ | `postflight.*` | Exit code, output existence/SHA, JSON field equality, source unchanged |
159
+
160
+ Every path involved in an output existence, SHA-256, or JSON assertion must be
161
+ absent before launch and is hashed into the receipt after it passes.
162
+
163
+ ## State layout
164
+
165
+ Per run under `{workspace}/.runspecimen/runs/{campaign_id}/{run_id}/`:
166
+
167
+ - `approval.json` — bound hashes + expiry
168
+ - `state.json` — atomic phase document
169
+ - `events.jsonl` — hash-chained append-only log (`events.append.lock` serializes appends)
170
+ - `stdout.capture` / `stderr.capture` — bounded captures
171
+ - `certificate.json` — postflight receipt
172
+
173
+ Workspace-wide execution lease: `{workspace}/.runspecimen/execution.lock` (held by
174
+ approve/preflight/run/postflight; status is read-only).
175
+
176
+ ## New in rc9: Missing features implemented
177
+
178
+ ### Crash recovery with audited human decisions
179
+
180
+ When a run crashes mid-execution, use the new recovery commands:
181
+
182
+ ```bash
183
+ # Check if a run needs recovery
184
+ runspecimen recovery-status --workspace . --campaign-id demo --run-id run-001
185
+
186
+ # Abandon a crashed run (TTY confirmation required)
187
+ runspecimen abandon --workspace . --campaign-id demo --run-id run-001
188
+ ```
189
+
190
+ ### Authenticated receipts (shared-secret)
191
+
192
+ Authenticate certificates with local HMAC keys for tamper detection:
193
+
194
+ ```bash
195
+ # Generate an authentication key
196
+ runspecimen keygen --workspace .
197
+
198
+ # List available keys
199
+ runspecimen list-keys --workspace .
200
+
201
+ # Authenticate a certificate (creates .signed.json with MAC)
202
+ runspecimen sign --workspace . --key-id <key-id> --certificate path/to/certificate.json
203
+
204
+ # Verify an authenticated certificate
205
+ runspecimen verify-signature --workspace . --key-id <key-id> --signed path/to/certificate.signed.json
206
+ ```
207
+
208
+ **Shared-secret limitation**: HMAC-SHA256 uses the same key for authentication
209
+ and verification. Anyone with the key can forge certificates. For independent
210
+ third-party verification without sharing secrets, use asymmetric cryptography.
211
+
212
+ ### Extended runtime provenance
213
+
214
+ Contracts now support a `runtime` field for enhanced provenance binding:
215
+
216
+ ```json
217
+ {
218
+ "runtime": {
219
+ "env_allowlist": ["PATH", "HOME", "PYTHONPATH"],
220
+ "interpreter": "/usr/bin/python3",
221
+ "capture_libs": true
222
+ }
223
+ }
224
+ ```
225
+
226
+ This binds environment variables, interpreter, and optionally linked libraries
227
+ into the certificate's `runtime_id`.
228
+
229
+ ## Release-candidate limitations
230
+
231
+ - Authenticated receipts use HMAC-SHA256 shared-secret MACs (MVP). This provides
232
+ tamper detection but NOT digital signatures: anyone with the key can forge
233
+ certificates. Production deployments should upgrade to Ed25519/RSA via
234
+ optional dependencies for true asymmetric signatures with non-repudiation.
235
+ - The executed payload is not sandboxed and CPU, memory, network, filesystem,
236
+ and child-process limits are not yet enforced. The current hard bounds are one
237
+ workspace run, wall-clock duration, and captured output size.
238
+ - The resolved executable or interpreter is automatically hashed. Native
239
+ libraries, environment variables, and input datasets still need to be placed
240
+ in `source.roots` or otherwise asserted by the workload.
241
+ - This release is licensed under Apache-2.0. The CLI remains the enforcement
242
+ boundary; Codex and Cursor integrations are constrained adapters to it.
243
+
244
+ ## Non-goals
245
+
246
+ - **Not an OS sandbox.** Process groups, wall clocks, and path containment are orchestration controls, not a security boundary against a hostile payload.
247
+ - **Finite computation is not proof.** A green postflight and a valid certificate mean the approved contract ran under recorded provenance and assertions passed — not that the scientific/engineering claim is true.
248
+ - **Not a job scheduler.** No cron, no watchers, no fan-out workers, no multi-run parallelism inside one lease domain.
249
+ - **Not a remote execution fabric.** Local workspace only.
250
+
251
+ ## Tests
252
+
253
+ ```bash
254
+ python3 -m unittest discover -s tests -v
255
+ ```
256
+
257
+ For the complete release-candidate gate, run `python3 scripts/release_check.py`.
258
+ Day-to-day usage: [about](docs/ABOUT.md), [user guide](docs/USER_GUIDE.md), and [FAQ](docs/FAQ.md).
259
+ Before sensitive work: [threat model](docs/THREAT_MODEL.md),
260
+ [release checklist](docs/RELEASE_CHECKLIST.md), and [security policy](SECURITY.md).