continuity-receipt 0.2.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.
Files changed (52) hide show
  1. continuity_receipt-0.2.0/ANCHORING.md +117 -0
  2. continuity_receipt-0.2.0/CHANGELOG.md +66 -0
  3. continuity_receipt-0.2.0/CONTRIBUTING.md +34 -0
  4. continuity_receipt-0.2.0/LICENSE +202 -0
  5. continuity_receipt-0.2.0/MANIFEST.in +13 -0
  6. continuity_receipt-0.2.0/PKG-INFO +100 -0
  7. continuity_receipt-0.2.0/README.md +78 -0
  8. continuity_receipt-0.2.0/ROADMAP.md +58 -0
  9. continuity_receipt-0.2.0/SIGNING.md +32 -0
  10. continuity_receipt-0.2.0/SPEC.md +299 -0
  11. continuity_receipt-0.2.0/THREAT_MODEL.md +31 -0
  12. continuity_receipt-0.2.0/continuity_receipt/__init__.py +31 -0
  13. continuity_receipt-0.2.0/continuity_receipt/bundle.py +63 -0
  14. continuity_receipt-0.2.0/continuity_receipt/canon.py +42 -0
  15. continuity_receipt-0.2.0/continuity_receipt/disclose.py +218 -0
  16. continuity_receipt-0.2.0/continuity_receipt/keys.py +115 -0
  17. continuity_receipt-0.2.0/continuity_receipt/records.py +151 -0
  18. continuity_receipt-0.2.0/continuity_receipt/verify.py +394 -0
  19. continuity_receipt-0.2.0/continuity_receipt.egg-info/PKG-INFO +100 -0
  20. continuity_receipt-0.2.0/continuity_receipt.egg-info/SOURCES.txt +50 -0
  21. continuity_receipt-0.2.0/continuity_receipt.egg-info/dependency_links.txt +1 -0
  22. continuity_receipt-0.2.0/continuity_receipt.egg-info/entry_points.txt +3 -0
  23. continuity_receipt-0.2.0/continuity_receipt.egg-info/requires.txt +1 -0
  24. continuity_receipt-0.2.0/continuity_receipt.egg-info/top_level.txt +1 -0
  25. continuity_receipt-0.2.0/pyproject.toml +42 -0
  26. continuity_receipt-0.2.0/schema/continuity-receipt-0.2.schema.json +305 -0
  27. continuity_receipt-0.2.0/setup.cfg +4 -0
  28. continuity_receipt-0.2.0/tests/test_schema.py +51 -0
  29. continuity_receipt-0.2.0/tests/test_vectors.py +99 -0
  30. continuity_receipt-0.2.0/tools/make_vectors.py +387 -0
  31. continuity_receipt-0.2.0/vectors/01_happy_minimal.json +146 -0
  32. continuity_receipt-0.2.0/vectors/02_happy_full.json +204 -0
  33. continuity_receipt-0.2.0/vectors/03_tampered_body.json +146 -0
  34. continuity_receipt-0.2.0/vectors/04_missing_termination.json +113 -0
  35. continuity_receipt-0.2.0/vectors/05_cap_exceeded.json +204 -0
  36. continuity_receipt-0.2.0/vectors/06_delivery_before_settlement.json +200 -0
  37. continuity_receipt-0.2.0/vectors/07_redacted_no_disclosure.json +208 -0
  38. continuity_receipt-0.2.0/vectors/08_redacted_disclosed.json +216 -0
  39. continuity_receipt-0.2.0/vectors/09_erased_content.json +209 -0
  40. continuity_receipt-0.2.0/vectors/10a_anchor_invalid.json +152 -0
  41. continuity_receipt-0.2.0/vectors/10b_anchor_missing.json +146 -0
  42. continuity_receipt-0.2.0/vectors/10c_anchor_unknown_type.json +156 -0
  43. continuity_receipt-0.2.0/vectors/11_succession_handoff.json +228 -0
  44. continuity_receipt-0.2.0/vectors/12_ms_timestamps.json +146 -0
  45. continuity_receipt-0.2.0/vectors/13_attestation_valid.json +209 -0
  46. continuity_receipt-0.2.0/vectors/13b_attestation_tampered.json +209 -0
  47. continuity_receipt-0.2.0/vectors/14a_revoked_key.json +158 -0
  48. continuity_receipt-0.2.0/vectors/14b_revocation_after_issue.json +158 -0
  49. continuity_receipt-0.2.0/vectors/15_merkle_provenance.json +146 -0
  50. continuity_receipt-0.2.0/vectors/15b_provenance_invalid.json +146 -0
  51. continuity_receipt-0.2.0/vectors/INDEX.md +28 -0
  52. continuity_receipt-0.2.0/vectors/manifest.json +165 -0
