causal-continuity-engine 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. causal_continuity_engine-0.1.0/.editorconfig +15 -0
  2. causal_continuity_engine-0.1.0/.gitattributes +21 -0
  3. causal_continuity_engine-0.1.0/.githooks/commit-msg +19 -0
  4. causal_continuity_engine-0.1.0/.githooks/pre-commit +61 -0
  5. causal_continuity_engine-0.1.0/.github/CODEOWNERS +45 -0
  6. causal_continuity_engine-0.1.0/.github/CONTRIBUTING.md +260 -0
  7. causal_continuity_engine-0.1.0/.github/ISSUE_TEMPLATE/bug.yml +125 -0
  8. causal_continuity_engine-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  9. causal_continuity_engine-0.1.0/.github/ISSUE_TEMPLATE/feature.yml +59 -0
  10. causal_continuity_engine-0.1.0/.github/SECURITY.md +180 -0
  11. causal_continuity_engine-0.1.0/.github/SUPPORT.md +43 -0
  12. causal_continuity_engine-0.1.0/.github/dependabot.yml +75 -0
  13. causal_continuity_engine-0.1.0/.github/pull_request_template.md +37 -0
  14. causal_continuity_engine-0.1.0/.github/release.yml +17 -0
  15. causal_continuity_engine-0.1.0/.github/ruleset.README.md +139 -0
  16. causal_continuity_engine-0.1.0/.github/ruleset.json +65 -0
  17. causal_continuity_engine-0.1.0/.github/scripts/bootstrap_tools.py +272 -0
  18. causal_continuity_engine-0.1.0/.github/scripts/build_distributions.py +660 -0
  19. causal_continuity_engine-0.1.0/.github/scripts/check_clean.py +24 -0
  20. causal_continuity_engine-0.1.0/.github/scripts/check_release_metadata.py +160 -0
  21. causal_continuity_engine-0.1.0/.github/scripts/check_release_tag.py +561 -0
  22. causal_continuity_engine-0.1.0/.github/scripts/check_stdlib.py +41 -0
  23. causal_continuity_engine-0.1.0/.github/scripts/prepare_release_tag.py +270 -0
  24. causal_continuity_engine-0.1.0/.github/scripts/render_api_docs.py +34 -0
  25. causal_continuity_engine-0.1.0/.github/scripts/run_gates.py +132 -0
  26. causal_continuity_engine-0.1.0/.github/scripts/verify_distributions.py +2370 -0
  27. causal_continuity_engine-0.1.0/.github/scripts/verify_public_schemas.py +201 -0
  28. causal_continuity_engine-0.1.0/.github/tag-ruleset.json +17 -0
  29. causal_continuity_engine-0.1.0/.github/workflows/ci.yml +166 -0
  30. causal_continuity_engine-0.1.0/.github/workflows/commit-signature-audit.yml +44 -0
  31. causal_continuity_engine-0.1.0/.github/workflows/dependency-review.yml +45 -0
  32. causal_continuity_engine-0.1.0/.github/workflows/no-ai-attribution.yml +129 -0
  33. causal_continuity_engine-0.1.0/.github/workflows/release.yml +265 -0
  34. causal_continuity_engine-0.1.0/.github/workflows/secret-scan.yml +33 -0
  35. causal_continuity_engine-0.1.0/.gitignore +15 -0
  36. causal_continuity_engine-0.1.0/.gitleaks.toml +28 -0
  37. causal_continuity_engine-0.1.0/.pre-commit-config.yaml +51 -0
  38. causal_continuity_engine-0.1.0/AGENTS.md +340 -0
  39. causal_continuity_engine-0.1.0/CHANGELOG.md +555 -0
  40. causal_continuity_engine-0.1.0/CITATION.cff +25 -0
  41. causal_continuity_engine-0.1.0/LICENSE.txt +202 -0
  42. causal_continuity_engine-0.1.0/MANIFEST.in +21 -0
  43. causal_continuity_engine-0.1.0/NOTICE +6 -0
  44. causal_continuity_engine-0.1.0/PKG-INFO +720 -0
  45. causal_continuity_engine-0.1.0/README.md +685 -0
  46. causal_continuity_engine-0.1.0/SPEC.md +515 -0
  47. causal_continuity_engine-0.1.0/benchmarks/__init__.py +0 -0
  48. causal_continuity_engine-0.1.0/benchmarks/continuitybench/__init__.py +0 -0
  49. causal_continuity_engine-0.1.0/benchmarks/continuitybench/run.py +146 -0
  50. causal_continuity_engine-0.1.0/benchmarks/continuitybench/scenarios.py +544 -0
  51. causal_continuity_engine-0.1.0/causal_continuity_engine/__init__.py +21 -0
  52. causal_continuity_engine-0.1.0/causal_continuity_engine/api.py +1264 -0
  53. causal_continuity_engine-0.1.0/causal_continuity_engine/capabilities.py +548 -0
  54. causal_continuity_engine-0.1.0/causal_continuity_engine/capsule.py +996 -0
  55. causal_continuity_engine-0.1.0/causal_continuity_engine/cli.py +1338 -0
  56. causal_continuity_engine-0.1.0/causal_continuity_engine/core.py +468 -0
  57. causal_continuity_engine-0.1.0/causal_continuity_engine/engine.py +4354 -0
  58. causal_continuity_engine-0.1.0/causal_continuity_engine/evidence.py +971 -0
  59. causal_continuity_engine-0.1.0/causal_continuity_engine/extraction.py +263 -0
  60. causal_continuity_engine-0.1.0/causal_continuity_engine/github.py +657 -0
  61. causal_continuity_engine-0.1.0/causal_continuity_engine/graph.py +809 -0
  62. causal_continuity_engine-0.1.0/causal_continuity_engine/invalidation.py +1040 -0
  63. causal_continuity_engine-0.1.0/causal_continuity_engine/lamport.py +306 -0
  64. causal_continuity_engine-0.1.0/causal_continuity_engine/learning.py +466 -0
  65. causal_continuity_engine-0.1.0/causal_continuity_engine/memory.py +610 -0
  66. causal_continuity_engine-0.1.0/causal_continuity_engine/ontology.py +108 -0
  67. causal_continuity_engine-0.1.0/causal_continuity_engine/partial.py +309 -0
  68. causal_continuity_engine-0.1.0/causal_continuity_engine/policy.py +940 -0
  69. causal_continuity_engine-0.1.0/causal_continuity_engine/proof.py +920 -0
  70. causal_continuity_engine-0.1.0/causal_continuity_engine/py.typed +1 -0
  71. causal_continuity_engine-0.1.0/causal_continuity_engine/redaction.py +94 -0
  72. causal_continuity_engine-0.1.0/causal_continuity_engine/resume.py +653 -0
  73. causal_continuity_engine-0.1.0/causal_continuity_engine/store.py +1174 -0
  74. causal_continuity_engine-0.1.0/causal_continuity_engine/verifiers.py +1006 -0
  75. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/PKG-INFO +720 -0
  76. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/SOURCES.txt +181 -0
  77. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/dependency_links.txt +1 -0
  78. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/entry_points.txt +2 -0
  79. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/requires.txt +7 -0
  80. causal_continuity_engine-0.1.0/causal_continuity_engine.egg-info/top_level.txt +1 -0
  81. causal_continuity_engine-0.1.0/docs/API.md +81 -0
  82. causal_continuity_engine-0.1.0/docs/CAPABILITIES.md +47 -0
  83. causal_continuity_engine-0.1.0/docs/PUBLIC-FLIP.md +434 -0
  84. causal_continuity_engine-0.1.0/docs/RELEASE.md +413 -0
  85. causal_continuity_engine-0.1.0/docs/REQUIREMENTS.md +186 -0
  86. causal_continuity_engine-0.1.0/docs/REQUIREMENTS_COVERAGE.md +162 -0
  87. causal_continuity_engine-0.1.0/docs/RESEARCH-ROADMAP.md +233 -0
  88. causal_continuity_engine-0.1.0/docs/TESTING.md +49 -0
  89. causal_continuity_engine-0.1.0/docs/adr/ADR-INDEX.md +1890 -0
  90. causal_continuity_engine-0.1.0/docs/assets/social-preview.png +0 -0
  91. causal_continuity_engine-0.1.0/justfile +131 -0
  92. causal_continuity_engine-0.1.0/pyproject.toml +104 -0
  93. causal_continuity_engine-0.1.0/requirements-dev.in +8 -0
  94. causal_continuity_engine-0.1.0/requirements-dev.lock +210 -0
  95. causal_continuity_engine-0.1.0/schemas/cce.anchor.v1.json +62 -0
  96. causal_continuity_engine-0.1.0/schemas/cce.capsule.v1.json +112 -0
  97. causal_continuity_engine-0.1.0/schemas/cce.continuity-receipt.v1.json +315 -0
  98. causal_continuity_engine-0.1.0/schemas/cce.event.v1.json +73 -0
  99. causal_continuity_engine-0.1.0/schemas/cce.proof-predicate.v1.json +35 -0
  100. causal_continuity_engine-0.1.0/schemas/cce.proof.v1.json +242 -0
  101. causal_continuity_engine-0.1.0/schemas/cce.recovery.v1.json +109 -0
  102. causal_continuity_engine-0.1.0/schemas/cce.resume.v1.json +332 -0
  103. causal_continuity_engine-0.1.0/setup.cfg +4 -0
  104. causal_continuity_engine-0.1.0/tests/__init__.py +1 -0
  105. causal_continuity_engine-0.1.0/tests/schema_validation.py +61 -0
  106. causal_continuity_engine-0.1.0/tests/test_api_contract.py +1051 -0
  107. causal_continuity_engine-0.1.0/tests/test_cli.py +664 -0
  108. causal_continuity_engine-0.1.0/tests/test_conformance.py +758 -0
  109. causal_continuity_engine-0.1.0/tests/test_distribution_environment.py +26 -0
  110. causal_continuity_engine-0.1.0/tests/test_engine_e2e.py +286 -0
  111. causal_continuity_engine-0.1.0/tests/test_github_redaction.py +193 -0
  112. causal_continuity_engine-0.1.0/tests/test_instrument_validation.py +535 -0
  113. causal_continuity_engine-0.1.0/tests/test_invalidation_resume.py +205 -0
  114. causal_continuity_engine-0.1.0/tests/test_learning_partial_api.py +380 -0
  115. causal_continuity_engine-0.1.0/tests/test_memory_extraction.py +151 -0
  116. causal_continuity_engine-0.1.0/tests/test_regressions.py +406 -0
  117. causal_continuity_engine-0.1.0/tests/test_regressions_round10_release.py +842 -0
  118. causal_continuity_engine-0.1.0/tests/test_regressions_round11_deep_integrity.py +831 -0
  119. causal_continuity_engine-0.1.0/tests/test_regressions_round12_release_blockers.py +206 -0
  120. causal_continuity_engine-0.1.0/tests/test_regressions_round13_jcs.py +212 -0
  121. causal_continuity_engine-0.1.0/tests/test_regressions_round14_state_integrity.py +1056 -0
  122. causal_continuity_engine-0.1.0/tests/test_regressions_round15_capsule_invalidation_github.py +251 -0
  123. causal_continuity_engine-0.1.0/tests/test_regressions_round15_public_boundaries.py +561 -0
  124. causal_continuity_engine-0.1.0/tests/test_regressions_round15_storage_boundaries.py +707 -0
  125. causal_continuity_engine-0.1.0/tests/test_regressions_round16_cli_api_core_capabilities.py +285 -0
  126. causal_continuity_engine-0.1.0/tests/test_regressions_round2.py +388 -0
  127. causal_continuity_engine-0.1.0/tests/test_regressions_round3.py +490 -0
  128. causal_continuity_engine-0.1.0/tests/test_regressions_round4.py +557 -0
  129. causal_continuity_engine-0.1.0/tests/test_regressions_round5.py +583 -0
  130. causal_continuity_engine-0.1.0/tests/test_regressions_round6.py +559 -0
  131. causal_continuity_engine-0.1.0/tests/test_regressions_round7.py +579 -0
  132. causal_continuity_engine-0.1.0/tests/test_regressions_round8_boundaries.py +558 -0
  133. causal_continuity_engine-0.1.0/tests/test_regressions_round8_engine.py +843 -0
  134. causal_continuity_engine-0.1.0/tests/test_regressions_round8_portability.py +2250 -0
  135. causal_continuity_engine-0.1.0/tests/test_regressions_round8_state.py +705 -0
  136. causal_continuity_engine-0.1.0/tests/test_regressions_round9_integrity.py +885 -0
  137. causal_continuity_engine-0.1.0/tests/test_regressions_round9_scope_freshness.py +179 -0
  138. causal_continuity_engine-0.1.0/tests/test_release_boundary_validation.py +676 -0
  139. causal_continuity_engine-0.1.0/tests/test_release_controls.py +840 -0
  140. causal_continuity_engine-0.1.0/tests/test_sqlite_lifecycle.py +52 -0
  141. causal_continuity_engine-0.1.0/tests/test_store_graph.py +172 -0
  142. causal_continuity_engine-0.1.0/tests/test_trust.py +398 -0
  143. causal_continuity_engine-0.1.0/vectors/action_intent_wrong_type.json +170 -0
  144. causal_continuity_engine-0.1.0/vectors/actor_wrong_type.json +170 -0
  145. causal_continuity_engine-0.1.0/vectors/created_at_invalid_calendar_date.json +172 -0
  146. causal_continuity_engine-0.1.0/vectors/created_at_noncanonical_offset.json +172 -0
  147. causal_continuity_engine-0.1.0/vectors/empty_required_authoritative_failure.json +114 -0
  148. causal_continuity_engine-0.1.0/vectors/empty_required_authoritative_pass.json +107 -0
  149. causal_continuity_engine-0.1.0/vectors/empty_required_no_results.json +99 -0
  150. causal_continuity_engine-0.1.0/vectors/empty_required_self_asserted_pass.json +105 -0
  151. causal_continuity_engine-0.1.0/vectors/generate.py +498 -0
  152. causal_continuity_engine-0.1.0/vectors/incomplete_failed_check.json +168 -0
  153. causal_continuity_engine-0.1.0/vectors/index.json +240 -0
  154. causal_continuity_engine-0.1.0/vectors/input_item_wrong_type.json +163 -0
  155. causal_continuity_engine-0.1.0/vectors/invalid_result_value.json +170 -0
  156. causal_continuity_engine-0.1.0/vectors/lamport_fingerprint_spoof.json +1458 -0
  157. causal_continuity_engine-0.1.0/vectors/lamport_no_registry.json +1454 -0
  158. causal_continuity_engine-0.1.0/vectors/lamport_truncated_key.json +1454 -0
  159. causal_continuity_engine-0.1.0/vectors/missing_required_field.json +157 -0
  160. causal_continuity_engine-0.1.0/vectors/non_binary64_integer.json +174 -0
  161. causal_continuity_engine-0.1.0/vectors/policy_decision_wrong_type.json +146 -0
  162. causal_continuity_engine-0.1.0/vectors/retry_cannot_launder_a_failure.json +197 -0
  163. causal_continuity_engine-0.1.0/vectors/self_asserted_cannot_satisfy.json +173 -0
  164. causal_continuity_engine-0.1.0/vectors/self_assertion_cannot_poison_authoritative_pass.json +194 -0
  165. causal_continuity_engine-0.1.0/vectors/status_contradicts_contents.json +173 -0
  166. causal_continuity_engine-0.1.0/vectors/summary_contradicts_contents.json +170 -0
  167. causal_continuity_engine-0.1.0/vectors/tamper_statement.json +172 -0
  168. causal_continuity_engine-0.1.0/vectors/tamper_statement_resealed.json +172 -0
  169. causal_continuity_engine-0.1.0/vectors/task_id_under_unrelated_field.json +172 -0
  170. causal_continuity_engine-0.1.0/vectors/unbound_task.json +165 -0
  171. causal_continuity_engine-0.1.0/vectors/unknown_action_intent_field.json +173 -0
  172. causal_continuity_engine-0.1.0/vectors/unknown_algorithm.json +172 -0
  173. causal_continuity_engine-0.1.0/vectors/unknown_schema_version.json +170 -0
  174. causal_continuity_engine-0.1.0/vectors/unknown_top_level_field.json +175 -0
  175. causal_continuity_engine-0.1.0/vectors/unverified_forged_body_no_key.json +170 -0
  176. causal_continuity_engine-0.1.0/vectors/unverified_hmac_no_key.json +170 -0
  177. causal_continuity_engine-0.1.0/vectors/valid_hmac.json +172 -0
  178. causal_continuity_engine-0.1.0/vectors/valid_hmac_jcs_edges.json +186 -0
  179. causal_continuity_engine-0.1.0/vectors/valid_hmac_unicode.json +172 -0
  180. causal_continuity_engine-0.1.0/vectors/valid_lamport.json +1458 -0
  181. causal_continuity_engine-0.1.0/vectors/wrong_project.json +173 -0
  182. causal_continuity_engine-0.1.0/verifiers/__init__.py +0 -0
  183. causal_continuity_engine-0.1.0/verifiers/verify_proof.py +1109 -0
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.py]
12
+ indent_size = 4
13
+
14
+ [Makefile]
15
+ indent_style = tab
@@ -0,0 +1,21 @@
1
+ # Canonicalize every committed text blob as LF, whatever platform authored it.
2
+ # The index blobs were already LF when this rule was enabled; a pre-existing
3
+ # Windows worktree may still need a fresh checkout before exact release checks.
4
+ * text=auto eol=lf
5
+
6
+ # Shell scripts must stay LF even in a Windows working tree or /bin/sh will
7
+ # not run them. The git hooks are shell scripts with no .sh extension.
8
+ *.sh text eol=lf
9
+ .githooks/* text eol=lf
10
+ *.bat text eol=crlf
11
+
12
+ # Binary: never normalize line endings, never diff as text.
13
+ *.png -text
14
+
15
+ # Language statistics. docs/ is prose about the engine, not engine code.
16
+ docs/** linguist-documentation
17
+
18
+ # The conformance corpus is produced by vectors/generate.py and checked back
19
+ # in; `python3 vectors/generate.py --check` is what validates it, not review
20
+ # of the JSON by hand. vectors/generate.py itself stays counted as source.
21
+ vectors/*.json linguist-generated
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+ PATTERN='co-authored-by:.*(anthropic|chatgpt|claude|codex|copilot|gemini|openai)|noreply@(anthropic|openai)\.com|generated (with|by)[[:space:]]+\[?(chatgpt|claude|codex|copilot|gemini|openai)'
3
+ identity_input="$(mktemp)" || exit 1
4
+ trap 'rm -f "$identity_input"' EXIT HUP INT TERM
5
+ cat "$1" > "$identity_input" || exit 1
6
+ git var GIT_AUTHOR_IDENT >> "$identity_input" || exit 1
7
+ grep_status=0
8
+ grep -nEi "$PATTERN" "$identity_input" || grep_status=$?
9
+ case "$grep_status" in
10
+ 0)
11
+ echo "ERROR: AI attribution in commit message or author identity. Remove it." >&2
12
+ exit 1
13
+ ;;
14
+ 1) ;;
15
+ *)
16
+ echo "ERROR: grep failed; attribution status is unknown." >&2
17
+ exit "$grep_status"
18
+ ;;
19
+ esac
@@ -0,0 +1,61 @@
1
+ #!/bin/sh
2
+ # Repository pre-commit gate. Attribution is blocking; gitleaks is blocking
3
+ # when installed and emits an explicit warning when unavailable.
4
+ #
5
+ # WHY BOTH LIVE HERE: git honours exactly one hook path. This repository sets
6
+ # `core.hooksPath = .githooks`, and the pre-commit framework refuses to install
7
+ # while that is set ("Cowardly refusing to install hooks with `core.hooksPath`
8
+ # set"). Keeping the secret scan only in .pre-commit-config.yaml therefore meant
9
+ # a maintainer with the repo's hook path configured got the attribution guard
10
+ # and NO secret scan, while a contributor who ran `pre-commit install` got the
11
+ # reverse. Either way exactly one gate was live, and nothing said which.
12
+ #
13
+ # .pre-commit-config.yaml remains supported for contributors who prefer the
14
+ # framework: unset core.hooksPath first. CI enforces the attribution rule
15
+ # independently (.github/workflows/no-ai-attribution.yml), so a contributor who
16
+ # runs neither hook path is still caught before merge.
17
+
18
+ # ---------------------------------------------------------------- attribution
19
+ # The three enforcement files necessarily contain the expression they search
20
+ # for, so only those exact files are excluded. No directory is exempt.
21
+ PATTERN='co-authored-by:.*(anthropic|chatgpt|claude|codex|copilot|gemini|openai)|noreply@(anthropic|openai)\.com|generated (with|by)[[:space:]]+\[?(chatgpt|claude|codex|copilot|gemini|openai)'
22
+ # Search the proposed index tree rather than raw diff text. Deleted lines must
23
+ # not prevent the commit that removes a violation.
24
+ git_grep_status=0
25
+ git grep --cached -nEi "$PATTERN" -- . \
26
+ ':(exclude).githooks/pre-commit' \
27
+ ':(exclude).githooks/commit-msg' \
28
+ ':(exclude).github/workflows/no-ai-attribution.yml' \
29
+ || git_grep_status=$?
30
+ case "$git_grep_status" in
31
+ 0)
32
+ echo "ERROR: AI attribution found in staged changes. Remove it before committing." >&2
33
+ exit 1
34
+ ;;
35
+ 1) ;;
36
+ *)
37
+ echo "ERROR: git grep failed; attribution status is unknown." >&2
38
+ exit "$git_grep_status"
39
+ ;;
40
+ esac
41
+
42
+ # --------------------------------------------------------------------- secrets
43
+ # Load-bearing, not decoration. GitHub secret scanning and push protection are
44
+ # unavailable here (private repository, personal Pro plan). When gitleaks is
45
+ # installed and this hook is not bypassed, it is the only local scan before a
46
+ # pasted credential reaches the remote; the server workflow runs after push.
47
+ # .gitleaks.toml allowlists the synthetic token the redaction tests need by
48
+ # VALUE rather than by path, so a real secret in the same file is still caught.
49
+ if command -v gitleaks >/dev/null 2>&1; then
50
+ if ! gitleaks git --staged --config .gitleaks.toml --redact --no-banner; then
51
+ echo "ERROR: gitleaks flagged a potential secret in the staged changes." >&2
52
+ echo "If it is a synthetic test value, allowlist it BY VALUE in .gitleaks.toml." >&2
53
+ exit 1
54
+ fi
55
+ else
56
+ # Warn rather than refuse. A fresh clone has no gitleaks, and blocking every
57
+ # commit until it is installed teaches people to reach for --no-verify,
58
+ # which would disable the attribution guard above as well.
59
+ echo "WARNING: gitleaks is not installed - the secret scan did NOT run." >&2
60
+ echo " brew install gitleaks (or use .pre-commit-config.yaml)" >&2
61
+ fi
@@ -0,0 +1,45 @@
1
+ # Code owners for the Causal Continuity Engine.
2
+ #
3
+ # HOW THIS FILE IS READ: the LAST pattern that matches a file wins — not the
4
+ # first, and not the most specific. So the catch-all is written first and the
5
+ # high-sensitivity paths follow it, in order of increasing sensitivity, so
6
+ # that they are matched last and therefore win. Adding a new broad pattern at
7
+ # the bottom would silently take ownership of everything below it.
8
+ #
9
+ # Syntax note: GitHub's CODEOWNERS does not support "!" negation or "[ ]"
10
+ # character ranges. Every pattern here is a plain gitignore-style path.
11
+ #
12
+ # One maintainer owns everything today, so every line names the same owner and
13
+ # nothing here changes who can merge — GitHub does not request review from the
14
+ # author of a pull request, and there is no second reviewer to request. The
15
+ # file earns its place because it makes sensitive-path changes visible in
16
+ # review and predeclares the paths that should gain an additional owner. When
17
+ # a second maintainer is added, edit the relevant patterns to name that
18
+ # reviewer; collaborator status alone does not change the owners listed here.
19
+
20
+ # Everything, unless a later line says otherwise.
21
+ * @thequantumfalcon
22
+
23
+ # Repository automation: CI, the attribution guard, this policy set.
24
+ /.github/ @thequantumfalcon
25
+
26
+ # Commit-time enforcement. A change here can disable the guards.
27
+ /.githooks/ @thequantumfalcon
28
+
29
+ # The normative proof-envelope specification. Changing this text changes what
30
+ # every implementation is required to do.
31
+ /SPEC.md @thequantumfalcon
32
+
33
+ # The independent verifier, and the conformance corpus that is the arbiter
34
+ # between it and the reference implementation.
35
+ /verifiers/ @thequantumfalcon
36
+ /vectors/ @thequantumfalcon
37
+
38
+ # The trust layer: envelope construction and verification, the verifier
39
+ # policy, and the completion gate that refuses a task without a valid proof.
40
+ /causal_continuity_engine/proof.py @thequantumfalcon
41
+ /causal_continuity_engine/policy.py @thequantumfalcon
42
+ /causal_continuity_engine/engine.py @thequantumfalcon
43
+
44
+ # The decision record. Entries are appended, not rewritten.
45
+ /docs/adr/ @thequantumfalcon
@@ -0,0 +1,260 @@
1
+ # Contributing to the Causal Continuity Engine
2
+
3
+ This project makes a narrow, checkable claim: that a coding agent's work can be
4
+ resumed, invalidated, and completed under proof, and that the checks doing the
5
+ deciding actually run in the path that decides. Contributions are welcome to
6
+ the extent they hold that claim up. The bar is not politeness or volume, it is
7
+ evidence.
8
+
9
+ Read [`docs/adr/ADR-INDEX.md`](../docs/adr/ADR-INDEX.md) before proposing a
10
+ change. Most design questions a newcomer has are answered there, usually
11
+ because the naive answer was tried, shipped, and broken by a later review
12
+ round.
13
+
14
+ ## The trust core is change-controlled
15
+
16
+ The 0.1.0 trust core has a high change bar. It is not literally frozen:
17
+ post-round-7 review added operator receipts, policy configuration, and
18
+ transactional race hardening. New subsystems require a proposal issue and the
19
+ same reproduce-first, adversarial evidence expected of a defect fix.
20
+
21
+ **In scope**
22
+
23
+ - Defect fixes, with a reproduction (see below).
24
+ - Corrections to `SPEC.md` where it is ambiguous, or where
25
+ `verifiers/verify_proof.py` is faithful to the text and the text is wrong.
26
+ Round 7's worst finding was of exactly this kind: the implementation was
27
+ correct and the specification was not.
28
+ - New conformance vectors in `vectors/` that pin a case both implementations
29
+ should already agree on, or that catch a drift they could fall into.
30
+ - Portability fixes to `verifiers/verify_proof.py`, which must stay standard
31
+ library only and must never import from `causal_continuity_engine`.
32
+ - Documentation that is wrong, stale, or overstated. Claims that outrun the
33
+ code are treated as defects, not as marketing.
34
+
35
+ **Not in scope**
36
+
37
+ - New subsystems, new memory tiers, new trigger types, new verifier kinds.
38
+ - Restructuring. `causal_continuity_engine/` is a flat layout, not `src/`,
39
+ deliberately. `tests/`
40
+ lives at the repository root, outside the package, deliberately.
41
+ - Converting `docs/adr/ADR-INDEX.md` to MADR or any other ADR format.
42
+ - Any third-party runtime dependency. `causal_continuity_engine/` is standard
43
+ library only, and
44
+ `just deps` fails if that stops being true.
45
+
46
+ If you think something belongs in the engine anyway, open a proposal issue
47
+ first and argue it there. Do not smuggle feature scope into an unrelated fix.
48
+
49
+ ## Setup
50
+
51
+ Python 3.11 or newer. The engine has no runtime dependencies, but the checks
52
+ do. `just setup` installs every direct and transitive tool from
53
+ `requirements-dev.lock` in pip's all-or-nothing hash-checking mode, refuses
54
+ source distributions, then installs `causal-continuity-engine` editable without dependency
55
+ resolution or an isolated build environment. The reviewed direct inputs are
56
+ `pytest` 9.1.1, `ruff` 0.16.1, `build` 1.5.0, `jsonschema` 4.26.0,
57
+ `setuptools` 83.0.0, and `pip` 26.1.2. None is imported by the engine; jsonschema validates
58
+ emitted receipt instances only in the test/release gate.
59
+
60
+ The pins were revalidated on 2026-08-04. Setuptools 83.0.0 and pip 26.1.2
61
+ are the first patched releases for
62
+ [GHSA-h35f-9h28-mq5c](https://github.com/advisories/GHSA-h35f-9h28-mq5c)
63
+ and [GHSA-wf93-45jw-7689](https://github.com/advisories/GHSA-wf93-45jw-7689);
64
+ pytest 9.1.1 is newer than the 9.0.3 fix for
65
+ [GHSA-6w46-j5rx-g56g](https://github.com/advisories/GHSA-6w46-j5rx-g56g),
66
+ and the lock carries Pygments 2.20.0, the fix for
67
+ [GHSA-5239-wwwm-4pmq](https://github.com/advisories/GHSA-5239-wwwm-4pmq).
68
+ Build remains at 1.5.0 because PyPI marks 1.5.1 yanked; jsonschema 4.26.0 and
69
+ ruff 0.16.1 were the current stable releases on that date. This is a dated
70
+ review record, not a claim that pins stay current without future review.
71
+
72
+ When a direct pin changes, edit `pyproject.toml` and `requirements-dev.in`,
73
+ regenerate the lock with the command recorded in its header, and review the
74
+ complete dependency and hash diff. A regression requires those direct inputs
75
+ to remain identical and every locked requirement to carry a SHA-256 hash.
76
+
77
+ Your Python interpreter, `venv`, and its initial `ensurepip`/pip are bootstrap
78
+ trust: the initial pip installs the hashed closure once. That closure includes
79
+ the reviewed pip pin, and the bootstrap verifies every distribution version
80
+ and origin inside the new environment before it runs repository gates.
81
+
82
+ ```bash
83
+ git clone https://github.com/thequantumfalcon/causal-continuity-engine.git
84
+ cd causal-continuity-engine
85
+ just setup # editable engine + pinned dev/release checks
86
+ git config core.hooksPath .githooks # attribution scan AND gitleaks, both blocking
87
+ brew install gitleaks # or a release binary from gitleaks/gitleaks
88
+ just test # should be green before you change anything
89
+ ```
90
+
91
+ Install gitleaks. It is load-bearing here, not decoration: GitHub's native
92
+ secret scanning and repository push protection are unavailable on this private
93
+ personal-account repository. The local hook catches a credential before it
94
+ leaves the machine; the `secrets` workflow scans pull requests, pushes to
95
+ `main`, and the full history weekly. The hook warns rather than refuses when
96
+ gitleaks is missing, so that server-side scan remains visible after a local
97
+ `--no-verify`. The committed ruleset makes it merge-blocking, but the live
98
+ ruleset still requires only `ci`; see `.github/ruleset.README.md`. If a
99
+ synthetic test value trips the scan,
100
+ allowlist it in `.gitleaks.toml` by value, never by path, so a real secret in
101
+ the same file is still caught.
102
+
103
+ `.pre-commit-config.yaml` remains supported for contributors who prefer the
104
+ framework, with one constraint: git honours exactly one hook path, and
105
+ pre-commit refuses to install while `core.hooksPath` is set. Unset it first
106
+ (`git config --unset core.hooksPath`). That path covers gitleaks, `ruff check` (the same
107
+ lint gate as `just lint` and CI) and file hygiene, but not the attribution
108
+ scan. It deliberately carries no `ruff-format` hook — see the `fmt-check` note
109
+ in the `justfile`. CI enforces the attribution rule independently either way
110
+ (`.github/workflows/no-ai-attribution.yml`), so nothing that reaches a pull
111
+ request depends on which hook path you chose.
112
+
113
+ Focused recipes live in the `justfile`. Hosted Linux, Windows, macOS, and release
114
+ jobs all invoke the checked-in standard-library
115
+ `.github/scripts/run_gates.py`, avoiding a downloaded command runner in the
116
+ trusted path. `just check` calls the same aggregate locally; every focused
117
+ equivalent below is cross-platform.
118
+
119
+ ## Gates
120
+
121
+ All six focused behavioral recipes — lint, dependency-boundary scan, tests,
122
+ corpus, capability audit, and benchmark — must pass locally before you open a
123
+ pull request. `just build` is additionally required when packaging, generated
124
+ assets, or release machinery changes. Hosted CI runs the six-recipe aggregate
125
+ across Python 3.11, 3.12, 3.13, and 3.14, repeats it natively on Windows 3.14
126
+ and macOS 15 ARM64/Python 3.14, and always builds twice and audits an installed
127
+ wheel. The `ci` job fans all those paths into one context.
128
+
129
+ | Recipe | Direct equivalent | What it establishes |
130
+ |---|---|---|
131
+ | `just setup` | `python -m pip install --force-reinstall --require-hashes --only-binary=:all: -r requirements-dev.lock`, then `python -m pip check`, then `python -m pip install --no-deps --no-build-isolation -e .` | Nothing on its own. It installs the reviewed, hash-locked tool closure, checks dependency consistency, and installs the local package without undeclared resolution. |
132
+ | `just lint` | `python -m ruff check .` | Ruff passes under the rule set pinned in `pyproject.toml` `[tool.ruff.lint]` — `E`, `F`, `W`, `I`, line length 100. That set, and nothing wider: it is not passed on the command line, so widening the gate means editing `pyproject.toml`. |
133
+ | `just deps` | `python .github/scripts/check_stdlib.py` | `causal_continuity_engine/` imports nothing outside the standard library. It parses the AST instead of importing, so a lazy, guarded, or function-local import is caught too. This is the gate behind the zero-runtime-dependency claim. |
134
+ | `just test` | `python -m pytest tests/ -q` | The complete regression suite and planted instrument-validation cases pass. |
135
+ | `just corpus` | `python vectors/generate.py --check` | The reference implementation still reaches every committed verdict. Cross-implementation agreement is established by `just test`, not here. |
136
+ | `just caps` | `python -m causal_continuity_engine.capabilities --write` then `git diff --exit-code -- docs/CAPABILITIES.md` | Every capability claim resolves to real symbols, files, and tests, and the committed `docs/CAPABILITIES.md` is identical to what the audit generates. |
137
+ | `just bench` | `python -m benchmarks.continuitybench.run` | All ten ContinuityBench scenarios still pass and all six metrics are still at their gates. |
138
+ | `just build` | the scripts under `.github/scripts/` | Each pass first binds physical source bytes without Git filters to the exact `HEAD`/index blobs, stages only those bytes in an empty disposable source directory, validates a canonical closed-manifest sdist before materializing it, and builds the wheel only from that exact normalized payload; two passes are byte-identical under the locked backend, backend execution leaves source unchanged, the checksum manifest is exact, shipped bytes equal the source tree, the audit surface is present, and an isolated installed wheel passes dependency-free import/CLI probes before exact locked tools run capability and behavioral checks. |
139
+
140
+ Attribution is not one of these, and it is not a lint rule. It is enforced by
141
+ `.githooks/pre-commit` locally and by the `attribution` job in
142
+ `.github/workflows/no-ai-attribution.yml`. The committed desired ruleset
143
+ requires both `attribution` and `secrets`; the live ruleset does not yet,
144
+ and that operational drift is a blocker documented in
145
+ `.github/ruleset.README.md`.
146
+
147
+ `docs/CAPABILITIES.md` is generated, never hand-edited. If your change moves a
148
+ symbol a claim points at, run
149
+ `python -m causal_continuity_engine.capabilities --write` and commit
150
+ the result: `just caps` regenerates the table and then requires a clean
151
+ `git diff` for it, so a stale or hand-edited copy fails the gate.
152
+
153
+ Two limits worth stating, because they set expectations for review. The
154
+ capability audit proves a symbol resolves and that the table on disk is current
155
+ — it cannot see a control that exists but does not run in the path that
156
+ decides, which is the shape of three
157
+ of this project's worst defects (ADR-014, ADR-043, ADR-044). Instrument
158
+ validation only proves each gate distinguishes its own case; it says nothing
159
+ about whether the set of gates is complete (ADR-056, ADR-067). Green gates are
160
+ a floor, not a verdict.
161
+
162
+ ## Reproduction first
163
+
164
+ A bug fix is not reviewable without a reproduction. The order is not
165
+ negotiable:
166
+
167
+ 1. **Reproduce it against the released code, by hand.** Drive the CLI or the
168
+ engine API the way a user would. Put the exact commands and the exact
169
+ output in the issue or the pull request body.
170
+ 2. **Write the regression test and watch it fail against the pre-fix code.**
171
+ State in the pull request that you did this, and what the failure looked
172
+ like. A test that has only ever been run against the fixed code proves
173
+ nothing about the bug.
174
+ 3. **Then fix it,** and show the same test passing.
175
+
176
+ The reason is on the record. In round 4 the first version of the ADR-024 fix
177
+ left the default configuration exploitable while every new test passed,
178
+ because the tests all used the pinned form the fix had introduced. Running the
179
+ original attack verbatim against the built artifact is what caught it. Tests
180
+ written alongside a fix inherit the fix's assumptions; the attack does not.
181
+
182
+ A fix is a change like any other and earns its own adversarial pass. Two
183
+ defects in this repository were introduced by an earlier round's fixes and
184
+ found only because the fixes themselves were re-reviewed.
185
+
186
+ If your change touches a rejection path in `complete_task`, it also needs a
187
+ planted-defect case in `tests/test_instrument_validation.py` naming which gate
188
+ should catch it. A defect caught by the wrong gate is a mismatch, not a pass.
189
+
190
+ ## Commits and pull requests
191
+
192
+ **The pull request title must be a Conventional Commit.** Everything is merged
193
+ by squash, so the title becomes the permanent commit subject on `main` — it is
194
+ what `git log` shows a year from now, and it is what GitHub's generated release
195
+ notes list, sorted into sections by label per `.github/release.yml`. Your
196
+ Individual branch commits do not drive release notes, but the attribution
197
+ gate scans every commit message, author name, and author email. Keep them
198
+ descriptive and compliant even though the squash title is the permanent
199
+ subject on `main`.
200
+
201
+ ```
202
+ fix(proof): reject an envelope whose recorded status contradicts its checks
203
+ docs(spec): state that §4 and §5 hash different bodies
204
+ test(regressions): pin the round-7 retention/rebuild boundary
205
+ ```
206
+
207
+ Use `feat`, `fix`, `docs`, `test`, `refactor`, or `chore` — the same set
208
+ `.github/pull_request_template.md` lists. Given the trust core's change bar,
209
+ `feat` usually needs an accepted proposal issue before implementation. Mark a
210
+ breaking change to the
211
+ `cce.proof.v1` envelope, the schemas, or the CLI with `!` before the colon,
212
+ explain it in the body, and label the pull request `breaking` so the release
213
+ notes file it under Breaking Changes.
214
+
215
+ Nothing derives a changelog or version bump from commit subjects. Releases are
216
+ operator-triggered: `just release` runs the complete clean-tree and
217
+ reproducibility gate locally, then a signed annotated tag matching the package
218
+ version triggers `.github/workflows/release.yml`. The workflow verifies the
219
+ tag on GitHub, requires the commit on `main` with trusted exact-SHA checks,
220
+ repeats every gate under read-only permissions, and hands the exact wheel,
221
+ sdist, and checksum manifest to a separate draft-to-final publish job. See
222
+ `docs/RELEASE.md`.
223
+
224
+ **Sign off your commits.** Contributions are accepted under the
225
+ [Developer Certificate of Origin 1.1](https://developercertificate.org/), and
226
+ external contributions are asked for a
227
+ `Signed-off-by` trailer:
228
+
229
+ ```bash
230
+ git commit -s -m "fix(graph): bound traversal at the configured budget"
231
+ ```
232
+
233
+ This is not enforced today. There is no DCO app, workflow, or `commit-msg`
234
+ check for the trailer, so a pull request is not yet blocked for missing it.
235
+ Existing history predates enforcement and is not being rewritten merely to
236
+ add trailers. The DCO app will be enabled, and its check made required, when
237
+ the repository goes public. `git rebase --signoff` will add the trailer if you
238
+ forget it on an unpublished branch. By signing off you certify the DCO's terms
239
+ and license your contribution under the repository's Apache-2.0 license.
240
+
241
+ Keep the branch focused. One defect, one pull request. Do not reformat
242
+ adjacent code, rename things you did not introduce, or clean up unrelated dead
243
+ code in passing — mention it instead. Diff noise is treated as a defect,
244
+ because a review that has to separate intent from noise is a worse review.
245
+
246
+ ## Two standing rules
247
+
248
+ **Absence of success is never success.** A check that did not run detected
249
+ nothing, a probe that crashed found nothing, and an empty required-verifier
250
+ list verifies nothing. If your change can produce a "nothing went wrong"
251
+ outcome, say what distinguishes it from "nothing happened".
252
+
253
+ **No authorship attribution to tooling.** The `.githooks/` hooks and the CI
254
+ attribution guard both reject it, in commit messages and in committed files.
255
+ Do not work around them.
256
+
257
+ ## Security
258
+
259
+ Do not open a public issue for a vulnerability. Follow
260
+ [SECURITY.md](SECURITY.md).
@@ -0,0 +1,125 @@
1
+ name: Bug report
2
+ description: The engine does something that contradicts its documented behaviour.
3
+ title: "bug: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ A bug report is a claim about behaviour, and the claim has to carry
10
+ enough for someone else to reproduce it on a machine you do not
11
+ control. A report that cannot be reproduced is not necessarily wrong,
12
+ but there is nothing in it to act on.
13
+
14
+ Before filing, check that what you are seeing is not a limit that is
15
+ already written down. `docs/CAPABILITIES.md` records the honest limit
16
+ of every capability claim — `implemented` there means the mechanism
17
+ exists and is tested, never that the requirement is solved in full.
18
+ `SPEC.md` section 11 lists what the proof envelope specification
19
+ deliberately does not cover.
20
+
21
+ - type: dropdown
22
+ id: subsystem
23
+ attributes:
24
+ label: Subsystem
25
+ description: A best guess is fine. Pick "Not sure / other" if it does not fit.
26
+ options:
27
+ - Engine and causal graph
28
+ - Resume packet
29
+ - Proof envelope and completion gate
30
+ - Evidence probes and grading
31
+ - Invalidation and blast radius
32
+ - Memory tiers
33
+ - CLI
34
+ - Standalone verifier (verifiers/verify_proof.py)
35
+ - Not sure / other
36
+ validations:
37
+ required: true
38
+
39
+ - type: textarea
40
+ id: ran
41
+ attributes:
42
+ label: What you ran
43
+ description: The exact command or API call, verbatim, including every flag.
44
+ render: shell
45
+ validations:
46
+ required: true
47
+
48
+ - type: textarea
49
+ id: expected
50
+ attributes:
51
+ label: What you expected
52
+ description: >-
53
+ If the expectation comes from a document, cite it: a SPEC.md section,
54
+ an ADR number from docs/adr/ADR-INDEX.md, a row in docs/CAPABILITIES.md,
55
+ or a line in the README. An expectation with a source is a much stronger
56
+ report than one without.
57
+ validations:
58
+ required: true
59
+
60
+ - type: textarea
61
+ id: actual
62
+ attributes:
63
+ label: What happened
64
+ description: >-
65
+ The output verbatim, including the exit code and any traceback.
66
+ Paraphrasing loses the detail that usually turns out to matter.
67
+ render: shell
68
+ validations:
69
+ required: true
70
+
71
+ - type: textarea
72
+ id: reproduction
73
+ attributes:
74
+ label: Minimal reproduction
75
+ description: >-
76
+ The shortest sequence that reaches the wrong behaviour starting from a
77
+ fresh project — `cce-engine init` and then the fewest steps that show it, or a
78
+ failing test. Strip out everything that is not needed to make it happen.
79
+ A report without a reproduction cannot be acted on. If the bug needs a
80
+ particular database, proof envelope, or webhook payload, attach it with
81
+ anything private removed.
82
+ render: shell
83
+ validations:
84
+ required: true
85
+
86
+ - type: input
87
+ id: cce-version
88
+ attributes:
89
+ label: CCE version
90
+ description: >-
91
+ `python -c "from causal_continuity_engine import __version__; print(__version__)"`, or the version in
92
+ causal_continuity_engine/__init__.py. If you are running from a checkout,
93
+ give the commit SHA
94
+ instead — it is more precise than the version string.
95
+ placeholder: "0.1.0, or a commit SHA"
96
+ validations:
97
+ required: true
98
+
99
+ - type: input
100
+ id: python-version
101
+ attributes:
102
+ label: Python version
103
+ description: The full output of `python -V`. The engine requires 3.11 or newer.
104
+ placeholder: "Python 3.12.4"
105
+ validations:
106
+ required: true
107
+
108
+ - type: input
109
+ id: os
110
+ attributes:
111
+ label: Operating system
112
+ description: Name, version, and architecture.
113
+ placeholder: "macOS 15.5 arm64, or Ubuntu 24.04 x86_64"
114
+ validations:
115
+ required: true
116
+
117
+ - type: checkboxes
118
+ id: documented-limits
119
+ attributes:
120
+ label: Documented limits
121
+ options:
122
+ - label: >-
123
+ I checked `docs/CAPABILITIES.md` and section 11 of `SPEC.md`, and what
124
+ I am reporting is not one of the limits recorded there.
125
+ required: true
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Questions
4
+ url: https://github.com/thequantumfalcon/causal-continuity-engine/discussions
5
+ about: Ask and answer questions here.
6
+ - name: Security report
7
+ url: https://github.com/thequantumfalcon/causal-continuity-engine/security/policy
8
+ about: Read the security policy before reporting. Never open a public issue for a vulnerability.
@@ -0,0 +1,59 @@
1
+ name: Proposal
2
+ description: A spec clarification, a documentation fix, or a verifier or tooling proposal.
3
+ title: "proposal: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ The trust core is change-controlled, not frozen. A new surface costs
10
+ new gates, conformance evidence, and an adversarial pass showing it did
11
+ not weaken existing controls. This proposal form is where that scope is
12
+ argued before implementation.
13
+
14
+ In scope:
15
+
16
+ - clarifications and corrections to `SPEC.md`, which is normative
17
+ - conformance vectors that pin behaviour the spec already requires
18
+ - documentation that is wrong, missing, or misleading
19
+ - verifiers and tooling that live outside `causal_continuity_engine/` — another independent
20
+ implementation of the spec, a checker, a CI job
21
+
22
+ Rejected without prior design agreement: new engine subsystems, event
23
+ or edge types, or CLI subcommands. Always out of scope: anything that
24
+ would make `causal_continuity_engine/` depend on a package outside the standard library.
25
+
26
+ If the engine is wrong rather than incomplete, file a bug report instead.
27
+
28
+ - type: textarea
29
+ id: problem
30
+ attributes:
31
+ label: What problem does this solve
32
+ description: >-
33
+ Describe the situation you are actually in, not the change you want.
34
+ Concrete beats general: what did you try to do, and where did it stop?
35
+ validations:
36
+ required: true
37
+
38
+ - type: textarea
39
+ id: proposal
40
+ attributes:
41
+ label: What you are proposing
42
+ description: >-
43
+ The specific change. For a spec clarification, quote the sentence that is
44
+ ambiguous and give the reading you think is correct.
45
+ validations:
46
+ required: true
47
+
48
+ - type: textarea
49
+ id: why-not-outside
50
+ attributes:
51
+ label: Why can this not be done outside the engine
52
+ description: >-
53
+ The engine exposes an event log, a CLI, an HTTP API, JSON schemas, and a
54
+ normative spec that a stranger can implement against. Explain what stops
55
+ this from being built on top of those instead of inside `causal_continuity_engine/`. If the
56
+ answer is that the engine does not expose enough, say precisely what is
57
+ missing — that is a narrower and much more likely change.
58
+ validations:
59
+ required: true