astp-docs-server 0.1.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 (224) hide show
  1. astp_docs_server-0.1.0/.dockerignore +17 -0
  2. astp_docs_server-0.1.0/.github/workflows/publish.yml +93 -0
  3. astp_docs_server-0.1.0/.gitignore +11 -0
  4. astp_docs_server-0.1.0/.protocol/.github/ISSUE_TEMPLATE/bug_report.md +18 -0
  5. astp_docs_server-0.1.0/.protocol/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. astp_docs_server-0.1.0/.protocol/.github/ISSUE_TEMPLATE/proposal.md +16 -0
  7. astp_docs_server-0.1.0/.protocol/.github/ISSUE_TEMPLATE/spec_issue.md +18 -0
  8. astp_docs_server-0.1.0/.protocol/.github/PULL_REQUEST_TEMPLATE.md +21 -0
  9. astp_docs_server-0.1.0/.protocol/.github/workflows/publish.yml +61 -0
  10. astp_docs_server-0.1.0/.protocol/.github/workflows/tests.yml +69 -0
  11. astp_docs_server-0.1.0/.protocol/.gitignore +13 -0
  12. astp_docs_server-0.1.0/.protocol/.mailmap +10 -0
  13. astp_docs_server-0.1.0/.protocol/AGENTS.md +64 -0
  14. astp_docs_server-0.1.0/.protocol/CHANGELOG.md +568 -0
  15. astp_docs_server-0.1.0/.protocol/CLAUDE.md +5 -0
  16. astp_docs_server-0.1.0/.protocol/CODE_OF_CONDUCT.md +84 -0
  17. astp_docs_server-0.1.0/.protocol/CONFORMANCE-BFM.md +430 -0
  18. astp_docs_server-0.1.0/.protocol/CONFORMANCE-CONTEXT.md +332 -0
  19. astp_docs_server-0.1.0/.protocol/CONFORMANCE-CROSS-EPISODE-LINKING.md +258 -0
  20. astp_docs_server-0.1.0/.protocol/CONFORMANCE-LAYER3.md +272 -0
  21. astp_docs_server-0.1.0/.protocol/CONFORMANCE-REPRODUCIBILITY.md +219 -0
  22. astp_docs_server-0.1.0/.protocol/CONFORMANCE-TRUST.md +639 -0
  23. astp_docs_server-0.1.0/.protocol/CONTRIBUTING.md +186 -0
  24. astp_docs_server-0.1.0/.protocol/DCO.txt +34 -0
  25. astp_docs_server-0.1.0/.protocol/GLOSSARY.md +661 -0
  26. astp_docs_server-0.1.0/.protocol/GOVERNANCE.md +43 -0
  27. astp_docs_server-0.1.0/.protocol/IMPLEMENTATION-CONTEXT.md +121 -0
  28. astp_docs_server-0.1.0/.protocol/IMPLEMENTATION-PHASE3.md +732 -0
  29. astp_docs_server-0.1.0/.protocol/LICENSE.txt +202 -0
  30. astp_docs_server-0.1.0/.protocol/MANIFEST.in +16 -0
  31. astp_docs_server-0.1.0/.protocol/NOTICE +60 -0
  32. astp_docs_server-0.1.0/.protocol/PATENTS.md +325 -0
  33. astp_docs_server-0.1.0/.protocol/PROTOCOL-CONFORMANCE.md +470 -0
  34. astp_docs_server-0.1.0/.protocol/README.md +230 -0
  35. astp_docs_server-0.1.0/.protocol/SECURITY.md +39 -0
  36. astp_docs_server-0.1.0/.protocol/SPEC.md +3220 -0
  37. astp_docs_server-0.1.0/.protocol/VERSIONING.md +105 -0
  38. astp_docs_server-0.1.0/.protocol/astp/__init__.py +35 -0
  39. astp_docs_server-0.1.0/.protocol/astp/adapters/__init__.py +19 -0
  40. astp_docs_server-0.1.0/.protocol/astp/adapters/base.py +580 -0
  41. astp_docs_server-0.1.0/.protocol/astp/adapters/memory.py +613 -0
  42. astp_docs_server-0.1.0/.protocol/astp/core/__init__.py +22 -0
  43. astp_docs_server-0.1.0/.protocol/astp/core/audit_chain.py +100 -0
  44. astp_docs_server-0.1.0/.protocol/astp/core/branch_operations.py +2352 -0
  45. astp_docs_server-0.1.0/.protocol/astp/core/branching.py +1803 -0
  46. astp_docs_server-0.1.0/.protocol/astp/core/coherence.py +303 -0
  47. astp_docs_server-0.1.0/.protocol/astp/core/constants.py +51 -0
  48. astp_docs_server-0.1.0/.protocol/astp/core/content_hash_v2.py +154 -0
  49. astp_docs_server-0.1.0/.protocol/astp/core/context_operations.py +221 -0
  50. astp_docs_server-0.1.0/.protocol/astp/core/context_v1.py +398 -0
  51. astp_docs_server-0.1.0/.protocol/astp/core/cross_episode.py +747 -0
  52. astp_docs_server-0.1.0/.protocol/astp/core/crystallization.py +381 -0
  53. astp_docs_server-0.1.0/.protocol/astp/core/drift_fsm.py +178 -0
  54. astp_docs_server-0.1.0/.protocol/astp/core/grouping.py +687 -0
  55. astp_docs_server-0.1.0/.protocol/astp/core/hash_canonical.py +123 -0
  56. astp_docs_server-0.1.0/.protocol/astp/core/merkle.py +563 -0
  57. astp_docs_server-0.1.0/.protocol/astp/core/ordering.py +25 -0
  58. astp_docs_server-0.1.0/.protocol/astp/core/proof_of_record.py +267 -0
  59. astp_docs_server-0.1.0/.protocol/astp/core/schema.py +968 -0
  60. astp_docs_server-0.1.0/.protocol/astp/core/seal_v2.py +374 -0
  61. astp_docs_server-0.1.0/.protocol/astp/core/wil.py +246 -0
  62. astp_docs_server-0.1.0/.protocol/astp/core/workflow_execution.py +617 -0
  63. astp_docs_server-0.1.0/.protocol/astp/nodes/__init__.py +31 -0
  64. astp_docs_server-0.1.0/.protocol/astp/nodes/episode/__init__.py +31 -0
  65. astp_docs_server-0.1.0/.protocol/astp/nodes/episode/factory.py +75 -0
  66. astp_docs_server-0.1.0/.protocol/astp/nodes/episode/lifecycle.py +82 -0
  67. astp_docs_server-0.1.0/.protocol/astp/nodes/episode/payload.py +115 -0
  68. astp_docs_server-0.1.0/.protocol/astp/nodes/factory.py +117 -0
  69. astp_docs_server-0.1.0/.protocol/astp/nodes/segment/__init__.py +34 -0
  70. astp_docs_server-0.1.0/.protocol/astp/nodes/segment/factory.py +67 -0
  71. astp_docs_server-0.1.0/.protocol/astp/nodes/segment/payload.py +82 -0
  72. astp_docs_server-0.1.0/.protocol/astp/protocol/__init__.py +157 -0
  73. astp_docs_server-0.1.0/.protocol/astp/protocol/anchor.py +138 -0
  74. astp_docs_server-0.1.0/.protocol/astp/protocol/anchor_v2.py +46 -0
  75. astp_docs_server-0.1.0/.protocol/astp/protocol/audit.py +149 -0
  76. astp_docs_server-0.1.0/.protocol/astp/protocol/audit_v2.py +265 -0
  77. astp_docs_server-0.1.0/.protocol/astp/protocol/canonical_json.py +138 -0
  78. astp_docs_server-0.1.0/.protocol/astp/protocol/chain_proof.py +216 -0
  79. astp_docs_server-0.1.0/.protocol/astp/protocol/delta.py +87 -0
  80. astp_docs_server-0.1.0/.protocol/astp/protocol/encoding.py +128 -0
  81. astp_docs_server-0.1.0/.protocol/astp/protocol/errors.py +80 -0
  82. astp_docs_server-0.1.0/.protocol/astp/protocol/governance.py +99 -0
  83. astp_docs_server-0.1.0/.protocol/astp/protocol/hashing.py +27 -0
  84. astp_docs_server-0.1.0/.protocol/astp/protocol/keys.py +192 -0
  85. astp_docs_server-0.1.0/.protocol/astp/protocol/leaf_hash.py +133 -0
  86. astp_docs_server-0.1.0/.protocol/astp/protocol/merkle.py +344 -0
  87. astp_docs_server-0.1.0/.protocol/astp/protocol/node.py +126 -0
  88. astp_docs_server-0.1.0/.protocol/astp/protocol/rebalance.py +113 -0
  89. astp_docs_server-0.1.0/.protocol/astp/protocol/registry.py +71 -0
  90. astp_docs_server-0.1.0/.protocol/astp/protocol/retrieval_audit.py +86 -0
  91. astp_docs_server-0.1.0/.protocol/astp/protocol/verification.py +252 -0
  92. astp_docs_server-0.1.0/.protocol/astp/protocol/version_vector.py +62 -0
  93. astp_docs_server-0.1.0/.protocol/astp/protocol/witness.py +151 -0
  94. astp_docs_server-0.1.0/.protocol/astp/protocol/witness_v2.py +180 -0
  95. astp_docs_server-0.1.0/.protocol/astp/py.typed +0 -0
  96. astp_docs_server-0.1.0/.protocol/docs/RATIFICATION-5.0.0.md +56 -0
  97. astp_docs_server-0.1.0/.protocol/docs/RATIFICATION-6.0.0.md +71 -0
  98. astp_docs_server-0.1.0/.protocol/docs/RATIFICATION-PATENTS-1.0.0.md +116 -0
  99. astp_docs_server-0.1.0/.protocol/docs/RATIFICATION-PROTOCOL-CONFORMANCE-1.0.0.md +145 -0
  100. astp_docs_server-0.1.0/.protocol/docs/RATIFICATION-SPEC-6.0.2.md +136 -0
  101. astp_docs_server-0.1.0/.protocol/docs/history/AMENDMENT-v2.0-CROSS-EPISODE-LINKING.md +673 -0
  102. astp_docs_server-0.1.0/.protocol/docs/history/AMENDMENT-v3.0-WORKFLOW-EXECUTION-DAG.md +509 -0
  103. astp_docs_server-0.1.0/.protocol/docs/history/README.md +16 -0
  104. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-5.0.0-DRAFT-seal-constructions.md +346 -0
  105. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-6.0.0-DRAFT-context-commitment.md +353 -0
  106. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-v1.md +453 -0
  107. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-v3.md +2692 -0
  108. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-v4.md +2831 -0
  109. astp_docs_server-0.1.0/.protocol/docs/history/SPEC-v5.md +2993 -0
  110. astp_docs_server-0.1.0/.protocol/docs/history/VISION.md +586 -0
  111. astp_docs_server-0.1.0/.protocol/docs/proofs/README.md +29 -0
  112. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-4.0.0.458fb62b.full.json +99 -0
  113. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-5.0.0.ce3f569c.full.json +71 -0
  114. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-6.0.0.80e5a2dd.full.json +222 -0
  115. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-patents-1.0.0.df3434bd.full.json +233 -0
  116. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-protocol-conformance-1.0.0.19d4390f.full.json +932 -0
  117. astp_docs_server-0.1.0/.protocol/docs/proofs/episode-of-record-spec-6.0.2.46490010.full.json +1070 -0
  118. astp_docs_server-0.1.0/.protocol/pyproject.toml +53 -0
  119. astp_docs_server-0.1.0/.protocol/tests/__init__.py +13 -0
  120. astp_docs_server-0.1.0/.protocol/tests/conformance/__init__.py +13 -0
  121. astp_docs_server-0.1.0/.protocol/tests/conformance/test_audit_record_v2_vectors.py +231 -0
  122. astp_docs_server-0.1.0/.protocol/tests/conformance/test_content_hashes_v2_vectors.py +156 -0
  123. astp_docs_server-0.1.0/.protocol/tests/conformance/test_context_commitment_v1_vectors.py +399 -0
  124. astp_docs_server-0.1.0/.protocol/tests/conformance/test_seal_constructions_v2_vectors.py +347 -0
  125. astp_docs_server-0.1.0/.protocol/tests/conformance/test_witness_anchor_v2_vectors.py +156 -0
  126. astp_docs_server-0.1.0/.protocol/tests/conftest.py +19 -0
  127. astp_docs_server-0.1.0/.protocol/tests/unit/__init__.py +13 -0
  128. astp_docs_server-0.1.0/.protocol/tests/unit/adapters/__init__.py +13 -0
  129. astp_docs_server-0.1.0/.protocol/tests/unit/adapters/test_context_operations.py +230 -0
  130. astp_docs_server-0.1.0/.protocol/tests/unit/adapters/test_in_memory_store.py +233 -0
  131. astp_docs_server-0.1.0/.protocol/tests/unit/core/__init__.py +13 -0
  132. astp_docs_server-0.1.0/.protocol/tests/unit/core/test_legacy_episode_id_seal.py +62 -0
  133. astp_docs_server-0.1.0/.protocol/tests/unit/core/test_proof_of_record.py +108 -0
  134. astp_docs_server-0.1.0/.protocol/tests/unit/core/test_prose_unit_v2.py +43 -0
  135. astp_docs_server-0.1.0/.protocol/tests/unit/core/test_seal_v2_api.py +69 -0
  136. astp_docs_server-0.1.0/.protocol/tests/unit/nodes/__init__.py +13 -0
  137. astp_docs_server-0.1.0/.protocol/tests/unit/nodes/test_factory.py +116 -0
  138. astp_docs_server-0.1.0/.protocol/tests/unit/nodes/test_segment.py +95 -0
  139. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/__init__.py +13 -0
  140. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_changelog_currency.py +59 -0
  141. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_cross_episode_linking.py +548 -0
  142. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_drift_fsm.py +187 -0
  143. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_failure_contract.py +84 -0
  144. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_grouping.py +383 -0
  145. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_live_spine_root.py +106 -0
  146. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_namespace_firewall.py +231 -0
  147. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase2_operations.py +667 -0
  148. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase2_schema.py +265 -0
  149. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase3_conformance.py +460 -0
  150. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase3_operations.py +424 -0
  151. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase3_schema.py +271 -0
  152. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase4_intercept.py +188 -0
  153. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_phase4_schema.py +214 -0
  154. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_protocol_version.py +49 -0
  155. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_readme_links.py +52 -0
  156. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_reproducibility_conformance.py +388 -0
  157. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_retained_names.py +65 -0
  158. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_spec_digest.py +57 -0
  159. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_spec_episode_lifecycle.py +78 -0
  160. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_structural_store.py +152 -0
  161. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_verification.py +320 -0
  162. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_versioning_doc.py +63 -0
  163. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_wil_operations.py +204 -0
  164. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_wire_constants.py +78 -0
  165. astp_docs_server-0.1.0/.protocol/tests/unit/protocol/test_workflow_execution.py +597 -0
  166. astp_docs_server-0.1.0/.protocol/vectors/5.0.0/generate.py +275 -0
  167. astp_docs_server-0.1.0/.protocol/vectors/5.0.0/seal-constructions.json +402 -0
  168. astp_docs_server-0.1.0/.protocol/vectors/6.0.0/context-commitment.json +353 -0
  169. astp_docs_server-0.1.0/.protocol/vectors/6.0.0/generate.py +239 -0
  170. astp_docs_server-0.1.0/AGENTS.md +59 -0
  171. astp_docs_server-0.1.0/DEPLOY.md +90 -0
  172. astp_docs_server-0.1.0/Dockerfile +67 -0
  173. astp_docs_server-0.1.0/LICENSE.txt +202 -0
  174. astp_docs_server-0.1.0/NOTICE +72 -0
  175. astp_docs_server-0.1.0/PKG-INFO +107 -0
  176. astp_docs_server-0.1.0/README.md +70 -0
  177. astp_docs_server-0.1.0/llms.txt +53 -0
  178. astp_docs_server-0.1.0/pyproject.toml +59 -0
  179. astp_docs_server-0.1.0/scripts/build_open_index.py +66 -0
  180. astp_docs_server-0.1.0/scripts/check_image_current.sh +38 -0
  181. astp_docs_server-0.1.0/scripts/vendor_corpus.py +124 -0
  182. astp_docs_server-0.1.0/src/astp_docs_server/__init__.py +12 -0
  183. astp_docs_server-0.1.0/src/astp_docs_server/__main__.py +8 -0
  184. astp_docs_server-0.1.0/src/astp_docs_server/atlas_manifest.py +108 -0
  185. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CHANGELOG.md +568 -0
  186. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-BFM.md +430 -0
  187. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-CONTEXT.md +332 -0
  188. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-CROSS-EPISODE-LINKING.md +258 -0
  189. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-LAYER3.md +272 -0
  190. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-REPRODUCIBILITY.md +219 -0
  191. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/CONFORMANCE-TRUST.md +639 -0
  192. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/GLOSSARY.md +661 -0
  193. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/GOVERNANCE.md +43 -0
  194. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/IMPLEMENTATION-CONTEXT.md +121 -0
  195. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/IMPLEMENTATION-PHASE3.md +732 -0
  196. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/LICENSE.txt +202 -0
  197. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/NOTICE +60 -0
  198. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/PATENTS.md +325 -0
  199. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/PROTOCOL-CONFORMANCE.md +470 -0
  200. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/RATIFICATION-5.0.0.md +56 -0
  201. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/RATIFICATION-6.0.0.md +71 -0
  202. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/RATIFICATION-PATENTS-1.0.0.md +116 -0
  203. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/RATIFICATION-PROTOCOL-CONFORMANCE-1.0.0.md +145 -0
  204. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/RATIFICATION-SPEC-6.0.2.md +136 -0
  205. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/README.md +230 -0
  206. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/SPEC.md +3220 -0
  207. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/VERSIONING.md +105 -0
  208. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/vectors/5.0.0/seal-constructions.json +402 -0
  209. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/vectors/6.0.0/context-commitment.json +353 -0
  210. astp_docs_server-0.1.0/src/astp_docs_server/corpus/open/vendor_manifest.json +31 -0
  211. astp_docs_server-0.1.0/src/astp_docs_server/mcp_server.py +145 -0
  212. astp_docs_server-0.1.0/src/astp_docs_server/open_corpus.py +235 -0
  213. astp_docs_server-0.1.0/src/astp_docs_server/vendor_manifest.py +124 -0
  214. astp_docs_server-0.1.0/src/astp_docs_server/web/__init__.py +7 -0
  215. astp_docs_server-0.1.0/src/astp_docs_server/web/__main__.py +5 -0
  216. astp_docs_server-0.1.0/src/astp_docs_server/web/answerer.py +307 -0
  217. astp_docs_server-0.1.0/src/astp_docs_server/web/app.py +151 -0
  218. astp_docs_server-0.1.0/tests/test_chat_flag_and_freshness.py +98 -0
  219. astp_docs_server-0.1.0/tests/test_license_terms.py +205 -0
  220. astp_docs_server-0.1.0/tests/test_open_corpus.py +61 -0
  221. astp_docs_server-0.1.0/tests/test_readme_links.py +39 -0
  222. astp_docs_server-0.1.0/tests/test_server_tools.py +105 -0
  223. astp_docs_server-0.1.0/tests/test_vendor_freshness.py +174 -0
  224. astp_docs_server-0.1.0/tests/test_web.py +234 -0
