crprotocol 2.0.0__tar.gz → 2.3.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 (330) hide show
  1. crprotocol-2.3.0/.github/workflows/docs.yml +32 -0
  2. {crprotocol-2.0.0 → crprotocol-2.3.0}/CHANGELOG.md +210 -0
  3. crprotocol-2.3.0/HOSTING_POSITIONING.md +140 -0
  4. {crprotocol-2.0.0 → crprotocol-2.3.0}/PKG-INFO +3 -2
  5. crprotocol-2.3.0/RAILWAY_DEPLOYMENT_GUIDE.md +269 -0
  6. crprotocol-2.3.0/RAILWAY_VARIABLES.md +167 -0
  7. {crprotocol-2.0.0 → crprotocol-2.3.0}/README.md +2 -1
  8. crprotocol-2.3.0/SITE_NAVIGATION_AND_PUBLISHING.md +399 -0
  9. crprotocol-2.3.0/STRIPE_MONETISATION.md +440 -0
  10. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/__init__.py +82 -0
  11. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/_version.py +1 -1
  12. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/fabric.py +24 -1
  13. crprotocol-2.3.0/crp/core/context_enforcer.py +769 -0
  14. crprotocol-2.3.0/crp/core/context_source.py +725 -0
  15. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/dispatch_router.py +34 -0
  16. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/errors.py +4 -0
  17. crprotocol-2.3.0/crp/core/ledger_backends.py +186 -0
  18. crprotocol-2.3.0/crp/core/manifest_derive.py +243 -0
  19. crprotocol-2.3.0/crp/core/manifest_ledger.py +602 -0
  20. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/formatter.py +41 -1
  21. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/types.py +12 -1
  22. crprotocol-2.3.0/crp/integrations/__init__.py +42 -0
  23. crprotocol-2.3.0/crp/integrations/_common.py +66 -0
  24. crprotocol-2.3.0/crp/integrations/anthropic_hook.py +92 -0
  25. crprotocol-2.3.0/crp/integrations/langchain_hook.py +118 -0
  26. crprotocol-2.3.0/crp/integrations/openai_hook.py +171 -0
  27. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/openai.py +10 -4
  28. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/warm_store.py +34 -2
  29. {crprotocol-2.0.0 → crprotocol-2.3.0}/mkdocs.yml +6 -0
  30. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/index.md +30 -0
  31. crprotocol-2.3.0/site-docs/products/comply-autocyber.md +263 -0
  32. crprotocol-2.3.0/site-docs/products/comply.md +457 -0
  33. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/products/index.md +24 -19
  34. crprotocol-2.3.0/site-docs/products/scribe.md +223 -0
  35. crprotocol-2.3.0/site-docs/protocol/context-sources.md +391 -0
  36. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/why-crp.md +9 -1
  37. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/03_CONTEXT_ENVELOPE.md +216 -0
  38. crprotocol-2.3.0/tests/test_context_enforcer.py +641 -0
  39. crprotocol-2.3.0/tests/test_context_source.py +327 -0
  40. crprotocol-2.3.0/tests/test_gaps_2_3.py +478 -0
  41. crprotocol-2.3.0/tests/test_manifest_ledger.py +330 -0
  42. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_smoke.py +1 -1
  43. crprotocol-2.0.0/site-docs/products/comply.md +0 -217
  44. crprotocol-2.0.0/site-docs/products/scribe.md +0 -215
  45. {crprotocol-2.0.0 → crprotocol-2.3.0}/.dockerignore +0 -0
  46. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/CODEOWNERS +0 -0
  47. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/FUNDING.yml +0 -0
  48. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
  49. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
  50. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/ISSUE_TEMPLATE/spec-clarification.yml +0 -0
  51. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  52. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/workflows/ci.yml +0 -0
  53. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/workflows/link-check-config.json +0 -0
  54. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/workflows/link-check.yml +0 -0
  55. {crprotocol-2.0.0 → crprotocol-2.3.0}/.github/workflows/validate-schemas.yml +0 -0
  56. {crprotocol-2.0.0 → crprotocol-2.3.0}/.gitignore +0 -0
  57. {crprotocol-2.0.0 → crprotocol-2.3.0}/.pre-commit-config.yaml +0 -0
  58. {crprotocol-2.0.0 → crprotocol-2.3.0}/BENCHMARKS.md +0 -0
  59. {crprotocol-2.0.0 → crprotocol-2.3.0}/CODE_OF_CONDUCT.md +0 -0
  60. {crprotocol-2.0.0 → crprotocol-2.3.0}/CONTRIBUTING.md +0 -0
  61. {crprotocol-2.0.0 → crprotocol-2.3.0}/CRP_CAPABILITIES.md +0 -0
  62. {crprotocol-2.0.0 → crprotocol-2.3.0}/Dockerfile +0 -0
  63. {crprotocol-2.0.0 → crprotocol-2.3.0}/GOVERNANCE.md +0 -0
  64. {crprotocol-2.0.0 → crprotocol-2.3.0}/INTERNAL_DOCS.md +0 -0
  65. {crprotocol-2.0.0 → crprotocol-2.3.0}/LICENSE.md +0 -0
  66. {crprotocol-2.0.0 → crprotocol-2.3.0}/NOTICE +0 -0
  67. {crprotocol-2.0.0 → crprotocol-2.3.0}/SECURITY.md +0 -0
  68. {crprotocol-2.0.0 → crprotocol-2.3.0}/TRADEMARK.md +0 -0
  69. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/__main__.py +0 -0
  70. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/_typing.py +0 -0
  71. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/adapters.py +0 -0
  72. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/__init__.py +0 -0
  73. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/auto_ingest.py +0 -0
  74. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/cqs.py +0 -0
  75. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/cross_window.py +0 -0
  76. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/curator.py +0 -0
  77. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/feedback.py +0 -0
  78. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/hierarchical.py +0 -0
  79. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/meta_learning.py +0 -0
  80. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/parallel.py +0 -0
  81. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/review_cycle.py +0 -0
  82. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/scale_mode.py +0 -0
  83. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/advanced/source_grounding.py +0 -0
  84. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/__init__.py +0 -0
  85. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/community.py +0 -0
  86. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/gc.py +0 -0
  87. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/graph_walk.py +0 -0
  88. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/merge.py +0 -0
  89. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/pattern_query.py +0 -0
  90. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/pubsub.py +0 -0
  91. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/ckf/semantic.py +0 -0
  92. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/cli/__init__.py +0 -0
  93. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/cli/main.py +0 -0
  94. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/cli/sidecar.py +0 -0
  95. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/cli/startup.py +0 -0
  96. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/__init__.py +0 -0
  97. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/completion.py +0 -0
  98. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/degradation.py +0 -0
  99. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/document_map.py +0 -0
  100. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/flow.py +0 -0
  101. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/gap.py +0 -0
  102. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/manager.py +0 -0
  103. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/quality_monitor.py +0 -0
  104. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/stitch.py +0 -0
  105. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/trigger.py +0 -0
  106. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/continuation/voice.py +0 -0
  107. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/__init__.py +0 -0
  108. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/batch.py +0 -0
  109. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/circuit_breaker.py +0 -0
  110. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/config.py +0 -0
  111. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/context_tools.py +0 -0
  112. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/extraction_facade.py +0 -0
  113. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/facilitator.py +0 -0
  114. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/idempotency.py +0 -0
  115. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/orchestrator.py +0 -0
  116. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/relay_strategies.py +0 -0
  117. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/security_manager.py +0 -0
  118. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/session.py +0 -0
  119. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/task_intent.py +0 -0
  120. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/core/window.py +0 -0
  121. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/__init__.py +0 -0
  122. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/builder.py +0 -0
  123. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/decomposer.py +0 -0
  124. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/packer.py +0 -0
  125. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/reranker.py +0 -0
  126. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/envelope/scoring.py +0 -0
  127. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/__init__.py +0 -0
  128. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/complexity.py +0 -0
  129. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/contradiction.py +0 -0
  130. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/pipeline.py +0 -0
  131. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/quality_gate.py +0 -0
  132. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage1_regex.py +0 -0
  133. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage2_statistical.py +0 -0
  134. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage3_gliner.py +0 -0
  135. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage4_uie.py +0 -0
  136. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage5_discourse.py +0 -0
  137. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/stage6_llm.py +0 -0
  138. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/extraction/structured_output.py +0 -0
  139. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/license_guard.py +0 -0
  140. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/__init__.py +0 -0
  141. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/audit.py +0 -0
  142. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/events.py +0 -0
  143. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/metrics.py +0 -0
  144. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/quality.py +0 -0
  145. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/structured_logging.py +0 -0
  146. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/observability/telemetry.py +0 -0
  147. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/__init__.py +0 -0
  148. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/_embeddings.py +0 -0
  149. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/_types.py +0 -0
  150. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/attribution_scorer.py +0 -0
  151. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/claim_detector.py +0 -0
  152. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/contradiction_detector.py +0 -0
  153. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/distortion_detector.py +0 -0
  154. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/entailment_verifier.py +0 -0
  155. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/fabrication_detector.py +0 -0
  156. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/hallucination_scorer.py +0 -0
  157. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/omission_analyzer.py +0 -0
  158. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/provenance_chain.py +0 -0
  159. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/provenance/report_generator.py +0 -0
  160. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/__init__.py +0 -0
  161. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/anthropic.py +0 -0
  162. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/base.py +0 -0
  163. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/custom.py +0 -0
  164. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/diagnostic.py +0 -0
  165. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/llamacpp.py +0 -0
  166. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/manager.py +0 -0
  167. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/ollama.py +0 -0
  168. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/providers/tokenizers.py +0 -0
  169. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/py.typed +0 -0
  170. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/resources/__init__.py +0 -0
  171. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/resources/adaptive_allocator.py +0 -0
  172. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/resources/cost_model.py +0 -0
  173. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/resources/overhead_manager.py +0 -0
  174. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/resources/resource_manager.py +0 -0
  175. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/__init__.py +0 -0
  176. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/cost-estimate.json +0 -0
  177. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/crp-error.json +0 -0
  178. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/envelope-preview.json +0 -0
  179. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/persisted-state-header.json +0 -0
  180. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/quality-report.json +0 -0
  181. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/session-handle.json +0 -0
  182. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/session-status.json +0 -0
  183. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/stream-event.json +0 -0
  184. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/schemas/task-intent.json +0 -0
  185. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/__init__.py +0 -0
  186. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/audit_trail.py +0 -0
  187. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/binding.py +0 -0
  188. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/compliance.py +0 -0
  189. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/consent.py +0 -0
  190. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/embedding_defense.py +0 -0
  191. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/encryption.py +0 -0
  192. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/injection.py +0 -0
  193. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/integrity.py +0 -0
  194. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/privacy.py +0 -0
  195. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/quarantine.py +0 -0
  196. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/rbac.py +0 -0
  197. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/security/validation.py +0 -0
  198. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/__init__.py +0 -0
  199. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/cold_storage.py +0 -0
  200. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/compaction.py +0 -0
  201. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/critical_state.py +0 -0
  202. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/event_log.py +0 -0
  203. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/fact.py +0 -0
  204. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/serialization.py +0 -0
  205. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/session_cleanup.py +0 -0
  206. {crprotocol-2.0.0 → crprotocol-2.3.0}/crp/state/snapshot.py +0 -0
  207. {crprotocol-2.0.0 → crprotocol-2.3.0}/docs/OPERATIONS_RUNBOOK.md +0 -0
  208. {crprotocol-2.0.0 → crprotocol-2.3.0}/docs/WASA_INTEGRATION_TUTORIAL.md +0 -0
  209. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/async_usage.py +0 -0
  210. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/benchmark_continuation.py +0 -0
  211. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/choose_provider.py +0 -0
  212. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/comply_demo.py +0 -0
  213. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/demo_app/README.md +0 -0
  214. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/demo_app/demo.py +0 -0
  215. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/demo_app/demo_v1.py +0 -0
  216. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/extraction-pipeline.md +0 -0
  217. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/ingestion.py +0 -0
  218. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/local-model.md +0 -0
  219. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/multi-provider.md +0 -0
  220. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/multi_turn.py +0 -0
  221. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/quickstart.md +0 -0
  222. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/quickstart.py +0 -0
  223. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/scribe_demo.py +0 -0
  224. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/session-resumption.md +0 -0
  225. {crprotocol-2.0.0 → crprotocol-2.3.0}/examples/streaming.py +0 -0
  226. {crprotocol-2.0.0 → crprotocol-2.3.0}/media/logo.svg +0 -0
  227. {crprotocol-2.0.0 → crprotocol-2.3.0}/pyproject.toml +0 -0
  228. {crprotocol-2.0.0 → crprotocol-2.3.0}/rfcs/0000-template.md +0 -0
  229. {crprotocol-2.0.0 → crprotocol-2.3.0}/rfcs/0001-initial-release.md +0 -0
  230. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/cost-estimate.json +0 -0
  231. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/crp-error.json +0 -0
  232. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/envelope-preview.json +0 -0
  233. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/openapi.json +0 -0
  234. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/persisted-state-header.json +0 -0
  235. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/quality-report.json +0 -0
  236. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/session-handle.json +0 -0
  237. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/session-status.json +0 -0
  238. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/stream-event.json +0 -0
  239. {crprotocol-2.0.0 → crprotocol-2.3.0}/schemas/task-intent.json +0 -0
  240. {crprotocol-2.0.0 → crprotocol-2.3.0}/scripts/gen_changelog.py +0 -0
  241. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/CNAME +0 -0
  242. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/api/client.md +0 -0
  243. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/api/compliance.md +0 -0
  244. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/api/dispatch.md +0 -0
  245. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/api/index.md +0 -0
  246. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/api/schemas.md +0 -0
  247. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/benchmarks.md +0 -0
  248. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/eu-ai-act.md +0 -0
  249. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/gdpr.md +0 -0
  250. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/index.md +0 -0
  251. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/iso-42001.md +0 -0
  252. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/nist-ai-rmf.md +0 -0
  253. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/compliance/security.md +0 -0
  254. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/contributing.md +0 -0
  255. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/cli.md +0 -0
  256. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/index.md +0 -0
  257. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/installation.md +0 -0
  258. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/licensing.md +0 -0
  259. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/local-models.md +0 -0
  260. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/providers.md +0 -0
  261. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/getting-started/quickstart.md +0 -0
  262. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/demo-app.md +0 -0
  263. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/index.md +0 -0
  264. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/ingestion.md +0 -0
  265. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/multi-turn.md +0 -0
  266. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/session-persistence.md +0 -0
  267. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/sidecar.md +0 -0
  268. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/guides/streaming.md +0 -0
  269. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/ckf.md +0 -0
  270. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/continuation.md +0 -0
  271. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/core.md +0 -0
  272. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/dispatch-strategies.md +0 -0
  273. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/envelope.md +0 -0
  274. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/extraction.md +0 -0
  275. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/index.md +0 -0
  276. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/meta-learning.md +0 -0
  277. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/provenance.md +0 -0
  278. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/quality-tiers.md +0 -0
  279. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/protocol/research.md +0 -0
  280. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/terms-of-service.md +0 -0
  281. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/testing/benchmarks.md +0 -0
  282. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/testing/index.md +0 -0
  283. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/testing/reproduce.md +0 -0
  284. {crprotocol-2.0.0 → crprotocol-2.3.0}/site-docs/testing/running-tests.md +0 -0
  285. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/01_RESEARCH_FOUNDATIONS.md +0 -0
  286. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/02_CORE_PROTOCOL.md +0 -0
  287. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/04_TOKEN_GENERATION_PROTOCOL.md +0 -0
  288. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/05_SYSTEM_WIDE_INTEGRATION.md +0 -0
  289. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/06_IMPLEMENTATION_PLAN.md +0 -0
  290. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/07_SECURITY.md +0 -0
  291. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/08_MONETIZATION.md +0 -0
  292. {crprotocol-2.0.0 → crprotocol-2.3.0}/specification/09_DEPLOYMENT.md +0 -0
  293. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/conftest.py +0 -0
  294. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/killer_test/crp_killer_report.json +0 -0
  295. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/killer_test/crp_killer_report.txt +0 -0
  296. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/killer_test/crp_killer_test.py +0 -0
  297. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/killer_test/debug_gap.py +0 -0
  298. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/killer_test/debug_gap2.py +0 -0
  299. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_adaptive_allocator.py +0 -0
  300. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_adversarial_provenance.py +0 -0
  301. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_agentic.py +0 -0
  302. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_benchmarks.py +0 -0
  303. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_ckf_gate.py +0 -0
  304. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_compliance_security.py +0 -0
  305. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_compliance_wiring.py +0 -0
  306. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_decision_provenance.py +0 -0
  307. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_decision_provenance_engine.py +0 -0
  308. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_entailment_risk.py +0 -0
  309. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_fidelity_verification.py +0 -0
  310. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_gap_fixes_live.py +0 -0
  311. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_integration.py +0 -0
  312. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_ip_protection.py +0 -0
  313. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_live_comprehensive.py +0 -0
  314. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_live_full_capture.py +0 -0
  315. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_live_long_generation.py +0 -0
  316. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_live_verification.py +0 -0
  317. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase1.py +0 -0
  318. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase2.py +0 -0
  319. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase3.py +0 -0
  320. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase4.py +0 -0
  321. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase5.py +0 -0
  322. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase6.py +0 -0
  323. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase7.py +0 -0
  324. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase8.py +0 -0
  325. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_phase9.py +0 -0
  326. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_production_hardening.py +0 -0
  327. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_relay_strategies.py +0 -0
  328. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_resource_manager.py +0 -0
  329. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_security_modules.py +0 -0
  330. {crprotocol-2.0.0 → crprotocol-2.3.0}/tests/test_tool_relay.py +0 -0
