crprotocol 2.3.0__tar.gz → 3.0.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 (457) hide show
  1. {crprotocol-2.3.0 → crprotocol-3.0.0}/CHANGELOG.md +560 -414
  2. {crprotocol-2.3.0 → crprotocol-3.0.0}/PKG-INFO +72 -3
  3. {crprotocol-2.3.0 → crprotocol-3.0.0}/README.md +71 -2
  4. crprotocol-3.0.0/SPECS_27-05-2027/CRP-FEASIBILITY.md +132 -0
  5. crprotocol-3.0.0/SPECS_27-05-2027/CRP-IETF-EMAIL-TEMPLATES.md +500 -0
  6. crprotocol-3.0.0/SPECS_27-05-2027/CRP-PUBLIC-CHECKLIST.md +109 -0
  7. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SITE-STRATEGY.md +549 -0
  8. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-001-core-protocol.md +246 -0
  9. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-002-headers.md +1775 -0
  10. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-003-envelope.md +678 -0
  11. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-004-continuation.md +792 -0
  12. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-005-dpe.md +1070 -0
  13. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-006-safety-policy.md +466 -0
  14. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-007-session-token.md +400 -0
  15. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-008-dispatch.md +463 -0
  16. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-009-ckf.md +332 -0
  17. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-010-regulatory-mapping.md +153 -0
  18. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-011-audit-trail.md +276 -0
  19. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-012-multi-agent-safety.md +396 -0
  20. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-013-github-action.md +374 -0
  21. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-014-conformance.md +600 -0
  22. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-015-security-privacy.md +396 -0
  23. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-016-gateway-service.md +735 -0
  24. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  25. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SPEC-HOSTING-CONTROL.md +188 -0
  26. crprotocol-3.0.0/SPECS_27-05-2027/CRP-SUBMISSION-GUIDE.md +467 -0
  27. crprotocol-3.0.0/SPECS_27-05-2027/CRP-V3-IMPLEMENTATION-PLAN.md +295 -0
  28. crprotocol-3.0.0/SPECS_27-05-2027/Overview of all documents.docx +0 -0
  29. crprotocol-3.0.0/SPECS_27-05-2027/SUBMISSION-GUIDE.md +577 -0
  30. crprotocol-3.0.0/SPECS_27-05-2027/TRACKING_OF_PROGRESS.MD +447 -0
  31. crprotocol-3.0.0/SPECS_27-05-2027/crp-headers-spec.html +1533 -0
  32. crprotocol-3.0.0/SPECS_27-05-2027/crp-product-ecosystem.html +1058 -0
  33. crprotocol-3.0.0/SPECS_27-05-2027/crp-v3-complete-spec.html +1047 -0
  34. crprotocol-3.0.0/SPECS_27-05-2027/~$erview of all documents.docx +0 -0
  35. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/_version.py +1 -1
  36. crprotocol-3.0.0/crp/activation/__init__.py +73 -0
  37. crprotocol-3.0.0/crp/activation/mode.py +179 -0
  38. crprotocol-3.0.0/crp/activation/onboarding.py +130 -0
  39. crprotocol-3.0.0/crp/activation/policy_adjust.py +87 -0
  40. crprotocol-3.0.0/crp/activation/stages.py +88 -0
  41. crprotocol-3.0.0/crp/agent/__init__.py +88 -0
  42. crprotocol-3.0.0/crp/agent/budget.py +168 -0
  43. crprotocol-3.0.0/crp/agent/chain.py +159 -0
  44. crprotocol-3.0.0/crp/agent/oversight.py +60 -0
  45. crprotocol-3.0.0/crp/agent/propagation.py +144 -0
  46. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/trigger.py +17 -1
  47. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/__init__.py +16 -1
  48. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/config.py +7 -0
  49. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/context_enforcer.py +769 -769
  50. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/dispatch_router.py +5 -2
  51. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/manifest_ledger.py +602 -602
  52. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/window.py +156 -0
  53. crprotocol-3.0.0/crp/headers/__init__.py +54 -0
  54. crprotocol-3.0.0/crp/headers/conditional.py +161 -0
  55. crprotocol-3.0.0/crp/headers/emit.py +261 -0
  56. crprotocol-3.0.0/crp/headers/halt.py +82 -0
  57. crprotocol-3.0.0/crp/headers/middleware.py +93 -0
  58. crprotocol-3.0.0/crp/headers/names.py +141 -0
  59. crprotocol-3.0.0/crp/headers/parse.py +179 -0
  60. crprotocol-3.0.0/crp/policy/__init__.py +77 -0
  61. crprotocol-3.0.0/crp/policy/enforce.py +250 -0
  62. crprotocol-3.0.0/crp/policy/grammar.py +157 -0
  63. crprotocol-3.0.0/crp/policy/inheritance.py +134 -0
  64. crprotocol-3.0.0/crp/policy/mode.py +129 -0
  65. crprotocol-3.0.0/crp/policy/model.py +269 -0
  66. crprotocol-3.0.0/crp/policy/nonce.py +37 -0
  67. crprotocol-3.0.0/crp/policy/profiles.py +76 -0
  68. crprotocol-3.0.0/crp/policy/report.py +115 -0
  69. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/__init__.py +197 -1
  70. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/_types.py +29 -0
  71. crprotocol-3.0.0/crp/provenance/amplifiers.py +111 -0
  72. crprotocol-3.0.0/crp/provenance/rqa.py +95 -0
  73. crprotocol-3.0.0/crp/provenance/rqa_stages.py +602 -0
  74. crprotocol-3.0.0/crp/provenance/window_chain.py +220 -0
  75. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/__init__.py +15 -0
  76. crprotocol-3.0.0/crp/providers/discovery.py +478 -0
  77. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/__init__.py +23 -0
  78. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/audit_trail.py +175 -0
  79. crprotocol-3.0.0/crp/security/session_token.py +372 -0
  80. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/fact.py +4 -0
  81. crprotocol-3.0.0/crp_envelope_budget +0 -0
  82. crprotocol-3.0.0/docs/CRP_V3_COMPLETENESS.md +157 -0
  83. crprotocol-3.0.0/docs/LINKEDIN_LAUNCH_SERIES.md +115 -0
  84. crprotocol-3.0.0/examples/crp_demos/README.md +59 -0
  85. crprotocol-3.0.0/examples/crp_demos/__init__.py +17 -0
  86. crprotocol-3.0.0/examples/crp_demos/pipeline.py +596 -0
  87. crprotocol-3.0.0/examples/crp_demos/server.py +179 -0
  88. crprotocol-3.0.0/examples/crp_demos/static/app.js +72 -0
  89. crprotocol-3.0.0/examples/crp_demos/static/context.html +88 -0
  90. crprotocol-3.0.0/examples/crp_demos/static/context.js +127 -0
  91. crprotocol-3.0.0/examples/crp_demos/static/index.html +117 -0
  92. crprotocol-3.0.0/examples/crp_demos/static/safety.html +99 -0
  93. crprotocol-3.0.0/examples/crp_demos/static/safety.js +134 -0
  94. crprotocol-3.0.0/examples/crp_demos/static/style.css +165 -0
  95. crprotocol-3.0.0/mkdocs.yml +242 -0
  96. crprotocol-3.0.0/overrides/main.html +270 -0
  97. crprotocol-3.0.0/site-docs/BingSiteAuth.xml +4 -0
  98. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/index.md +47 -6
  99. crprotocol-3.0.0/site-docs/legal/ai-policy.md +234 -0
  100. crprotocol-3.0.0/site-docs/legal/cookie-policy.md +94 -0
  101. crprotocol-3.0.0/site-docs/legal/index.md +46 -0
  102. crprotocol-3.0.0/site-docs/legal/information-security-policy.md +215 -0
  103. crprotocol-3.0.0/site-docs/legal/privacy-policy.md +181 -0
  104. crprotocol-3.0.0/site-docs/products/gateway.md +56 -0
  105. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/products/index.md +61 -0
  106. crprotocol-3.0.0/site-docs/products/scan.md +57 -0
  107. crprotocol-3.0.0/site-docs/products/visualise.md +43 -0
  108. crprotocol-3.0.0/site-docs/protocol/conformance.md +21 -0
  109. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/context-sources.md +499 -391
  110. crprotocol-3.0.0/site-docs/protocol/headers.md +24 -0
  111. crprotocol-3.0.0/site-docs/protocol/multi-agent.md +38 -0
  112. crprotocol-3.0.0/site-docs/protocol/safety-policy.md +17 -0
  113. crprotocol-3.0.0/site-docs/protocol/session-token.md +29 -0
  114. crprotocol-3.0.0/site-docs/protocol/zero-ckf-mode.md +47 -0
  115. crprotocol-3.0.0/site-docs/robots.txt +10 -0
  116. crprotocol-3.0.0/site-docs/safety/black-box.md +91 -0
  117. crprotocol-3.0.0/site-docs/safety/coverage.md +52 -0
  118. crprotocol-3.0.0/site-docs/safety/dpe.md +43 -0
  119. crprotocol-3.0.0/site-docs/safety/index.md +100 -0
  120. crprotocol-3.0.0/site-docs/safety/safety-policy.md +62 -0
  121. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-001-core-protocol.md +246 -0
  122. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-002-headers.md +1775 -0
  123. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-003-envelope.md +678 -0
  124. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-004-continuation.md +792 -0
  125. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-005-dpe.md +1086 -0
  126. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-006-safety-policy.md +466 -0
  127. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-007-session-token.md +400 -0
  128. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-008-dispatch.md +463 -0
  129. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-009-ckf.md +332 -0
  130. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-010-regulatory-mapping.md +153 -0
  131. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-011-audit-trail.md +276 -0
  132. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-012-multi-agent-safety.md +396 -0
  133. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-013-github-action.md +374 -0
  134. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-014-conformance.md +600 -0
  135. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-015-security-privacy.md +396 -0
  136. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  137. crprotocol-3.0.0/site-docs/spec/CRP-SPEC-HOSTING-CONTROL.md +188 -0
  138. crprotocol-3.0.0/site-docs/spec/index.md +63 -0
  139. crprotocol-3.0.0/site-docs/standards.md +53 -0
  140. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/terms-of-service.md +25 -3
  141. crprotocol-3.0.0/tests/conformance/__init__.py +35 -0
  142. crprotocol-3.0.0/tests/conformance/levels.py +74 -0
  143. crprotocol-3.0.0/tests/conformance/runner.py +376 -0
  144. crprotocol-3.0.0/tests/conformance/test_conformance.py +33 -0
  145. crprotocol-3.0.0/tests/conformance/vectors/agent.json +31 -0
  146. crprotocol-3.0.0/tests/conformance/vectors/dpe.json +61 -0
  147. crprotocol-3.0.0/tests/conformance/vectors/headers.json +64 -0
  148. crprotocol-3.0.0/tests/conformance/vectors/hmac.json +58 -0
  149. crprotocol-3.0.0/tests/conformance/vectors/safety_policy.json +58 -0
  150. crprotocol-3.0.0/tests/conformance/vectors/session.json +51 -0
  151. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase1.py +964 -962
  152. crprotocol-2.3.0/mkdocs.yml +0 -151
  153. {crprotocol-2.3.0 → crprotocol-3.0.0}/.dockerignore +0 -0
  154. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/CODEOWNERS +0 -0
  155. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/FUNDING.yml +0 -0
  156. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
  157. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
  158. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/ISSUE_TEMPLATE/spec-clarification.yml +0 -0
  159. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  160. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/workflows/ci.yml +0 -0
  161. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/workflows/docs.yml +0 -0
  162. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/workflows/link-check-config.json +0 -0
  163. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/workflows/link-check.yml +0 -0
  164. {crprotocol-2.3.0 → crprotocol-3.0.0}/.github/workflows/validate-schemas.yml +0 -0
  165. {crprotocol-2.3.0 → crprotocol-3.0.0}/.gitignore +0 -0
  166. {crprotocol-2.3.0 → crprotocol-3.0.0}/.pre-commit-config.yaml +0 -0
  167. {crprotocol-2.3.0 → crprotocol-3.0.0}/BENCHMARKS.md +0 -0
  168. {crprotocol-2.3.0 → crprotocol-3.0.0}/CODE_OF_CONDUCT.md +0 -0
  169. {crprotocol-2.3.0 → crprotocol-3.0.0}/CONTRIBUTING.md +0 -0
  170. {crprotocol-2.3.0 → crprotocol-3.0.0}/CRP_CAPABILITIES.md +0 -0
  171. {crprotocol-2.3.0 → crprotocol-3.0.0}/Dockerfile +0 -0
  172. {crprotocol-2.3.0 → crprotocol-3.0.0}/GOVERNANCE.md +0 -0
  173. {crprotocol-2.3.0 → crprotocol-3.0.0}/HOSTING_POSITIONING.md +0 -0
  174. {crprotocol-2.3.0 → crprotocol-3.0.0}/INTERNAL_DOCS.md +0 -0
  175. {crprotocol-2.3.0 → crprotocol-3.0.0}/LICENSE.md +0 -0
  176. {crprotocol-2.3.0 → crprotocol-3.0.0}/NOTICE +0 -0
  177. {crprotocol-2.3.0 → crprotocol-3.0.0}/RAILWAY_DEPLOYMENT_GUIDE.md +0 -0
  178. {crprotocol-2.3.0 → crprotocol-3.0.0}/RAILWAY_VARIABLES.md +0 -0
  179. {crprotocol-2.3.0 → crprotocol-3.0.0}/SECURITY.md +0 -0
  180. {crprotocol-2.3.0 → crprotocol-3.0.0}/SITE_NAVIGATION_AND_PUBLISHING.md +0 -0
  181. {crprotocol-2.3.0 → crprotocol-3.0.0}/STRIPE_MONETISATION.md +0 -0
  182. {crprotocol-2.3.0 → crprotocol-3.0.0}/TRADEMARK.md +0 -0
  183. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/__init__.py +0 -0
  184. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/__main__.py +0 -0
  185. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/_typing.py +0 -0
  186. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/adapters.py +0 -0
  187. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/__init__.py +0 -0
  188. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/auto_ingest.py +0 -0
  189. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/cqs.py +0 -0
  190. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/cross_window.py +0 -0
  191. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/curator.py +0 -0
  192. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/feedback.py +0 -0
  193. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/hierarchical.py +0 -0
  194. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/meta_learning.py +0 -0
  195. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/parallel.py +0 -0
  196. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/review_cycle.py +0 -0
  197. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/scale_mode.py +0 -0
  198. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/advanced/source_grounding.py +0 -0
  199. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/__init__.py +0 -0
  200. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/community.py +0 -0
  201. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/fabric.py +0 -0
  202. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/gc.py +0 -0
  203. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/graph_walk.py +0 -0
  204. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/merge.py +0 -0
  205. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/pattern_query.py +0 -0
  206. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/pubsub.py +0 -0
  207. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/ckf/semantic.py +0 -0
  208. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/cli/__init__.py +0 -0
  209. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/cli/main.py +0 -0
  210. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/cli/sidecar.py +0 -0
  211. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/cli/startup.py +0 -0
  212. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/__init__.py +0 -0
  213. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/completion.py +0 -0
  214. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/degradation.py +0 -0
  215. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/document_map.py +0 -0
  216. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/flow.py +0 -0
  217. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/gap.py +0 -0
  218. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/manager.py +0 -0
  219. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/quality_monitor.py +0 -0
  220. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/stitch.py +0 -0
  221. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/continuation/voice.py +0 -0
  222. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/batch.py +0 -0
  223. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/circuit_breaker.py +0 -0
  224. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/context_source.py +0 -0
  225. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/context_tools.py +0 -0
  226. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/errors.py +0 -0
  227. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/extraction_facade.py +0 -0
  228. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/facilitator.py +0 -0
  229. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/idempotency.py +0 -0
  230. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/ledger_backends.py +0 -0
  231. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/manifest_derive.py +0 -0
  232. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/orchestrator.py +0 -0
  233. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/relay_strategies.py +0 -0
  234. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/security_manager.py +0 -0
  235. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/session.py +0 -0
  236. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/core/task_intent.py +0 -0
  237. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/__init__.py +0 -0
  238. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/builder.py +0 -0
  239. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/decomposer.py +0 -0
  240. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/formatter.py +0 -0
  241. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/packer.py +0 -0
  242. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/reranker.py +0 -0
  243. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/envelope/scoring.py +0 -0
  244. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/__init__.py +0 -0
  245. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/complexity.py +0 -0
  246. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/contradiction.py +0 -0
  247. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/pipeline.py +0 -0
  248. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/quality_gate.py +0 -0
  249. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage1_regex.py +0 -0
  250. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage2_statistical.py +0 -0
  251. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage3_gliner.py +0 -0
  252. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage4_uie.py +0 -0
  253. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage5_discourse.py +0 -0
  254. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/stage6_llm.py +0 -0
  255. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/structured_output.py +0 -0
  256. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/extraction/types.py +0 -0
  257. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/integrations/__init__.py +0 -0
  258. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/integrations/_common.py +0 -0
  259. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/integrations/anthropic_hook.py +0 -0
  260. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/integrations/langchain_hook.py +0 -0
  261. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/integrations/openai_hook.py +0 -0
  262. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/license_guard.py +0 -0
  263. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/__init__.py +0 -0
  264. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/audit.py +0 -0
  265. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/events.py +0 -0
  266. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/metrics.py +0 -0
  267. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/quality.py +0 -0
  268. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/structured_logging.py +0 -0
  269. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/observability/telemetry.py +0 -0
  270. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/_embeddings.py +0 -0
  271. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/attribution_scorer.py +0 -0
  272. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/claim_detector.py +0 -0
  273. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/contradiction_detector.py +0 -0
  274. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/distortion_detector.py +0 -0
  275. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/entailment_verifier.py +0 -0
  276. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/fabrication_detector.py +0 -0
  277. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/hallucination_scorer.py +0 -0
  278. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/omission_analyzer.py +0 -0
  279. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/provenance_chain.py +0 -0
  280. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/provenance/report_generator.py +0 -0
  281. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/anthropic.py +0 -0
  282. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/base.py +0 -0
  283. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/custom.py +0 -0
  284. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/diagnostic.py +0 -0
  285. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/llamacpp.py +0 -0
  286. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/manager.py +0 -0
  287. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/ollama.py +0 -0
  288. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/openai.py +0 -0
  289. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/providers/tokenizers.py +0 -0
  290. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/py.typed +0 -0
  291. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/resources/__init__.py +0 -0
  292. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/resources/adaptive_allocator.py +0 -0
  293. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/resources/cost_model.py +0 -0
  294. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/resources/overhead_manager.py +0 -0
  295. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/resources/resource_manager.py +0 -0
  296. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/__init__.py +0 -0
  297. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/cost-estimate.json +0 -0
  298. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/crp-error.json +0 -0
  299. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/envelope-preview.json +0 -0
  300. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/persisted-state-header.json +0 -0
  301. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/quality-report.json +0 -0
  302. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/session-handle.json +0 -0
  303. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/session-status.json +0 -0
  304. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/stream-event.json +0 -0
  305. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/schemas/task-intent.json +0 -0
  306. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/binding.py +0 -0
  307. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/compliance.py +0 -0
  308. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/consent.py +0 -0
  309. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/embedding_defense.py +0 -0
  310. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/encryption.py +0 -0
  311. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/injection.py +0 -0
  312. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/integrity.py +0 -0
  313. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/privacy.py +0 -0
  314. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/quarantine.py +0 -0
  315. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/rbac.py +0 -0
  316. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/security/validation.py +0 -0
  317. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/__init__.py +0 -0
  318. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/cold_storage.py +0 -0
  319. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/compaction.py +0 -0
  320. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/critical_state.py +0 -0
  321. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/event_log.py +0 -0
  322. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/serialization.py +0 -0
  323. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/session_cleanup.py +0 -0
  324. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/snapshot.py +0 -0
  325. {crprotocol-2.3.0 → crprotocol-3.0.0}/crp/state/warm_store.py +0 -0
  326. {crprotocol-2.3.0 → crprotocol-3.0.0}/docs/OPERATIONS_RUNBOOK.md +0 -0
  327. {crprotocol-2.3.0 → crprotocol-3.0.0}/docs/WASA_INTEGRATION_TUTORIAL.md +0 -0
  328. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/async_usage.py +0 -0
  329. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/benchmark_continuation.py +0 -0
  330. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/choose_provider.py +0 -0
  331. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/comply_demo.py +0 -0
  332. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/demo_app/README.md +0 -0
  333. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/demo_app/demo.py +0 -0
  334. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/demo_app/demo_v1.py +0 -0
  335. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/extraction-pipeline.md +0 -0
  336. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/ingestion.py +0 -0
  337. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/local-model.md +0 -0
  338. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/multi-provider.md +0 -0
  339. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/multi_turn.py +0 -0
  340. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/quickstart.md +0 -0
  341. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/quickstart.py +0 -0
  342. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/scribe_demo.py +0 -0
  343. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/session-resumption.md +0 -0
  344. {crprotocol-2.3.0 → crprotocol-3.0.0}/examples/streaming.py +0 -0
  345. {crprotocol-2.3.0 → crprotocol-3.0.0}/media/logo.svg +0 -0
  346. {crprotocol-2.3.0 → crprotocol-3.0.0}/pyproject.toml +0 -0
  347. {crprotocol-2.3.0 → crprotocol-3.0.0}/rfcs/0000-template.md +0 -0
  348. {crprotocol-2.3.0 → crprotocol-3.0.0}/rfcs/0001-initial-release.md +0 -0
  349. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/cost-estimate.json +0 -0
  350. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/crp-error.json +0 -0
  351. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/envelope-preview.json +0 -0
  352. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/openapi.json +0 -0
  353. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/persisted-state-header.json +0 -0
  354. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/quality-report.json +0 -0
  355. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/session-handle.json +0 -0
  356. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/session-status.json +0 -0
  357. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/stream-event.json +0 -0
  358. {crprotocol-2.3.0 → crprotocol-3.0.0}/schemas/task-intent.json +0 -0
  359. {crprotocol-2.3.0 → crprotocol-3.0.0}/scripts/gen_changelog.py +0 -0
  360. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/CNAME +0 -0
  361. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/api/client.md +0 -0
  362. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/api/compliance.md +0 -0
  363. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/api/dispatch.md +0 -0
  364. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/api/index.md +0 -0
  365. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/api/schemas.md +0 -0
  366. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/benchmarks.md +0 -0
  367. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/eu-ai-act.md +0 -0
  368. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/gdpr.md +0 -0
  369. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/index.md +0 -0
  370. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/iso-42001.md +0 -0
  371. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/nist-ai-rmf.md +0 -0
  372. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/compliance/security.md +0 -0
  373. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/contributing.md +0 -0
  374. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/cli.md +0 -0
  375. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/index.md +0 -0
  376. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/installation.md +0 -0
  377. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/licensing.md +0 -0
  378. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/local-models.md +0 -0
  379. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/providers.md +0 -0
  380. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/getting-started/quickstart.md +0 -0
  381. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/demo-app.md +0 -0
  382. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/index.md +0 -0
  383. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/ingestion.md +0 -0
  384. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/multi-turn.md +0 -0
  385. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/session-persistence.md +0 -0
  386. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/sidecar.md +0 -0
  387. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/guides/streaming.md +0 -0
  388. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/products/comply-autocyber.md +0 -0
  389. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/products/comply.md +0 -0
  390. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/products/scribe.md +0 -0
  391. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/ckf.md +0 -0
  392. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/continuation.md +0 -0
  393. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/core.md +0 -0
  394. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/dispatch-strategies.md +0 -0
  395. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/envelope.md +0 -0
  396. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/extraction.md +0 -0
  397. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/index.md +0 -0
  398. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/meta-learning.md +0 -0
  399. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/provenance.md +0 -0
  400. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/quality-tiers.md +0 -0
  401. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/protocol/research.md +0 -0
  402. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/testing/benchmarks.md +0 -0
  403. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/testing/index.md +0 -0
  404. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/testing/reproduce.md +0 -0
  405. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/testing/running-tests.md +0 -0
  406. {crprotocol-2.3.0 → crprotocol-3.0.0}/site-docs/why-crp.md +0 -0
  407. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/01_RESEARCH_FOUNDATIONS.md +0 -0
  408. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/02_CORE_PROTOCOL.md +0 -0
  409. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/03_CONTEXT_ENVELOPE.md +0 -0
  410. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/04_TOKEN_GENERATION_PROTOCOL.md +0 -0
  411. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/05_SYSTEM_WIDE_INTEGRATION.md +0 -0
  412. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/06_IMPLEMENTATION_PLAN.md +0 -0
  413. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/07_SECURITY.md +0 -0
  414. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/08_MONETIZATION.md +0 -0
  415. {crprotocol-2.3.0 → crprotocol-3.0.0}/specification/09_DEPLOYMENT.md +0 -0
  416. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/conftest.py +0 -0
  417. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/killer_test/crp_killer_report.json +0 -0
  418. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/killer_test/crp_killer_report.txt +0 -0
  419. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/killer_test/crp_killer_test.py +0 -0
  420. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/killer_test/debug_gap.py +0 -0
  421. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/killer_test/debug_gap2.py +0 -0
  422. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_adaptive_allocator.py +0 -0
  423. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_adversarial_provenance.py +0 -0
  424. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_agentic.py +0 -0
  425. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_benchmarks.py +0 -0
  426. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_ckf_gate.py +0 -0
  427. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_compliance_security.py +0 -0
  428. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_compliance_wiring.py +0 -0
  429. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_context_enforcer.py +0 -0
  430. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_context_source.py +0 -0
  431. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_decision_provenance.py +0 -0
  432. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_decision_provenance_engine.py +0 -0
  433. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_entailment_risk.py +0 -0
  434. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_fidelity_verification.py +0 -0
  435. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_gap_fixes_live.py +0 -0
  436. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_gaps_2_3.py +0 -0
  437. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_integration.py +0 -0
  438. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_ip_protection.py +0 -0
  439. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_live_comprehensive.py +0 -0
  440. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_live_full_capture.py +0 -0
  441. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_live_long_generation.py +0 -0
  442. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_live_verification.py +0 -0
  443. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_manifest_ledger.py +0 -0
  444. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase2.py +0 -0
  445. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase3.py +0 -0
  446. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase4.py +0 -0
  447. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase5.py +0 -0
  448. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase6.py +0 -0
  449. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase7.py +0 -0
  450. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase8.py +0 -0
  451. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_phase9.py +0 -0
  452. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_production_hardening.py +0 -0
  453. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_relay_strategies.py +0 -0
  454. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_resource_manager.py +0 -0
  455. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_security_modules.py +0 -0
  456. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_smoke.py +0 -0
  457. {crprotocol-2.3.0 → crprotocol-3.0.0}/tests/test_tool_relay.py +0 -0
