crprotocol 2.3.1__tar.gz → 4.1.1__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 (1138) hide show
  1. crprotocol-4.1.1/.github/PULL_REQUEST_TEMPLATE.md +34 -0
  2. crprotocol-4.1.1/.github/workflows/docs.yml +41 -0
  3. crprotocol-4.1.1/.gitignore +81 -0
  4. crprotocol-4.1.1/.kimi/skills/crp-auth-expert/SKILL.md +450 -0
  5. crprotocol-4.1.1/.kimi/skills/crp-comply-expert/SKILL.md +134 -0
  6. crprotocol-4.1.1/.kimi/skills/crp-gateway-expert/SKILL.md +130 -0
  7. crprotocol-4.1.1/.kimi/skills/crp-v4-expert/SKILL.md +223 -0
  8. crprotocol-4.1.1/.kimi/skills/crp-v4-specs/SKILL.md +152 -0
  9. crprotocol-4.1.1/.kimi/skills/programmatic-video-production/SKILL.md +87 -0
  10. crprotocol-4.1.1/.kimi/skills/programmatic-video-production/references/tool-comparison.md +20 -0
  11. crprotocol-4.1.1/AGENTS.md +940 -0
  12. crprotocol-4.1.1/AI Agent adoption/CRP-AGENT-ADOPTION-STRATEGY.md +143 -0
  13. crprotocol-4.1.1/AI Agent adoption/CRP-MCP-SERVER-SPECIFICATION.md +543 -0
  14. crprotocol-4.1.1/AI Agent adoption/CRP-SKILL.md +203 -0
  15. crprotocol-4.1.1/AI Agent adoption/llms-full.txt +203 -0
  16. crprotocol-4.1.1/AI Agent adoption/llms.txt +37 -0
  17. crprotocol-4.1.1/CHANGELOG.md +727 -0
  18. crprotocol-4.1.1/CRP Comply LLM connection methods issues prompt.txt +208 -0
  19. crprotocol-4.1.1/CRP protocol ecosystem figure.png +0 -0
  20. crprotocol-4.1.1/CRP-COMPLY-AI-SAFETY-PLAN.md +106 -0
  21. crprotocol-4.1.1/CRP-COMPLY-UPGRADE-REPORT-v2.md +159 -0
  22. crprotocol-4.1.1/CRP-COMPLY-UPGRADE-REPORT.md +320 -0
  23. crprotocol-4.1.1/CRP-SHARED-HERO-POSITIONING.md +167 -0
  24. crprotocol-4.1.1/CRP-v4-SPRINT-REPORT.md +147 -0
  25. crprotocol-4.1.1/CRP-v4-VISUAL-AUDIT-RATING.md +165 -0
  26. crprotocol-4.1.1/CRP_Comply_github_app_details.txt +45 -0
  27. crprotocol-4.1.1/CRP_protocol_FULL_transparent_white.png +0 -0
  28. crprotocol-4.1.1/CRPv4_Implementation_Rounds.md +1619 -0
  29. crprotocol-4.1.1/CRPv4_realised_deliverables.md +359 -0
  30. crprotocol-4.1.1/D1_CRP_Protocol_Marketing_Update.docx +0 -0
  31. crprotocol-4.1.1/PKG-INFO +1404 -0
  32. crprotocol-4.1.1/README.md +1331 -0
  33. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/CRP-BUILD-PROMPT.md +441 -0
  34. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/CRP-CODER-BRIEF.md +246 -0
  35. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/CRP-GATEWAY-BLUEPRINT.md +349 -0
  36. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/CRP-MASTER-INDEX.md +90 -0
  37. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/CRP-SDK-REFERENCE.md +353 -0
  38. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-FEASIBILITY.md +132 -0
  39. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-IANA-RESPONSE-STRATEGY.md +246 -0
  40. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-IETF-EMAIL-TEMPLATES.md +461 -0
  41. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-PUBLIC-CHECKLIST.md +109 -0
  42. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SITE-STRATEGY.md +549 -0
  43. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-001-core-protocol.md +246 -0
  44. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-002-headers.md +1775 -0
  45. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-003-envelope.md +678 -0
  46. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-004-continuation.md +792 -0
  47. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-005-dpe.md +1070 -0
  48. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-006-safety-policy.md +466 -0
  49. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-007-session-token.md +400 -0
  50. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-008-dispatch.md +463 -0
  51. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-009-ckf.md +332 -0
  52. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-010-regulatory-mapping.md +153 -0
  53. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-011-audit-trail.md +276 -0
  54. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-012-multi-agent-safety.md +396 -0
  55. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-013-github-action.md +374 -0
  56. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-014-conformance.md +600 -0
  57. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-015-security-privacy.md +396 -0
  58. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-016-gateway-service.md +735 -0
  59. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  60. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-018-air.md +423 -0
  61. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-019-cognitive-quality.md +225 -0
  62. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-020-cognitive-load-distribution.md +279 -0
  63. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-021-reasoning-orchestration.md +294 -0
  64. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-022-execution-fabric.md +296 -0
  65. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-023-amplification-boundary.md +276 -0
  66. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-024-coverage-differential-retrieval.md +533 -0
  67. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-025-graph-retrieval.md +266 -0
  68. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-026-semantic-quality-benchmark.md +239 -0
  69. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-027-retrieval-integrity.md +322 -0
  70. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-028-conversational-context.md +358 -0
  71. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-029-ephemeral-tool-context.md +329 -0
  72. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-030-cognitive-state-relay.md +361 -0
  73. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-031-semantic-task-layer.md +340 -0
  74. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-032-developer-experience.md +302 -0
  75. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-033-safety-control-plane.md +471 -0
  76. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-034-safety-coverage.md +277 -0
  77. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-035-context-lifecycle.md +235 -0
  78. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-036-scan-remediation.md +245 -0
  79. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-037-unified-config.md +240 -0
  80. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-038-storage-backends.md +275 -0
  81. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-039-semantic-code-ingestion.md +265 -0
  82. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-040-crp-comply.md +267 -0
  83. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-041-adoption-ecosystem.md +208 -0
  84. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SPEC-HOSTING-CONTROL.md +188 -0
  85. crprotocol-4.1.1/SPECS-2.06.2026/CRP-COMPLETE-PACKAGE/crp-coder-package/specs/CRP-SUBMISSION-GUIDE.md +467 -0
  86. crprotocol-4.1.1/SPECS-2.06.2026/CRP-MASTER-INDEX.md +90 -0
  87. crprotocol-4.1.1/SPECS-2.06.2026/CRP-SPEC-040-crp-comply.md +267 -0
  88. crprotocol-4.1.1/SPECS-2.06.2026/CRP-SPEC-041-adoption-ecosystem.md +208 -0
  89. crprotocol-4.1.1/SPECS_27-05-2027/CRP-FEASIBILITY.md +132 -0
  90. crprotocol-4.1.1/SPECS_27-05-2027/CRP-IETF-EMAIL-TEMPLATES.md +500 -0
  91. crprotocol-4.1.1/SPECS_27-05-2027/CRP-PUBLIC-CHECKLIST.md +109 -0
  92. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SITE-STRATEGY.md +549 -0
  93. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-001-core-protocol.md +246 -0
  94. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-002-headers.md +1775 -0
  95. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-003-envelope.md +678 -0
  96. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-004-continuation.md +792 -0
  97. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-005-dpe.md +1070 -0
  98. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-006-safety-policy.md +466 -0
  99. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-007-session-token.md +400 -0
  100. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-008-dispatch.md +463 -0
  101. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-009-ckf.md +332 -0
  102. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-010-regulatory-mapping.md +153 -0
  103. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-011-audit-trail.md +276 -0
  104. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-012-multi-agent-safety.md +396 -0
  105. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-013-github-action.md +374 -0
  106. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-014-conformance.md +600 -0
  107. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-015-security-privacy.md +396 -0
  108. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-016-gateway-service.md +735 -0
  109. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  110. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SPEC-HOSTING-CONTROL.md +188 -0
  111. crprotocol-4.1.1/SPECS_27-05-2027/CRP-SUBMISSION-GUIDE.md +467 -0
  112. crprotocol-4.1.1/SPECS_27-05-2027/CRP-V3-IMPLEMENTATION-PLAN.md +295 -0
  113. crprotocol-4.1.1/SPECS_27-05-2027/Overview of all documents.docx +0 -0
  114. crprotocol-4.1.1/SPECS_27-05-2027/SUBMISSION-GUIDE.md +577 -0
  115. crprotocol-4.1.1/SPECS_27-05-2027/TRACKING_OF_PROGRESS.MD +447 -0
  116. crprotocol-4.1.1/SPECS_27-05-2027/crp-headers-spec.html +1533 -0
  117. crprotocol-4.1.1/SPECS_27-05-2027/crp-product-ecosystem.html +1058 -0
  118. crprotocol-4.1.1/SPECS_27-05-2027/crp-v3-complete-spec.html +1047 -0
  119. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/Automated prompt-response review, questions, actions and insights.txt +246 -0
  120. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-AUTH-MIGRATION-SPRINT-SUMMARY.md +94 -0
  121. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-AUTH-POSTGRESQL-MIGRATION-PLAN.md +968 -0
  122. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-AUTH-USER-MANAGEMENT-SOLUTION.md +295 -0
  123. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-BUILD-PROMPT.md +441 -0
  124. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-CODER-BRIEF.md +246 -0
  125. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-COMPLY-BUILDER-PROMPT.md +146 -0
  126. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-COMPLY-UPGRADE-HANDOFF.md +240 -0
  127. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-ECOSYSTEM-BOUNDARIES.md +155 -0
  128. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-GATEWAY-BLUEPRINT.md +349 -0
  129. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-GATEWAY-PRODUCT-OVERVIEW.md +253 -0
  130. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-GITHUB-APP-GUIDE.md +240 -0
  131. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-GITHUB-CONNECTIVITY-SOLUTION.md +313 -0
  132. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-MARKET-STRATEGY.md +225 -0
  133. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-MASTER-INDEX.md +157 -0
  134. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-RAILWAY-SETUP-GUIDE.md +250 -0
  135. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-SDK-REFERENCE.md +353 -0
  136. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-STRIPE-SETUP-GUIDE.md +63 -0
  137. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-V4-UPGRADE-PROMPT.md +225 -0
  138. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/CRP-v4-PHASED-IMPLEMENTATION-REPORT.md +339 -0
  139. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/adversarially-robust-safety.md +88 -0
  140. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/mfa_plan.md +73 -0
  141. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-FEASIBILITY.md +132 -0
  142. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-IANA-RESPONSE-STRATEGY.md +246 -0
  143. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-IETF-EMAIL-TEMPLATES.md +461 -0
  144. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-PUBLIC-CHECKLIST.md +109 -0
  145. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SITE-STRATEGY.md +549 -0
  146. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-001-core-protocol.md +246 -0
  147. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-002-headers.md +1775 -0
  148. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-003-envelope.md +678 -0
  149. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-004-continuation.md +792 -0
  150. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-005-dpe.md +1070 -0
  151. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-006-safety-policy.md +466 -0
  152. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-007-session-token.md +400 -0
  153. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-008-dispatch.md +463 -0
  154. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-009-ckf.md +332 -0
  155. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-010-regulatory-mapping.md +153 -0
  156. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-011-audit-trail.md +276 -0
  157. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-012-multi-agent-safety.md +396 -0
  158. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-013-github-action.md +374 -0
  159. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-014-conformance.md +600 -0
  160. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-015-security-privacy.md +396 -0
  161. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-016-gateway-service.md +735 -0
  162. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  163. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-018-air.md +423 -0
  164. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-019-cognitive-quality.md +225 -0
  165. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-020-cognitive-load-distribution.md +279 -0
  166. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-021-reasoning-orchestration.md +294 -0
  167. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-022-execution-fabric.md +296 -0
  168. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-023-amplification-boundary.md +276 -0
  169. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-024-coverage-differential-retrieval.md +533 -0
  170. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-025-graph-retrieval.md +266 -0
  171. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-026-semantic-quality-benchmark.md +239 -0
  172. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-027-retrieval-integrity.md +322 -0
  173. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-028-conversational-context.md +358 -0
  174. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-029-ephemeral-tool-context.md +329 -0
  175. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-030-cognitive-state-relay.md +361 -0
  176. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-031-semantic-task-layer.md +340 -0
  177. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-032-developer-experience.md +302 -0
  178. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-033-safety-control-plane.md +471 -0
  179. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-034-safety-coverage.md +277 -0
  180. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-035-context-lifecycle.md +235 -0
  181. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-036-scan-remediation.md +245 -0
  182. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-037-unified-config.md +240 -0
  183. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-038-storage-backends.md +275 -0
  184. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-039-semantic-code-ingestion.md +265 -0
  185. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-040-crp-comply.md +311 -0
  186. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-041-adoption-ecosystem.md +208 -0
  187. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-042-comply-upgrade-integration.md +276 -0
  188. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-043-gateway-runtime-product.md +200 -0
  189. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-044-authoritative-domain-agent.md +199 -0
  190. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-045-knowledge-learning.md +213 -0
  191. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-046-user-defined-cognition.md +197 -0
  192. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-047-monetisation-payments.md +532 -0
  193. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-048-comply-lowcode-github.md +262 -0
  194. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-HOSTING-CONTROL.md +188 -0
  195. crprotocol-4.1.1/SPECS_5_06_2026_CRP_v4/specs/CRP-SUBMISSION-GUIDE.md +467 -0
  196. crprotocol-4.1.1/android-chrome-192x192.png +0 -0
  197. crprotocol-4.1.1/android-chrome-512x512.png +0 -0
  198. crprotocol-4.1.1/apple-touch-icon.png +0 -0
  199. crprotocol-4.1.1/crp/__init__.py +221 -0
  200. crprotocol-4.1.1/crp/_version.py +5 -0
  201. crprotocol-4.1.1/crp/activation/__init__.py +73 -0
  202. crprotocol-4.1.1/crp/activation/mode.py +260 -0
  203. crprotocol-4.1.1/crp/activation/onboarding.py +130 -0
  204. crprotocol-4.1.1/crp/activation/policy_adjust.py +89 -0
  205. crprotocol-4.1.1/crp/activation/stages.py +90 -0
  206. crprotocol-4.1.1/crp/advanced/cqs.py +298 -0
  207. crprotocol-4.1.1/crp/advanced/cross_window.py +622 -0
  208. crprotocol-4.1.1/crp/advanced/curator.py +277 -0
  209. crprotocol-4.1.1/crp/advanced/feedback.py +149 -0
  210. crprotocol-4.1.1/crp/advanced/meta_learning.py +560 -0
  211. crprotocol-4.1.1/crp/advanced/source_grounding.py +277 -0
  212. crprotocol-4.1.1/crp/agent/__init__.py +88 -0
  213. crprotocol-4.1.1/crp/agent/budget.py +249 -0
  214. crprotocol-4.1.1/crp/agent/chain.py +230 -0
  215. crprotocol-4.1.1/crp/agent/oversight.py +101 -0
  216. crprotocol-4.1.1/crp/agent/propagation.py +146 -0
  217. crprotocol-4.1.1/crp/ckf/__init__.py +48 -0
  218. crprotocol-4.1.1/crp/ckf/cdgr.py +375 -0
  219. crprotocol-4.1.1/crp/ckf/community.py +378 -0
  220. crprotocol-4.1.1/crp/ckf/fabric.py +565 -0
  221. crprotocol-4.1.1/crp/ckf/gc.py +177 -0
  222. crprotocol-4.1.1/crp/ckf/graph_edges.py +274 -0
  223. crprotocol-4.1.1/crp/ckf/semantic.py +214 -0
  224. crprotocol-4.1.1/crp/cli/main.py +469 -0
  225. crprotocol-4.1.1/crp/cli/sidecar.py +943 -0
  226. crprotocol-4.1.1/crp/cli/startup.py +274 -0
  227. crprotocol-4.1.1/crp/comply/__init__.py +13 -0
  228. crprotocol-4.1.1/crp/comply/billing/__init__.py +41 -0
  229. crprotocol-4.1.1/crp/comply/billing/checkout.py +159 -0
  230. crprotocol-4.1.1/crp/comply/billing/constants.py +117 -0
  231. crprotocol-4.1.1/crp/comply/billing/entitlements.py +110 -0
  232. crprotocol-4.1.1/crp/comply/billing/metering.py +114 -0
  233. crprotocol-4.1.1/crp/comply/billing/reconciliation.py +117 -0
  234. crprotocol-4.1.1/crp/comply/billing/webhook.py +262 -0
  235. crprotocol-4.1.1/crp/comply/checkpoint_inbox.py +128 -0
  236. crprotocol-4.1.1/crp/comply/gateway_client.py +136 -0
  237. crprotocol-4.1.1/crp/comply/gateway_proxy.py +152 -0
  238. crprotocol-4.1.1/crp/comply/github_routes.py +191 -0
  239. crprotocol-4.1.1/crp/comply/header_mapping.py +99 -0
  240. crprotocol-4.1.1/crp/comply/no_code.py +197 -0
  241. crprotocol-4.1.1/crp/comply/quota_gate.py +69 -0
  242. crprotocol-4.1.1/crp/comply/signup.py +106 -0
  243. crprotocol-4.1.1/crp/config.py +273 -0
  244. crprotocol-4.1.1/crp/config_schema.py +211 -0
  245. crprotocol-4.1.1/crp/continuation/__init__.py +130 -0
  246. crprotocol-4.1.1/crp/continuation/degradation.py +159 -0
  247. crprotocol-4.1.1/crp/continuation/document_map.py +169 -0
  248. crprotocol-4.1.1/crp/continuation/flow.py +253 -0
  249. crprotocol-4.1.1/crp/continuation/gap.py +420 -0
  250. crprotocol-4.1.1/crp/continuation/manager.py +576 -0
  251. crprotocol-4.1.1/crp/continuation/quality_monitor.py +180 -0
  252. crprotocol-4.1.1/crp/continuation/voice.py +166 -0
  253. crprotocol-4.1.1/crp/core/__init__.py +84 -0
  254. crprotocol-4.1.1/crp/core/config.py +397 -0
  255. crprotocol-4.1.1/crp/core/context_enforcer.py +783 -0
  256. crprotocol-4.1.1/crp/core/context_source.py +736 -0
  257. crprotocol-4.1.1/crp/core/context_tools.py +542 -0
  258. crprotocol-4.1.1/crp/core/dispatch_router.py +4023 -0
  259. crprotocol-4.1.1/crp/core/errors.py +161 -0
  260. crprotocol-4.1.1/crp/core/facilitator.py +716 -0
  261. crprotocol-4.1.1/crp/core/idempotency.py +220 -0
  262. crprotocol-4.1.1/crp/core/ledger_backends.py +201 -0
  263. crprotocol-4.1.1/crp/core/manifest_ledger.py +639 -0
  264. crprotocol-4.1.1/crp/core/orchestrator.py +1514 -0
  265. crprotocol-4.1.1/crp/core/session.py +227 -0
  266. crprotocol-4.1.1/crp/core/task_intent.py +55 -0
  267. crprotocol-4.1.1/crp/core/window.py +641 -0
  268. crprotocol-4.1.1/crp/envelope/__init__.py +43 -0
  269. crprotocol-4.1.1/crp/envelope/builder.py +323 -0
  270. crprotocol-4.1.1/crp/envelope/cdr.py +311 -0
  271. crprotocol-4.1.1/crp/envelope/formatter.py +209 -0
  272. crprotocol-4.1.1/crp/envelope/reranker.py +226 -0
  273. crprotocol-4.1.1/crp/envelope/retrieval_integrity.py +216 -0
  274. crprotocol-4.1.1/crp/envelope/scoring.py +319 -0
  275. crprotocol-4.1.1/crp/extraction/pipeline.py +394 -0
  276. crprotocol-4.1.1/crp/extraction/stage1_regex.py +174 -0
  277. crprotocol-4.1.1/crp/extraction/stage3_gliner.py +211 -0
  278. crprotocol-4.1.1/crp/extraction/stage4_uie.py +185 -0
  279. crprotocol-4.1.1/crp/extraction/stage6_llm.py +184 -0
  280. crprotocol-4.1.1/crp/extraction/structured_output.py +221 -0
  281. crprotocol-4.1.1/crp/extraction/types.py +447 -0
  282. crprotocol-4.1.1/crp/gateway/__init__.py +29 -0
  283. crprotocol-4.1.1/crp/gateway/api.py +1115 -0
  284. crprotocol-4.1.1/crp/gateway/key_vault.py +211 -0
  285. crprotocol-4.1.1/crp/gateway/router.py +332 -0
  286. crprotocol-4.1.1/crp/headers/__init__.py +54 -0
  287. crprotocol-4.1.1/crp/headers/conditional.py +164 -0
  288. crprotocol-4.1.1/crp/headers/emit.py +270 -0
  289. crprotocol-4.1.1/crp/headers/halt.py +82 -0
  290. crprotocol-4.1.1/crp/headers/middleware.py +102 -0
  291. crprotocol-4.1.1/crp/headers/names.py +141 -0
  292. crprotocol-4.1.1/crp/headers/parse.py +180 -0
  293. crprotocol-4.1.1/crp/integrations/anthropic_hook.py +111 -0
  294. crprotocol-4.1.1/crp/integrations/langchain_hook.py +132 -0
  295. crprotocol-4.1.1/crp/integrations/openai_hook.py +201 -0
  296. crprotocol-4.1.1/crp/observability/events.py +240 -0
  297. crprotocol-4.1.1/crp/observability/metrics.py +293 -0
  298. crprotocol-4.1.1/crp/observability/quality.py +142 -0
  299. crprotocol-4.1.1/crp/observability/structured_logging.py +89 -0
  300. crprotocol-4.1.1/crp/observability/telemetry.py +124 -0
  301. crprotocol-4.1.1/crp/policy/__init__.py +77 -0
  302. crprotocol-4.1.1/crp/policy/enforce.py +270 -0
  303. crprotocol-4.1.1/crp/policy/grammar.py +158 -0
  304. crprotocol-4.1.1/crp/policy/inheritance.py +136 -0
  305. crprotocol-4.1.1/crp/policy/mode.py +129 -0
  306. crprotocol-4.1.1/crp/policy/model.py +277 -0
  307. crprotocol-4.1.1/crp/policy/nonce.py +37 -0
  308. crprotocol-4.1.1/crp/policy/profiles.py +76 -0
  309. crprotocol-4.1.1/crp/policy/report.py +125 -0
  310. crprotocol-4.1.1/crp/provenance/__init__.py +542 -0
  311. crprotocol-4.1.1/crp/provenance/_types.py +563 -0
  312. crprotocol-4.1.1/crp/provenance/amplifiers.py +121 -0
  313. crprotocol-4.1.1/crp/provenance/attribution_scorer.py +265 -0
  314. crprotocol-4.1.1/crp/provenance/calibration.py +235 -0
  315. crprotocol-4.1.1/crp/provenance/distortion_detector.py +418 -0
  316. crprotocol-4.1.1/crp/provenance/fabrication_detector.py +210 -0
  317. crprotocol-4.1.1/crp/provenance/hallucination_scorer.py +329 -0
  318. crprotocol-4.1.1/crp/provenance/provenance_chain.py +202 -0
  319. crprotocol-4.1.1/crp/provenance/rqa.py +104 -0
  320. crprotocol-4.1.1/crp/provenance/rqa_stages.py +611 -0
  321. crprotocol-4.1.1/crp/provenance/window_chain.py +231 -0
  322. crprotocol-4.1.1/crp/providers/__init__.py +58 -0
  323. crprotocol-4.1.1/crp/providers/anthropic.py +277 -0
  324. crprotocol-4.1.1/crp/providers/base.py +185 -0
  325. crprotocol-4.1.1/crp/providers/custom.py +99 -0
  326. crprotocol-4.1.1/crp/providers/diagnostic.py +254 -0
  327. crprotocol-4.1.1/crp/providers/discovery.py +486 -0
  328. crprotocol-4.1.1/crp/providers/llamacpp.py +231 -0
  329. crprotocol-4.1.1/crp/providers/manager.py +179 -0
  330. crprotocol-4.1.1/crp/providers/ollama.py +250 -0
  331. crprotocol-4.1.1/crp/providers/openai.py +641 -0
  332. crprotocol-4.1.1/crp/py.typed +0 -0
  333. crprotocol-4.1.1/crp/resources/adaptive_allocator.py +529 -0
  334. crprotocol-4.1.1/crp/resources/cost_model.py +398 -0
  335. crprotocol-4.1.1/crp/resources/overhead_manager.py +222 -0
  336. crprotocol-4.1.1/crp/resources/resource_manager.py +276 -0
  337. crprotocol-4.1.1/crp/scan/__init__.py +28 -0
  338. crprotocol-4.1.1/crp/scan/github_app.py +332 -0
  339. crprotocol-4.1.1/crp/scan/remediation.py +506 -0
  340. crprotocol-4.1.1/crp/scan/semantic_ingestion.py +691 -0
  341. crprotocol-4.1.1/crp/scan/templates/README.md +3 -0
  342. crprotocol-4.1.1/crp/sdk/__init__.py +98 -0
  343. crprotocol-4.1.1/crp/sdk/client.py +1316 -0
  344. crprotocol-4.1.1/crp/sdk/dynamic.py +143 -0
  345. crprotocol-4.1.1/crp/sdk/proxies.py +1468 -0
  346. crprotocol-4.1.1/crp/sdk/proxies_extra.py +664 -0
  347. crprotocol-4.1.1/crp/sdk/proxies_more.py +684 -0
  348. crprotocol-4.1.1/crp/sdk/response.py +92 -0
  349. crprotocol-4.1.1/crp/security/__init__.py +140 -0
  350. crprotocol-4.1.1/crp/security/audit_trail.py +652 -0
  351. crprotocol-4.1.1/crp/security/binding.py +193 -0
  352. crprotocol-4.1.1/crp/security/checkpoint.py +313 -0
  353. crprotocol-4.1.1/crp/security/compliance.py +885 -0
  354. crprotocol-4.1.1/crp/security/consent.py +734 -0
  355. crprotocol-4.1.1/crp/security/control_plane.py +402 -0
  356. crprotocol-4.1.1/crp/security/coverage.py +223 -0
  357. crprotocol-4.1.1/crp/security/embedding_defense.py +170 -0
  358. crprotocol-4.1.1/crp/security/encryption.py +211 -0
  359. crprotocol-4.1.1/crp/security/injection.py +353 -0
  360. crprotocol-4.1.1/crp/security/integrity.py +278 -0
  361. crprotocol-4.1.1/crp/security/privacy.py +667 -0
  362. crprotocol-4.1.1/crp/security/quarantine.py +250 -0
  363. crprotocol-4.1.1/crp/security/rbac.py +224 -0
  364. crprotocol-4.1.1/crp/security/safety_manifest.py +179 -0
  365. crprotocol-4.1.1/crp/security/session_token.py +397 -0
  366. crprotocol-4.1.1/crp/state/__init__.py +81 -0
  367. crprotocol-4.1.1/crp/state/backends/__init__.py +40 -0
  368. crprotocol-4.1.1/crp/state/backends/base.py +49 -0
  369. crprotocol-4.1.1/crp/state/backends/memory.py +96 -0
  370. crprotocol-4.1.1/crp/state/backends/redis.py +88 -0
  371. crprotocol-4.1.1/crp/state/backends/s3.py +123 -0
  372. crprotocol-4.1.1/crp/state/backends/sqlite.py +130 -0
  373. crprotocol-4.1.1/crp/state/cold_storage.py +267 -0
  374. crprotocol-4.1.1/crp/state/coverage_set.py +314 -0
  375. crprotocol-4.1.1/crp/state/critical_state.py +122 -0
  376. crprotocol-4.1.1/crp/state/cso.py +657 -0
  377. crprotocol-4.1.1/crp/state/event_log.py +328 -0
  378. crprotocol-4.1.1/crp/state/fact.py +203 -0
  379. crprotocol-4.1.1/crp/state/horizons.py +203 -0
  380. crprotocol-4.1.1/crp/state/scratch_buffer.py +226 -0
  381. crprotocol-4.1.1/crp/state/snapshot.py +301 -0
  382. crprotocol-4.1.1/crp/state/storage/__init__.py +35 -0
  383. crprotocol-4.1.1/crp/state/storage/ephemeral_store.py +210 -0
  384. crprotocol-4.1.1/crp/state/storage/hot_cache.py +112 -0
  385. crprotocol-4.1.1/crp/state/storage/inverted_index.py +144 -0
  386. crprotocol-4.1.1/crp/state/storage/rolling_log.py +92 -0
  387. crprotocol-4.1.1/crp/state/storage/router.py +239 -0
  388. crprotocol-4.1.1/crp/state/warm_store.py +517 -0
  389. crprotocol-4.1.1/crp/stl/__init__.py +33 -0
  390. crprotocol-4.1.1/crp/stl/classifier.py +132 -0
  391. crprotocol-4.1.1/crp/stl/depth_model.py +160 -0
  392. crprotocol-4.1.1/crp/stl/frame_builder.py +189 -0
  393. crprotocol-4.1.1/crp/stl/goal_compass.py +133 -0
  394. crprotocol-4.1.1/crp/stl/orchestrator.py +192 -0
  395. crprotocol-4.1.1/crp_envelope_budget +0 -0
  396. crprotocol-4.1.1/crp_mcp/.env.example +81 -0
  397. crprotocol-4.1.1/crp_mcp/.env.hosted.template +81 -0
  398. crprotocol-4.1.1/crp_mcp/__init__.py +18 -0
  399. crprotocol-4.1.1/crp_mcp/agent_tools.py +325 -0
  400. crprotocol-4.1.1/crp_mcp/auth.py +325 -0
  401. crprotocol-4.1.1/crp_mcp/backend_client.py +162 -0
  402. crprotocol-4.1.1/crp_mcp/billing.py +268 -0
  403. crprotocol-4.1.1/crp_mcp/capabilities.py +240 -0
  404. crprotocol-4.1.1/crp_mcp/checkpoint_policy.py +275 -0
  405. crprotocol-4.1.1/crp_mcp/checkpoint_service.py +437 -0
  406. crprotocol-4.1.1/crp_mcp/completions.py +93 -0
  407. crprotocol-4.1.1/crp_mcp/comply_tools.py +236 -0
  408. crprotocol-4.1.1/crp_mcp/config_tools.py +142 -0
  409. crprotocol-4.1.1/crp_mcp/connectors/__init__.py +69 -0
  410. crprotocol-4.1.1/crp_mcp/connectors/base.py +22 -0
  411. crprotocol-4.1.1/crp_mcp/connectors/comply.py +54 -0
  412. crprotocol-4.1.1/crp_mcp/connectors/console.py +40 -0
  413. crprotocol-4.1.1/crp_mcp/connectors/email.py +116 -0
  414. crprotocol-4.1.1/crp_mcp/connectors/fcm.py +171 -0
  415. crprotocol-4.1.1/crp_mcp/connectors/gmail.py +67 -0
  416. crprotocol-4.1.1/crp_mcp/connectors/pagerduty.py +83 -0
  417. crprotocol-4.1.1/crp_mcp/connectors/slack.py +70 -0
  418. crprotocol-4.1.1/crp_mcp/connectors/sms.py +91 -0
  419. crprotocol-4.1.1/crp_mcp/connectors/webhook.py +48 -0
  420. crprotocol-4.1.1/crp_mcp/corpus.py +244 -0
  421. crprotocol-4.1.1/crp_mcp/dpe_tools.py +249 -0
  422. crprotocol-4.1.1/crp_mcp/gateway_tools.py +393 -0
  423. crprotocol-4.1.1/crp_mcp/headers_lint.py +73 -0
  424. crprotocol-4.1.1/crp_mcp/local_tools.py +351 -0
  425. crprotocol-4.1.1/crp_mcp/permissions.py +295 -0
  426. crprotocol-4.1.1/crp_mcp/prompts.py +83 -0
  427. crprotocol-4.1.1/crp_mcp/resources.py +158 -0
  428. crprotocol-4.1.1/crp_mcp/safety_tools.py +311 -0
  429. crprotocol-4.1.1/crp_mcp/scaffold.py +277 -0
  430. crprotocol-4.1.1/crp_mcp/scan_tools.py +274 -0
  431. crprotocol-4.1.1/crp_mcp/server.py +964 -0
  432. crprotocol-4.1.1/crp_mcp/types.py +83 -0
  433. crprotocol-4.1.1/crp_shared/__init__.py +62 -0
  434. crprotocol-4.1.1/crp_shared/audit.py +543 -0
  435. crprotocol-4.1.1/crp_shared/auth.py +247 -0
  436. crprotocol-4.1.1/crp_shared/crp_headers.py +181 -0
  437. crprotocol-4.1.1/crp_shared/db.py +62 -0
  438. crprotocol-4.1.1/crp_shared/passkey.py +667 -0
  439. crprotocol-4.1.1/crp_shared/schema.py +142 -0
  440. crprotocol-4.1.1/crp_shared/session_token.py +236 -0
  441. crprotocol-4.1.1/docs/AUDIT_REPORT_ROUND_1_SITE_FIXES.md +288 -0
  442. crprotocol-4.1.1/docs/AUDIT_REPORT_ROUND_2_VISUAL_IMPROVEMENTS.md +360 -0
  443. crprotocol-4.1.1/docs/Analysis_of_benchmark_results.md +312 -0
  444. crprotocol-4.1.1/docs/CRP_AVAILABILITY.md +93 -0
  445. crprotocol-4.1.1/docs/CRP_CHECKPOINTS_SETUP_GUIDE.md +475 -0
  446. crprotocol-4.1.1/docs/CRP_DEMO_VIDEO_SCRIPT.md +135 -0
  447. crprotocol-4.1.1/docs/CRP_MCP_ACTIONABLE_DEPLOYMENT_GUIDE.md +775 -0
  448. crprotocol-4.1.1/docs/CRP_MCP_CONNECTORS_SETUP_GUIDE.md +302 -0
  449. crprotocol-4.1.1/docs/CRP_MCP_ENVIRONMENT_MAPPING.md +134 -0
  450. crprotocol-4.1.1/docs/CRP_MCP_PRODUCTION_CHECKLIST.md +357 -0
  451. crprotocol-4.1.1/docs/CRP_MCP_SECURITY_AND_CHECKPOINTS_REPORT.md +298 -0
  452. crprotocol-4.1.1/docs/CRP_SCAN_ACTION_GUIDE.md +467 -0
  453. crprotocol-4.1.1/docs/CRP_SCAN_ACTION_PLAN.md +126 -0
  454. crprotocol-4.1.1/docs/CRP_SCAN_MARKETPLACE_AND_PARTNERSHIP.md +29 -0
  455. crprotocol-4.1.1/docs/CRP_SDK_CONTEXT_SAFETY_GAP_REPORT.md +144 -0
  456. crprotocol-4.1.1/docs/CRP_SPEC_REALITY_MAP.md +94 -0
  457. crprotocol-4.1.1/docs/CRP_V3_COMPLETENESS.md +157 -0
  458. crprotocol-4.1.1/docs/DEMO_REPRODUCTION_AND_VIDEO_GUIDE.md +1805 -0
  459. crprotocol-4.1.1/docs/DOCS_PLATFORM_EVALUATION.md +126 -0
  460. crprotocol-4.1.1/docs/DOCS_QUALITY_STRATEGY.md +159 -0
  461. crprotocol-4.1.1/docs/GATEWAY_BACKEND_INTEGRATION.md +275 -0
  462. crprotocol-4.1.1/docs/GATEWAY_RAILWAY_DEPLOY.md +32 -0
  463. crprotocol-4.1.1/docs/GITHUB_ACTION_PUBLISH.md +116 -0
  464. crprotocol-4.1.1/docs/LINKEDIN_LAUNCH_SERIES.md +115 -0
  465. crprotocol-4.1.1/docs/OPERATIONS_RUNBOOK.md +266 -0
  466. crprotocol-4.1.1/docs/SEO_AEO_GEO_STRATEGY.md +212 -0
  467. crprotocol-4.1.1/docs/UX_ACCESSIBILITY_IMPROVEMENTS.md +76 -0
  468. crprotocol-4.1.1/docs/VS_CODE_EXTENSION_PUBLISH.md +75 -0
  469. crprotocol-4.1.1/examples/crp_demos/README.md +78 -0
  470. crprotocol-4.1.1/examples/crp_demos/__init__.py +17 -0
  471. crprotocol-4.1.1/examples/crp_demos/_benchmark_results/20260601_140350_comparison.json +331 -0
  472. crprotocol-4.1.1/examples/crp_demos/_benchmark_results/20260601_140350_crp_document.md +452 -0
  473. crprotocol-4.1.1/examples/crp_demos/_benchmark_results/20260601_140350_hierarchical_document.md +185 -0
  474. crprotocol-4.1.1/examples/crp_demos/_benchmark_results/20260601_140350_injection_document.md +266 -0
  475. crprotocol-4.1.1/examples/crp_demos/_benchmark_results/20260601_140350_rag_document.md +262 -0
  476. crprotocol-4.1.1/examples/crp_demos/comparison_backend.py +314 -0
  477. crprotocol-4.1.1/examples/crp_demos/pipeline.py +596 -0
  478. crprotocol-4.1.1/examples/crp_demos/run_benchmark.py +186 -0
  479. crprotocol-4.1.1/examples/crp_demos/server.py +249 -0
  480. crprotocol-4.1.1/examples/crp_demos/sqb_benchmark.py +1225 -0
  481. crprotocol-4.1.1/examples/crp_demos/static/app.js +72 -0
  482. crprotocol-4.1.1/examples/crp_demos/static/comparison.html +717 -0
  483. crprotocol-4.1.1/examples/crp_demos/static/context.html +88 -0
  484. crprotocol-4.1.1/examples/crp_demos/static/context.js +127 -0
  485. crprotocol-4.1.1/examples/crp_demos/static/index.html +117 -0
  486. crprotocol-4.1.1/examples/crp_demos/static/safety.html +99 -0
  487. crprotocol-4.1.1/examples/crp_demos/static/safety.js +134 -0
  488. crprotocol-4.1.1/examples/crp_demos/static/style.css +165 -0
  489. crprotocol-4.1.1/examples/crp_demos/strategies/__init__.py +1 -0
  490. crprotocol-4.1.1/examples/crp_demos/strategies/base.py +290 -0
  491. crprotocol-4.1.1/examples/crp_demos/strategies/crp_strategy.py +597 -0
  492. crprotocol-4.1.1/examples/crp_demos/strategies/hierarchical_strategy.py +242 -0
  493. crprotocol-4.1.1/examples/crp_demos/strategies/injection_strategy.py +161 -0
  494. crprotocol-4.1.1/examples/crp_demos/strategies/rag_strategy.py +216 -0
  495. crprotocol-4.1.1/examples/crp_demos/v4/server.py +1314 -0
  496. crprotocol-4.1.1/examples/crp_demos/v4/static/app.js +571 -0
  497. crprotocol-4.1.1/examples/crp_demos/v4/static/index.html +311 -0
  498. crprotocol-4.1.1/examples/crp_demos/v4/static/style.css +488 -0
  499. crprotocol-4.1.1/favicon-16x16.png +0 -0
  500. crprotocol-4.1.1/favicon-32x32.png +0 -0
  501. crprotocol-4.1.1/favicon.ico +0 -0
  502. crprotocol-4.1.1/hooks/mkdocs_hooks.py +45 -0
  503. crprotocol-4.1.1/media/FINAL_CRP_Full_logo-transparent.png +0 -0
  504. crprotocol-4.1.1/message for AI safety.txt +26 -0
  505. crprotocol-4.1.1/migrations/001_initial.sql +225 -0
  506. crprotocol-4.1.1/mkdocs.yml +437 -0
  507. crprotocol-4.1.1/overrides/404.html +42 -0
  508. crprotocol-4.1.1/overrides/main.html +194 -0
  509. crprotocol-4.1.1/overrides/partials/logo.html +11 -0
  510. crprotocol-4.1.1/pyproject.toml +145 -0
  511. crprotocol-4.1.1/scripts/audit_docs.py +223 -0
  512. crprotocol-4.1.1/scripts/audit_docstrings.py +156 -0
  513. crprotocol-4.1.1/scripts/auto_docstrings.py +354 -0
  514. crprotocol-4.1.1/scripts/demo_varied_tests.py +140 -0
  515. crprotocol-4.1.1/scripts/gen_changelog.py +86 -0
  516. crprotocol-4.1.1/scripts/generate_api_reference.py +237 -0
  517. crprotocol-4.1.1/scripts/probe_safety.py +187 -0
  518. crprotocol-4.1.1/scripts/probe_varied_use_cases.py +201 -0
  519. crprotocol-4.1.1/scripts/validate_crp_mcp.py +346 -0
  520. crprotocol-4.1.1/scripts/verify_v4_demo.py +183 -0
  521. crprotocol-4.1.1/site-docs/BingSiteAuth.xml +4 -0
  522. crprotocol-4.1.1/site-docs/CNAME +1 -0
  523. crprotocol-4.1.1/site-docs/aiuc-1.md +468 -0
  524. crprotocol-4.1.1/site-docs/api/.meta.yml +6 -0
  525. crprotocol-4.1.1/site-docs/api/activation.md +17 -0
  526. crprotocol-4.1.1/site-docs/api/advanced.md +3 -0
  527. crprotocol-4.1.1/site-docs/api/agent.md +17 -0
  528. crprotocol-4.1.1/site-docs/api/ckf.md +24 -0
  529. crprotocol-4.1.1/site-docs/api/cli.md +3 -0
  530. crprotocol-4.1.1/site-docs/api/client.md +74 -0
  531. crprotocol-4.1.1/site-docs/api/compliance.md +95 -0
  532. crprotocol-4.1.1/site-docs/api/comply.md +10 -0
  533. crprotocol-4.1.1/site-docs/api/config.md +10 -0
  534. crprotocol-4.1.1/site-docs/api/continuation.md +3 -0
  535. crprotocol-4.1.1/site-docs/api/core.md +3 -0
  536. crprotocol-4.1.1/site-docs/api/cso.md +17 -0
  537. crprotocol-4.1.1/site-docs/api/dispatch.md +117 -0
  538. crprotocol-4.1.1/site-docs/api/envelope.md +3 -0
  539. crprotocol-4.1.1/site-docs/api/errors.md +3 -0
  540. crprotocol-4.1.1/site-docs/api/events.md +10 -0
  541. crprotocol-4.1.1/site-docs/api/extraction.md +24 -0
  542. crprotocol-4.1.1/site-docs/api/gateway.md +10 -0
  543. crprotocol-4.1.1/site-docs/api/headers.md +10 -0
  544. crprotocol-4.1.1/site-docs/api/index.md +83 -0
  545. crprotocol-4.1.1/site-docs/api/modules/activation.md +44 -0
  546. crprotocol-4.1.1/site-docs/api/modules/adapters.md +12 -0
  547. crprotocol-4.1.1/site-docs/api/modules/advanced.md +100 -0
  548. crprotocol-4.1.1/site-docs/api/modules/agent.md +44 -0
  549. crprotocol-4.1.1/site-docs/api/modules/ckf.md +92 -0
  550. crprotocol-4.1.1/site-docs/api/modules/cli.md +36 -0
  551. crprotocol-4.1.1/site-docs/api/modules/comply.md +116 -0
  552. crprotocol-4.1.1/site-docs/api/modules/config.md +12 -0
  553. crprotocol-4.1.1/site-docs/api/modules/config_schema.md +12 -0
  554. crprotocol-4.1.1/site-docs/api/modules/continuation.md +92 -0
  555. crprotocol-4.1.1/site-docs/api/modules/core.md +172 -0
  556. crprotocol-4.1.1/site-docs/api/modules/envelope.md +76 -0
  557. crprotocol-4.1.1/site-docs/api/modules/extraction.md +108 -0
  558. crprotocol-4.1.1/site-docs/api/modules/gateway.md +36 -0
  559. crprotocol-4.1.1/site-docs/api/modules/headers.md +60 -0
  560. crprotocol-4.1.1/site-docs/api/modules/index.md +43 -0
  561. crprotocol-4.1.1/site-docs/api/modules/integrations.md +36 -0
  562. crprotocol-4.1.1/site-docs/api/modules/license_guard.md +12 -0
  563. crprotocol-4.1.1/site-docs/api/modules/observability.md +60 -0
  564. crprotocol-4.1.1/site-docs/api/modules/policy.md +76 -0
  565. crprotocol-4.1.1/site-docs/api/modules/provenance.md +124 -0
  566. crprotocol-4.1.1/site-docs/api/modules/providers.md +92 -0
  567. crprotocol-4.1.1/site-docs/api/modules/resources.md +44 -0
  568. crprotocol-4.1.1/site-docs/api/modules/scan.md +36 -0
  569. crprotocol-4.1.1/site-docs/api/modules/schemas.md +12 -0
  570. crprotocol-4.1.1/site-docs/api/modules/sdk.md +28 -0
  571. crprotocol-4.1.1/site-docs/api/modules/security.md +148 -0
  572. crprotocol-4.1.1/site-docs/api/modules/state.md +212 -0
  573. crprotocol-4.1.1/site-docs/api/modules/stl.md +52 -0
  574. crprotocol-4.1.1/site-docs/api/observability.md +10 -0
  575. crprotocol-4.1.1/site-docs/api/policy.md +10 -0
  576. crprotocol-4.1.1/site-docs/api/provenance.md +17 -0
  577. crprotocol-4.1.1/site-docs/api/providers.md +17 -0
  578. crprotocol-4.1.1/site-docs/api/reasoning.md +17 -0
  579. crprotocol-4.1.1/site-docs/api/resources.md +3 -0
  580. crprotocol-4.1.1/site-docs/api/safety.md +24 -0
  581. crprotocol-4.1.1/site-docs/api/scan.md +10 -0
  582. crprotocol-4.1.1/site-docs/api/schemas.md +252 -0
  583. crprotocol-4.1.1/site-docs/api/security.md +3 -0
  584. crprotocol-4.1.1/site-docs/api/state.md +3 -0
  585. crprotocol-4.1.1/site-docs/assets/CRP_protocol_ecosystem_transparent.png +0 -0
  586. crprotocol-4.1.1/site-docs/assets/favicon/android-chrome-192x192.png +0 -0
  587. crprotocol-4.1.1/site-docs/assets/favicon/android-chrome-512x512.png +0 -0
  588. crprotocol-4.1.1/site-docs/assets/favicon/apple-touch-icon.png +0 -0
  589. crprotocol-4.1.1/site-docs/assets/favicon/favicon-16x16.png +0 -0
  590. crprotocol-4.1.1/site-docs/assets/favicon/favicon-32x32.png +0 -0
  591. crprotocol-4.1.1/site-docs/assets/favicon/favicon.ico +0 -0
  592. crprotocol-4.1.1/site-docs/assets/favicon/site.webmanifest +1 -0
  593. crprotocol-4.1.1/site-docs/assets/logo-full-readme.png +0 -0
  594. crprotocol-4.1.1/site-docs/assets/logo-full.png +0 -0
  595. crprotocol-4.1.1/site-docs/assets/logo-small.png +0 -0
  596. crprotocol-4.1.1/site-docs/assets/og-image.png +0 -0
  597. crprotocol-4.1.1/site-docs/capabilities.md +378 -0
  598. crprotocol-4.1.1/site-docs/cite.md +98 -0
  599. crprotocol-4.1.1/site-docs/compliance/.meta.yml +6 -0
  600. crprotocol-4.1.1/site-docs/compliance/eu-ai-act.md +175 -0
  601. crprotocol-4.1.1/site-docs/compliance/gdpr.md +170 -0
  602. crprotocol-4.1.1/site-docs/compliance/index.md +132 -0
  603. crprotocol-4.1.1/site-docs/compliance/iso-42001.md +150 -0
  604. crprotocol-4.1.1/site-docs/compliance/nist-ai-rmf.md +139 -0
  605. crprotocol-4.1.1/site-docs/compliance/security.md +201 -0
  606. crprotocol-4.1.1/site-docs/contributing.md +107 -0
  607. crprotocol-4.1.1/site-docs/control-evidence.md +194 -0
  608. crprotocol-4.1.1/site-docs/crpv4-roadmap.md +199 -0
  609. crprotocol-4.1.1/site-docs/faq.md +162 -0
  610. crprotocol-4.1.1/site-docs/getting-started/.meta.yml +6 -0
  611. crprotocol-4.1.1/site-docs/getting-started/cli.md +122 -0
  612. crprotocol-4.1.1/site-docs/getting-started/index.md +46 -0
  613. crprotocol-4.1.1/site-docs/getting-started/installation.md +71 -0
  614. crprotocol-4.1.1/site-docs/getting-started/licensing.md +206 -0
  615. crprotocol-4.1.1/site-docs/getting-started/local-models.md +236 -0
  616. crprotocol-4.1.1/site-docs/getting-started/operating-the-ecosystem.md +116 -0
  617. crprotocol-4.1.1/site-docs/getting-started/providers.md +122 -0
  618. crprotocol-4.1.1/site-docs/getting-started/quickstart.md +83 -0
  619. crprotocol-4.1.1/site-docs/guides/.meta.yml +6 -0
  620. crprotocol-4.1.1/site-docs/guides/demo-app.md +135 -0
  621. crprotocol-4.1.1/site-docs/guides/gateway-railway.md +44 -0
  622. crprotocol-4.1.1/site-docs/guides/index.md +67 -0
  623. crprotocol-4.1.1/site-docs/guides/ingestion.md +102 -0
  624. crprotocol-4.1.1/site-docs/guides/multi-turn.md +157 -0
  625. crprotocol-4.1.1/site-docs/guides/sdk-phases.md +79 -0
  626. crprotocol-4.1.1/site-docs/guides/sdk.md +431 -0
  627. crprotocol-4.1.1/site-docs/guides/session-persistence.md +66 -0
  628. crprotocol-4.1.1/site-docs/guides/sidecar.md +108 -0
  629. crprotocol-4.1.1/site-docs/guides/streaming.md +102 -0
  630. crprotocol-4.1.1/site-docs/index.md +489 -0
  631. crprotocol-4.1.1/site-docs/javascripts/ticker.js +220 -0
  632. crprotocol-4.1.1/site-docs/legal/.meta.yml +5 -0
  633. crprotocol-4.1.1/site-docs/legal/ai-policy.md +234 -0
  634. crprotocol-4.1.1/site-docs/legal/cookie-policy.md +94 -0
  635. crprotocol-4.1.1/site-docs/legal/index.md +46 -0
  636. crprotocol-4.1.1/site-docs/legal/information-security-policy.md +215 -0
  637. crprotocol-4.1.1/site-docs/legal/privacy-policy.md +181 -0
  638. crprotocol-4.1.1/site-docs/llms-full.txt +203 -0
  639. crprotocol-4.1.1/site-docs/llms.txt +36 -0
  640. crprotocol-4.1.1/site-docs/pricing.md +214 -0
  641. crprotocol-4.1.1/site-docs/products/.meta.yml +7 -0
  642. crprotocol-4.1.1/site-docs/products/comply.md +532 -0
  643. crprotocol-4.1.1/site-docs/products/gateway.md +150 -0
  644. crprotocol-4.1.1/site-docs/products/index.md +258 -0
  645. crprotocol-4.1.1/site-docs/products/scan.md +139 -0
  646. crprotocol-4.1.1/site-docs/products/scribe.md +232 -0
  647. crprotocol-4.1.1/site-docs/products/visualise.md +46 -0
  648. crprotocol-4.1.1/site-docs/protocol/.meta.yml +6 -0
  649. crprotocol-4.1.1/site-docs/protocol/ckf.md +153 -0
  650. crprotocol-4.1.1/site-docs/protocol/conformance.md +50 -0
  651. crprotocol-4.1.1/site-docs/protocol/context-sources.md +519 -0
  652. crprotocol-4.1.1/site-docs/protocol/continuation.md +192 -0
  653. crprotocol-4.1.1/site-docs/protocol/core.md +141 -0
  654. crprotocol-4.1.1/site-docs/protocol/dispatch-strategies.md +273 -0
  655. crprotocol-4.1.1/site-docs/protocol/envelope.md +147 -0
  656. crprotocol-4.1.1/site-docs/protocol/extraction.md +188 -0
  657. crprotocol-4.1.1/site-docs/protocol/headers.md +54 -0
  658. crprotocol-4.1.1/site-docs/protocol/index.md +101 -0
  659. crprotocol-4.1.1/site-docs/protocol/meta-learning.md +257 -0
  660. crprotocol-4.1.1/site-docs/protocol/multi-agent.md +75 -0
  661. crprotocol-4.1.1/site-docs/protocol/provenance.md +262 -0
  662. crprotocol-4.1.1/site-docs/protocol/quality-tiers.md +164 -0
  663. crprotocol-4.1.1/site-docs/protocol/research.md +295 -0
  664. crprotocol-4.1.1/site-docs/protocol/safety-policy.md +60 -0
  665. crprotocol-4.1.1/site-docs/protocol/session-token.md +55 -0
  666. crprotocol-4.1.1/site-docs/protocol/zero-ckf-mode.md +71 -0
  667. crprotocol-4.1.1/site-docs/robots.txt +10 -0
  668. crprotocol-4.1.1/site-docs/safety/.meta.yml +6 -0
  669. crprotocol-4.1.1/site-docs/safety/black-box.md +91 -0
  670. crprotocol-4.1.1/site-docs/safety/coverage.md +52 -0
  671. crprotocol-4.1.1/site-docs/safety/dpe.md +55 -0
  672. crprotocol-4.1.1/site-docs/safety/index.md +196 -0
  673. crprotocol-4.1.1/site-docs/safety/safety-policy.md +62 -0
  674. crprotocol-4.1.1/site-docs/sdk/.meta.yml +6 -0
  675. crprotocol-4.1.1/site-docs/sdk/ai-safety.md +390 -0
  676. crprotocol-4.1.1/site-docs/sdk/async.md +71 -0
  677. crprotocol-4.1.1/site-docs/sdk/configuration.md +158 -0
  678. crprotocol-4.1.1/site-docs/sdk/context-management.md +283 -0
  679. crprotocol-4.1.1/site-docs/sdk/errors.md +122 -0
  680. crprotocol-4.1.1/site-docs/sdk/index.md +384 -0
  681. crprotocol-4.1.1/site-docs/sdk/tools-and-agents.md +168 -0
  682. crprotocol-4.1.1/site-docs/spec/.meta.yml +6 -0
  683. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-001-core-protocol.md +293 -0
  684. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-002-headers.md +1775 -0
  685. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-003-envelope.md +678 -0
  686. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-004-continuation.md +796 -0
  687. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-005-dpe.md +1088 -0
  688. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-006-safety-policy.md +466 -0
  689. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-007-session-token.md +400 -0
  690. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-008-dispatch.md +463 -0
  691. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-009-ckf.md +332 -0
  692. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-010-regulatory-mapping.md +153 -0
  693. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-011-audit-trail.md +276 -0
  694. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-012-multi-agent-safety.md +396 -0
  695. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-013-github-action.md +374 -0
  696. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-014-conformance.md +600 -0
  697. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-015-security-privacy.md +396 -0
  698. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-016-gateway-service.md +735 -0
  699. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-017-zero-ckf-mode.md +545 -0
  700. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-018-air.md +423 -0
  701. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-019-cognitive-quality.md +225 -0
  702. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-020-cognitive-load-distribution.md +279 -0
  703. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-021-reasoning-orchestration.md +294 -0
  704. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-022-execution-fabric.md +296 -0
  705. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-023-amplification-boundary.md +276 -0
  706. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-024-coverage-differential-retrieval.md +533 -0
  707. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-025-graph-retrieval.md +266 -0
  708. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-026-semantic-quality-benchmark.md +239 -0
  709. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-027-retrieval-integrity.md +322 -0
  710. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-028-conversational-context.md +358 -0
  711. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-029-ephemeral-tool-context.md +329 -0
  712. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-030-cognitive-state-relay.md +361 -0
  713. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-031-semantic-task-layer.md +340 -0
  714. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-032-developer-experience.md +302 -0
  715. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-033-safety-control-plane.md +471 -0
  716. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-034-safety-coverage.md +277 -0
  717. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-035-context-lifecycle.md +235 -0
  718. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-036-scan-remediation.md +245 -0
  719. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-037-unified-config.md +240 -0
  720. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-038-storage-backends.md +275 -0
  721. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-039-semantic-code-ingestion.md +265 -0
  722. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-040-crp-comply.md +309 -0
  723. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-041-adoption-ecosystem.md +185 -0
  724. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-042-comply-upgrade-integration.md +276 -0
  725. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-043-gateway-runtime-product.md +200 -0
  726. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-044-authoritative-domain-agent.md +199 -0
  727. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-045-knowledge-learning.md +213 -0
  728. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-046-user-defined-cognition.md +197 -0
  729. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-047-monetisation-payments.md +20 -0
  730. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-048-comply-lowcode-github.md +262 -0
  731. crprotocol-4.1.1/site-docs/spec/CRP-SPEC-HOSTING-CONTROL.md +17 -0
  732. crprotocol-4.1.1/site-docs/spec/CRP-SUBMISSION-GUIDE.md +17 -0
  733. crprotocol-4.1.1/site-docs/spec/index.md +121 -0
  734. crprotocol-4.1.1/site-docs/standards.md +61 -0
  735. crprotocol-4.1.1/site-docs/stylesheets/extra.css +1887 -0
  736. crprotocol-4.1.1/site-docs/tags.md +12 -0
  737. crprotocol-4.1.1/site-docs/terms-of-service.md +200 -0
  738. crprotocol-4.1.1/site-docs/testing/.meta.yml +6 -0
  739. crprotocol-4.1.1/site-docs/testing/benchmarks.md +212 -0
  740. crprotocol-4.1.1/site-docs/testing/index.md +56 -0
  741. crprotocol-4.1.1/site-docs/testing/reproduce.md +200 -0
  742. crprotocol-4.1.1/site-docs/testing/running-tests.md +292 -0
  743. crprotocol-4.1.1/site-docs/topics/.meta.yml +7 -0
  744. crprotocol-4.1.1/site-docs/topics/ai-compliance.md +185 -0
  745. crprotocol-4.1.1/site-docs/topics/ai-governance.md +182 -0
  746. crprotocol-4.1.1/site-docs/topics/ai-safety.md +205 -0
  747. crprotocol-4.1.1/site-docs/topics/context-management.md +163 -0
  748. crprotocol-4.1.1/site-docs/topics/crp-vs-rag-mcp.md +159 -0
  749. crprotocol-4.1.1/site-docs/topics/index.md +68 -0
  750. crprotocol-4.1.1/site-docs/who-is-it-for.md +207 -0
  751. crprotocol-4.1.1/site-docs/why-crp.md +319 -0
  752. crprotocol-4.1.1/skills/visual-expert/SKILL.md +165 -0
  753. crprotocol-4.1.1/specification/02_CORE_PROTOCOL.md +6960 -0
  754. crprotocol-4.1.1/tests/__init__.py +3 -0
  755. crprotocol-4.1.1/tests/conformance/__init__.py +35 -0
  756. crprotocol-4.1.1/tests/conformance/levels.py +74 -0
  757. crprotocol-4.1.1/tests/conformance/runner.py +376 -0
  758. crprotocol-4.1.1/tests/conformance/test_conformance.py +33 -0
  759. crprotocol-4.1.1/tests/conformance/vectors/agent.json +31 -0
  760. crprotocol-4.1.1/tests/conformance/vectors/dpe.json +61 -0
  761. crprotocol-4.1.1/tests/conformance/vectors/headers.json +64 -0
  762. crprotocol-4.1.1/tests/conformance/vectors/hmac.json +58 -0
  763. crprotocol-4.1.1/tests/conformance/vectors/safety_policy.json +58 -0
  764. crprotocol-4.1.1/tests/conformance/vectors/session.json +51 -0
  765. crprotocol-4.1.1/tests/test_audit.py +117 -0
  766. crprotocol-4.1.1/tests/test_audit_integration.py +83 -0
  767. crprotocol-4.1.1/tests/test_checkpoint_inbox.py +56 -0
  768. crprotocol-4.1.1/tests/test_comply_billing.py +326 -0
  769. crprotocol-4.1.1/tests/test_comply_gateway_proxy.py +157 -0
  770. crprotocol-4.1.1/tests/test_comply_quota_gate.py +57 -0
  771. crprotocol-4.1.1/tests/test_crp_headers.py +76 -0
  772. crprotocol-4.1.1/tests/test_crp_mcp.py +444 -0
  773. crprotocol-4.1.1/tests/test_crp_mcp_auth.py +187 -0
  774. crprotocol-4.1.1/tests/test_crp_mcp_backends.py +132 -0
  775. crprotocol-4.1.1/tests/test_crp_mcp_billing.py +52 -0
  776. crprotocol-4.1.1/tests/test_crp_mcp_checkpoint.py +152 -0
  777. crprotocol-4.1.1/tests/test_crp_mcp_checkpoint_policy.py +80 -0
  778. crprotocol-4.1.1/tests/test_crp_mcp_connectors.py +168 -0
  779. crprotocol-4.1.1/tests/test_crp_mcp_coverage.py +226 -0
  780. crprotocol-4.1.1/tests/test_crp_mcp_permissions.py +283 -0
  781. crprotocol-4.1.1/tests/test_cso.py +349 -0
  782. crprotocol-4.1.1/tests/test_decision_provenance_engine.py +891 -0
  783. crprotocol-4.1.1/tests/test_entailment_risk.py +1048 -0
  784. crprotocol-4.1.1/tests/test_fidelity_verification.py +986 -0
  785. crprotocol-4.1.1/tests/test_gateway.py +355 -0
  786. crprotocol-4.1.1/tests/test_gateway_client.py +66 -0
  787. crprotocol-4.1.1/tests/test_github_app.py +116 -0
  788. crprotocol-4.1.1/tests/test_github_routes.py +113 -0
  789. crprotocol-4.1.1/tests/test_horizons.py +72 -0
  790. crprotocol-4.1.1/tests/test_no_code.py +82 -0
  791. crprotocol-4.1.1/tests/test_orchestrator_perf.py +76 -0
  792. crprotocol-4.1.1/tests/test_phase1.py +967 -0
  793. crprotocol-4.1.1/tests/test_retrieval_integrity.py +85 -0
  794. crprotocol-4.1.1/tests/test_safety_control_plane.py +138 -0
  795. crprotocol-4.1.1/tests/test_scan_r3.py +298 -0
  796. crprotocol-4.1.1/tests/test_scoring_robustness.py +567 -0
  797. crprotocol-4.1.1/tests/test_scratch_buffer.py +71 -0
  798. crprotocol-4.1.1/tests/test_sdk_dynamic.py +80 -0
  799. crprotocol-4.1.1/tests/test_sdk_extra_namespaces.py +96 -0
  800. crprotocol-4.1.1/tests/test_sdk_generated_reference.py +65 -0
  801. crprotocol-4.1.1/tests/test_sdk_level0.py +79 -0
  802. crprotocol-4.1.1/tests/test_sdk_level2.py +61 -0
  803. crprotocol-4.1.1/tests/test_sdk_more_namespaces.py +158 -0
  804. crprotocol-4.1.1/tests/test_sdk_namespaces.py +209 -0
  805. crprotocol-4.1.1/tests/test_security_modules.py +396 -0
  806. crprotocol-4.1.1/tests/test_session_token.py +82 -0
  807. crprotocol-4.1.1/tests/test_signup.py +81 -0
  808. crprotocol-4.1.1/tests/test_smoke.py +62 -0
  809. crprotocol-4.1.1/tests/test_stl.py +135 -0
  810. crprotocol-4.1.1/tests/test_unified_config.py +109 -0
  811. crprotocol-2.3.1/.github/PULL_REQUEST_TEMPLATE.md +0 -34
  812. crprotocol-2.3.1/.github/workflows/docs.yml +0 -32
  813. crprotocol-2.3.1/.gitignore +0 -61
  814. crprotocol-2.3.1/CHANGELOG.md +0 -519
  815. crprotocol-2.3.1/PKG-INFO +0 -1296
  816. crprotocol-2.3.1/README.md +0 -1239
  817. crprotocol-2.3.1/crp/__init__.py +0 -208
  818. crprotocol-2.3.1/crp/_version.py +0 -5
  819. crprotocol-2.3.1/crp/advanced/cqs.py +0 -235
  820. crprotocol-2.3.1/crp/advanced/cross_window.py +0 -477
  821. crprotocol-2.3.1/crp/advanced/curator.py +0 -265
  822. crprotocol-2.3.1/crp/advanced/feedback.py +0 -146
  823. crprotocol-2.3.1/crp/advanced/meta_learning.py +0 -401
  824. crprotocol-2.3.1/crp/advanced/source_grounding.py +0 -207
  825. crprotocol-2.3.1/crp/ckf/__init__.py +0 -35
  826. crprotocol-2.3.1/crp/ckf/community.py +0 -377
  827. crprotocol-2.3.1/crp/ckf/fabric.py +0 -468
  828. crprotocol-2.3.1/crp/ckf/gc.py +0 -175
  829. crprotocol-2.3.1/crp/ckf/semantic.py +0 -207
  830. crprotocol-2.3.1/crp/cli/main.py +0 -329
  831. crprotocol-2.3.1/crp/cli/sidecar.py +0 -929
  832. crprotocol-2.3.1/crp/cli/startup.py +0 -272
  833. crprotocol-2.3.1/crp/continuation/__init__.py +0 -103
  834. crprotocol-2.3.1/crp/continuation/degradation.py +0 -157
  835. crprotocol-2.3.1/crp/continuation/document_map.py +0 -160
  836. crprotocol-2.3.1/crp/continuation/flow.py +0 -109
  837. crprotocol-2.3.1/crp/continuation/gap.py +0 -419
  838. crprotocol-2.3.1/crp/continuation/manager.py +0 -484
  839. crprotocol-2.3.1/crp/continuation/quality_monitor.py +0 -179
  840. crprotocol-2.3.1/crp/continuation/voice.py +0 -157
  841. crprotocol-2.3.1/crp/core/__init__.py +0 -69
  842. crprotocol-2.3.1/crp/core/config.py +0 -384
  843. crprotocol-2.3.1/crp/core/context_enforcer.py +0 -769
  844. crprotocol-2.3.1/crp/core/context_source.py +0 -725
  845. crprotocol-2.3.1/crp/core/context_tools.py +0 -540
  846. crprotocol-2.3.1/crp/core/dispatch_router.py +0 -4014
  847. crprotocol-2.3.1/crp/core/errors.py +0 -132
  848. crprotocol-2.3.1/crp/core/facilitator.py +0 -713
  849. crprotocol-2.3.1/crp/core/idempotency.py +0 -215
  850. crprotocol-2.3.1/crp/core/ledger_backends.py +0 -186
  851. crprotocol-2.3.1/crp/core/manifest_ledger.py +0 -602
  852. crprotocol-2.3.1/crp/core/orchestrator.py +0 -1435
  853. crprotocol-2.3.1/crp/core/session.py +0 -134
  854. crprotocol-2.3.1/crp/core/task_intent.py +0 -36
  855. crprotocol-2.3.1/crp/core/window.py +0 -363
  856. crprotocol-2.3.1/crp/envelope/__init__.py +0 -30
  857. crprotocol-2.3.1/crp/envelope/builder.py +0 -288
  858. crprotocol-2.3.1/crp/envelope/formatter.py +0 -208
  859. crprotocol-2.3.1/crp/envelope/reranker.py +0 -209
  860. crprotocol-2.3.1/crp/envelope/scoring.py +0 -310
  861. crprotocol-2.3.1/crp/extraction/pipeline.py +0 -360
  862. crprotocol-2.3.1/crp/extraction/stage1_regex.py +0 -173
  863. crprotocol-2.3.1/crp/extraction/stage3_gliner.py +0 -210
  864. crprotocol-2.3.1/crp/extraction/stage4_uie.py +0 -183
  865. crprotocol-2.3.1/crp/extraction/stage6_llm.py +0 -178
  866. crprotocol-2.3.1/crp/extraction/structured_output.py +0 -219
  867. crprotocol-2.3.1/crp/extraction/types.py +0 -310
  868. crprotocol-2.3.1/crp/integrations/anthropic_hook.py +0 -92
  869. crprotocol-2.3.1/crp/integrations/langchain_hook.py +0 -118
  870. crprotocol-2.3.1/crp/integrations/openai_hook.py +0 -171
  871. crprotocol-2.3.1/crp/observability/events.py +0 -233
  872. crprotocol-2.3.1/crp/observability/metrics.py +0 -264
  873. crprotocol-2.3.1/crp/observability/quality.py +0 -135
  874. crprotocol-2.3.1/crp/observability/structured_logging.py +0 -81
  875. crprotocol-2.3.1/crp/observability/telemetry.py +0 -117
  876. crprotocol-2.3.1/crp/provenance/__init__.py +0 -314
  877. crprotocol-2.3.1/crp/provenance/_types.py +0 -378
  878. crprotocol-2.3.1/crp/provenance/attribution_scorer.py +0 -252
  879. crprotocol-2.3.1/crp/provenance/distortion_detector.py +0 -397
  880. crprotocol-2.3.1/crp/provenance/fabrication_detector.py +0 -203
  881. crprotocol-2.3.1/crp/provenance/hallucination_scorer.py +0 -320
  882. crprotocol-2.3.1/crp/provenance/provenance_chain.py +0 -205
  883. crprotocol-2.3.1/crp/providers/__init__.py +0 -43
  884. crprotocol-2.3.1/crp/providers/anthropic.py +0 -270
  885. crprotocol-2.3.1/crp/providers/base.py +0 -135
  886. crprotocol-2.3.1/crp/providers/custom.py +0 -63
  887. crprotocol-2.3.1/crp/providers/diagnostic.py +0 -251
  888. crprotocol-2.3.1/crp/providers/llamacpp.py +0 -224
  889. crprotocol-2.3.1/crp/providers/manager.py +0 -139
  890. crprotocol-2.3.1/crp/providers/ollama.py +0 -243
  891. crprotocol-2.3.1/crp/providers/openai.py +0 -634
  892. crprotocol-2.3.1/crp/resources/adaptive_allocator.py +0 -525
  893. crprotocol-2.3.1/crp/resources/cost_model.py +0 -388
  894. crprotocol-2.3.1/crp/resources/overhead_manager.py +0 -217
  895. crprotocol-2.3.1/crp/resources/resource_manager.py +0 -262
  896. crprotocol-2.3.1/crp/security/__init__.py +0 -93
  897. crprotocol-2.3.1/crp/security/audit_trail.py +0 -392
  898. crprotocol-2.3.1/crp/security/binding.py +0 -192
  899. crprotocol-2.3.1/crp/security/compliance.py +0 -813
  900. crprotocol-2.3.1/crp/security/consent.py +0 -593
  901. crprotocol-2.3.1/crp/security/embedding_defense.py +0 -161
  902. crprotocol-2.3.1/crp/security/encryption.py +0 -202
  903. crprotocol-2.3.1/crp/security/injection.py +0 -335
  904. crprotocol-2.3.1/crp/security/integrity.py +0 -267
  905. crprotocol-2.3.1/crp/security/privacy.py +0 -662
  906. crprotocol-2.3.1/crp/security/quarantine.py +0 -249
  907. crprotocol-2.3.1/crp/security/rbac.py +0 -221
  908. crprotocol-2.3.1/crp/state/__init__.py +0 -31
  909. crprotocol-2.3.1/crp/state/cold_storage.py +0 -258
  910. crprotocol-2.3.1/crp/state/critical_state.py +0 -104
  911. crprotocol-2.3.1/crp/state/event_log.py +0 -313
  912. crprotocol-2.3.1/crp/state/fact.py +0 -189
  913. crprotocol-2.3.1/crp/state/snapshot.py +0 -290
  914. crprotocol-2.3.1/crp/state/warm_store.py +0 -378
  915. crprotocol-2.3.1/docs/OPERATIONS_RUNBOOK.md +0 -265
  916. crprotocol-2.3.1/media/logo.svg +0 -41
  917. crprotocol-2.3.1/mkdocs.yml +0 -151
  918. crprotocol-2.3.1/pyproject.toml +0 -122
  919. crprotocol-2.3.1/scripts/gen_changelog.py +0 -86
  920. crprotocol-2.3.1/site-docs/api/client.md +0 -159
  921. crprotocol-2.3.1/site-docs/api/compliance.md +0 -224
  922. crprotocol-2.3.1/site-docs/api/dispatch.md +0 -242
  923. crprotocol-2.3.1/site-docs/api/index.md +0 -50
  924. crprotocol-2.3.1/site-docs/api/schemas.md +0 -249
  925. crprotocol-2.3.1/site-docs/benchmarks.md +0 -122
  926. crprotocol-2.3.1/site-docs/compliance/eu-ai-act.md +0 -158
  927. crprotocol-2.3.1/site-docs/compliance/gdpr.md +0 -141
  928. crprotocol-2.3.1/site-docs/compliance/index.md +0 -98
  929. crprotocol-2.3.1/site-docs/compliance/iso-42001.md +0 -117
  930. crprotocol-2.3.1/site-docs/compliance/nist-ai-rmf.md +0 -101
  931. crprotocol-2.3.1/site-docs/compliance/security.md +0 -182
  932. crprotocol-2.3.1/site-docs/contributing.md +0 -88
  933. crprotocol-2.3.1/site-docs/getting-started/cli.md +0 -89
  934. crprotocol-2.3.1/site-docs/getting-started/index.md +0 -20
  935. crprotocol-2.3.1/site-docs/getting-started/installation.md +0 -58
  936. crprotocol-2.3.1/site-docs/getting-started/licensing.md +0 -206
  937. crprotocol-2.3.1/site-docs/getting-started/local-models.md +0 -231
  938. crprotocol-2.3.1/site-docs/getting-started/providers.md +0 -103
  939. crprotocol-2.3.1/site-docs/getting-started/quickstart.md +0 -75
  940. crprotocol-2.3.1/site-docs/guides/demo-app.md +0 -126
  941. crprotocol-2.3.1/site-docs/guides/index.md +0 -35
  942. crprotocol-2.3.1/site-docs/guides/ingestion.md +0 -106
  943. crprotocol-2.3.1/site-docs/guides/multi-turn.md +0 -132
  944. crprotocol-2.3.1/site-docs/guides/session-persistence.md +0 -143
  945. crprotocol-2.3.1/site-docs/guides/sidecar.md +0 -171
  946. crprotocol-2.3.1/site-docs/guides/streaming.md +0 -92
  947. crprotocol-2.3.1/site-docs/index.md +0 -290
  948. crprotocol-2.3.1/site-docs/products/comply-autocyber.md +0 -263
  949. crprotocol-2.3.1/site-docs/products/comply.md +0 -457
  950. crprotocol-2.3.1/site-docs/products/index.md +0 -179
  951. crprotocol-2.3.1/site-docs/products/scribe.md +0 -223
  952. crprotocol-2.3.1/site-docs/protocol/ckf.md +0 -131
  953. crprotocol-2.3.1/site-docs/protocol/context-sources.md +0 -499
  954. crprotocol-2.3.1/site-docs/protocol/continuation.md +0 -175
  955. crprotocol-2.3.1/site-docs/protocol/core.md +0 -133
  956. crprotocol-2.3.1/site-docs/protocol/dispatch-strategies.md +0 -207
  957. crprotocol-2.3.1/site-docs/protocol/envelope.md +0 -121
  958. crprotocol-2.3.1/site-docs/protocol/extraction.md +0 -161
  959. crprotocol-2.3.1/site-docs/protocol/index.md +0 -88
  960. crprotocol-2.3.1/site-docs/protocol/meta-learning.md +0 -218
  961. crprotocol-2.3.1/site-docs/protocol/provenance.md +0 -233
  962. crprotocol-2.3.1/site-docs/protocol/quality-tiers.md +0 -154
  963. crprotocol-2.3.1/site-docs/protocol/research.md +0 -270
  964. crprotocol-2.3.1/site-docs/terms-of-service.md +0 -178
  965. crprotocol-2.3.1/site-docs/testing/benchmarks.md +0 -141
  966. crprotocol-2.3.1/site-docs/testing/index.md +0 -46
  967. crprotocol-2.3.1/site-docs/testing/reproduce.md +0 -165
  968. crprotocol-2.3.1/site-docs/testing/running-tests.md +0 -230
  969. crprotocol-2.3.1/site-docs/why-crp.md +0 -198
  970. crprotocol-2.3.1/specification/02_CORE_PROTOCOL.md +0 -6960
  971. crprotocol-2.3.1/tests/test_decision_provenance_engine.py +0 -889
  972. crprotocol-2.3.1/tests/test_entailment_risk.py +0 -1045
  973. crprotocol-2.3.1/tests/test_fidelity_verification.py +0 -984
  974. crprotocol-2.3.1/tests/test_phase1.py +0 -964
  975. crprotocol-2.3.1/tests/test_security_modules.py +0 -396
  976. crprotocol-2.3.1/tests/test_smoke.py +0 -62
  977. {crprotocol-2.3.1 → crprotocol-4.1.1}/.dockerignore +0 -0
  978. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/CODEOWNERS +0 -0
  979. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/FUNDING.yml +0 -0
  980. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
  981. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
  982. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/ISSUE_TEMPLATE/spec-clarification.yml +0 -0
  983. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/workflows/ci.yml +0 -0
  984. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/workflows/link-check-config.json +0 -0
  985. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/workflows/link-check.yml +0 -0
  986. {crprotocol-2.3.1 → crprotocol-4.1.1}/.github/workflows/validate-schemas.yml +0 -0
  987. {crprotocol-2.3.1 → crprotocol-4.1.1}/.pre-commit-config.yaml +0 -0
  988. /crprotocol-2.3.1/crp/py.typed → /crprotocol-4.1.1/3.1.0 +0 -0
  989. {crprotocol-2.3.1 → crprotocol-4.1.1}/BENCHMARKS.md +0 -0
  990. {crprotocol-2.3.1/site-docs → crprotocol-4.1.1}/CNAME +0 -0
  991. {crprotocol-2.3.1 → crprotocol-4.1.1}/CODE_OF_CONDUCT.md +0 -0
  992. {crprotocol-2.3.1 → crprotocol-4.1.1}/CONTRIBUTING.md +0 -0
  993. {crprotocol-2.3.1 → crprotocol-4.1.1}/CRP_CAPABILITIES.md +0 -0
  994. {crprotocol-2.3.1 → crprotocol-4.1.1}/Dockerfile +0 -0
  995. {crprotocol-2.3.1 → crprotocol-4.1.1}/GOVERNANCE.md +0 -0
  996. {crprotocol-2.3.1 → crprotocol-4.1.1}/HOSTING_POSITIONING.md +0 -0
  997. {crprotocol-2.3.1 → crprotocol-4.1.1}/INTERNAL_DOCS.md +0 -0
  998. {crprotocol-2.3.1 → crprotocol-4.1.1}/LICENSE.md +0 -0
  999. {crprotocol-2.3.1 → crprotocol-4.1.1}/NOTICE +0 -0
  1000. {crprotocol-2.3.1 → crprotocol-4.1.1}/RAILWAY_DEPLOYMENT_GUIDE.md +0 -0
  1001. {crprotocol-2.3.1 → crprotocol-4.1.1}/RAILWAY_VARIABLES.md +0 -0
  1002. {crprotocol-2.3.1 → crprotocol-4.1.1}/SECURITY.md +0 -0
  1003. {crprotocol-2.3.1 → crprotocol-4.1.1}/SITE_NAVIGATION_AND_PUBLISHING.md +0 -0
  1004. {crprotocol-2.3.1 → crprotocol-4.1.1}/STRIPE_MONETISATION.md +0 -0
  1005. {crprotocol-2.3.1 → crprotocol-4.1.1}/TRADEMARK.md +0 -0
  1006. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/__main__.py +0 -0
  1007. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/_typing.py +0 -0
  1008. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/adapters.py +0 -0
  1009. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/__init__.py +0 -0
  1010. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/auto_ingest.py +0 -0
  1011. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/hierarchical.py +0 -0
  1012. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/parallel.py +0 -0
  1013. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/review_cycle.py +0 -0
  1014. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/advanced/scale_mode.py +0 -0
  1015. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/ckf/graph_walk.py +0 -0
  1016. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/ckf/merge.py +0 -0
  1017. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/ckf/pattern_query.py +0 -0
  1018. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/ckf/pubsub.py +0 -0
  1019. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/cli/__init__.py +0 -0
  1020. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/continuation/completion.py +0 -0
  1021. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/continuation/stitch.py +0 -0
  1022. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/continuation/trigger.py +0 -0
  1023. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/batch.py +0 -0
  1024. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/circuit_breaker.py +0 -0
  1025. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/extraction_facade.py +0 -0
  1026. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/manifest_derive.py +0 -0
  1027. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/relay_strategies.py +0 -0
  1028. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/core/security_manager.py +0 -0
  1029. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/envelope/decomposer.py +0 -0
  1030. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/envelope/packer.py +0 -0
  1031. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/__init__.py +0 -0
  1032. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/complexity.py +0 -0
  1033. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/contradiction.py +0 -0
  1034. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/quality_gate.py +0 -0
  1035. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/stage2_statistical.py +0 -0
  1036. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/extraction/stage5_discourse.py +0 -0
  1037. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/integrations/__init__.py +0 -0
  1038. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/integrations/_common.py +0 -0
  1039. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/license_guard.py +0 -0
  1040. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/observability/__init__.py +0 -0
  1041. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/observability/audit.py +0 -0
  1042. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/_embeddings.py +0 -0
  1043. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/claim_detector.py +0 -0
  1044. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/contradiction_detector.py +0 -0
  1045. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/entailment_verifier.py +0 -0
  1046. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/omission_analyzer.py +0 -0
  1047. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/provenance/report_generator.py +0 -0
  1048. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/providers/tokenizers.py +0 -0
  1049. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/resources/__init__.py +0 -0
  1050. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/__init__.py +0 -0
  1051. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/cost-estimate.json +0 -0
  1052. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/crp-error.json +0 -0
  1053. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/envelope-preview.json +0 -0
  1054. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/persisted-state-header.json +0 -0
  1055. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/quality-report.json +0 -0
  1056. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/session-handle.json +0 -0
  1057. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/session-status.json +0 -0
  1058. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/stream-event.json +0 -0
  1059. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/schemas/task-intent.json +0 -0
  1060. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/security/validation.py +0 -0
  1061. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/state/compaction.py +0 -0
  1062. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/state/serialization.py +0 -0
  1063. {crprotocol-2.3.1 → crprotocol-4.1.1}/crp/state/session_cleanup.py +0 -0
  1064. {crprotocol-2.3.1 → crprotocol-4.1.1}/docs/WASA_INTEGRATION_TUTORIAL.md +0 -0
  1065. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/async_usage.py +0 -0
  1066. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/benchmark_continuation.py +0 -0
  1067. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/choose_provider.py +0 -0
  1068. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/comply_demo.py +0 -0
  1069. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/demo_app/README.md +0 -0
  1070. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/demo_app/demo.py +0 -0
  1071. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/demo_app/demo_v1.py +0 -0
  1072. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/extraction-pipeline.md +0 -0
  1073. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/ingestion.py +0 -0
  1074. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/local-model.md +0 -0
  1075. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/multi-provider.md +0 -0
  1076. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/multi_turn.py +0 -0
  1077. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/quickstart.md +0 -0
  1078. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/quickstart.py +0 -0
  1079. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/scribe_demo.py +0 -0
  1080. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/session-resumption.md +0 -0
  1081. {crprotocol-2.3.1 → crprotocol-4.1.1}/examples/streaming.py +0 -0
  1082. {crprotocol-2.3.1 → crprotocol-4.1.1}/rfcs/0000-template.md +0 -0
  1083. {crprotocol-2.3.1 → crprotocol-4.1.1}/rfcs/0001-initial-release.md +0 -0
  1084. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/cost-estimate.json +0 -0
  1085. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/crp-error.json +0 -0
  1086. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/envelope-preview.json +0 -0
  1087. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/openapi.json +0 -0
  1088. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/persisted-state-header.json +0 -0
  1089. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/quality-report.json +0 -0
  1090. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/session-handle.json +0 -0
  1091. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/session-status.json +0 -0
  1092. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/stream-event.json +0 -0
  1093. {crprotocol-2.3.1 → crprotocol-4.1.1}/schemas/task-intent.json +0 -0
  1094. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/01_RESEARCH_FOUNDATIONS.md +0 -0
  1095. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/03_CONTEXT_ENVELOPE.md +0 -0
  1096. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/04_TOKEN_GENERATION_PROTOCOL.md +0 -0
  1097. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/05_SYSTEM_WIDE_INTEGRATION.md +0 -0
  1098. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/06_IMPLEMENTATION_PLAN.md +0 -0
  1099. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/07_SECURITY.md +0 -0
  1100. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/08_MONETIZATION.md +0 -0
  1101. {crprotocol-2.3.1 → crprotocol-4.1.1}/specification/09_DEPLOYMENT.md +0 -0
  1102. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/conftest.py +0 -0
  1103. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/killer_test/crp_killer_report.json +0 -0
  1104. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/killer_test/crp_killer_report.txt +0 -0
  1105. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/killer_test/crp_killer_test.py +0 -0
  1106. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/killer_test/debug_gap.py +0 -0
  1107. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/killer_test/debug_gap2.py +0 -0
  1108. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_adaptive_allocator.py +0 -0
  1109. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_adversarial_provenance.py +0 -0
  1110. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_agentic.py +0 -0
  1111. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_benchmarks.py +0 -0
  1112. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_ckf_gate.py +0 -0
  1113. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_compliance_security.py +0 -0
  1114. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_compliance_wiring.py +0 -0
  1115. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_context_enforcer.py +0 -0
  1116. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_context_source.py +0 -0
  1117. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_decision_provenance.py +0 -0
  1118. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_gap_fixes_live.py +0 -0
  1119. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_gaps_2_3.py +0 -0
  1120. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_integration.py +0 -0
  1121. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_ip_protection.py +0 -0
  1122. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_live_comprehensive.py +0 -0
  1123. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_live_full_capture.py +0 -0
  1124. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_live_long_generation.py +0 -0
  1125. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_live_verification.py +0 -0
  1126. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_manifest_ledger.py +0 -0
  1127. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase2.py +0 -0
  1128. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase3.py +0 -0
  1129. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase4.py +0 -0
  1130. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase5.py +0 -0
  1131. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase6.py +0 -0
  1132. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase7.py +0 -0
  1133. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase8.py +0 -0
  1134. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_phase9.py +0 -0
  1135. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_production_hardening.py +0 -0
  1136. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_relay_strategies.py +0 -0
  1137. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_resource_manager.py +0 -0
  1138. {crprotocol-2.3.1 → crprotocol-4.1.1}/tests/test_tool_relay.py +0 -0