@@ -0,0 +1,32 @@
1
+ # Copyright © 2025 Constantinos Vidiniotis. All rights reserved.
2
+ # Licensed under Elastic License 2.0 — see LICENSE.md for details.
3
+
4
+ name: Deploy Docs
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ paths:
10
+ - 'site-docs/**'
11
+ - 'mkdocs.yml'
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: write
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.13'
27
+
28
+ - name: Install docs dependencies
29
+ run: pip install mkdocs-material pymdownx-extensions
30
+
31
+ - name: Build and deploy
32
+ run: mkdocs gh-deploy --force --strict
@@ -12,6 +12,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
12
12
  ## [Unreleased]
13
13
 
14
14
  ### Added
15
+ - (none yet)
16
+
17
+ ## [2.2.0] - 2026-04-23
18
+
19
+ ### Added — Miscellaneous (from 2.1 Unreleased pool)
15
20
  - Trademark notice: "Context Relay Protocol" (application pending, Class 9)
16
21
  - Contact emails: info@crprotocol.io (general), contact@crprotocol.io (enterprise)
17
22
  - GitHub Discussions enabled
@@ -27,6 +32,133 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
27
32
  - `TypeAlias` annotations and extended type aliases in `crp/_typing.py`
28
33
  - All error types and config classes exported from `crp.__init__`