@@ -0,0 +1,117 @@
1
+ # Anchoring — policy and decision record
2
+
3
+ **Status:** decided 2026-09-18 (v0 policy). Applies to `continuity-receipt/0.1`–`0.2`.
4
+ **Scope:** the `anchors[]` bundle member and issuance practice; not a new protocol layer.
5
+
6
+ ## Decision
7
+
8
+ Anchoring is **optional in the format and recommended in practice** when a
9
+ consumer needs an independent timestamp:
10
+
11
+ 1. **OpenTimestamps (OTS) is the recommended default** issuance path. It is
12
+ free, requires no custody, publishes only a hash, and is verifiable with
13
+ open tooling. An OTS attestation proves the anchored digest existed no
14
+ later than the Bitcoin block in which it was included.
15
+ 2. **Public-chain anchoring is a supported peer type**, for counterparties
16
+ that require a chain-reachable identifier (SAIHM's reference deployment is
17
+ an example). The spec recommends no chain; the format stays
18
+ ledger-agnostic, and the anchor object carries whatever identifier the
19
+ counterparty's tooling needs.
20
+ 3. **`custom` is the escape hatch** for private ledgers and registries. A
21
+ consumer that cannot describe a custom anchor's verification MUST treat it
22
+ as opaque metadata, not evidence.
23
+ 4. **No mandatory anchoring.** A receipt verifies without anchors. A consumer
24
+ that requires an anchor states that explicitly (`--require-anchor` →
25
+ `PROVISIONAL` + `anchor_missing` when absent), so the requirement travels
26
+ with the verdict instead of being assumed.
27
+ 5. **Verification scope is frozen for 0.x:** this repository's verifier checks
28
+ anchor *shape and digest binding only* — `anchor.hash == receipt_digest(target)`
29
+ and the declared type. Proof verification (calendar response, Merkle path,
30
+ Bitcoin header) is delegated to the provider's tooling until a 0.3
31
+ companion tool lands. Until then, `type: opentimestamps` is a **claim** to
32
+ a verifier that has not checked the proof, not evidence.
33
+
34
+ ## What an anchor proves — and what it does not
35
+
36
+ With a checked proof: the anchored digest existed no later than the anchor's
37
+ timestamp, and it was not altered afterwards. Transitively, anchoring a
38
+ chain's final receipt commits to every earlier receipt through the `prev`
39
+ links, provided the chain itself verifies.
40
+
41
+ It does **not** prove that statements inside the receipt are true. A
42
+ timestamp is evidence of existence and ordering, not of honesty. Erasure and
43
+ revocation semantics are separate (SPEC §6, §7) and are not affected by
44
+ anchoring.
45
+
46
+ ## Options considered
47
+
48
+ | | OpenTimestamps | Public chain (tx/OP_RETURN) | Defer until asked |
49
+ |---|---|---|---|
50
+ | Cost | free | gas/tx fee | none |
51
+ | Custody | none | wallet + key custody | none |
52
+ | Latency | minutes to hours (block cadence) | seconds to minutes | — |
53
+ | Lock-in | none (federated calendars; Bitcoin anchors) | chain-specific tooling | none |
54
+ | Privacy | hash only; no identity attached | address/value linkability common | — |
55
+ | Dependency | calendar servers + Bitcoin headers | RPC/node/explorer | — |
56
+ | Fit with non-goals | strong (no custody, no payments) | weaker (custody, fee rail) | no anchor evidence |
57
+
58
+ Decision rationale: the format's non-goals exclude custody and payment rails,
59
+ so the default issuance path must not require either. OTS gives independent
60
+ timestamping at zero cost; chain anchoring remains available where a
61
+ counterparty demands it, without the spec blessing a chain.
62
+
63
+ ## Issuance workflow (recommended)
64
+
65
+ 1. Freeze the bundle. Compute the target receipt's digest exactly as the
66
+ verifier does (canonical bytes excluding `sig`).
67
+ 2. Prefer the **chain tip** as the anchor target: one anchor per task chain
68
+ commits transitively to the earlier receipts and leaks less than anchoring
69
+ every receipt.
70
+ 3. `ots stamp <bundle-file>` (or the calendar API) and keep `<file>.ots`
71
+ beside the bundle. **Never mutate the bundle afterwards** — any change to
72
+ the anchored receipt invalidates the binding.
73
+ 4. After Bitcoin confirmation, `ots upgrade` the proof and verify it with
74
+ `ots verify`. Store the upgraded proof with the bundle.
75
+ 5. Record the anchor in the bundle:
76
+
77
+ ```json
78
+ "anchors": [
79
+ {
80
+ "target": "urn:uuid:<receipt_id>",
81
+ "hash": "sha256:<receipt_digest>",
82
+ "anchor": { "type": "opentimestamps", "value": "https://<calendar>/..." }
83
+ }
84
+ ]
85
+ ```
86
+
87
+ 6. For a counterparty requiring chain anchoring, same shape with
88
+ `"type": "public-chain"` and the chain-reachable identifier in `value`.
89
+
90
+ ## Failure and renewal guidance
91
+
92
+ - **Calendar unavailability:** submit to more than one OTS calendar; any one
93
+ sufficient proof is enough to verify.
94
+ - **Reorgs:** treat an anchor as settled only after the transaction has a
95
+ small confirmation depth; long-range reorgs are the residual risk.
96
+ - **Long horizons:** keep the upgraded proof; re-upgrade against current
97
+ headers before archiving if the proof references headers a later verifier
98
+ may not have.
99
+ - **Mutated bundles:** the digest binding fails (`anchor_invalid`); re-issue
100
+ under a new receipt, do not edit an anchored one.
101
+
102
+ ## Open items
103
+
104
+ - **0.3 candidate:** OTS proof verification in the verifier or a companion
105
+ `continuity_receipt.anchor` tool, plus a documented renewal procedure.
106
+ - Bundle-root anchoring (one anchor for many chains) is not expressible in
107
+ 0.2; the schema binds anchors to receipts. Revisit if consumers need it.
108
+ - No chain recommendation is deliberate; revisit only with deployment demand.
109
+
110
+ ## Interop note
111
+
112
+ SAIHM (`draft-saihm-memory-protocol-01`) mandates public-chain anchoring per
113
+ mutating operation and is chain-agnostic about the chain. Our `public-chain`
114
+ anchor type is the mapping surface: `value` carries the chain-reachable
115
+ identifier sufficient to reproduce the receipt independently, while the
116
+ digest binding stays ours. See the mapping note offered to the W3C AI Agent
117
+ Memory Interoperability CG.
@@ -0,0 +1,66 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - Packaging: `pyproject.toml` at 0.2.0 with console scripts
6
+ (`continuity-receipt-verify`, `continuity-receipt-disclose`), a full sdist
7
+ via `MANIFEST.in`, and a CI job that builds the wheel, installs it, and
8
+ exercises both console scripts. PyPI name `continuity-receipt` is available;
9
+ upload pending maintainer token.
10
+ - `ANCHORING.md` — anchoring policy and decision record: OpenTimestamps as the
11
+ recommended default issuance path, `public-chain` supported for
12
+ counterparties that require it, `custom` as an opaque escape hatch;
13
+ verifier scope stays shape + digest binding only, proof verification
14
+ targeted for 0.3.
15
+
16
+ ## 0.2.0 — 2026-09-18
17
+
18
+ Interoperability and robustness release; `0.1` remains supported.
19
+
20
+ - **New record type** `authority.succession` (authority hand-off).
21
+ - **Millisecond timestamps** (optional 1–3 fractional digits); second precision
22
+ still valid. Ordering within a chain remains by `seq`.
23
+ - **Counterparty attestations** — signing rule defined (body with
24
+ `counterparty.attestation` removed) and verified per-signature; invalid
25
+ attestation → `bad_attestation`. Absence is reported, not penalized.
26
+ - **Revocation statements** — bundle-level, self-signed by the revoked key;
27
+ receipts issued at or after `revoked_at` fail with `key_revoked`; earlier
28
+ receipts remain valid. Invalid statements fail closed (`bad_revocation`).
29
+ - **Provenance roots** — `observed_sources_hash` accepts `merkle-sha256:`;
30
+ unsupported forms fail with `provenance_invalid`.
31
+ - **Anchor typing** — anchor metadata `type` ∈ {`opentimestamps`,
32
+ `public-chain`, `custom`}; unknown types → `anchor_invalid`.
33
+ - **JSON Schema** (`schema/continuity-receipt-0.2.schema.json`) validated
34
+ against every schema-valid vector in CI.
35
+ - **CI** (GitHub Actions) + **machine-readable vector manifest**
36
+ (`vectors/manifest.json`) + CLI-surface verification of all vectors.
37
+ - **THREAT_MODEL.md** (13 threat classes, including the open
38
+ pre-revocation-compromise gap) and **CONTRIBUTING.md** (DCO, no CLA).
39
+ - Test set grows from 11 to 20 vectors; suite is 10 tests (vectors, schema,
40
+ primitives).
41
+
42
+ Deferred to 0.3 with reasons in `SPEC.md` §11: CBOR equivalence, commitment
43
+ HMAC/domain separation, revocation distribution, anchor proof verification,
44
+ succession multi-signatures.
45
+
46
+ ## 0.1.0 — 2026-09-18
47
+
48
+ Initial public release.
49
+
50
+ - `continuity-receipt/0.1` specification, including pinned 0.1 decisions:
51
+ - JSON-only canonicalization (pinned RFC 8785-compatible subset; floats rejected);
52
+ - commitment scheme `sha256(salt_bytes || 0x7c || JCS(value))`, 16-byte per-field salt;
53
+ - redaction as an issuance-time act (chain tail re-signed);
54
+ - flat `observed_sources_hash` (Merkle roots deferred to 0.2).
55
+ - Reference verifier (`continuity_receipt/`) with verdict semantics
56
+ `TRUSTED | PROVISIONAL | INSUFFICIENT_EVIDENCE | UNTRUSTED` and 13 error codes.
57
+ - 11 test vectors (10 plus anchor sub-cases 10a/10b) with expected verdicts.
58
+ - Vector generator (`tools/make_vectors.py`) for deterministic reproduction.
59
+ - Conformance suite: `python3 -m unittest discover -s tests -v`.
60
+
61
+ Source lineage: extracted from the MandalaOS gate-lite work, where the module passed
62
+ gate acceptance G1–G8 and the wider project suite; this repository versions independently.
63
+
64
+ Open items for 0.2 are listed in `SPEC.md` §11 (CBOR profile, Merkle source roots,
65
+ HMAC/domain separation, required-field minimalism review with an underwriter,
66
+ succession receipts).
@@ -0,0 +1,34 @@
1
+ # Contributing
2
+
3
+ ## Ground rules
4
+
5
+ 1. **Small specification, testable changes.** A change to `SPEC.md` lands only with a vector, an acceptance test, or a documented negative case. If it cannot be tested, it is a discussion item, not a spec change.
6
+ 2. **Additive within 0.x.** Breaking changes require a new minor version and a new vector set (see `SPEC.md` §10).
7
+ 3. **Interop beats elegance.** When a choice exists, align with the neutral venues (W3C AI Agent Memory Interoperability CG; IETF agentproto) and with existing implementations.
8
+ 4. **Failures publish.** Rejected designs and known gaps are documented in `SPEC.md` §11 and `THREAT_MODEL.md`, not hidden.
9
+
10
+ ## How to contribute
11
+
12
+ - **Issues first** for spec questions, field-mapping suggestions, or proposed vectors.
13
+ - **Pull requests** must:
14
+ - add or update vectors and `vectors/manifest.json` via `tools/make_vectors.py` when behavior changes;
15
+ - keep `python3 -m unittest discover -s tests -v` green (vectors, schema, primitives);
16
+ - update `SPEC.md`, `CHANGELOG.md`, and `THREAT_MODEL.md` when semantics change.
17
+ - **Developer Certificate of Origin (DCO).** Contributions are accepted under the DCO 1.1: sign off commits with `git commit -s` to certify you wrote the contribution or have the right to submit it. No separate CLA is required. (Decision recorded 2026-09-18; revisit only if the work moves to a foundation.)
18
+ - **License.** By contributing you agree your contribution is licensed under Apache-2.0.
19
+
20
+ ## Running the suite
21
+
22
+ ```bash
23
+ pip install 'cryptography>=42' jsonschema
24
+ python3 tools/make_vectors.py # regenerates vectors + manifest (non-deterministic ids/timestamps)
25
+ python3 -m unittest discover -s tests -v # 20 vectors + schema + primitives
26
+ ```
27
+
28
+ Note: regenerating vectors rewrites files with fresh random IDs and timestamps; that is expected (the generator is the source of truth for the set).
29
+
30
+ ## Scope guidance
31
+
32
+ - Spec text, schema, vectors, and the reference verifier are in scope.
33
+ - Gate/orchestrator machinery (the broader MandalaOS project) is out of scope here.
34
+ - Interoperability discussion belongs in the open standards venues; this repository tracks concrete text, code, and vectors.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,13 @@
1
+ include LICENSE
2
+ include README.md
3
+ include SPEC.md
4
+ include ANCHORING.md
5
+ include CHANGELOG.md
6
+ include ROADMAP.md
7
+ include THREAT_MODEL.md
8
+ include CONTRIBUTING.md
9
+ include SIGNING.md
10
+ recursive-include schema *.json
11
+ recursive-include vectors *.json *.md
12
+ recursive-include tools *.py
13
+ recursive-include tests *.py
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: continuity-receipt
3
+ Version: 0.2.0
4
+ Summary: Continuity Receipt — open specification, test vectors, and reference verifier for verifiable records of governed AI-agent tasks
5
+ Author: Lucas Bailey
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/lbailey94/continuity-receipt
8
+ Project-URL: Repository, https://github.com/lbailey94/continuity-receipt
9
+ Project-URL: Issues, https://github.com/lbailey94/continuity-receipt/issues
10
+ Project-URL: Specification, https://github.com/lbailey94/continuity-receipt/blob/main/SPEC.md
11
+ Keywords: agent-memory,provenance,verification,receipts,interoperability,ed25519
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Security :: Cryptography
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: cryptography>=42
21
+ Dynamic: license-file
22
+
23
+ # Continuity Receipt
24
+
25
+ **An open specification, test vectors, and reference verifier for verifiable records of governed AI-agent tasks.**
26
+
27
+ **Spec version:** `continuity-receipt/0.2` — published 2026-09-18 (`0.1` remains supported; open items listed in `SPEC.md` §11).
28
+ **License:** Apache-2.0 (specification text, code, and vectors).
29
+
30
+ A Continuity Receipt is a signed, hash-chained record of one governed task:
31
+ **decision → authority → execution → delivery → termination → settlement**. It is designed to be verified offline by any third party — insurers, arbiters, procurement, courts, other agents — **without requiring trust in the issuer**.
32
+
33
+ The spec is intentionally small: JSON (RFC 8785 canonicalization), SHA-256, Ed25519, `did:key` identities. No new cryptography. Redaction uses salted commitments so fields can be revealed selectively without breaking integrity; erasure makes commitments opaque while the chain still verifies.
34
+
35
+ ## Why this exists
36
+
37
+ Agents are accumulating persistent memory and doing delegated work at scale, but accountability is still self-reported. This document is the opposite: claims arrive with evidence, missing evidence is distinguished from false evidence, and "proof it stopped" (`task.termination`) is required for a task to verify as complete.
38
+
39
+ Verification verdicts (IETF CTQ-aligned):
40
+ `TRUSTED` · `PROVISIONAL` · `INSUFFICIENT_EVIDENCE` · `UNTRUSTED`.
41
+ `INSUFFICIENT_EVIDENCE` is explicitly not the same as false.
42
+
43
+ ## Layout
44
+
45
+ ```
46
+ SPEC.md the v0.2 specification (normative; 0.1 supported)
47
+ schema/ JSON Schema (2020-12) for 0.1 + 0.2 bundles
48
+ THREAT_MODEL.md what receipts prove, and what they do not
49
+ ANCHORING.md anchoring policy: OpenTimestamps default, chain optional
50
+ CONTRIBUTING.md DCO, test rules, scope
51
+ ROADMAP.md what lands in 0.3 and beyond, and the selection rule
52
+ continuity_receipt/ reference implementation (Python, cryptography>=42)
53
+ vectors/ 20 test vectors + INDEX.md + manifest.json
54
+ tools/make_vectors.py regenerates the vectors deterministically
55
+ tests/ conformance suite (vectors, schema, primitives)
56
+ ```
57
+
58
+ ## Quickstart
59
+
60
+ ```bash
61
+ python3 -m venv .venv && . .venv/bin/activate
62
+ pip install 'cryptography>=42'
63
+
64
+ # verify a vector (TRUSTED / PROVISIONAL / INSUFFICIENT_EVIDENCE / UNTRUSTED)
65
+ python3 -m continuity_receipt.verify vectors/02_happy_full.json
66
+
67
+ # vectors that require an anchor policy
68
+ python3 -m continuity_receipt.verify vectors/10b_anchor_missing.json --require-anchor
69
+
70
+ # run the conformance suite (11/11 expected)
71
+ python3 -m unittest discover -s tests -v
72
+ ```
73
+
74
+ ## Test vectors
75
+
76
+ 20 vectors with machine-readable expectations in `vectors/manifest.json`
77
+ (human index: `vectors/INDEX.md`): 0.1 conformance (`01`–`10c`) plus 0.2
78
+ additions — succession records, millisecond timestamps, counterparty
79
+ attestations, revocation semantics, Merkle provenance, and anchor typing.
80
+ Every schema-valid vector is also checked against
81
+ `schema/continuity-receipt-0.2.schema.json` in CI.
82
+
83
+ ## Status and provenance
84
+
85
+ - **Origin:** developed in the MandalaOS gate-lite work, where it passed acceptance G1–G8 and the wider project suite (49 tests, dogfood evidence). This repository is the format's public home; it versions independently of any product release train.
86
+ - **Releases:** `0.1` (2026-09-18) — spec, reference verifier, 11 vectors. `0.2` (2026-09-18) — `authority.succession`, bundle-level revocation statements, counterparty attestation rules, millisecond timestamps, `merkle-sha256:` provenance, anchor typing, JSON Schema, CI, machine-readable vector manifest.
87
+ - **Origin implementation:** [WhiteMagic](https://github.com/lbailey94/whitemagic) — an MIT, local-first memory substrate for agents (this spec repo is Apache-2.0; the two are separate works).
88
+ - **Standards context:** the format is intended as a contribution to the emerging neutral layer (W3C AI Agent Memory Interoperability CG; IETF agentproto work). It is not endorsed by those bodies, and no claim of adoption is made.
89
+
90
+ ## Development disclosure
91
+
92
+ This project is developed with AI agents as drafting, implementation, and review collaborators, under the direction and accountability of the human maintainer. Every artifact published here — spec text, code, vectors — is reviewed and signed off by the human maintainer, who is responsible for its claims. We disclose this proactively because verifiability is the project's subject as well as its method.
93
+
94
+ ## Contributing
95
+
96
+ Open an issue for spec questions, mapping suggestions, or implementation feedback. Interoperability discussion belongs in the open standards venues; this repository tracks concrete text and vectors.
97
+
98
+ ## License
99
+
100
+ Apache License 2.0 — see `LICENSE`. The specification is published for royalty-free implementation. Test keys in the vectors are deterministic and public; **never use them for real receipts**.
@@ -0,0 +1,78 @@
1
+ # Continuity Receipt
2
+
3
+ **An open specification, test vectors, and reference verifier for verifiable records of governed AI-agent tasks.**
4
+
5
+ **Spec version:** `continuity-receipt/0.2` — published 2026-09-18 (`0.1` remains supported; open items listed in `SPEC.md` §11).
6
+ **License:** Apache-2.0 (specification text, code, and vectors).
7
+
8
+ A Continuity Receipt is a signed, hash-chained record of one governed task:
9
+ **decision → authority → execution → delivery → termination → settlement**. It is designed to be verified offline by any third party — insurers, arbiters, procurement, courts, other agents — **without requiring trust in the issuer**.
10
+
11
+ The spec is intentionally small: JSON (RFC 8785 canonicalization), SHA-256, Ed25519, `did:key` identities. No new cryptography. Redaction uses salted commitments so fields can be revealed selectively without breaking integrity; erasure makes commitments opaque while the chain still verifies.
12
+
13
+ ## Why this exists
14
+
15
+ Agents are accumulating persistent memory and doing delegated work at scale, but accountability is still self-reported. This document is the opposite: claims arrive with evidence, missing evidence is distinguished from false evidence, and "proof it stopped" (`task.termination`) is required for a task to verify as complete.
16
+
17
+ Verification verdicts (IETF CTQ-aligned):
18
+ `TRUSTED` · `PROVISIONAL` · `INSUFFICIENT_EVIDENCE` · `UNTRUSTED`.
19
+ `INSUFFICIENT_EVIDENCE` is explicitly not the same as false.
20
+
21
+ ## Layout
22
+
23
+ ```
24
+ SPEC.md the v0.2 specification (normative; 0.1 supported)
25
+ schema/ JSON Schema (2020-12) for 0.1 + 0.2 bundles
26
+ THREAT_MODEL.md what receipts prove, and what they do not
27
+ ANCHORING.md anchoring policy: OpenTimestamps default, chain optional
28
+ CONTRIBUTING.md DCO, test rules, scope
29
+ ROADMAP.md what lands in 0.3 and beyond, and the selection rule
30
+ continuity_receipt/ reference implementation (Python, cryptography>=42)
31
+ vectors/ 20 test vectors + INDEX.md + manifest.json
32
+ tools/make_vectors.py regenerates the vectors deterministically
33
+ tests/ conformance suite (vectors, schema, primitives)
34
+ ```
35
+
36
+ ## Quickstart
37
+
38
+ ```bash
39
+ python3 -m venv .venv && . .venv/bin/activate
40
+ pip install 'cryptography>=42'
41
+
42
+ # verify a vector (TRUSTED / PROVISIONAL / INSUFFICIENT_EVIDENCE / UNTRUSTED)
43
+ python3 -m continuity_receipt.verify vectors/02_happy_full.json
44
+
45
+ # vectors that require an anchor policy
46
+ python3 -m continuity_receipt.verify vectors/10b_anchor_missing.json --require-anchor
47
+
48
+ # run the conformance suite (11/11 expected)
49
+ python3 -m unittest discover -s tests -v
50
+ ```
51
+
52
+ ## Test vectors
53
+
54
+ 20 vectors with machine-readable expectations in `vectors/manifest.json`
55
+ (human index: `vectors/INDEX.md`): 0.1 conformance (`01`–`10c`) plus 0.2
56
+ additions — succession records, millisecond timestamps, counterparty
57
+ attestations, revocation semantics, Merkle provenance, and anchor typing.
58
+ Every schema-valid vector is also checked against
59
+ `schema/continuity-receipt-0.2.schema.json` in CI.
60
+
61
+ ## Status and provenance
62
+
63
+ - **Origin:** developed in the MandalaOS gate-lite work, where it passed acceptance G1–G8 and the wider project suite (49 tests, dogfood evidence). This repository is the format's public home; it versions independently of any product release train.
64
+ - **Releases:** `0.1` (2026-09-18) — spec, reference verifier, 11 vectors. `0.2` (2026-09-18) — `authority.succession`, bundle-level revocation statements, counterparty attestation rules, millisecond timestamps, `merkle-sha256:` provenance, anchor typing, JSON Schema, CI, machine-readable vector manifest.
65
+ - **Origin implementation:** [WhiteMagic](https://github.com/lbailey94/whitemagic) — an MIT, local-first memory substrate for agents (this spec repo is Apache-2.0; the two are separate works).
66
+ - **Standards context:** the format is intended as a contribution to the emerging neutral layer (W3C AI Agent Memory Interoperability CG; IETF agentproto work). It is not endorsed by those bodies, and no claim of adoption is made.
67
+
68
+ ## Development disclosure
69
+
70
+ This project is developed with AI agents as drafting, implementation, and review collaborators, under the direction and accountability of the human maintainer. Every artifact published here — spec text, code, vectors — is reviewed and signed off by the human maintainer, who is responsible for its claims. We disclose this proactively because verifiability is the project's subject as well as its method.
71
+
72
+ ## Contributing
73
+
74
+ Open an issue for spec questions, mapping suggestions, or implementation feedback. Interoperability discussion belongs in the open standards venues; this repository tracks concrete text and vectors.
75
+
76
+ ## License
77
+
78
+ Apache License 2.0 — see `LICENSE`. The specification is published for royalty-free implementation. Test keys in the vectors are deterministic and public; **never use them for real receipts**.