@@ -1,414 +1,560 @@
1
- <!--
2
- Copyright (c) 2026 Constantinos Vidiniotis. All rights reserved.
3
- Licensed under the terms described in LICENSE.md in the root of this repository.
4
- -->
5
-
6
- # Changelog
7
-
8
- All notable changes to the CRP specification will be documented in this file.
9
-
10
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
-
12
- ## [Unreleased]
13
-
14
- ### Added
15
- - (none yet)
16
-
17
- ## [2.2.0] - 2026-04-23
18
-
19
- ### AddedMiscellaneous (from 2.1 Unreleased pool)
20
- - Trademark notice: "Context Relay Protocol" (application pending, Class 9)
21
- - Contact emails: info@crprotocol.io (general), contact@crprotocol.io (enterprise)
22
- - GitHub Discussions enabled
23
- - Operational runbook (`docs/OPERATIONS_RUNBOOK.md`) — deployment, monitoring, incident response
24
- - Integrity chain external verification (`export_for_verification()`, `verify_external()`)
25
- - `/metrics` endpoint on HTTP sidecar (Prometheus format)
26
- - Session file schema versioning with forward-compatible migration path
27
- - Bounded ingest queue (`maxsize=1000`) prevents unbounded memory growth
28
- - Pipeline short-circuit skips late extraction stages when early stages produce enough facts
29
- - Config file layer — YAML/JSON config files (`~/.crp/config.yaml`, `.crp.yaml`)
30
- - Structured logging wired into orchestrator initialization
31
- - Metadata size limits on `Fact` (64 keys, 128-char key length, 4096-char value size)
32
- - `TypeAlias` annotations and extended type aliases in `crp/_typing.py`
33
- - All error types and config classes exported from `crp.__init__`
34
-
35
- ### Changed — Miscellaneous (from 2.1 Unreleased pool)
36
- - `FactGraph` edge lookups now O(1) via indexed dicts (was O(n) list scan)
37
- - Provider error responses sanitized no internal details leak to clients
38
- - Envelope builder truncates when exceeding token budget, clamps saturation to 1.0
39
- - Test fixtures use `tmp_path` pytest fixture instead of `tempfile.TemporaryDirectory()`
40
- - Correlation IDs propagated through ingest path
41
-
42
- ### Fixed Miscellaneous (from 2.1 Unreleased pool)
43
- - Unknown config kwargs now produce a warning log instead of silent ignore
44
-
45
- ### Added Enforcement Pipeline, Ledger & Injection Detection (§7.14.4–§7.14.5)
46
-
47
- CRP 2.1 defined the **vocabulary** for context-source provenance
48
- (`ContextSource`, `ContextManifest`). CRP 2.2 defines the **enforcement
49
- point** — the single wire-side choke-point every envelope assembly flows
50
- through plus cross-turn persistence, key rotation, and content-side
51
- verification of declared trust labels. This closes the gap between
52
- "context is labelled" and "context is actually enforced on the wire".
53
-
54
- - New module `crp.core.context_enforcer` (§7.14.4):
55
- - `EnforcementPolicy` (`OBSERVE` / `WARN` / `REJECT`) — application-
56
- level policy for what happens on a violation.
57
- - `ContextEnforcer` — composes manifest signature-verify, expiry
58
- check, attestation mismatch scan (`check_attestation`), and
59
- injection-signal scan into a single `check(manifest, observed)`
60
- call. Under `REJECT`, raises `CRPError(CONTEXT_ATTESTATION_MISMATCH)`
61
- or `CRPError(CONTEXT_MANIFEST_INVALID)`. Under `OBSERVE` / `WARN`,
62
- emits audit events and continues.
63
- - `detect_injection_signals()` six high-precision regex patterns
64
- (instruction override, role jailbreak, secret exfil, delimiter
65
- forgery, dangerous payload URLs, embedded tool calls) applied to
66
- sources declared `TrustLevel.TRUSTED`. Addresses the gap between
67
- *declared* and *actual* trust developers marking a system prompt
68
- as TRUSTED doesn't make templated user input safe.
69
- - `AuditSink` protocol + `LoggingAuditSink` + thread-safe
70
- `InMemoryAuditSink` (bounded ring buffer). Every mismatch and
71
- injection signal is emitted as a structured event for SIEM / audit
72
- pipelines.
73
- - `default_enforcer()` / `set_default_enforcer()` process-wide
74
- opt-in installer so libraries (dispatch router, CKF, warm store)
75
- can find a configured enforcer without explicit plumbing.
76
- - `observed_content(source, text)` helper for presenting source +
77
- payload pairs to the enforcer for content scanning.
78
-
79
- - New module `crp.core.manifest_ledger` (§7.14.5):
80
- - `ManifestLedger` — append-only JSONL store
81
- (`crp_sessions/<session_id>.manifest.jsonl`) of every manifest ever
82
- attached to a session. Supports `record()`, `load()`, `history()`,
83
- `latest()`, `find_by_source_id()`, `find_by_kind()`, and
84
- `verify_signatures()` for periodic integrity audits.
85
- - `KeyProvider` abstraction with two implementations:
86
- - `EnvVarKeyProvider` reads HMAC secret from an environment
87
- variable, auto-detects hex encoding, enforces ≥32-byte minimum.
88
- - `RotatingKeyProvider` current + retired key ring with
89
- configurable grace window, allowing in-flight manifests signed
90
- under the previous key to continue verifying after rotation.
91
-
92
- ### Added — Consumer-Side Integration (§7.14.4 wire point)
93
-
94
- - `crp.core.dispatch_router.assemble_messages()` now accepts optional
95
- `manifest`, `observed_sources`, and `enforcer` keyword arguments.
96
- When supplied (or a process-wide default enforcer is installed),
97
- every envelope assembly runs the full enforcement pipeline
98
- **before** messages are constructed. Zero-cost when no enforcer is
99
- configuredfully backward compatible with CRP 2.1 call sites.
100
-
101
- - `crp.state.warm_store.get_active_facts_as_extraction()` now stamps
102
- every un-sourced fact with
103
- `ContextSource(kind=WARM_STORE, origin=OBSERVED, trust_level=TRUSTED)`.
104
-
105
- - `crp.ckf.fabric.ContextKnowledgeFabric.retrieve()` now stamps every
106
- un-sourced merged fact with `ContextSource(kind=CKF_RETRIEVAL, ...)`
107
- carrying the retrieval modes and score in `metadata`.
108
-
109
- ### Changed Source-Kind Detection
110
-
111
- - `crp.core.context_source.detect_source_kind()` strengthened:
112
- - New structural hint parser: attempts `json.loads(content)` and
113
- inspects object keys (`function_name` + `arguments` → `FUNCTION_CALL`,
114
- `mcp` / `mcp_server` `MCP_TOOL`, `url` + `snippet` →
115
- `WEB_SEARCH`, `embedding` / `vector` → `VECTOR_DB`).
116
- - Six new heuristic regex patterns for JSON/XML/YAML code blocks,
117
- SQL DML, Cypher / graph query keywords, SERPAPI / Google / Bing
118
- signatures, common vector-DB provider names (Pinecone, Weaviate,
119
- Qdrant, Chroma, pgvector, Milvus), and `function_name` / `tool_name`
120
- tokens.
121
- - Structural hints are preferred over regex when parsing succeeds.
122
-
123
- ### Security
124
-
125
- - Manifest verification is now always attempted when both a signature
126
- and a secret are present, even if `require_signed_manifest=False`.
127
- Tampered signatures are detected and emitted as
128
- `CONTEXT_MANIFEST_INVALID` audit events.
129
- - `ManifestLedger` rejects session IDs that sanitize to empty
130
- (prevents directory traversal via crafted session identifiers).
131
- - HMAC verification continues to use `hmac.compare_digest` (constant
132
- time). `RotatingKeyProvider` iterates candidate keys for verification
133
- so key rotation does not create a signature-oracle side channel.
134
-
135
- ### Tests
136
-
137
- - 38 new tests in `tests/test_context_enforcer.py` (injection patterns,
138
- audit sinks, all three policies, default-enforcer install, integration
139
- with `assemble_messages`).
140
- - 34 new tests in `tests/test_manifest_ledger.py` (JSONL round-trip,
141
- cross-instance rehydration, lineage queries, key rotation, hex/utf-8
142
- env secret decode, grace-window verification).
143
- - Total suite: **182 passing** (110 pre-2.2 baseline + 72 new).
144
-
145
- ## [2.1.0] - 2026-04-23
146
-
147
- ### Added Context-Source Provenance (§7.14.3)
148
- - Contact emails: info@crprotocol.io (general), contact@crprotocol.io (enterprise)
149
- - GitHub Discussions enabled
150
- - Operational runbook (`docs/OPERATIONS_RUNBOOK.md`) — deployment, monitoring, incident response
151
- - Integrity chain external verification (`export_for_verification()`, `verify_external()`)
152
- - `/metrics` endpoint on HTTP sidecar (Prometheus format)
153
- - Session file schema versioning with forward-compatible migration path
154
- - Bounded ingest queue (`maxsize=1000`) prevents unbounded memory growth
155
- - Pipeline short-circuit — skips late extraction stages when early stages produce enough facts
156
- - Config file layer YAML/JSON config files (`~/.crp/config.yaml`, `.crp.yaml`)
157
- - Structured logging wired into orchestrator initialization
158
- - Metadata size limits on `Fact` (64 keys, 128-char key length, 4096-char value size)
159
- - `TypeAlias` annotations and extended type aliases in `crp/_typing.py`
160
- - All error types and config classes exported from `crp.__init__`
161
-
162
- ### Changed
163
- - `FactGraph` edge lookups now O(1) via indexed dicts (was O(n) list scan)
164
- - Provider error responses sanitized — no internal details leak to clients
165
- - Envelope builder truncates when exceeding token budget, clamps saturation to 1.0
166
- - Test fixtures use `tmp_path` pytest fixture instead of `tempfile.TemporaryDirectory()`
167
- - Correlation IDs propagated through ingest path
168
-
169
- ### Fixed
170
- - Unknown config kwargs now produce a warning log instead of silent ignore
171
-
172
- ## [2.1.0] - 2026-04-23
173
-
174
- ### AddedContext-Source Provenance (§7.14.3)
175
-
176
- CRP's Decision Provenance Engine already classifies every *output* claim as
177
- `CONTEXT_GROUNDED | PARAMETRIC | MIXED | UNCERTAIN`. This release adds the
178
- symmetric **input-side** primitive: every fact that enters the envelope
179
- can now carry a record of *where it came from* (RAG chunk, vector DB,
180
- database read, MCP tool, function call, web search, user turn, file upload,
181
- agent memory, or parametric). This is foundational for ISO/IEC 42001 §4
182
- (Context of the organisation), EU AI Act Art. 10 (Data governance),
183
- GDPR Art. 30 (Records of Processing), and NIST AI RMF MAP-4.
184
-
185
- - New module `crp.core.context_source` with:
186
- - `SourceKind` closed enumeration (14 values) of upstream source
187
- categories. Additions require an RFC.
188
- - `ContextSource`immutable (`frozen=True`) record: `kind`, `source_id`,
189
- `origin` (declared / observed / heuristic), `trust_level`,
190
- `contains_pii`, `sensitivity`, `region`, `retrieval_query`,
191
- `retrieved_at`, `upstream_uri`, `declared_by_manifest_id`, `metadata`.
192
- - `ContextManifest` — customer-authored declarative attestation of
193
- intended upstream sources. HMAC-SHA256 signed over canonical JSON,
194
- with `sign()` / `verify()` using constant-time comparison and
195
- `is_expired()` helpers.
196
- - `detect_source_kind(content, role=…)` detective-mode heuristic
197
- parser that classifies message content by OpenAI-style role plus a
198
- conservative pattern library (`<RAG>`, `[retrieved]`, `<mcp:>`,
199
- `SELECT … FROM …`, web-search markers, etc.).
200
- - `check_attestation(observed, manifest)` — returns a list of
201
- `AttestationMismatch` rows (reasons: `no_manifest`,
202
- `manifest_expired`, `unattested_kind`, `unattested_source_id`).
203
- `to_audit_event()` produces the §7.14.2 audit-event envelope shape.
204
- - `Fact.source: ContextSource | None` — optional field; defaults to
205
- `None` so v2.0 callers see zero behavioural change.
206
- - Envelope section `[CONTEXT_SOURCES]` registered in the Tier 3 priority
207
- list (`crp/envelope/formatter.py::TIER_3_SECTIONS`).
208
- - Error codes `CONTEXT_ATTESTATION_MISMATCH = 1040` and
209
- `CONTEXT_MANIFEST_INVALID = 1041`.
210
- - `ManifestValidationError` raised on malformed JSON / empty signing key.
211
- - All primitives exported from `crp` (`SourceKind`, `SourceOrigin`,
212
- `TrustLevel`, `ContextSource`, `ContextManifest`, `AttestationMismatch`,
213
- `ManifestValidationError`, `detect_source_kind`, `check_attestation`).
214
- - 41-test suite (`tests/test_context_source.py`) covering frozen
215
- invariant, size limits, JSON round-trip, HMAC sign / verify, expiry,
216
- detective-mode classification, attestation-mismatch edge cases, audit
217
- event shape, and public API surface.
218
-
219
- ### Changed
220
-
221
- - `docs/CRP_CAPABILITIES.md` now lists context-source provenance as a
222
- first-class capability.
223
- - MkDocs site gains a dedicated *Protocol → Context Sources* page.
224
-
225
- ### Migration notes
226
-
227
- This release is **fully backward-compatible**. `Fact.source` defaults to
228
- `None`; consumers that ignore the field continue to work unchanged. To
229
- adopt, wrap retrieved chunks with `ContextSource` at ingestion time:
230
-
231
- ```python
232
- from crp import ContextSource, SourceKind, SourceOrigin, Fact
233
-
234
- fact = Fact(
235
- text=chunk.text,
236
- source=ContextSource(
237
- kind=SourceKind.VECTOR_DB,
238
- source_id="acme-hr-policies-vdb",
239
- origin=SourceOrigin.OBSERVED,
240
- contains_pii=True,
241
- region="eu-west-1",
242
- retrieval_query=user_query,
243
- ),
244
- )
245
- ```
246
-
247
- See `docs/protocol/context-sources.md` (published on crprotocol.io) for
248
- the full integration guide.
249
-
250
- ## [2.0.0] - 2026-04-06
251
-
252
- ### Added
253
-
254
- - **HTTP Sidecar Security Hardening & Full Protocol Surface** (§F2-security)
255
- - Defense-in-depth security model: 8 layers enforced on every request
256
- - Bearer-token authentication with timing-safe comparison (`secrets.compare_digest`)
257
- - Session ownership: sessions bound to SHA-256 hash of the creating token, other tokens get `403 Forbidden`
258
- - Per-IP rate limiting with monotonic-clock sliding window (default 120 req/60s, configurable)
259
- - Request body size limit: 10 MB cap, returns `413 Payload Too Large` when exceeded
260
- - Concurrent session cap: default 64, returns `503 Service Unavailable` when exceeded
261
- - Security headers on every response: `X-Content-Type-Options: nosniff`, `Cache-Control: no-store`
262
- - `--bind-all` security gate: requires `--auth-token` unless `--allow-unauthenticated` explicitly set
263
- - Full protocol surface exposed: all 6 dispatch variants (basic, tools, reflexive, progressive, stream-augmented, agentic) over HTTP
264
- - New endpoints: `/facts/feedback` (boost/penalize/reject), `/providers` (register fallback), `/estimate` (cost estimation)
265
- - Input validation on all endpoints: variant validation, required fields, capped limits
266
- - CLI options: `--max-sessions`, `--rate-limit`, `--allow-unauthenticated`
267
- - README: dedicated "Inter-LLM Context Sharing" section with endpoint reference, security model, and usage examples
268
-
269
- - **Deep Audit Gap Fixes — F1-F6, D1-D9** (§gap-audit)
270
- - F1: README provider claims corrected — removed false Google/vLLM/HuggingFace references
271
- - F2: `crp serve` HTTP sidecar implemented (`crp/cli/sidecar.py`) full REST API with inter-LLM context sharing via `/facts/share` endpoint
272
- - F3: Provider fallback chain `LLMProviderManager.generate_with_fallback()` tries primary then registered providers
273
- - F4: README RBAC enforcement note corrected — now accurately reflects full enforcement
274
- - F5: Test count updated 266 → 351
275
- - F6: `EventEmitter` wired into orchestrator 30+ event types emitted at all pipeline stages (dispatch.started/completed, envelope.built, window.opened/continued/completed, fact.created, extraction.completed, session.closed)
276
- - D1: `CQSDetector` wired context hunger detection after LLM generation
277
- - D2: `CrossWindowValidator` wired extraction-based consistency validation after continuation loop
278
- - D3: `FeedbackLoop` wired confidence adjustments after extraction, public API (boost/penalize/reject)
279
- - D4: `ParallelFanOut` wired instantiated with dispatch/extract callables
280
- - D5: `ReviewCycleManager` wired — checkpoint_review in continuation loop
281
- - D6: `ScaleModeSelector` wired — configured at dispatch start from session processing_mode
282
- - D7: `EventEmitter` wired (same as F6)
283
- - D8: `TelemetryWriter` wired optional JSONL sink for window telemetry
284
- - D9: `LLMProviderManager` wired with fallback chain (same as F3)
285
- - Public API: `emitter` property, `on()` subscription, `feedback` property, `boost_fact()`/`penalize_fact()`/`reject_fact()`, `register_provider()`, `parallel` property
286
- - HTTP sidecar endpoints: POST /sessions, GET /sessions/:id/status, POST /sessions/:id/dispatch, POST /sessions/:id/ingest, GET /sessions/:id/facts, POST /sessions/:id/facts/share, POST /sessions/:id/close, GET /health
287
- - All 351 tests passing after changes
288
-
289
- - **Adaptive Resource Allocation & Efficiency-First Optimization** (§resource-alloc)
290
- - `AdaptiveAllocator` — dynamic pipeline tuning based on real-time overhead + memory pressure
291
- - **Efficiency-first philosophy**: ML extraction stages (GLiNER, UIE, discourse) are core intelligence — never disabled
292
- - `PROTECTED_INTELLIGENCE` frozenset — ML features excluded from shedding cascade and stage scheduling
293
- - Throughput-based throttling: normal throttled → constrained (adjusts fact limits, batch sizes, packing) instead of disabling stages
294
- - `PromptEfficiency` dataclass — LLM-side optimization hints: fact deduplication, system prompt caching, envelope compression, connection reuse, estimated cache hit percentage
295
- - EWMA-smoothed overhead tracking with configurable cap (default 15%)
296
- - `_adapt_throughput()`adjusts throughput level based on overhead trends without sacrificing intelligence
297
- - `OverheadBudgetManager` wired into orchestrator shedding cascade now live, ML features protected
298
- - `ExtractionProfile` / `EnvelopeProfile` — recommended configurations based on resource state (stages always enabled)
299
- - Consecutive over-cap detection: 3+ consecutive windows triggers throughput reduction
300
- - `detect_hardware()` auto-detects CPU count, total/available RAM (Windows + POSIX)
301
- - `WindowOverheadRecord` per-window metrics with features shed + stages skipped tracking
302
- - `ResourceManager.mark_unloaded()` / `trigger_gc()`model lifecycle + conditional GC
303
- - `_record_dispatch_overhead()` on orchestrator feeds overhead to allocator after every dispatch
304
- - `_allocator_fields()` 4 new WindowMetrics fields: `adaptive_ewma_overhead_pct`, `adaptive_features_shed`, `adaptive_stages_disabled`, `adaptive_consecutive_over`
305
- - All 6 dispatch variants wired: dispatch, dispatch_with_tools, dispatch_reflexive, dispatch_progressive, dispatch_stream_augmented, dispatch_agentic
306
- - Tests covering hardware detection, EWMA smoothing, throughput adaptation, ML protection, prompt efficiency, profile generation, model lifecycle, edge cases
307
- - Test count: 266 → 351
308
-
309
- - **Resource Management & Meta-Learning Hardening** (§audit R2)
310
- - `ResourceManager` centralized model registry, memory pressure tracking, GC orchestration
311
- - `ResourceSnapshot` dataclass point-in-time view of memory budget, model utilization, pressure level
312
- - Pressure levels: none/low/medium/high/critical based on estimated CRP memory vs. budget
313
- - Model lifecycle tracking: register, load, use, unload, idle detection
314
- - Platform-aware RSS reading (Windows ctypes + POSIX /proc/self/status)
315
- - `CalibrationState` adaptive recalibration — drift detection replaces permanent baseline lock
316
- - Rolling window analysis (last 10 windows) with 30% drift threshold triggers recalibration
317
- - `calibration_epoch` counter tracks how many times baselines have been recalibrated
318
- - WindowMetrics `ram_available_mb`, `ram_used_by_crp_mb`, `pressure_level` now live-computed
319
- - WindowMetrics `marginal_gain` now computed as new-fact ratio per window
320
- - WindowMetrics `sections_covered` now counts unique Markdown headers in output
321
- - All 5 formerly-dead WindowMetrics fields are now populated across all 6 dispatch variants
322
- - `_resource_fields()` and `_marginal_fields()` helpers on orchestrator
323
- - GC runs automatically on `close()` for clean session teardown
324
- - 38 tests covering ResourceManager, CalibrationState recalibration, marginal gain, sections
325
-
326
- - **§22 LLM-in-the-Loop Agentic Architecture** (PARADIGM SHIFT)
327
- - CRPFacilitator cognitive engine with 6 LLM-driven decision modules
328
- - Task analysis (§22.1) LLM semantically understands task complexity
329
- - Strategy routing (§22.2) LLM chooses optimal dispatch strategy
330
- - Fact synthesis (§22.3) — LLM merges/compresses knowledge base facts
331
- - Output evaluation (§22.4) — LLM assesses output quality
332
- - Memory curation (§22.5) LLM manages CRP's knowledge base
333
- - Execution planning (§22.6) LLM decomposes complex tasks into multi-step plans
334
- - Multi-step plan execution each plan step dispatches with its own strategy
335
- - Enhanced revision loop structured evaluation feedback, strategy adjustment
336
- - Post-revision curation — iterative knowledge refinement
337
- - Continuation awareness — inner dispatch continuation state feeds into evaluation
338
- - 12 agentic telemetry fields in WindowMetrics
339
- - 84 tests covering all cognitive modules and integration paths
340
-
341
- - **Multi-Perspective Audit & CKF Gate Fix**
342
- - 5-perspective audit documented in CRP_MULTI_PERSPECTIVE_AUDIT.md
343
- - CKF Phase 6 gate reworked: budget reservation (15% or 120 tokens min) ensures CKF retrieval fires even at high envelope saturation
344
- - CKF_GATE_TOKENS lowered from 500 to 120 tokens
345
- - CKF_RESERVE_RATIO constant (0.15) reserves budget before warm store packing
346
- - Concurrency model documented in README.md
347
- - README badge corrected (709 → 185 tests)
348
- - 11 CKF gate tests added (test_ckf_gate.py)
349
-
350
- - **§21Novel Relay Strategies**
351
- - Reflexive dispatch generate-then-verify with fact-checking
352
- - Progressive dispatch compact index with on-demand expansion
353
- - Stream-augmented dispatch — mid-generation context injection
354
- - 61 tests covering all three strategies
355
-
356
- - **§20 Tool-Mediated Dispatch**
357
- - `dispatch_with_tools()` LLM requests context via tool calls
358
- - Multi-round tool negotiation with safety cap
359
- - Fact extraction from tool dispatch outputs
360
- - 34 tests covering tool relay pipeline
361
-
362
- - **Complete CRP v2.0 Specification** — 9 documents, ~19,200 lines
363
- - 01_RESEARCH_FOUNDATIONS.md Academic research backing (9 research areas, 40+ papers)
364
- - 02_CORE_PROTOCOL.md — Core specification (29 sections, ~6,800 lines)
365
- - 03_CONTEXT_ENVELOPE.md — Context envelope architecture
366
- - 04_TOKEN_GENERATION_PROTOCOL.md — Unbounded output via continuation
367
- - 05_SYSTEM_WIDE_INTEGRATION.md Integration architecture (87+ call sites)
368
- - 06_IMPLEMENTATION_PLAN.md — Implementation roadmap
369
- - 07_SECURITY.md Security architecture (OWASP-aligned, 14 sections)
370
- - 08_MONETIZATION.md — Business model (PostgreSQL model — full capability free)
371
- - 09_DEPLOYMENT.md — Deployment architecture (embedded library)
372
-
373
- - **JSON Schemas** (Draft 2020-12) for all API types:
374
- - task-intent.json, quality-report.json, session-status.json
375
- - cost-estimate.json, envelope-preview.json, session-handle.json
376
- - stream-event.json, crp-error.json, persisted-state-header.json
377
-
378
- - **Contextual Knowledge Fabric (CKF)** normative knowledge layer:
379
- - Graph walk, pattern query, semantic fallback, community summary retrieval
380
- - Event-sourced history, pub-sub architecture
381
- - Cross-session persistence
382
-
383
- - **6-Stage Extraction Pipeline** (blackboard-reactive):
384
- - Regex → Statistical (TextRank) → GLiNER NER → UIE Relations → RST Discourse → LLM-Assisted Relational
385
-
386
- - **Quality Tier System** — S/A/B/C/D with degradation model
387
-
388
- - **Multi-Signal Completion Detection** — fact flow + structural flow + vocabulary novelty + structural completion
389
-
390
- - **Meta-Learning Architecture** — ORC + ICML + RTL for small model reasoning amplification
391
-
392
- - **Security Architecture** — HMAC binding, RBAC, encryption at rest, fact integrity chains, OWASP mapping
393
-
394
- - **API Formalism** (§6.10) — RFC 2119 operation contracts, error taxonomy (13 codes), streaming API, async API, stability tiers
395
-
396
- - **Concurrency Model** (§23) — thread safety, lock ordering, session-level serialization
397
-
398
- - **Observability & Audit** (§24) — event model, telemetry, window DAG traceability
399
-
400
- - **Configuration Management** (§25) — 5-layer hierarchy
401
-
402
- - **Multi-Provider LLM Interface** (§26) — provider-agnostic adapter pattern
403
-
404
- - **Deployment Architecture** (§27 + 09_DEPLOYMENT) embedded library, Lambda/K8s scenarios
405
-
406
- - **Publication & Adoption Strategy** (§28) repo structure, visibility strategy, standards track
407
-
408
- ### Design Decisions
409
-
410
- - CKF is **free and normative** ships with every conformant SDK (PostgreSQL model)
411
- - CRP is an **embedded library**, not a server zero deployment overhead
412
- - Protocol is **language-neutral** JSON Schema for all types, pseudocode for algorithms
413
- - All 11 Knowledge Backend Interface operations are **REQUIRED**
414
- - GLiNER domain models are **FUTURE** work (Phase 3+)
1
+ <!--
2
+ Copyright (c) 2026 Constantinos Vidiniotis. All rights reserved.
3
+ Licensed under the terms described in LICENSE.md in the root of this repository.
4
+ -->
5
+
6
+ # Changelog
7
+
8
+ All notable changes to the CRP specification will be documented in this file.
9
+
10
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
+
12
+ ## [Unreleased]
13
+
14
+ ### Added
15
+ - (none yet)
16
+
17
+ ## [3.0.0] - 2026-05-29
18
+
19
+ CRP v3the governance release. CRP becomes an enforceable AI-safety and
20
+ context-management layer for local and hosted LLMs, with proof-of-work demos.
21
+
22
+ ### Added
23
+
24
+ - **Local LLM discovery** (`crp.providers.discovery.discover_local_llms`)
25
+ detects running LM Studio, Ollama and llama.cpp runtimes and reports each
26
+ model's architecture, quantization, true context ceiling vs. loaded window,
27
+ and tool/reasoning/vision capabilities.
28
+ - **Decision Provenance Engine enhancements** reasoning-quality amplifiers
29
+ (`crp.provenance.amplifiers`), RQA staging (`crp.provenance.rqa`,
30
+ `rqa_stages`) and a tamper-evident per-window HMAC chain
31
+ (`crp.provenance.window_chain`: `build_window_hmac`, `verify_window_chain`).
32
+ - **Signed session tokens** (`crp.security.session_token`) — `issue_token` and
33
+ `format_set_session_header` for `CRP-Set-Session`.
34
+ - **Policy, headers, activation and agent modules** — `crp.policy`,
35
+ `crp.headers`, `crp.activation`, `crp.agent`.
36
+ - **Interactive demo apps** (`examples/crp_demos/`) two browser apps over a
37
+ stdlib HTTP server that govern a real local LLM: an AI Safety & Governance
38
+ Console (injection shield, grounding/risk scoring, policy enforcement, HTTP
39
+ 451 halt, OCSF audit) and a Context Management & Provenance Explorer (CKF
40
+ recall, HMAC chain, tamper detection, signed tokens, `CRP-*` headers).
41
+ - **Conformance test suite** (`tests/conformance/`).
42
+ - **Completeness assessment** (`docs/CRP_V3_COMPLETENESS.md`) and launch series
43
+ (`docs/LINKEDIN_LAUNCH_SERIES.md`).
44
+
45
+ ## [2.3.2] - 2026-05-03
46
+
47
+ ### Fixed
48
+
49
+ - **`StateFact.extraction_stage` AttributeError** — `StateFact` now properly
50
+ delegates `extraction_stage` to its inner `Fact` object as a read-only
51
+ property, matching the existing delegation pattern for `id`, `text`,
52
+ `confidence`, etc. Previously the sidecar's `GET /sessions/:id/facts`
53
+ endpoint crashed with `'StateFact' object has no attribute 'extraction_stage'`
54
+ because the attribute was accessed directly on the wrapper rather than via
55
+ `self.fact.extraction_stage`. The fix makes all callers (including
56
+ `sidecar.py`) work correctly without requiring workarounds.
57
+
58
+ ## [2.3.1] - 2026-04-24
59
+
60
+ ### Fixed
61
+
62
+ - **Dispatch infinite-loop on trivial provider outputs** — fixed a hang in
63
+ `DispatchMixin` where the continuation loop could fire repeatedly against
64
+ a provider returning tiny/stop-reason outputs (common with mock/thin
65
+ providers and very cheap local models).
66
+ - `crp.continuation.trigger.TriggerConfig` gained
67
+ `gap_override_min_output_tokens` (default `16`): the gap-score override
68
+ path is now suppressed when the observed output is below this threshold
69
+ **and** the provider already reported `finish_reason="stop"`.
70
+ - `crp.core.config` gained a new `continuation_pause_s` key
71
+ (default `0.0`, bounds `[0.0, 60.0]`) that replaces the previously
72
+ hardcoded `time.sleep(2)` between continuation windows in
73
+ `DispatchMixin`. Local/slow-backend users can opt back in by setting
74
+ `continuation_pause_s=2.0` in their CRP config.
75
+ - Test assertions in `tests/test_phase1.py` were relaxed from exact
76
+ equality to `startswith("fake output")` so they tolerate the CRP 2.3
77
+ tamper-evidence signature tail (`<!-- CRP | ELv2 | ... -->`).
78
+ - Verified: `pytest tests/test_phase1.py::TestOrchestrator` now passes
79
+ 16/16 in ~75s (previously hung indefinitely).
80
+
81
+ ## [2.3.0] - 2026-04-23
82
+
83
+ ### Added Closes all 5 protocol-oversight gaps identified in 2.2
84
+
85
+ - **G1 Provider/framework hooks (`crp.integrations`)**: auto-instrument
86
+ uninstrumented call sites so CRP sees every model call even when the
87
+ integrator hand-builds requests or uses a third-party framework.
88
+ - `crp.integrations.openai_hook.install()` / `uninstall()` monkey-patches
89
+ `openai.OpenAI.chat.completions.create` (sync + async) to route through
90
+ the configured `ContextEnforcer` before dispatch.
91
+ - `crp.integrations.anthropic_hook.install()` / `uninstall()` — same for
92
+ `anthropic.Anthropic.messages.create`.
93
+ - `crp.integrations.langchain_hook.CRPCallbackHandler` — LangChain
94
+ `BaseCallbackHandler` that records every LLM/chain/tool invocation to
95
+ the ledger and enforces policy pre-flight.
96
+ - New exports: `install_openai_hook`, `install_anthropic_hook`,
97
+ `CRPCallbackHandler` on the top-level `crp` package.
98
+
99
+ - **G2 Derived manifests (`crp.core.manifest_derive`)**: infer a manifest
100
+ from observed bytes when integrators skip declaration. Distinguishes
101
+ *lazy* (content exists but no stamp) from *genuinely ephemeral* (no
102
+ durable source to stamp).
103
+ - `derive_manifest_from_content(...)` — SHA-256 digest, heuristic
104
+ `SourceKind` classification, `TrustLevel.UNKNOWN` stamp.
105
+ - `derive_manifest_batch(...)` batch-derive across a list of observed
106
+ payloads.
107
+ - Integrators who never stamp sources now get OBSERVE-level enforcement
108
+ benefit: derived manifests flow through the ledger just like declared
109
+ ones, with an explicit `origin=SourceOrigin.DERIVED` marker.
110
+
111
+ - **G3 — Turn-level enforcement**: `ContextEnforcer` re-validates every
112
+ turn, including `tool_result` injections mid-conversation.
113
+ - `ContextEnforcer.check_messages(messages, observed=...)` runs the
114
+ full enforcement pipeline against an entire chat-completions-shape
115
+ message list.
116
+ - `ContextEnforcer.check_tool_result(tool_call_id, content, ...)`
117
+ re-validates a single `tool_result` before it re-enters the prompt.
118
+
119
+ - **G4 Ledger hardening (`ManifestLedger`)**: tamper-evident hash chain,
120
+ SIEM/JSONL forwarding, pluggable backends.
121
+ - Every appended entry now carries `prev_hash` + `entry_hash`. Breaking
122
+ the chain is detected by `ManifestLedger.verify_chain(session_id)`.
123
+ - `ManifestLedger(forward_to=[AuditSink(...)])` — optional list of audit
124
+ sinks; each recorded entry is also emitted as an audit event so SIEM
125
+ forwarders / syslog / JSONL replicators see the ledger write in real
126
+ time. Forwarding never blocks ledger writes.
127
+ - `crp.core.ledger_backends` `LedgerBackend` protocol plus
128
+ `JsonlFileSink` and `SyslogSink` reference implementations.
129
+
130
+ - **G5 Default observe enforcer**: `assemble_messages` now auto-installs
131
+ an `OBSERVE`-mode enforcer if the integrator forgot to configure one.
132
+ Safer-by-default; closes the silent-skip footgun.
133
+
134
+ - **Custom / local-endpoint providers**: `OpenAIAdapter` now accepts
135
+ empty-string or `None` `api_key` when `base_url` is set. Unblocks
136
+ LM Studio, vLLM, llama.cpp server, Ollama OpenAI-compat, TGI, and any
137
+ unauthenticated local endpoint. Verified live against
138
+ `gemma-3-270m-it-qat` on LM Studio (`http://192.168.0.6:1234`).
139
+
140
+ ### Changed
141
+
142
+ - `ContextEnforcer.__init__` gained `key_provider`, `ledger`, and
143
+ `session_id` kwargs (additive; all optional). No existing call site
144
+ needs to change.
145
+ - `ManifestLedgerEntry` now always contains `prev_hash` + `entry_hash` on
146
+ newly written entries; legacy entries without hash fields are treated
147
+ as "chain origin" and do not break verification.
148
+
149
+ ### Fixed
150
+
151
+ - `AttestationMismatch.observed_source` attribute access regression
152
+ (previously crashed when an enforcer rejected a manifest mismatch).
153
+
154
+ ### Verification
155
+
156
+ - 30 new tests in `tests/test_gaps_2_3.py` covering all 5 gaps end-to-end.
157
+ - Live end-to-end verification against LM Studio (`gemma-3-270m-it-qat`)
158
+ 4/4 stages pass: empty-key adapter, basic generation, dispatch
159
+ through `ContextEnforcer` (OBSERVE) + `ManifestLedger`, multi-turn
160
+ sequential generation with explicit resource management.
161
+ - 163 core + gap tests pass serial (no parallelism).
162
+
163
+ ## [2.2.0] - 2026-04-23
164
+
165
+ ### Added Miscellaneous (from 2.1 Unreleased pool)
166
+ - Trademark notice: "Context Relay Protocol" (application pending, Class 9)
167
+ - Contact emails: info@crprotocol.io (general), contact@crprotocol.io (enterprise)
168
+ - GitHub Discussions enabled
169
+ - Operational runbook (`docs/OPERATIONS_RUNBOOK.md`) — deployment, monitoring, incident response
170
+ - Integrity chain external verification (`export_for_verification()`, `verify_external()`)
171
+ - `/metrics` endpoint on HTTP sidecar (Prometheus format)
172
+ - Session file schema versioning with forward-compatible migration path
173
+ - Bounded ingest queue (`maxsize=1000`) prevents unbounded memory growth
174
+ - Pipeline short-circuit skips late extraction stages when early stages produce enough facts
175
+ - Config file layer — YAML/JSON config files (`~/.crp/config.yaml`, `.crp.yaml`)
176
+ - Structured logging wired into orchestrator initialization
177
+ - Metadata size limits on `Fact` (64 keys, 128-char key length, 4096-char value size)
178
+ - `TypeAlias` annotations and extended type aliases in `crp/_typing.py`
179
+ - All error types and config classes exported from `crp.__init__`
180
+
181
+ ### Changed Miscellaneous (from 2.1 Unreleased pool)
182
+ - `FactGraph` edge lookups now O(1) via indexed dicts (was O(n) list scan)
183
+ - Provider error responses sanitized no internal details leak to clients
184
+ - Envelope builder truncates when exceeding token budget, clamps saturation to 1.0
185
+ - Test fixtures use `tmp_path` pytest fixture instead of `tempfile.TemporaryDirectory()`
186
+ - Correlation IDs propagated through ingest path
187
+
188
+ ### FixedMiscellaneous (from 2.1 Unreleased pool)
189
+ - Unknown config kwargs now produce a warning log instead of silent ignore
190
+
191
+ ### Added Enforcement Pipeline, Ledger & Injection Detection (§7.14.4–§7.14.5)
192
+
193
+ CRP 2.1 defined the **vocabulary** for context-source provenance
194
+ (`ContextSource`, `ContextManifest`). CRP 2.2 defines the **enforcement
195
+ point** — the single wire-side choke-point every envelope assembly flows
196
+ through — plus cross-turn persistence, key rotation, and content-side
197
+ verification of declared trust labels. This closes the gap between
198
+ "context is labelled" and "context is actually enforced on the wire".
199
+
200
+ - New module `crp.core.context_enforcer` (§7.14.4):
201
+ - `EnforcementPolicy` (`OBSERVE` / `WARN` / `REJECT`) — application-
202
+ level policy for what happens on a violation.
203
+ - `ContextEnforcer` composes manifest signature-verify, expiry
204
+ check, attestation mismatch scan (`check_attestation`), and
205
+ injection-signal scan into a single `check(manifest, observed)`
206
+ call. Under `REJECT`, raises `CRPError(CONTEXT_ATTESTATION_MISMATCH)`
207
+ or `CRPError(CONTEXT_MANIFEST_INVALID)`. Under `OBSERVE` / `WARN`,
208
+ emits audit events and continues.
209
+ - `detect_injection_signals()` six high-precision regex patterns
210
+ (instruction override, role jailbreak, secret exfil, delimiter
211
+ forgery, dangerous payload URLs, embedded tool calls) applied to
212
+ sources declared `TrustLevel.TRUSTED`. Addresses the gap between
213
+ *declared* and *actual* trust — developers marking a system prompt
214
+ as TRUSTED doesn't make templated user input safe.
215
+ - `AuditSink` protocol + `LoggingAuditSink` + thread-safe
216
+ `InMemoryAuditSink` (bounded ring buffer). Every mismatch and
217
+ injection signal is emitted as a structured event for SIEM / audit
218
+ pipelines.
219
+ - `default_enforcer()` / `set_default_enforcer()` — process-wide
220
+ opt-in installer so libraries (dispatch router, CKF, warm store)
221
+ can find a configured enforcer without explicit plumbing.
222
+ - `observed_content(source, text)` helper for presenting source +
223
+ payload pairs to the enforcer for content scanning.
224
+
225
+ - New module `crp.core.manifest_ledger` (§7.14.5):
226
+ - `ManifestLedger` — append-only JSONL store
227
+ (`crp_sessions/<session_id>.manifest.jsonl`) of every manifest ever
228
+ attached to a session. Supports `record()`, `load()`, `history()`,
229
+ `latest()`, `find_by_source_id()`, `find_by_kind()`, and
230
+ `verify_signatures()` for periodic integrity audits.
231
+ - `KeyProvider` abstraction with two implementations:
232
+ - `EnvVarKeyProvider` reads HMAC secret from an environment
233
+ variable, auto-detects hex encoding, enforces ≥32-byte minimum.
234
+ - `RotatingKeyProvider` — current + retired key ring with
235
+ configurable grace window, allowing in-flight manifests signed
236
+ under the previous key to continue verifying after rotation.
237
+
238
+ ### Added — Consumer-Side Integration (§7.14.4 wire point)
239
+
240
+ - `crp.core.dispatch_router.assemble_messages()` now accepts optional
241
+ `manifest`, `observed_sources`, and `enforcer` keyword arguments.
242
+ When supplied (or a process-wide default enforcer is installed),
243
+ every envelope assembly runs the full enforcement pipeline
244
+ **before** messages are constructed. Zero-cost when no enforcer is
245
+ configured — fully backward compatible with CRP 2.1 call sites.
246
+
247
+ - `crp.state.warm_store.get_active_facts_as_extraction()` now stamps
248
+ every un-sourced fact with
249
+ `ContextSource(kind=WARM_STORE, origin=OBSERVED, trust_level=TRUSTED)`.
250
+
251
+ - `crp.ckf.fabric.ContextKnowledgeFabric.retrieve()` now stamps every
252
+ un-sourced merged fact with `ContextSource(kind=CKF_RETRIEVAL, ...)`
253
+ carrying the retrieval modes and score in `metadata`.
254
+
255
+ ### Changed Source-Kind Detection
256
+
257
+ - `crp.core.context_source.detect_source_kind()` strengthened:
258
+ - New structural hint parser: attempts `json.loads(content)` and
259
+ inspects object keys (`function_name` + `arguments` `FUNCTION_CALL`,
260
+ `mcp` / `mcp_server` `MCP_TOOL`, `url` + `snippet`
261
+ `WEB_SEARCH`, `embedding` / `vector` `VECTOR_DB`).
262
+ - Six new heuristic regex patterns for JSON/XML/YAML code blocks,
263
+ SQL DML, Cypher / graph query keywords, SERPAPI / Google / Bing
264
+ signatures, common vector-DB provider names (Pinecone, Weaviate,
265
+ Qdrant, Chroma, pgvector, Milvus), and `function_name` / `tool_name`
266
+ tokens.
267
+ - Structural hints are preferred over regex when parsing succeeds.
268
+
269
+ ### Security
270
+
271
+ - Manifest verification is now always attempted when both a signature
272
+ and a secret are present, even if `require_signed_manifest=False`.
273
+ Tampered signatures are detected and emitted as
274
+ `CONTEXT_MANIFEST_INVALID` audit events.
275
+ - `ManifestLedger` rejects session IDs that sanitize to empty
276
+ (prevents directory traversal via crafted session identifiers).
277
+ - HMAC verification continues to use `hmac.compare_digest` (constant
278
+ time). `RotatingKeyProvider` iterates candidate keys for verification
279
+ so key rotation does not create a signature-oracle side channel.
280
+
281
+ ### Tests
282
+
283
+ - 38 new tests in `tests/test_context_enforcer.py` (injection patterns,
284
+ audit sinks, all three policies, default-enforcer install, integration
285
+ with `assemble_messages`).
286
+ - 34 new tests in `tests/test_manifest_ledger.py` (JSONL round-trip,
287
+ cross-instance rehydration, lineage queries, key rotation, hex/utf-8
288
+ env secret decode, grace-window verification).
289
+ - Total suite: **182 passing** (110 pre-2.2 baseline + 72 new).
290
+
291
+ ## [2.1.0] - 2026-04-23
292
+
293
+ ### Added Context-Source Provenance (§7.14.3)
294
+ - Contact emails: info@crprotocol.io (general), contact@crprotocol.io (enterprise)
295
+ - GitHub Discussions enabled
296
+ - Operational runbook (`docs/OPERATIONS_RUNBOOK.md`) — deployment, monitoring, incident response
297
+ - Integrity chain external verification (`export_for_verification()`, `verify_external()`)
298
+ - `/metrics` endpoint on HTTP sidecar (Prometheus format)
299
+ - Session file schema versioning with forward-compatible migration path
300
+ - Bounded ingest queue (`maxsize=1000`) prevents unbounded memory growth
301
+ - Pipeline short-circuit skips late extraction stages when early stages produce enough facts
302
+ - Config file layerYAML/JSON config files (`~/.crp/config.yaml`, `.crp.yaml`)
303
+ - Structured logging wired into orchestrator initialization
304
+ - Metadata size limits on `Fact` (64 keys, 128-char key length, 4096-char value size)
305
+ - `TypeAlias` annotations and extended type aliases in `crp/_typing.py`
306
+ - All error types and config classes exported from `crp.__init__`
307
+
308
+ ### Changed
309
+ - `FactGraph` edge lookups now O(1) via indexed dicts (was O(n) list scan)
310
+ - Provider error responses sanitized no internal details leak to clients
311
+ - Envelope builder truncates when exceeding token budget, clamps saturation to 1.0
312
+ - Test fixtures use `tmp_path` pytest fixture instead of `tempfile.TemporaryDirectory()`
313
+ - Correlation IDs propagated through ingest path
314
+
315
+ ### Fixed
316
+ - Unknown config kwargs now produce a warning log instead of silent ignore
317
+
318
+ ## [2.1.0] - 2026-04-23
319
+
320
+ ### Added Context-Source Provenance (§7.14.3)
321
+
322
+ CRP's Decision Provenance Engine already classifies every *output* claim as
323
+ `CONTEXT_GROUNDED | PARAMETRIC | MIXED | UNCERTAIN`. This release adds the
324
+ symmetric **input-side** primitive: every fact that enters the envelope
325
+ can now carry a record of *where it came from* (RAG chunk, vector DB,
326
+ database read, MCP tool, function call, web search, user turn, file upload,
327
+ agent memory, or parametric). This is foundational for ISO/IEC 42001 §4
328
+ (Context of the organisation), EU AI Act Art. 10 (Data governance),
329
+ GDPR Art. 30 (Records of Processing), and NIST AI RMF MAP-4.
330
+
331
+ - New module `crp.core.context_source` with:
332
+ - `SourceKind` closed enumeration (14 values) of upstream source
333
+ categories. Additions require an RFC.
334
+ - `ContextSource`immutable (`frozen=True`) record: `kind`, `source_id`,
335
+ `origin` (declared / observed / heuristic), `trust_level`,
336
+ `contains_pii`, `sensitivity`, `region`, `retrieval_query`,
337
+ `retrieved_at`, `upstream_uri`, `declared_by_manifest_id`, `metadata`.
338
+ - `ContextManifest` customer-authored declarative attestation of
339
+ intended upstream sources. HMAC-SHA256 signed over canonical JSON,
340
+ with `sign()` / `verify()` using constant-time comparison and
341
+ `is_expired()` helpers.
342
+ - `detect_source_kind(content, role=…)` detective-mode heuristic
343
+ parser that classifies message content by OpenAI-style role plus a
344
+ conservative pattern library (`<RAG>`, `[retrieved]`, `<mcp:>`,
345
+ `SELECT FROM …`, web-search markers, etc.).
346
+ - `check_attestation(observed, manifest)` returns a list of
347
+ `AttestationMismatch` rows (reasons: `no_manifest`,
348
+ `manifest_expired`, `unattested_kind`, `unattested_source_id`).
349
+ `to_audit_event()` produces the §7.14.2 audit-event envelope shape.
350
+ - `Fact.source: ContextSource | None` optional field; defaults to
351
+ `None` so v2.0 callers see zero behavioural change.
352
+ - Envelope section `[CONTEXT_SOURCES]` registered in the Tier 3 priority
353
+ list (`crp/envelope/formatter.py::TIER_3_SECTIONS`).
354
+ - Error codes `CONTEXT_ATTESTATION_MISMATCH = 1040` and
355
+ `CONTEXT_MANIFEST_INVALID = 1041`.
356
+ - `ManifestValidationError` raised on malformed JSON / empty signing key.
357
+ - All primitives exported from `crp` (`SourceKind`, `SourceOrigin`,
358
+ `TrustLevel`, `ContextSource`, `ContextManifest`, `AttestationMismatch`,
359
+ `ManifestValidationError`, `detect_source_kind`, `check_attestation`).
360
+ - 41-test suite (`tests/test_context_source.py`) covering frozen
361
+ invariant, size limits, JSON round-trip, HMAC sign / verify, expiry,
362
+ detective-mode classification, attestation-mismatch edge cases, audit
363
+ event shape, and public API surface.
364
+
365
+ ### Changed
366
+
367
+ - `docs/CRP_CAPABILITIES.md` now lists context-source provenance as a
368
+ first-class capability.
369
+ - MkDocs site gains a dedicated *Protocol → Context Sources* page.
370
+
371
+ ### Migration notes
372
+
373
+ This release is **fully backward-compatible**. `Fact.source` defaults to
374
+ `None`; consumers that ignore the field continue to work unchanged. To
375
+ adopt, wrap retrieved chunks with `ContextSource` at ingestion time:
376
+
377
+ ```python
378
+ from crp import ContextSource, SourceKind, SourceOrigin, Fact
379
+
380
+ fact = Fact(
381
+ text=chunk.text,
382
+ source=ContextSource(
383
+ kind=SourceKind.VECTOR_DB,
384
+ source_id="acme-hr-policies-vdb",
385
+ origin=SourceOrigin.OBSERVED,
386
+ contains_pii=True,
387
+ region="eu-west-1",
388
+ retrieval_query=user_query,
389
+ ),
390
+ )
391
+ ```
392
+
393
+ See `docs/protocol/context-sources.md` (published on crprotocol.io) for
394
+ the full integration guide.
395
+
396
+ ## [2.0.0] - 2026-04-06
397
+
398
+ ### Added
399
+
400
+ - **HTTP Sidecar Security Hardening & Full Protocol Surface** (§F2-security)
401
+ - Defense-in-depth security model: 8 layers enforced on every request
402
+ - Bearer-token authentication with timing-safe comparison (`secrets.compare_digest`)
403
+ - Session ownership: sessions bound to SHA-256 hash of the creating token, other tokens get `403 Forbidden`
404
+ - Per-IP rate limiting with monotonic-clock sliding window (default 120 req/60s, configurable)
405
+ - Request body size limit: 10 MB cap, returns `413 Payload Too Large` when exceeded
406
+ - Concurrent session cap: default 64, returns `503 Service Unavailable` when exceeded
407
+ - Security headers on every response: `X-Content-Type-Options: nosniff`, `Cache-Control: no-store`
408
+ - `--bind-all` security gate: requires `--auth-token` unless `--allow-unauthenticated` explicitly set
409
+ - Full protocol surface exposed: all 6 dispatch variants (basic, tools, reflexive, progressive, stream-augmented, agentic) over HTTP
410
+ - New endpoints: `/facts/feedback` (boost/penalize/reject), `/providers` (register fallback), `/estimate` (cost estimation)
411
+ - Input validation on all endpoints: variant validation, required fields, capped limits
412
+ - CLI options: `--max-sessions`, `--rate-limit`, `--allow-unauthenticated`
413
+ - README: dedicated "Inter-LLM Context Sharing" section with endpoint reference, security model, and usage examples
414
+
415
+ - **Deep Audit Gap Fixes — F1-F6, D1-D9** (§gap-audit)
416
+ - F1: README provider claims corrected — removed false Google/vLLM/HuggingFace references
417
+ - F2: `crp serve` HTTP sidecar implemented (`crp/cli/sidecar.py`) — full REST API with inter-LLM context sharing via `/facts/share` endpoint
418
+ - F3: Provider fallback chain — `LLMProviderManager.generate_with_fallback()` tries primary then registered providers
419
+ - F4: README RBAC enforcement note corrected — now accurately reflects full enforcement
420
+ - F5: Test count updated 266 → 351
421
+ - F6: `EventEmitter` wired into orchestrator — 30+ event types emitted at all pipeline stages (dispatch.started/completed, envelope.built, window.opened/continued/completed, fact.created, extraction.completed, session.closed)
422
+ - D1: `CQSDetector` wired — context hunger detection after LLM generation
423
+ - D2: `CrossWindowValidator` wired — extraction-based consistency validation after continuation loop
424
+ - D3: `FeedbackLoop` wired — confidence adjustments after extraction, public API (boost/penalize/reject)
425
+ - D4: `ParallelFanOut` wired — instantiated with dispatch/extract callables
426
+ - D5: `ReviewCycleManager` wired — checkpoint_review in continuation loop
427
+ - D6: `ScaleModeSelector` wired — configured at dispatch start from session processing_mode
428
+ - D7: `EventEmitter` wired (same as F6)
429
+ - D8: `TelemetryWriter` wired — optional JSONL sink for window telemetry
430
+ - D9: `LLMProviderManager` wired with fallback chain (same as F3)
431
+ - Public API: `emitter` property, `on()` subscription, `feedback` property, `boost_fact()`/`penalize_fact()`/`reject_fact()`, `register_provider()`, `parallel` property
432
+ - HTTP sidecar endpoints: POST /sessions, GET /sessions/:id/status, POST /sessions/:id/dispatch, POST /sessions/:id/ingest, GET /sessions/:id/facts, POST /sessions/:id/facts/share, POST /sessions/:id/close, GET /health
433
+ - All 351 tests passing after changes
434
+
435
+ - **Adaptive Resource Allocation & Efficiency-First Optimization** (§resource-alloc)
436
+ - `AdaptiveAllocator` — dynamic pipeline tuning based on real-time overhead + memory pressure
437
+ - **Efficiency-first philosophy**: ML extraction stages (GLiNER, UIE, discourse) are core intelligence — never disabled
438
+ - `PROTECTED_INTELLIGENCE` frozenset — ML features excluded from shedding cascade and stage scheduling
439
+ - Throughput-based throttling: normal → throttled → constrained (adjusts fact limits, batch sizes, packing) instead of disabling stages
440
+ - `PromptEfficiency` dataclass — LLM-side optimization hints: fact deduplication, system prompt caching, envelope compression, connection reuse, estimated cache hit percentage
441
+ - EWMA-smoothed overhead tracking with configurable cap (default 15%)
442
+ - `_adapt_throughput()` — adjusts throughput level based on overhead trends without sacrificing intelligence
443
+ - `OverheadBudgetManager` wired into orchestrator — shedding cascade now live, ML features protected
444
+ - `ExtractionProfile` / `EnvelopeProfile` — recommended configurations based on resource state (stages always enabled)
445
+ - Consecutive over-cap detection: 3+ consecutive windows triggers throughput reduction
446
+ - `detect_hardware()` — auto-detects CPU count, total/available RAM (Windows + POSIX)
447
+ - `WindowOverheadRecord` per-window metrics with features shed + stages skipped tracking
448
+ - `ResourceManager.mark_unloaded()` / `trigger_gc()` — model lifecycle + conditional GC
449
+ - `_record_dispatch_overhead()` on orchestrator — feeds overhead to allocator after every dispatch
450
+ - `_allocator_fields()` → 4 new WindowMetrics fields: `adaptive_ewma_overhead_pct`, `adaptive_features_shed`, `adaptive_stages_disabled`, `adaptive_consecutive_over`
451
+ - All 6 dispatch variants wired: dispatch, dispatch_with_tools, dispatch_reflexive, dispatch_progressive, dispatch_stream_augmented, dispatch_agentic
452
+ - Tests covering hardware detection, EWMA smoothing, throughput adaptation, ML protection, prompt efficiency, profile generation, model lifecycle, edge cases
453
+ - Test count: 266 → 351
454
+
455
+ - **Resource Management & Meta-Learning Hardening** (§audit R2)
456
+ - `ResourceManager` — centralized model registry, memory pressure tracking, GC orchestration
457
+ - `ResourceSnapshot` dataclass — point-in-time view of memory budget, model utilization, pressure level
458
+ - Pressure levels: none/low/medium/high/critical based on estimated CRP memory vs. budget
459
+ - Model lifecycle tracking: register, load, use, unload, idle detection
460
+ - Platform-aware RSS reading (Windows ctypes + POSIX /proc/self/status)
461
+ - `CalibrationState` adaptive recalibration — drift detection replaces permanent baseline lock
462
+ - Rolling window analysis (last 10 windows) with 30% drift threshold triggers recalibration
463
+ - `calibration_epoch` counter tracks how many times baselines have been recalibrated
464
+ - WindowMetrics `ram_available_mb`, `ram_used_by_crp_mb`, `pressure_level` now live-computed
465
+ - WindowMetrics `marginal_gain` now computed as new-fact ratio per window
466
+ - WindowMetrics `sections_covered` now counts unique Markdown headers in output
467
+ - All 5 formerly-dead WindowMetrics fields are now populated across all 6 dispatch variants
468
+ - `_resource_fields()` and `_marginal_fields()` helpers on orchestrator
469
+ - GC runs automatically on `close()` for clean session teardown
470
+ - 38 tests covering ResourceManager, CalibrationState recalibration, marginal gain, sections
471
+
472
+ - **§22 — LLM-in-the-Loop Agentic Architecture** (PARADIGM SHIFT)
473
+ - CRPFacilitator cognitive engine with 6 LLM-driven decision modules
474
+ - Task analysis (§22.1) — LLM semantically understands task complexity
475
+ - Strategy routing (§22.2) — LLM chooses optimal dispatch strategy
476
+ - Fact synthesis (§22.3) — LLM merges/compresses knowledge base facts
477
+ - Output evaluation (§22.4) — LLM assesses output quality
478
+ - Memory curation (§22.5) — LLM manages CRP's knowledge base
479
+ - Execution planning (§22.6) — LLM decomposes complex tasks into multi-step plans
480
+ - Multi-step plan execution — each plan step dispatches with its own strategy
481
+ - Enhanced revision loop — structured evaluation feedback, strategy adjustment
482
+ - Post-revision curation — iterative knowledge refinement
483
+ - Continuation awareness — inner dispatch continuation state feeds into evaluation
484
+ - 12 agentic telemetry fields in WindowMetrics
485
+ - 84 tests covering all cognitive modules and integration paths
486
+
487
+ - **Multi-Perspective Audit & CKF Gate Fix**
488
+ - 5-perspective audit documented in CRP_MULTI_PERSPECTIVE_AUDIT.md
489
+ - CKF Phase 6 gate reworked: budget reservation (15% or 120 tokens min) ensures CKF retrieval fires even at high envelope saturation
490
+ - CKF_GATE_TOKENS lowered from 500 to 120 tokens
491
+ - CKF_RESERVE_RATIO constant (0.15) reserves budget before warm store packing
492
+ - Concurrency model documented in README.md
493
+ - README badge corrected (709 → 185 tests)
494
+ - 11 CKF gate tests added (test_ckf_gate.py)
495
+
496
+ - **§21 — Novel Relay Strategies**
497
+ - Reflexive dispatch — generate-then-verify with fact-checking
498
+ - Progressive dispatch — compact index with on-demand expansion
499
+ - Stream-augmented dispatch — mid-generation context injection
500
+ - 61 tests covering all three strategies
501
+
502
+ - **§20 — Tool-Mediated Dispatch**
503
+ - `dispatch_with_tools()` — LLM requests context via tool calls
504
+ - Multi-round tool negotiation with safety cap
505
+ - Fact extraction from tool dispatch outputs
506
+ - 34 tests covering tool relay pipeline
507
+
508
+ - **Complete CRP v2.0 Specification** — 9 documents, ~19,200 lines
509
+ - 01_RESEARCH_FOUNDATIONS.md — Academic research backing (9 research areas, 40+ papers)
510
+ - 02_CORE_PROTOCOL.md — Core specification (29 sections, ~6,800 lines)
511
+ - 03_CONTEXT_ENVELOPE.md — Context envelope architecture
512
+ - 04_TOKEN_GENERATION_PROTOCOL.md — Unbounded output via continuation
513
+ - 05_SYSTEM_WIDE_INTEGRATION.md — Integration architecture (87+ call sites)
514
+ - 06_IMPLEMENTATION_PLAN.md — Implementation roadmap
515
+ - 07_SECURITY.md — Security architecture (OWASP-aligned, 14 sections)
516
+ - 08_MONETIZATION.md — Business model (PostgreSQL model — full capability free)
517
+ - 09_DEPLOYMENT.md — Deployment architecture (embedded library)
518
+
519
+ - **JSON Schemas** (Draft 2020-12) for all API types:
520
+ - task-intent.json, quality-report.json, session-status.json
521
+ - cost-estimate.json, envelope-preview.json, session-handle.json
522
+ - stream-event.json, crp-error.json, persisted-state-header.json
523
+
524
+ - **Contextual Knowledge Fabric (CKF)** — normative knowledge layer:
525
+ - Graph walk, pattern query, semantic fallback, community summary retrieval
526
+ - Event-sourced history, pub-sub architecture
527
+ - Cross-session persistence
528
+
529
+ - **6-Stage Extraction Pipeline** (blackboard-reactive):
530
+ - Regex → Statistical (TextRank) → GLiNER NER → UIE Relations → RST Discourse → LLM-Assisted Relational
531
+
532
+ - **Quality Tier System** — S/A/B/C/D with degradation model
533
+
534
+ - **Multi-Signal Completion Detection** — fact flow + structural flow + vocabulary novelty + structural completion
535
+
536
+ - **Meta-Learning Architecture** — ORC + ICML + RTL for small model reasoning amplification
537
+
538
+ - **Security Architecture** — HMAC binding, RBAC, encryption at rest, fact integrity chains, OWASP mapping
539
+
540
+ - **API Formalism** (§6.10) — RFC 2119 operation contracts, error taxonomy (13 codes), streaming API, async API, stability tiers
541
+
542
+ - **Concurrency Model** (§23) — thread safety, lock ordering, session-level serialization
543
+
544
+ - **Observability & Audit** (§24) — event model, telemetry, window DAG traceability
545
+
546
+ - **Configuration Management** (§25) — 5-layer hierarchy
547
+
548
+ - **Multi-Provider LLM Interface** (§26) — provider-agnostic adapter pattern
549
+
550
+ - **Deployment Architecture** (§27 + 09_DEPLOYMENT) — embedded library, Lambda/K8s scenarios
551
+
552
+ - **Publication & Adoption Strategy** (§28) — repo structure, visibility strategy, standards track
553
+
554
+ ### Design Decisions
555
+
556
+ - CKF is **free and normative** — ships with every conformant SDK (PostgreSQL model)
557
+ - CRP is an **embedded library**, not a server — zero deployment overhead
558
+ - Protocol is **language-neutral** — JSON Schema for all types, pseudocode for algorithms
559
+ - All 11 Knowledge Backend Interface operations are **REQUIRED**
560
+ - GLiNER domain models are **FUTURE** work (Phase 3+)