29
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
+ configured — fully 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
+
30
162
  ### Changed
31
163
  - `FactGraph` edge lookups now O(1) via indexed dicts (was O(n) list scan)
32
164
  - Provider error responses sanitized — no internal details leak to clients
@@ -37,6 +169,84 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
37
169
  ### Fixed
38
170
  - Unknown config kwargs now produce a warning log instead of silent ignore
39
171
 
172
+ ## [2.1.0] - 2026-04-23
173
+
174
+ ### Added — Context-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
+
40
250
  ## [2.0.0] - 2026-04-06
41
251
 
42
252
  ### Added
@@ -0,0 +1,140 @@
1
+ # CRP Hosting & Positioning Strategy
2
+
3
+ ## Positioning: "Local-First, Cloud-Ready"
4
+
5
+ CRP products are available as **hosted SaaS applications** and as **locally deployable software**. The SaaS offering provides instant onboarding via product subdomains, while the local deployment option targets enterprises and regulated environments that require on-premises control — this is AutoCyber AI's go-to for enterprise deployments.
6
+
7
+ ### Deployment Models
8
+
9
+ | Model | Description | Target |
10
+ |---|---|---|
11
+ | **SaaS (Hosted)** | Sign up at product subdomains, Stripe billing | Startups, SMBs, developers |
12
+ | **Local (Downloadable)** | Self-hosted on-premises or private cloud | Enterprises, regulated industries, government |
13
+
14
+ The local deployment uses the same codebase — packaged as a downloadable application (future: Tauri desktop app) that runs entirely on the customer's infrastructure. Data never leaves their environment.
15
+
16
+ ### Why SaaS, Not Packages
17
+
18
+ | Consideration | Package (pip install) | SaaS (hosted) |
19
+ |---|---|---|
20
+ | **Revenue** | No billing control | Stripe subscription billing |
21
+ | **Updates** | User must upgrade manually | Instant, zero-downtime deploys |
22
+ | **Security patches** | User may lag behind | Applied immediately |
23
+ | **Compliance audit trail** | Stored locally (risky) | HMAC-chained, server-side |
24
+ | **PII scanning** | User's responsibility | CRP-managed, always current |
25
+ | **Onboarding** | pip install + config | Sign up → start |
26
+ | **Support** | Debug user's environment | Controlled environment |
27
+ | **Telemetry** | Opt-in only | Built-in usage metrics |
28
+
29
+ ### Product URLs
30
+
31
+ | Product | URL | Status |
32
+ |---|---|---|
33
+ | CRP Scribe | `https://scribe.crprotocol.io` | Planned |
34
+ | CRP Comply | `https://comply.crprotocol.io` | Planned |
35
+ | Marketing site | `https://crprotocol.io` | **LIVE** |
36
+ | Documentation | `https://crprotocol.io/docs/` | **LIVE** |
37
+
38
+ ---
39
+
40
+ ## Hosting: Railway
41
+
42
+ ### Why Railway
43
+
44
+ | Factor | Railway | Vercel | AWS/GCP |
45
+ |---|---|---|---|
46
+ | **FastAPI support** | Native (Docker) | Serverless only | Manual setup |
47
+ | **WebSocket support** | ✓ | Limited | ✓ but complex |
48
+ | **Background workers** | ✓ | ✗ | ✓ |
49
+ | **Persistent storage** | PostgreSQL, Redis | External only | Managed services |
50
+ | **Custom domains** | ✓ (free SSL) | ✓ | Route53 + ACM |
51
+ | **Pricing model** | Usage-based ($5/mo hobby) | Per-seat | Pay-as-you-go |
52
+ | **Deploy from GitHub** | ✓ (auto-deploy) | ✓ | CodePipeline |
53
+ | **Startup friendly** | ✓ | ✓ | ✗ (complex) |
54
+
55
+ ### Railway Service Architecture
56
+
57
+ ```
58
+ railway.app
59
+ ├── crp-scribe-api (FastAPI, port 8500)
60
+ │ ├── Dockerfile
61
+ │ ├── PostgreSQL (scribe-db)
62
+ │ └── Redis (scribe-cache)
63
+
64
+ ├── crp-scribe-web (Vite static build)
65
+ │ └── served via nginx or Railway static hosting
66
+
67
+ ├── crp-comply-api (FastAPI, port 8400)
68
+ │ ├── Dockerfile
69
+ │ ├── PostgreSQL (comply-db)
70
+ │ └── Redis (comply-cache)
71
+
72
+ └── crp-comply-web (Vite static build)
73
+ └── served via nginx or Railway static hosting
74
+ ```
75
+
76
+ ### Deployment Tiers
77
+
78
+ | Environment | Railway Plan | Cost | Purpose |
79
+ |---|---|---|---|
80
+ | Development | Hobby ($5/mo) | ~$5-10/mo | Dev/test |
81
+ | Staging | Pro ($20/mo) | ~$20-40/mo | Pre-production |
82
+ | Production | Pro ($20/mo) | ~$50-200/mo | Live customers |
83
+
84
+ ---
85
+
86
+ ## Security: "The Security Is In The Protocol"
87
+
88
+ CRP products don't need to run in a locked-down VPC because security is embedded at the protocol layer:
89
+
90
+ | CRP Security Module | What It Does | Where It Runs |
91
+ |---|---|---|
92
+ | `PIIScanner` | 7-category PII detection | In every proxy request |
93
+ | `InjectionDetector` | 21 patterns + ML scoring | In every proxy request |
94
+ | `ComplianceAuditTrail` | HMAC-chained audit records | Server-side, append-only |
95
+ | `ProcessingRecordKeeper` | GDPR Art. 30 records | Server-side |
96
+ | `ErasureManager` | GDPR Art. 17 right to erasure | Server-side |
97
+ | `DataClassification` | PUBLIC → CRITICAL classification | Per-request |
98
+ | `RiskClassifier` | EU AI Act Art. 6 risk levels | Per-request |
99
+ | `ConsentManager` | Purpose-based consent tracking | Server-side |
100
+ | `ContextValidator` | Schema + semantic validation | In every request |
101
+ | `EncryptionManager` | AES-256-GCM field encryption | At rest + in transit |
102
+ | `AccessControl` | RBAC + ABAC policies | Per-request |
103
+ | `EnvelopeProtocol` | Signed, versioned message envelopes | Every message |
104
+
105
+ This means Railway's standard infrastructure (HTTPS, network isolation, managed PostgreSQL with encryption at rest) is **sufficient** — the CRP layer handles application-level security.
106
+
107
+ ---
108
+
109
+ ## Positioning Matrix
110
+
111
+ ### For Investors
112
+
113
+ > "CRP is a protocol-first company. Our SaaS products (Scribe, Comply) are hosted applications with Stripe subscription billing. Security is built into the protocol itself — we don't need expensive cloud infrastructure to be enterprise-grade."
114
+
115
+ ### For Enterprise Customers
116
+
117
+ > "CRP Comply runs as a managed service or a locally deployed application — your choice. In SaaS mode, your AI traffic flows through our compliance proxy with PII scanning and audit trails. In local mode, the same software runs entirely on your infrastructure — data never leaves your environment."
118
+
119
+ ### For Regulators
120
+
121
+ > "All processing records, audit trails, and consent records are maintained with HMAC-chain verification. GDPR Article 30 records and right-to-erasure requests are handled through documented API endpoints with full audit history. For regulated environments, CRP products can be deployed on-premises."
122
+
123
+ ### For Developers
124
+
125
+ > "Sign up at comply.crprotocol.io or scribe.crprotocol.io. Get an API key. Point your OpenAI calls at our proxy endpoint. Done. The CRP protocol library (`pip install crprotocol`) is available separately for developers who want to build their own CRP-compatible tools."
126
+
127
+ ---
128
+
129
+ ## Key Distinction
130
+
131
+ | | CRP Protocol (`crprotocol`) | CRP Products (SaaS) | CRP Products (Local) |
132
+ |---|---|---|---|
133
+ | **Distribution** | PyPI (`pip install crprotocol`) | Hosted SaaS | Downloadable app / Docker |
134
+ | **License** | ELv2 | ELv2 | ELv2 (commercial license) |
135
+ | **Pricing** | Free (open-source core) | Freemium + Stripe billing | Enterprise license |
136
+ | **Target** | Developers building CRP tools | Startups / SMBs | Enterprises / regulated |
137
+ | **Auth** | N/A | Clerk | Clerk or customer SSO |
138
+ | **Billing** | N/A | Stripe | Invoice / PO |
139
+ | **Data residency** | N/A | Railway (AU/US/EU) | Customer's infrastructure |
140
+ | **URL** | pypi.org/project/crprotocol | scribe/comply.crprotocol.io | On-premises |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crprotocol
3
- Version: 2.0.0
3
+ Version: 2.3.0
4
4
  Summary: Context Relay Protocol — unbounded context, unbounded generation, amplified reasoning for LLMs