@@ -0,0 +1,34 @@
1
+ ## Description
2
+
3
+ <!-- Briefly describe what this PR changes and why -->
4
+
5
+ ## Type of Change
6
+
7
+ - [ ] Typo / wording fix
8
+ - [ ] Specification clarification (no semantic change)
9
+ - [ ] Non-breaking addition (new optional field, new example)
10
+ - [ ] Breaking change (requires RFC)
11
+ - [ ] Schema change
12
+ - [ ] Example addition/update
13
+ - [ ] Documentation (README, CONTRIBUTING, etc.)
14
+
15
+ ## Specification Sections Affected
16
+
17
+ <!-- List affected sections, e.g., §3.8, §6.10.2, §22 -->
18
+
19
+ ## RFC 2119 Impact
20
+
21
+ <!-- If this changes any MUST/SHOULD/MAY requirements, list them here -->
22
+
23
+ - [ ] No RFC 2119 changes
24
+ - [ ] Changes MUST/MUST NOT requirements
25
+ - [ ] Changes SHOULD/SHOULD NOT requirements
26
+ - [ ] Changes MAY requirements
27
+
28
+ ## Checklist
29
+
30
+ - [ ] I have read the [Contributing Guide](../CONTRIBUTING.md)
31
+ - [ ] JSON Schemas validate correctly (if modified)
32
+ - [ ] Cross-references are correct (§ references point to valid sections)
33
+ - [ ] CHANGELOG.md is updated (for user-facing changes)
34
+ - [ ] No broken links in modified documents
@@ -0,0 +1,41 @@
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
+ - '.github/workflows/docs.yml'
13
+ - 'pyproject.toml'
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ contents: write
18
+
19
+ jobs:
20
+ deploy:
21
+ runs-on: ubuntu-latest
22
+ env:
23
+ DISABLE_MKDOCS_2_WARNING: true
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ with:
27
+ fetch-depth: 0
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: '3.13'
33
+
34
+ - name: Install docs dependencies
35
+ run: pip install -e ".[docs]"
36
+
37
+ - name: Regenerate API reference
38
+ run: python scripts/generate_api_reference.py
39
+
40
+ - name: Build and deploy
41
+ run: mkdocs gh-deploy --force --strict
@@ -0,0 +1,81 @@
1
+ # OS files
2
+ .DS_Store
3
+ Thumbs.db
4
+ desktop.ini
5
+
6
+ # Editor files
7
+ *.swp
8
+ *.swo
9
+ *~
10
+ .vscode/
11
+ .idea/
12
+ *.sublime-*
13
+
14
+ # Node modules (for schema validation)
15
+ node_modules/
16
+
17
+ # Build outputs
18
+ dist/
19
+ build/
20
+ *.egg-info/
21
+ site/
22
+ .cache/
23
+
24
+ # Python
25
+ __pycache__/
26
+ *.py[cod]
27
+ *.so
28
+ .mypy_cache/
29
+ .pytest_cache/
30
+ .ruff_cache/
31
+ *.egg
32
+ pip-wheel-metadata/
33
+
34
+ # Temporary files
35
+ *.tmp
36
+ *.bak
37
+
38
+ # Runtime session data
39
+ crp_sessions/
40
+ .hypothesis/
41
+
42
+ # Private keys / secrets — NEVER commit
43
+ *.pem
44
+ *.key
45
+ *.p8
46
+ encrypted-*.pem
47
+ *.env
48
+ *_railway.env
49
+ .env.local
50
+ .env.production
51
+ .env.staging
52
+ .env.development
53
+ secrets/
54
+
55
+ # Dev scratch files (root-level only)
56
+ /_*.py
57
+ /_*.txt
58
+ /_*.json
59
+ /_*.jsonl
60
+ /_full_*
61
+ /_long_gen*
62
+ /_live_*
63
+ /_check_*
64
+ /_dep_*
65
+ /_pytest_count*
66
+ /_test_*
67
+ /_tr.*
68
+ /_batch*
69
+ /0.80)
70
+ /_long_gen_results/
71
+ /type_confidence
72
+ /[0-9][0-9][0-9]*
73
+
74
+ # Numeric test output directories
75
+ /[0-9]*/
76
+
77
+ # Logs
78
+ *.log
79
+
80
+ .coverage
81
+ .env.hosted
@@ -0,0 +1,450 @@
1
+ # CRP Auth & User Management Expert
2
+
3
+ **Scope:** Project
4
+ **Purpose:** Deep expertise on CRP's unified authentication, identity, entitlement, and PostgreSQL persistence layer. Use this whenever working on auth, billing, user state, Clerk integration, GitHub connectivity, or database schema across CRP Gateway and CRP Comply.
5
+
6
+ ---
7
+
8
+ ## Canonical Documents
9
+
10
+ Always read these first before modifying auth-related code:
11
+
12
+ ```
13
+ SPECS_5_06_2026_CRP_v4/CRP-AUTH-POSTGRESQL-MIGRATION-PLAN.md # This plan
14
+ SPECS_5_06_2026_CRP_v4/CRP-AUTH-USER-MANAGEMENT-SOLUTION.md # Auth spec
15
+ SPECS_5_06_2026_CRP_v4/CRP-GITHUB-CONNECTIVITY-SOLUTION.md # GitHub spec
16
+ SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-047-monetisation-payments.md # Billing spec
17
+ SPECS_5_06_2026_CRP_v4/specs/CRP-SPEC-048-comply-lowcode-github.md # GitHub App spec
18
+ AGENTS.md # Project conventions
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Architecture Overview
24
+
25
+ ```
26
+ ┌─────────────────────────────────────────────────────────────┐
27
+ │ CLERK (clerk.crprotocol.io) — Identity + Entitlement │
28
+ │ - Users, orgs, memberships │
29
+ │ - public_metadata: {comply_plan, gateway_plan, scan_plan, │
30
+ │ stripeCustomerId, creditBalanceCents} │
31
+ │ - Stripe webhooks write here ONLY │
32
+ └────────────────────────┬────────────────────────────────────┘
33
+ │ verify JWT (JWKS)
34
+ ┌─────────────┼───────────────┐
35
+ ▼ ▼ ▼
36
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
37
+ │ Gateway │ │ Comply │ │ Scan │
38
+ │ FastAPI │ │ FastAPI │ │ (in Comply) │
39
+ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
40
+ │ read entitlement│ read entitlement│ read entitlement
41
+ │ (Clerk metadata)│ (Clerk metadata)│ (Clerk metadata)
42
+ ▼ ▼ ▼
43
+ ┌─────────────────────────────────────────────────────────────┐
44
+ │ POSTGRESQL (Railway managed) — Application State │
45
+ │ - tenants, api_keys, github_installations, github_repos, │
46
+ │ gateway_systems, gateway_usage, scan_results, etc. │
47
+ └─────────────────────────────────────────────────────────────┘
48
+ ```
49
+
50
+ **Golden rule:** Clerk stores WHO you are and WHAT you can do. PostgreSQL stores WHAT you have done.
51
+
52
+ ---
53
+
54
+ ## The Identity Model
55
+
56
+ ### Identity Dataclass
57
+
58
+ ```python
59
+ from dataclasses import dataclass
60
+
61
+ @dataclass(frozen=True)
62
+ class Identity:
63
+ user_id: str # Clerk "sub" claim
64
+ org_id: str | None # Clerk "org_id" claim (null = personal account)
65
+ org_role: str | None # Clerk "org_role" claim
66
+ ```
67
+
68
+ ### resolve_account()
69
+
70
+ ```python
71
+ def resolve_account(identity: Identity) -> tuple[str, str]:
72
+ """Return (account_type, account_id)."""
73
+ if identity.org_id:
74
+ return ("org", identity.org_id)
75
+ return ("user", identity.user_id)
76
+ ```
77
+
78
+ **Usage pattern:**
79
+ ```python
80
+ identity = await current_clerk_identity(request)
81
+ account_type, account_id = resolve_account(identity)
82
+ tenant_id = account_id # tenant_id = org_id for teams, user_id for personal
83
+ ```
84
+
85
+ ### Personal vs Organization Accounts
86
+
87
+ | Context | `org_id` | `resolve_account()` returns | `tenant_id` |
88
+ |---------|----------|----------------------------|-------------|
89
+ | Personal (solo developer) | `None` | `("user", "user_abc")` | `"user_abc"` |
90
+ | Organization (team/company) | `"org_xyz"` | `("org", "org_xyz")` | `"org_xyz"` |
91
+
92
+ **Critical:** Always use `resolve_account()` — never branch on `org_id` directly in route handlers.
93
+
94
+ ---
95
+
96
+ ## Entitlement: Clerk Metadata
97
+
98
+ ### The Five Rules
99
+
100
+ 1. **Stripe webhook is the ONLY writer.** Never write entitlement from app code.
101
+ 2. **Per-product keys.** `comply_plan`, `gateway_plan`, `scan_plan` — never `"plan"`.
102
+ 3. **Apps read via `get_entitlement()`.** Caches for 60s, reads from Clerk Backend API.
103
+ 4. **PostgreSQL never stores entitlement.** No `plan` column on any table.
104
+ 5. **Customer ID lives in Clerk metadata.** `stripeCustomerId` is the linkage.
105
+
106
+ ### Clerk Metadata Schema
107
+
108
+ ```json
109
+ {
110
+ "comply_plan": "free | starter | scale",
111
+ "gateway_plan": "free | developer | team",
112
+ "scan_plan": "free | pro | business",
113
+ "comply_quota": 100,
114
+ "gateway_quota": 1000,
115
+ "scan_quota": 50,
116
+ "stripeCustomerId": "cus_...",
117
+ "stripeSubscriptionId": "sub_...",
118
+ "creditBalanceCents": 0,
119
+ "features": ["advanced_analytics", "multi_org"]
120
+ }
121
+ ```
122
+
123
+ ### Reading Entitlement
124
+
125
+ ```python
126
+ from crp_shared.auth import get_entitlement, Identity
127
+
128
+ async def some_endpoint(identity: Identity = Depends(current_clerk_identity)):
129
+ entitlement = await get_entitlement(identity, product="comply")
130
+ # Returns: {"plan": "scale", "quota": 50000, "credits": 2000, "stripe_customer_id": "cus_..."}
131
+ if entitlement["plan"] == "free":
132
+ raise HTTPException(403, "This feature requires a paid plan")
133
+ ```
134
+
135
+ ### Writing Entitlement (Stripe Webhook Only)
136
+
137
+ ```python
138
+ # In Stripe webhook handler — NEVER in app code
139
+ async def handle_checkout_completed(event):
140
+ price_id = event["data"]["object"]["items"][0]["price"]["id"]
141
+ product = price_id_to_product(price_id) # "comply" | "gateway" | "scan"
142
+ plan = price_id_to_plan(price_id) # "starter" | "developer" | "pro"
143
+
144
+ meta_update = {
145
+ f"{product}_plan": plan,
146
+ f"{product}_quota": PLAN_QUOTAS[plan],
147
+ }
148
+
149
+ await clerk_backend_api.update_org_metadata(
150
+ org_id=org_id,
151
+ public_metadata=meta_update
152
+ )
153
+ ```
154
+
155
+ ---
156
+
157
+ ## PostgreSQL Schema
158
+
159
+ ### Shared Tables (both databases)
160
+
161
+ ```sql
162
+ -- tenants: links Clerk identity to app state
163
+ CREATE TABLE tenants (
164
+ tenant_id TEXT PRIMARY KEY, -- user_id (personal) or tnt_xxx (org)
165
+ clerk_org_id TEXT UNIQUE, -- NULL for personal
166
+ clerk_user_id TEXT NOT NULL,
167
+ account_type TEXT NOT NULL
168
+ CHECK (account_type IN ('org', 'personal'))
169
+ DEFAULT 'org',
170
+ name TEXT,
171
+ created_at TIMESTAMPTZ DEFAULT NOW(),
172
+ updated_at TIMESTAMPTZ DEFAULT NOW()
173
+ );
174
+
175
+ -- api_keys: hashed, per-tenant
176
+ CREATE TABLE api_keys (
177
+ key_id TEXT PRIMARY KEY,
178
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
179
+ key_hash TEXT NOT NULL, -- SHA-256
180
+ key_preview TEXT, -- last 8 chars
181
+ name TEXT DEFAULT 'default',
182
+ scopes TEXT[] DEFAULT '{}',
183
+ revoked BOOLEAN DEFAULT FALSE,
184
+ created_at TIMESTAMPTZ DEFAULT NOW(),
185
+ last_used_at TIMESTAMPTZ
186
+ );
187
+ ```
188
+
189
+ ### Gateway-Specific Tables
190
+
191
+ ```sql
192
+ CREATE TABLE gateway_systems (
193
+ system_id TEXT PRIMARY KEY,
194
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
195
+ name TEXT NOT NULL,
196
+ domain TEXT,
197
+ intended_purpose TEXT,
198
+ eu_ai_act_class TEXT CHECK (eu_ai_act_class IN ('MINIMAL','LIMITED','HIGH','UNACCEPTABLE')),
199
+ created_at TIMESTAMPTZ DEFAULT NOW()
200
+ );
201
+
202
+ CREATE TABLE gateway_providers (
203
+ provider_id TEXT PRIMARY KEY,
204
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
205
+ provider_type TEXT NOT NULL CHECK (provider_type IN ('openai','anthropic','ollama','custom')),
206
+ api_key_encrypted TEXT NOT NULL,
207
+ default_model TEXT,
208
+ created_at TIMESTAMPTZ DEFAULT NOW()
209
+ );
210
+
211
+ CREATE TABLE gateway_usage (
212
+ usage_id BIGSERIAL PRIMARY KEY,
213
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
214
+ call_type TEXT CHECK (call_type IN ('chat','completion','embedding')),
215
+ model TEXT,
216
+ tokens_in INT DEFAULT 0,
217
+ tokens_out INT DEFAULT 0,
218
+ risk_class TEXT,
219
+ halted BOOLEAN DEFAULT FALSE,
220
+ created_at TIMESTAMPTZ DEFAULT NOW()
221
+ );
222
+ ```
223
+
224
+ ### Comply-Specific Tables
225
+
226
+ ```sql
227
+ CREATE TABLE github_installations (
228
+ installation_id BIGINT PRIMARY KEY,
229
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
230
+ account_login TEXT NOT NULL,
231
+ account_type TEXT NOT NULL DEFAULT 'Organization' CHECK (account_type IN ('User','Organization')),
232
+ suspended BOOLEAN DEFAULT FALSE,
233
+ created_at TIMESTAMPTZ DEFAULT NOW()
234
+ );
235
+
236
+ CREATE TABLE github_repos (
237
+ repo_internal_id BIGSERIAL PRIMARY KEY,
238
+ installation_id BIGINT NOT NULL REFERENCES github_installations(installation_id) ON DELETE CASCADE,
239
+ repo_id BIGINT NOT NULL,
240
+ full_name TEXT NOT NULL,
241
+ private BOOLEAN NOT NULL DEFAULT TRUE,
242
+ connected BOOLEAN DEFAULT FALSE,
243
+ last_scanned_at TIMESTAMPTZ,
244
+ findings_count INT DEFAULT 0,
245
+ UNIQUE(installation_id, repo_id)
246
+ );
247
+
248
+ CREATE TABLE scan_results (
249
+ scan_id BIGSERIAL PRIMARY KEY,
250
+ repo_id BIGINT NOT NULL REFERENCES github_repos(repo_internal_id) ON DELETE CASCADE,
251
+ tenant_id TEXT NOT NULL REFERENCES tenants(tenant_id) ON DELETE CASCADE,
252
+ commit_sha TEXT,
253
+ findings JSONB DEFAULT '[]',
254
+ status TEXT DEFAULT 'pending' CHECK (status IN ('pending','running','completed','failed')),
255
+ created_at TIMESTAMPTZ DEFAULT NOW(),
256
+ completed_at TIMESTAMPTZ
257
+ );
258
+ ```
259
+
260
+ ---
261
+
262
+ ## GitHub App Connectivity
263
+
264
+ ### The Correct Flow
265
+
266
+ ```
267
+ [Frontend] clicks "Connect GitHub"
268
+
269
+ ▼ POST /api/v1/github/connect-start (Clerk-authed)
270
+ [Backend] creates signed state token → returns install URL
271
+
272
+ ▼ User installs on GitHub
273
+ [GitHub] redirects to Setup URL
274
+
275
+ ▼ GET /api/v1/github/setup?installation_id=NNN&state=TOKEN
276
+ [Backend] validates state → recovers identity → fetches repos → persists → redirects to app
277
+
278
+ ▼ Frontend calls GET /api/v1/github/repos
279
+ [Backend] returns repos from PostgreSQL (no GitHub API call)
280
+ ```
281
+
282
+ ### State Token Format
283
+
284
+ ```python
285
+ import hmac, hashlib, base64, json, time, secrets
286
+
287
+ STATE_SECRET = os.environ["GITHUB_STATE_SECRET"].encode()
288
+
289
+ def _sign_state(payload: dict) -> str:
290
+ raw = base64.urlsafe_b64encode(json.dumps(payload).encode()).decode()
291
+ sig = hmac.new(STATE_SECRET, raw.encode(), hashlib.sha256).hexdigest()
292
+ return f"{raw}.{sig}"
293
+
294
+ def _verify_state(state: str) -> dict:
295
+ raw, sig = state.split(".")
296
+ expect = hmac.new(STATE_SECRET, raw.encode(), hashlib.sha256).hexdigest()
297
+ if not hmac.compare_digest(sig, expect):
298
+ raise ValueError("bad signature")
299
+ payload = json.loads(base64.urlsafe_b64decode(raw))
300
+ if payload["exp"] < time.time():
301
+ raise ValueError("expired")
302
+ return payload
303
+
304
+ # Usage in connect-start:
305
+ state = _sign_state({
306
+ "clerk_user_id": identity.user_id,
307
+ "clerk_org_id": identity.org_id,
308
+ "exp": time.time() + 600,
309
+ "nonce": secrets.token_hex(8),
310
+ })
311
+ ```
312
+
313
+ ### Critical GitHub Webhook Events
314
+
315
+ | Event | Action | SQL Operation |
316
+ |-------|--------|---------------|
317
+ | `installation` + `deleted`/`suspend` | User uninstalled app | `DELETE FROM github_installations WHERE installation_id = $1` |
318
+ | `installation_repositories` + `added` | Repos granted | `INSERT INTO github_repos ... ON CONFLICT DO NOTHING` |
319
+ | `installation_repositories` + `removed` | Repos revoked | `DELETE FROM github_repos WHERE repo_id = $1` |
320
+ | `push` | New commit | Enqueue scan job (async worker) |
321
+
322
+ ---
323
+
324
+ ## API Key Handling
325
+
326
+ ### Creation
327
+
328
+ ```python
329
+ import secrets, hashlib
330
+
331
+ async def create_api_key(tenant_id: str, name: str = "default") -> str:
332
+ prefix = "crp_gw_" if is_gateway else "crp_cm_"
333
+ random_part = secrets.token_urlsafe(24)
334
+ full_key = f"{prefix}{random_part}"
335
+
336
+ key_hash = hashlib.sha256(full_key.encode()).hexdigest()
337
+ key_preview = full_key[-8:]
338
+
339
+ await db.execute("""
340
+ INSERT INTO api_keys (key_id, tenant_id, key_hash, key_preview, name)
341
+ VALUES ($1, $2, $3, $4, $5)
342
+ """, f"key_{secrets.token_urlsafe(8)}", tenant_id, key_hash, key_preview, name)
343
+
344
+ return full_key # Returned ONCE — never stored or logged
345
+ ```
346
+
347
+ ### Validation
348
+
349
+ ```python
350
+ async def validate_api_key(full_key: str) -> str | None:
351
+ key_hash = hashlib.sha256(full_key.encode()).hexdigest()
352
+ row = await db.fetchrow("""
353
+ SELECT tenant_id FROM api_keys
354
+ WHERE key_hash = $1 AND revoked = FALSE
355
+ """, key_hash)
356
+ return row["tenant_id"] if row else None
357
+ ```
358
+
359
+ ---
360
+
361
+ ## Railway Environment Variables
362
+
363
+ ### Both Apps (must be identical)
364
+
365
+ ```bash
366
+ CLERK_ISSUER=https://clerk.crprotocol.io
367
+ CLERK_SECRET_KEY=sk_live_...
368
+ CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsuY3Jwcm90b2NvbC5pbyQ
369
+ DATABASE_URL=postgresql://USER:PASS@HOST:5432/DB_NAME
370
+ ```
371
+
372
+ ### Comply Only
373
+
374
+ ```bash
375
+ GITHUB_APP_ID=...
376
+ GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
377
+ GITHUB_APP_WEBHOOK_SECRET=...
378
+ GITHUB_STATE_SECRET=<openssl rand -hex 32>
379
+ STRIPE_SECRET_KEY=sk_live_...
380
+ STRIPE_WEBHOOK_SECRET=whsec_...
381
+ STRIPE_COMPLY_STARTER_PRICE_ID=price_...
382
+ STRIPE_COMPLY_SCALE_PRICE_ID=price_...
383
+ STRIPE_SCAN_PRO_PRICE_ID=price_...
384
+ STRIPE_SCAN_BUSINESS_PRICE_ID=price_...
385
+ STRIPE_GATEWAY_DEVELOPER_PRICE_ID=price_...
386
+ STRIPE_GATEWAY_TEAM_PRICE_ID=price_...
387
+ ```
388
+
389
+ ### Gateway Only
390
+
391
+ ```bash
392
+ SECRET_KEY=<openssl rand -hex 32>
393
+ STRIPE_SECRET_KEY=sk_live_...
394
+ STRIPE_WEBHOOK_SECRET=whsec_...
395
+ STRIPE_GATEWAY_DEVELOPER_PRICE_ID=price_...
396
+ STRIPE_GATEWAY_TEAM_PRICE_ID=price_...
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Common Bugs & Fixes
402
+
403
+ | Bug | Cause | Fix |
404
+ |-----|-------|-----|
405
+ | Repos disappear after restart | `_connected_repos` is in-memory dict | Migrate to `github_repos` table |
406
+ | Billing plan overwritten | Shared `"plan"` key in Clerk metadata | Use `comply_plan` / `gateway_plan` / `scan_plan` |
407
+ | GitHub callback forged | Raw `user_id` in state param | Use HMAC-signed state tokens with TTL |
408
+ | Gateway loses all tenants | `_tenants` is module-level dict | Migrate to PostgreSQL `tenants` table |
409
+ | API keys visible in logs | Stored plaintext | Hash with SHA-256, store hash only |
410
+ | Entitlement drift | Stripe webhook writes local JSON | Write to Clerk metadata ONLY |
411
+ | Personal account 404s | `org_id` missing, no fallback | Use `resolve_account()` — falls back to `user_id` |
412
+ | CORS errors on cross-product links | Different Clerk instances | Align both apps to `clerk.crprotocol.io` |
413
+
414
+ ---
415
+
416
+ ## Testing Auth Changes
417
+
418
+ ```bash
419
+ # Test Clerk JWT verification
420
+ curl -H "Authorization: Bearer $(clerk_token)" https://gateway.crprotocol.io/api/v1/systems
421
+
422
+ # Test API key validation
423
+ curl -H "Authorization: Bearer crp_gw_xxx" https://gateway.crprotocol.io/v1/chat/completions
424
+
425
+ # Test GitHub connect-start
426
+ curl -X POST -H "Authorization: Bearer $(clerk_token)" \
427
+ https://comply.crprotocol.io/api/v1/github/connect-start
428
+
429
+ # Test entitlement read
430
+ python -c "
431
+ import asyncio
432
+ from crp_shared.auth import get_entitlement, Identity
433
+ async def test():
434
+ e = await get_entitlement(Identity('user_xxx', 'org_yyy', 'admin'), 'comply')
435
+ print(e)
436
+ asyncio.run(test())
437
+ "
438
+ ```
439
+
440
+ ---
441
+
442
+ ## Related Skills
443
+
444
+ - `crp-comply-expert` — Comply-specific architecture, frontend patterns, dead code
445
+ - `crp-gateway-expert` — Gateway-specific endpoints, provider vault, deployment
446
+ - `crp-v4-specs` — Spec lookup, implementation rounds, ownership
447
+
448
+ ---
449
+
450
+ *Last updated: 2026-06-05. Keep in sync with CRP-AUTH-POSTGRESQL-MIGRATION-PLAN.md.*