@@ -0,0 +1,17 @@
1
+ .git
2
+ .gitignore
3
+ **/__pycache__/
4
+ *.py[cod]
5
+ .pytest_cache/
6
+ tests/
7
+ # ...except the freshness guard, which the Dockerfile's freshness stage runs (I6).
8
+ !tests/test_vendor_freshness.py
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ .venv/
13
+ venv/
14
+ Dockerfile
15
+ .dockerignore
16
+ # NOTE: do not exclude *.md — the vendored corpus (src/astp_docs_server/corpus/**)
17
+ # is markdown and must ship in the image.
@@ -0,0 +1,93 @@
1
+ name: publish
2
+
3
+ # Publishes astp-docs-server to PyPI through Trusted Publishing: no stored
4
+ # token. PyPI trusts this workflow file in this repository, in the `pypi`
5
+ # environment, and nothing else.
6
+ #
7
+ # Started by hand from main. The upload waits for the `pypi` environment's
8
+ # required reviewers.
9
+ #
10
+ # This package depends on astp-docs, so astp-docs must already be on PyPI.
11
+ #
12
+ # The corpus-freshness gate is the point of this workflow. The server ships a
13
+ # vendored snapshot of the protocol documents, and a stale snapshot is a fully
14
+ # valid corpus: the server answers confidently out of superseded normative text
15
+ # and nothing reports a problem. ASTP_REQUIRE_CORPUS_FRESHNESS=1 turns the
16
+ # "no source checkout, skipping" case into a failure, so this job cannot pass
17
+ # by not looking.
18
+
19
+ on:
20
+ workflow_dispatch:
21
+ inputs:
22
+ protocol_ref:
23
+ description: "ref of scorched-earth-labs/astp to check the vendored corpus against"
24
+ required: false
25
+ default: main
26
+
27
+ permissions:
28
+ contents: read
29
+
30
+ jobs:
31
+ build:
32
+ if: github.ref == 'refs/heads/main'
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - name: Check out the protocol repository
37
+ uses: actions/checkout@v4
38
+ with:
39
+ repository: scorched-earth-labs/astp
40
+ ref: ${{ inputs.protocol_ref || 'main' }}
41
+ path: .protocol
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: "3.12"
45
+ - name: Install
46
+ run: pip install -e ".[mcp,web,dev]" build twine
47
+ - name: Full suite, with the vendored corpus checked against the protocol repo
48
+ env:
49
+ ASTP_REQUIRE_CORPUS_FRESHNESS: "1"
50
+ ASTP_PROTOCOL_DIR: ${{ github.workspace }}/.protocol
51
+ run: pytest -q tests/test_vendor_freshness.py
52
+ - name: Full suite
53
+ run: pytest -q
54
+ - name: Build
55
+ run: python -m build
56
+ - name: Check
57
+ run: |
58
+ twine check dist/*
59
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
60
+ whl=dist/astp_docs_server-"$version"-py3-none-any.whl
61
+ python -c "import zipfile,sys; n=zipfile.ZipFile(sys.argv[1]).namelist(); sys.exit(not all(any(x.endswith('dist-info/licenses/'+f) for x in n) for f in ('LICENSE.txt','NOTICE')))" "$whl" \
62
+ || { echo "::error::the wheel does not carry LICENSE.txt and NOTICE"; exit 1; }
63
+ python -c "import zipfile,sys; n=zipfile.ZipFile(sys.argv[1]).namelist(); sys.exit(not any(x.endswith('corpus/open/vendor_manifest.json') for x in n))" "$whl" \
64
+ || { echo "::error::the wheel does not carry the vendored corpus"; exit 1; }
65
+ python - "$whl" <<'PY'
66
+ import json, sys, zipfile
67
+ z = zipfile.ZipFile(sys.argv[1])
68
+ name = next(n for n in z.namelist() if n.endswith("corpus/open/vendor_manifest.json"))
69
+ m = json.loads(z.read(name))
70
+ print(f"corpus: SPEC {m['spec_version']} from {m['source_commit'][:12]}, {len(m['files'])} files")
71
+ PY
72
+ status=$(curl -s -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/astp-docs-server/$version/json")
73
+ test "$status" = 404 \
74
+ || { echo "::error::astp-docs-server $version is already on PyPI (HTTP $status); bump the package version"; exit 1; }
75
+ - uses: actions/upload-artifact@v4
76
+ with:
77
+ name: dist
78
+ path: dist/
79
+
80
+ publish:
81
+ needs: build
82
+ runs-on: ubuntu-latest
83
+ environment:
84
+ name: pypi
85
+ url: https://pypi.org/project/astp-docs-server/
86
+ permissions:
87
+ id-token: write # the OIDC token PyPI exchanges for a short-lived upload token
88
+ steps:
89
+ - uses: actions/download-artifact@v4
90
+ with:
91
+ name: dist
92
+ path: dist/
93
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .env
9
+ # Built indexes / vendored corpora — regenerated from source docs.
10
+ /index_cache/
11
+ /corpora_cache/
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Reference implementation bug
3
+ about: The astp package does something other than what SPEC.md requires
4
+ labels: bug
5
+ ---
6
+
7
+ <!-- Suspected vulnerability? Do not file it here. See SECURITY.md. -->
8
+
9
+ **Package version and commit**
10
+
11
+ **Python version**
12
+
13
+ **What SPEC.md requires** (section)
14
+
15
+ **What the package does instead**
16
+
17
+ **Smallest reproduction**
18
+ <!-- Inputs, and expected vs actual output. For hashes, give the digests. -->
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Report a vulnerability
4
+ url: https://github.com/scorched-earth-labs/astp/security/advisories/new
5
+ about: Integrity flaws in the specification or the reference implementation. Please report privately — see SECURITY.md.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Proposal
3
+ about: New protocol surface (MINOR) or a change to canonical form (MAJOR)
4
+ labels: proposal
5
+ ---
6
+
7
+ **Problem**
8
+ <!-- What can't be expressed or verified today? -->
9
+
10
+ **Proposed surface**
11
+
12
+ **Kind of change**
13
+ <!-- MINOR (existing conformant implementations stay conformant) or MAJOR. See VERSIONING.md. -->
14
+
15
+ **What happens to records that already exist**
16
+ <!-- Required for MAJOR: how records sealed under the current construction remain verifiable. -->
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Specification issue
3
+ about: A contradiction, ambiguity, gap, or error in SPEC.md or a companion document
4
+ labels: spec
5
+ ---
6
+
7
+ **Document and section**
8
+ <!-- e.g. SPEC.md §5.6, CONFORMANCE-BFM.md BR-001 -->
9
+
10
+ **SPEC version**
11
+ <!-- the Version: field at the top of SPEC.md -->
12
+
13
+ **What the text says**
14
+
15
+ **Why that is a problem**
16
+ <!-- What can two careful implementers do differently and both claim to conform? -->
17
+
18
+ **Suggested resolution** (optional)
@@ -0,0 +1,21 @@
1
+ ## What this changes
2
+
3
+
4
+ ## Kind of change
5
+
6
+ <!-- See VERSIONING.md. Would an implementation that conforms today still conform, unmodified? -->
7
+
8
+ - [ ] No protocol change (reference implementation, tests, tooling, non-normative docs)
9
+ - [ ] PATCH — errata; no semantic change
10
+ - [ ] MINOR — additive surface
11
+ - [ ] MAJOR — canonical form (needs the amendment process in GOVERNANCE.md)
12
+
13
+ SPEC.md sections touched:
14
+
15
+ ## Checklist
16
+
17
+ - [ ] `pytest` passes, and any test file I touched passes on its own
18
+ - [ ] Normative change: `SPEC.md` `Version:` and `CHANGELOG.md` updated together
19
+ - [ ] New or changed term: `GLOSSARY.md` updated first
20
+ - [ ] New hash-producing behaviour: a test with a fixed expected value
21
+ - [ ] New `.py` files carry the Apache-2.0 header
@@ -0,0 +1,61 @@
1
+ name: publish
2
+
3
+ # Publishes the reference package `astp` to PyPI through Trusted Publishing:
4
+ # no stored token. PyPI trusts this workflow file in this repository, in the
5
+ # `pypi` environment, and nothing else.
6
+ #
7
+ # Started by hand from main. A package release carries no vMAJOR.MINOR.PATCH
8
+ # tag (GOVERNANCE.md §Releases), so there is no tag to trigger on. The upload
9
+ # waits for the `pypi` environment's required reviewer.
10
+
11
+ on:
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ build:
19
+ if: github.ref == 'refs/heads/main'
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ - name: Install
27
+ run: pip install -e ".[neo4j,dev]" build twine
28
+ - name: Full suite
29
+ run: pytest -q
30
+ - name: Build
31
+ run: python -m build
32
+ - name: Check
33
+ run: |
34
+ twine check dist/*
35
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
36
+ test "$(python -c 'import astp; print(astp.__version__)')" = "$version" \
37
+ || { echo "::error::astp.__version__ does not match pyproject.toml ($version)"; exit 1; }
38
+ python -c "import zipfile,sys; n=zipfile.ZipFile(sys.argv[1]).namelist(); sys.exit(not any(x.endswith('dist-info/licenses/NOTICE') for x in n))" dist/astp-"$version"-py3-none-any.whl \
39
+ || { echo "::error::the wheel does not carry NOTICE"; exit 1; }
40
+ status=$(curl -s -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/astp/$version/json")
41
+ test "$status" = 404 \
42
+ || { echo "::error::astp $version is already on PyPI (HTTP $status); bump the package version"; exit 1; }
43
+ - uses: actions/upload-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+
48
+ publish:
49
+ needs: build
50
+ runs-on: ubuntu-latest
51
+ environment:
52
+ name: pypi
53
+ url: https://pypi.org/project/astp/
54
+ permissions:
55
+ id-token: write # the OIDC token PyPI exchanges for a short-lived upload token
56
+ steps:
57
+ - uses: actions/download-artifact@v4
58
+ with:
59
+ name: dist
60
+ path: dist/
61
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,69 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ pytest:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.11", "3.12"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: pip
24
+ - name: Install
25
+ run: pip install -e ".[neo4j,dev]"
26
+ - name: Full suite
27
+ run: pytest -q
28
+ - name: Each test file on its own
29
+ # A file that only passes because another file ran first is a broken file.
30
+ run: |
31
+ status=0
32
+ for f in $(git ls-files 'tests/**/test_*.py'); do
33
+ env -u ARIADNE_ENABLED pytest -q "$f" || { echo "::error file=$f::fails when run alone"; status=1; }
34
+ done
35
+ exit $status
36
+
37
+ package:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - uses: actions/setup-python@v5
42
+ with:
43
+ python-version: "3.12"
44
+ - run: pip install build twine
45
+ - run: python -m build
46
+ - run: twine check dist/*
47
+
48
+ dco:
49
+ # CONTRIBUTING.md, "Certificate of origin": every commit carries its author's sign-off.
50
+ if: github.event_name == 'pull_request'
51
+ runs-on: ubuntu-latest
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+ with:
55
+ fetch-depth: 0
56
+ - name: Every commit is signed off by its author
57
+ env:
58
+ BASE: ${{ github.event.pull_request.base.sha }}
59
+ HEAD: ${{ github.event.pull_request.head.sha }}
60
+ run: |
61
+ status=0
62
+ for c in $(git rev-list --no-merges "$BASE..$HEAD"); do
63
+ want="Signed-off-by: $(git log -1 --format='%an <%ae>' "$c")"
64
+ if ! git log -1 --format='%(trailers:key=Signed-off-by,unfold)' "$c" | grep -qxF "$want"; then
65
+ echo "::error::$(git log -1 --format='%h %s' "$c") lacks '$want'"
66
+ status=1
67
+ fi
68
+ done
69
+ exit $status
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .pytest_cache/
10
+ .venv/
11
+ venv/
12
+ .env
13
+ astp.code-workspace
@@ -0,0 +1,10 @@
1
+ # Map build-machine and personal identities to their project identities.
2
+ #
3
+ # This file changes only what git DISPLAYS. It rewrites no commit, changes no
4
+ # SHA, and therefore leaves intact the commit identifiers cited in the
5
+ # ratification records under docs/ and in SPEC.md.
6
+ #
7
+ # Format: Proper Name <proper@email> Commit Name <commit@email>
8
+
9
+ Scorched Earth Labs <dev@scorchedearthlabs.com> selserver <selserver@og-ca-app01-sel-local.tail24b730.ts.net>
10
+ Mick Smothers <mick.smothers@scorchedearthlabs.com> Mick Smothers <mick.smothers@gmail.com>
@@ -0,0 +1,64 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI coding agents (Claude Code, Codex, Copilot, Cursor and others) working in this repository. Human contributors: start with [`CONTRIBUTING.md`](./CONTRIBUTING.md).
4
+
5
+ ## What this repository is
6
+
7
+ ASTP is a **protocol** — a specification plus a reference implementation — not an application. It ships:
8
+
9
+ 1. The normative specification, `SPEC.md`, with its companion documents: `CONFORMANCE*.md` (conformance requirements), `IMPLEMENTATION-*.md` (implementer guides), `GLOSSARY.md`, `VERSIONING.md`, `CHANGELOG.md`.
10
+ 2. The Python package `astp/` — protocol primitives, node types, the two adapter contracts and their in-memory reference implementation. No storage provider is named anywhere in it.
11
+ 3. The test suite under `tests/`.
12
+
13
+ `docs/history/` holds superseded documents, kept for provenance. Do not implement from them and do not update them.
14
+
15
+ ## Commands
16
+
17
+ ```bash
18
+ pip install -e ".[dev]" # editable install with test dependencies
19
+ pytest # full suite; needs no database and no network
20
+ pytest tests/unit/protocol/test_verification.py
21
+ pytest tests/unit/protocol/test_verification.py::test_name -v
22
+ ```
23
+
24
+ There is no lint, format, or typecheck command configured. Don't invent one. Every test file must pass on its own as well as in the full run.
25
+
26
+ The suite needs no database and no network: the operations run against `astp.adapters.memory.InMemoryStore`. A deployment's adapter, and its integration tests, live with that deployment.
27
+
28
+ ## Architecture
29
+
30
+ ```
31
+ astp/protocol/ Node-generic layer. Operates on CognitiveNode only.
32
+ astp/nodes/ Node-type instantiation (episode/, segment/). Each defines its NodePayload.
33
+ astp/core/ Episode-era schema, governance, WIL, branching, grouping,
34
+ cross-episode linking, workflow_execution (Layer 3), seal_v2
35
+ (5.0.0 seal constructions), context_v1 and context_operations
36
+ (6.0.0 context commitment: constructions, and the operations over StructuralStore).
37
+ astp/adapters/ ASTPAdapter + StructuralStore contracts; InMemoryStore implements both.
38
+ ```
39
+
40
+ **The namespace firewall is the most important invariant in the tree:** nothing under `astp/protocol/` imports from `astp/nodes/`. `tests/unit/protocol/test_namespace_firewall.py` enforces it, along with a second rule: `astp/protocol/` imports nothing from `astp/core/` or `astp/adapters/` either. If a change seems to need such an import, the symbol is in the wrong layer — move the symbol or rethink the design. Do not relax the test.
41
+
42
+ ### Persistence layers (SPEC §3.4 — not the same thing as the directories above)
43
+
44
+ - **Layer 1 — Merkle Spine.** The hash-chained, authoritative cognitive record.
45
+ - **Layer 2 — Episode Content.** Segments and their supporting structures, anchored to Layer 1 by parent reference.
46
+ - **Layer 3 — Workflow & Execution DAG** (SPEC §21; `astp/core/workflow_execution.py`). Cryptographically isolated: it references Layers 1 and 2 by identifier only and is never hash-linked into the Spine. Each Layer 3 node type has one designated writer per workspace (the Cognitive Implementation Authority). Do not add multi-writer paths.
47
+
48
+ ## Invariants that are not obvious from local context
49
+
50
+ - **Dual index.** `sequence_index` (immutable temporal position) is in the leaf hash preimage. `tree_leaf_index` (mutable structural position) is not. Never swap them. See `astp/protocol/leaf_hash.py`.
51
+ - **Canonical form is stable within a major version.** A change to any hash preimage, Merkle construction, canonical serialization, or required field is a MAJOR protocol change under `VERSIONING.md` and goes through the amendment process in `GOVERNANCE.md`. It is never a quiet code change, and it is always introduced as a new versioned construction so existing sealed records stay verifiable.
52
+ - **Wire constants kept the `ariadne` prefix when the package became `astp`.** HKDF `info` strings, the `ariadne::` coordinator key prefix, `Ariadne*` graph labels. They feed derived keys or name stored data. `tests/unit/protocol/test_wire_constants.py` pins them; do not "fix" them.
53
+ - **Governance rules (`G-*`, numbered in `SPEC.md`)** are enforced where the write happens and raise. Do not catch and continue; adapters must surface the violation.
54
+ - **Reparenting is forbidden.** `parent_node_id` is in the leaf hash. To correct parentage, create a new node and deprecate the old one.
55
+ - **Sealed nodes are immutable.** Corrections go forward: new node plus a deprecation or succession edge. There is no in-place edit path.
56
+ - **Crystallization is a state transition, not a receipt.** `CrystallizationDelta` is immutable after creation.
57
+ - **WIL write ordering** (`astp/core/wil.py`, SPEC §12): durable content store → authoritative structural store → ephemeral coordinator → search index. Every write is idempotent, and an interruption at any phase is recoverable.
58
+
59
+ ## Documents
60
+
61
+ - `SPEC.md`'s `Version:` field **is** the protocol version. A normative change updates that field and `CHANGELOG.md` together; a test checks they agree. `astp.PROTOCOL_VERSION` names the SPEC version the package implements; `astp.__version__` is the package's own version.
62
+ - `GLOSSARY.md` is the single source for definitions. Reference it; if you introduce a term, add it there first.
63
+ - New normative or companion documents carry the header block the existing ones use: **Version**, **Status**, **Authors**, **Date**.
64
+ - New `.py` files start with the repository's Apache-2.0 header, before the module docstring.