5
5
  Project-URL: Homepage, https://crprotocol.io
6
6
  Project-URL: Documentation, https://crprotocol.io
@@ -73,7 +73,7 @@ Description-Content-Type: text/markdown
73
73
  <p align="center">
74
74
  <a href="LICENSE.md"><img src="https://img.shields.io/badge/Spec-CC_BY--SA_4.0-blue.svg" alt="Spec: CC BY-SA 4.0"></a>
75
75
  <a href="LICENSE.md"><img src="https://img.shields.io/badge/Code-ELv2-orange.svg" alt="Code: Elastic License 2.0"></a>
76
- <img src="https://img.shields.io/badge/Spec_Version-2.0.0-brightgreen.svg" alt="Spec Version: 2.0.0">
76
+ <img src="https://img.shields.io/badge/Spec_Version-2.2.0-brightgreen.svg" alt="Spec Version: 2.2.0">
77
77
  <img src="https://img.shields.io/badge/RFC_2119-Conformant-orange.svg" alt="RFC 2119">
78
78
  <img src="https://img.shields.io/badge/Language_Neutral-JSON_Schema-yellow.svg" alt="Language Neutral">
79
79
  <img src="https://img.shields.io/badge/Status-Specification_Complete-green.svg" alt="Status: Specification Complete">
@@ -190,6 +190,7 @@ For every LLM call you already make, CRP:
190
190
  - **Works with any LLM provider** — auto-detected, 3 fields to configure. Built-in adapters for OpenAI, Anthropic, Ollama, and llama.cpp — plus `CustomProvider` to wrap any LLM in 3 lines
191
191
  - **Structured knowledge extraction** — 6-stage graduated pipeline (regex → statistical NLP → GLiNER NER → UIE relations → RST discourse → LLM-assisted relational). Not just text chunking
192
192
  - **Contextual Knowledge Fabric (CKF)** — graph-structured knowledge with 4-mode retrieval (graph walk + pattern query + semantic fallback + community summaries), event-sourced history, and cross-session persistence
193
+ - **Two-sided provenance** — CRP classifies every model *output* as `CONTEXT_GROUNDED | PARAMETRIC | MIXED | UNCERTAIN` **and** records every *input* fact's upstream source (RAG chunk, vector DB, MCP tool, function call, web search, user turn, file upload, agent memory, or parametric). `ContextManifest` lets you sign a declaration of intended sources; anything observed outside the declaration is flagged as `CONTEXT_ATTESTATION_MISMATCH` in the audit log. Foundational for **ISO/IEC 42001 §4**, **EU AI Act Art. 10**, and **GDPR Art. 30**
193
194
  - **Unbounded input** — automatically ingests documents larger than any model's context window through structure-aware chunking with protected spans
194
195
  - **Unbounded output** — automatic continuation with voice profile preservation, document maps, degradation-triggered re-grounding, and content-type-aware stitching
195
196
  - **Honest quality guarantees** — a degradation model, not magic claims. Quality tiers S through D, reported with every dispatch. Extraction recall percentages published per stage