trunkit 0.2.1__tar.gz → 0.2.2__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 (225) hide show
  1. {trunkit-0.2.1 → trunkit-0.2.2}/.github/workflows/python-package-conda.yml +6 -5
  2. {trunkit-0.2.1 → trunkit-0.2.2}/Makefile +2 -41
  3. trunkit-0.2.2/PKG-INFO +309 -0
  4. trunkit-0.2.2/README.md +277 -0
  5. {trunkit-0.2.1 → trunkit-0.2.2}/SKILL.md +2 -146
  6. trunkit-0.2.2/assets/logo.png +0 -0
  7. {trunkit-0.2.1 → trunkit-0.2.2}/pyproject.toml +1 -1
  8. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/__init__.py +0 -2
  9. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/db.py +1 -0
  10. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/generate.py +1 -1
  11. trunkit-0.2.2/src/calx/sql/89_nerode_bridge.sql +53 -0
  12. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/__init__.py +1 -1
  13. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/cli.py +6 -10
  14. {trunkit-0.2.1 → trunkit-0.2.2}/tests/conftest.py +0 -5
  15. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_composite_dfa.py +1 -1
  16. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_crt.py +16 -21
  17. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_dynamics.py +3 -3
  18. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_factorizations.py +2 -2
  19. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_oeis_match.py +2 -2
  20. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sieve.py +4 -12
  21. trunkit-0.2.1/PKG-INFO +0 -242
  22. trunkit-0.2.1/README.md +0 -210
  23. trunkit-0.2.1/assets/logo.png +0 -0
  24. trunkit-0.2.1/proofs/bigrading.py +0 -248
  25. trunkit-0.2.1/proofs/chromatic.py +0 -254
  26. trunkit-0.2.1/proofs/colimit_closure.py +0 -242
  27. trunkit-0.2.1/proofs/combined_scale.py +0 -346
  28. trunkit-0.2.1/proofs/developed_sequence.py +0 -433
  29. trunkit-0.2.1/proofs/f1_radix.py +0 -181
  30. trunkit-0.2.1/proofs/factorial_homology_signature.py +0 -261
  31. trunkit-0.2.1/proofs/grading.py +0 -237
  32. trunkit-0.2.1/proofs/identity_decomposition.py +0 -235
  33. trunkit-0.2.1/proofs/lithon.py +0 -190
  34. trunkit-0.2.1/proofs/moonshine.py +0 -192
  35. trunkit-0.2.1/proofs/omega_family.py +0 -215
  36. trunkit-0.2.1/proofs/omega_family_succ.py +0 -269
  37. trunkit-0.2.1/proofs/prime_members_functor.py +0 -188
  38. trunkit-0.2.1/proofs/self_shadow.py +0 -176
  39. trunkit-0.2.1/proofs/self_syzygy.py +0 -162
  40. trunkit-0.2.1/proofs/seq_homology_signature.py +0 -200
  41. trunkit-0.2.1/proofs/shadow.py +0 -185
  42. trunkit-0.2.1/proofs/shared_prime_h2.py +0 -220
  43. trunkit-0.2.1/proofs/strata_tower.py +0 -219
  44. {trunkit-0.2.1 → trunkit-0.2.2}/.dockerignore +0 -0
  45. {trunkit-0.2.1 → trunkit-0.2.2}/.gitattributes +0 -0
  46. {trunkit-0.2.1 → trunkit-0.2.2}/.gitignore +0 -0
  47. {trunkit-0.2.1 → trunkit-0.2.2}/Dockerfile +0 -0
  48. {trunkit-0.2.1 → trunkit-0.2.2}/LICENSE +0 -0
  49. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/_notify_demo.py +0 -0
  50. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/bench.py +0 -0
  51. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/bench_chomsky.py +0 -0
  52. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval.py +0 -0
  53. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval_classify_retry.log +0 -0
  54. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval_run.log +0 -0
  55. {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/sequence_bench.py +0 -0
  56. {trunkit-0.2.1 → trunkit-0.2.2}/docker-compose.yml +0 -0
  57. {trunkit-0.2.1 → trunkit-0.2.2}/proofs/combined_signature.py +0 -0
  58. {trunkit-0.2.1 → trunkit-0.2.2}/proofs/equipment.py +0 -0
  59. {trunkit-0.2.1 → trunkit-0.2.2}/proofs/gap_homology_primes.py +0 -0
  60. {trunkit-0.2.1 → trunkit-0.2.2}/proofs/perfect_28.py +0 -0
  61. {trunkit-0.2.1 → trunkit-0.2.2}/scripts/morning_brief_demo.py +0 -0
  62. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/cli.py +0 -0
  63. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/curry_adapter.py +0 -0
  64. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/primesieve.py +0 -0
  65. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/00_rehome_to_calx.sql +0 -0
  66. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/01_schema.sql +0 -0
  67. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/02_views.sql +0 -0
  68. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/03_generate.sql +0 -0
  69. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/04_crt.sql +0 -0
  70. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/05_dynamics.sql +0 -0
  71. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/06_oeis_match.sql +0 -0
  72. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/07_compositions.sql +0 -0
  73. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/10_curry.sql +0 -0
  74. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/20_kan.sql +0 -0
  75. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/21_kan_functors.sql +0 -0
  76. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/22_kan_elements.sql +0 -0
  77. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/23_kan_monoidal.sql +0 -0
  78. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/24_kan_natural_transformations.sql +0 -0
  79. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/25_kan_extensions.sql +0 -0
  80. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/26_kan_enrichment.sql +0 -0
  81. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/27_kan_profunctors.sql +0 -0
  82. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/28_kan_adjunctions.sql +0 -0
  83. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/30_kan_corpus.sql +0 -0
  84. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/40_cert.sql +0 -0
  85. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/41_cert_formal.sql +0 -0
  86. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/42_cert_gap_homology.sql +0 -0
  87. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/43_kan_sequence_homology.sql +0 -0
  88. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/44_cert_seq_homology.sql +0 -0
  89. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/45_kan_factorial_homology.sql +0 -0
  90. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/46_cert_factorial_homology.sql +0 -0
  91. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/47_kan_combined_signature.sql +0 -0
  92. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/48_cert_combined.sql +0 -0
  93. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/49_kan_shared_prime_betti.sql +0 -0
  94. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/50_cert_combined_scale.sql +0 -0
  95. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/51_cert_shared_prime_h2.sql +0 -0
  96. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/52_cert_developed_sequence.sql +0 -0
  97. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/53_cert_omega_family.sql +0 -0
  98. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/54_cert_omega_family_succ.sql +0 -0
  99. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/55_kan_prime_members.sql +0 -0
  100. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/56_cert_prime_members_functor.sql +0 -0
  101. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/57_kan_strata_tower.sql +0 -0
  102. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/58_cert_strata_tower.sql +0 -0
  103. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/59_kan_grading.sql +0 -0
  104. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/60_cert_grading.sql +0 -0
  105. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/61_kan_identity_decomposition.sql +0 -0
  106. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/62_cert_identity_decomposition.sql +0 -0
  107. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/63_kan_bigrading.sql +0 -0
  108. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/64_cert_bigrading.sql +0 -0
  109. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/65_kan_chromatic.sql +0 -0
  110. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/66_cert_chromatic.sql +0 -0
  111. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/67_kan_lithon.sql +0 -0
  112. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/68_cert_lithon.sql +0 -0
  113. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/69_kan_shadow.sql +0 -0
  114. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/70_cert_shadow.sql +0 -0
  115. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/71_kan_self_syzygy.sql +0 -0
  116. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/72_cert_self_syzygy.sql +0 -0
  117. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/73_kan_self_shadow.sql +0 -0
  118. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/74_cert_self_shadow.sql +0 -0
  119. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/75_kan_f1_radix.sql +0 -0
  120. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/76_cert_f1_radix.sql +0 -0
  121. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/77_kan_moonshine.sql +0 -0
  122. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/78_cert_moonshine.sql +0 -0
  123. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/79_cert_kan_engines.sql +0 -0
  124. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/80_kan_colimit_closure.sql +0 -0
  125. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/81_cert_colimit_closure.sql +0 -0
  126. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/82_kan_equipment.sql +0 -0
  127. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/83_cert_equipment.sql +0 -0
  128. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/84_cert_witness.sql +0 -0
  129. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/85_cert_derivation.sql +0 -0
  130. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/86_cert_verify.sql +0 -0
  131. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/87_cert_export_bundle.sql +0 -0
  132. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/88_cert_witness_carry.sql +0 -0
  133. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/crt_examples.sql +0 -0
  134. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/dynamics_examples.sql +0 -0
  135. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/queries.sql +0 -0
  136. {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/validate.py +0 -0
  137. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/adapters.py +0 -0
  138. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/automata.py +0 -0
  139. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/db.py +0 -0
  140. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/precache.py +0 -0
  141. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sources.py +0 -0
  142. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/00_bootstrap.sql +0 -0
  143. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/01_schema.sql +0 -0
  144. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/02_run.sql +0 -0
  145. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/03_minimize.sql +0 -0
  146. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/04_product.sql +0 -0
  147. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/05_from_regex.sql +0 -0
  148. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/10_cert.sql +0 -0
  149. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/11_chomsky.sql +0 -0
  150. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/20_calx_bridge.sql +0 -0
  151. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/30_protocol.sql +0 -0
  152. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/40_eigenform.sql +0 -0
  153. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/50_corpus.sql +0 -0
  154. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/60_product_corpus.sql +0 -0
  155. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/70_morphism.sql +0 -0
  156. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/80_categorical.sql +0 -0
  157. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/90_sequence.sql +0 -0
  158. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/91_sequence_cache.sql +0 -0
  159. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/92_session_automata.sql +0 -0
  160. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/93_handoff.sql +0 -0
  161. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/94_open_session.sql +0 -0
  162. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/95_cybernetic_automata.sql +0 -0
  163. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/96_dead_time_factory.sql +0 -0
  164. {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/97_composite_dfa.sql +0 -0
  165. {trunkit-0.2.1 → trunkit-0.2.2}/tests/__init__.py +0 -0
  166. {trunkit-0.2.1 → trunkit-0.2.2}/tests/fixtures/oeis/.gitkeep +0 -0
  167. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_aliquot.py +0 -0
  168. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_build.py +0 -0
  169. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_categorical.py +0 -0
  170. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_chomsky.py +0 -0
  171. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_compose_match.py +0 -0
  172. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_cybernetic.py +0 -0
  173. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_dead_time_factory.py +0 -0
  174. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_equivalent.py +0 -0
  175. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_minimize.py +0 -0
  176. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_morphisms.py +0 -0
  177. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1a.py +0 -0
  178. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1b.py +0 -0
  179. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1c.py +0 -0
  180. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase2.py +0 -0
  181. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_product.py +0 -0
  182. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_run.py +0 -0
  183. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_schema.py +0 -0
  184. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sequence.py +0 -0
  185. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sources.py +0 -0
  186. {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_stream_interceptor.py +0 -0
  187. {trunkit-0.2.1 → trunkit-0.2.2}/tools/agent_demo.py +0 -0
  188. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_bigrading.py +0 -0
  189. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_chromatic.py +0 -0
  190. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_colimit_closure.py +0 -0
  191. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_equipment.py +0 -0
  192. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_f1_radix.py +0 -0
  193. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_grading.py +0 -0
  194. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_identity_decomposition.py +0 -0
  195. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_lithon.py +0 -0
  196. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_moonshine.py +0 -0
  197. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_self_shadow.py +0 -0
  198. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_self_syzygy.py +0 -0
  199. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_shadow.py +0 -0
  200. {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_strata_tower.py +0 -0
  201. {trunkit-0.2.1 → trunkit-0.2.2}/tools/cert_formal.py +0 -0
  202. {trunkit-0.2.1 → trunkit-0.2.2}/tools/compose_match.py +0 -0
  203. {trunkit-0.2.1 → trunkit-0.2.2}/tools/cryptanalysis.py +0 -0
  204. {trunkit-0.2.1 → trunkit-0.2.2}/tools/develop_omega_family.py +0 -0
  205. {trunkit-0.2.1 → trunkit-0.2.2}/tools/develop_sequence.py +0 -0
  206. {trunkit-0.2.1 → trunkit-0.2.2}/tools/diagnostic_tests.py +0 -0
  207. {trunkit-0.2.1 → trunkit-0.2.2}/tools/factorial_homology.py +0 -0
  208. {trunkit-0.2.1 → trunkit-0.2.2}/tools/kan_in_kan.py +0 -0
  209. {trunkit-0.2.1 → trunkit-0.2.2}/tools/load_kan_corpus.py +0 -0
  210. {trunkit-0.2.1 → trunkit-0.2.2}/tools/oeis_loader.py +0 -0
  211. {trunkit-0.2.1 → trunkit-0.2.2}/tools/oeis_match.py +0 -0
  212. {trunkit-0.2.1 → trunkit-0.2.2}/tools/omega_equal_control.py +0 -0
  213. {trunkit-0.2.1 → trunkit-0.2.2}/tools/port_curry_sqlite_to_pg.py +0 -0
  214. {trunkit-0.2.1 → trunkit-0.2.2}/tools/prime_members_functor.py +0 -0
  215. {trunkit-0.2.1 → trunkit-0.2.2}/tools/register_calx_fn_deps.py +0 -0
  216. {trunkit-0.2.1 → trunkit-0.2.2}/tools/register_calx_in_curry.py +0 -0
  217. {trunkit-0.2.1 → trunkit-0.2.2}/tools/relationship_report.py +0 -0
  218. {trunkit-0.2.1 → trunkit-0.2.2}/tools/run_compose_discovery.py +0 -0
  219. {trunkit-0.2.1 → trunkit-0.2.2}/tools/run_discovery.py +0 -0
  220. {trunkit-0.2.1 → trunkit-0.2.2}/tools/seed_oeis_classics.py +0 -0
  221. {trunkit-0.2.1 → trunkit-0.2.2}/tools/seed_sequences.py +0 -0
  222. {trunkit-0.2.1 → trunkit-0.2.2}/tools/seq_homology.py +0 -0
  223. {trunkit-0.2.1 → trunkit-0.2.2}/tools/shared_prime_betti.py +0 -0
  224. {trunkit-0.2.1 → trunkit-0.2.2}/tools/smoke_curry_calx.py +0 -0
  225. {trunkit-0.2.1 → trunkit-0.2.2}/tools/stream_interceptor.py +0 -0
@@ -54,11 +54,11 @@ jobs:
54
54
  - name: Lint
55
55
  run: ruff check src/
56
56
 
57
- - name: Apply schema
57
+ - name: Apply Trunkit schema
58
58
  env:
59
59
  PGPASSWORD: trunk
60
60
  run: |
61
- for f in src/calx/sql/0[0-7]*.sql; do
61
+ for f in $(ls src/calx/sql/*.sql | sort); do
62
62
  psql -h localhost -p 5434 -U trunk -d trunk -f "$f" -q
63
63
  done
64
64
 
@@ -67,15 +67,16 @@ jobs:
67
67
  NERODE_DSN: postgresql://nerode:nerode@localhost:5435/nerode
68
68
  run: |
69
69
  python -c "
70
- from nerode.db import apply_schema, connect
71
- with connect() as conn:
70
+ import psycopg
71
+ from nerode.db import apply_schema
72
+ with psycopg.connect('postgresql://nerode:nerode@localhost:5435/nerode') as conn:
72
73
  apply_schema(conn, verbose=True)
73
74
  "
74
75
 
75
76
  - name: Test
76
77
  env:
77
78
  CALX_TEST_DSN: postgresql://trunk:trunk@localhost:5434/trunk
78
- NERODE_TEST_DSN: postgresql://nerode:nerode@localhost:5435/nerode
79
+ NERODE_DSN: postgresql://nerode:nerode@localhost:5435/nerode
79
80
  run: pytest -m "not slow and not primesieve and not network"
80
81
 
81
82
  build:
@@ -1,27 +1,17 @@
1
- <<<<<<< HEAD
2
1
  TRUNK_DSN ?= postgresql://trunk:trunk@localhost:5434/trunk
3
2
  NERODE_DSN ?= postgresql://nerode:nerode@localhost:5435/nerode
4
3
 
5
- .PHONY: up down apply apply-trunkit apply-nerode check install dev-install test lint build
4
+ .PHONY: up down apply apply-trunkit apply-nerode check check-trunkit check-nerode \
5
+ install dev-install test test-network lint build reset-trunkit reset-nerode
6
6
 
7
7
  ## Start both PostgreSQL instances via Docker Compose
8
8
  up:
9
9
  docker compose up -d db-trunkit db-nerode
10
- =======
11
- DSN ?= postgresql://trunk:trunk@localhost:5434/trunk
12
-
13
- .PHONY: up down apply check reset install
14
-
15
- ## Start PostgreSQL via Docker Compose
16
- up:
17
- docker compose up -d db
18
- >>>>>>> origin/main
19
10
 
20
11
  ## Stop and remove containers
21
12
  down:
22
13
  docker compose down
23
14
 
24
- <<<<<<< HEAD
25
15
  ## Apply Trunkit (calx/kan/curry/cert) schemas — idempotent
26
16
  apply-trunkit:
27
17
  @for f in $$(ls src/calx/sql/*.sql | sort); do \
@@ -56,32 +46,10 @@ check: check-trunkit check-nerode
56
46
  ## Full local bootstrap: up -> apply -> check
57
47
  install: up
58
48
  @echo "Waiting for databases to be ready..."
59
- =======
60
- ## Apply all SQL schemas in order (idempotent)
61
- apply:
62
- @for f in $$(ls src/calx/sql/*.sql | sort); do \
63
- echo " $$f"; \
64
- psql $(DSN) -f "$$f" -q; \
65
- done
66
- @echo "Done. Run 'make check' to verify."
67
-
68
- ## Populate integers and run reflexive closure + cert attestation
69
- check:
70
- python tools/kan_in_kan.py
71
-
72
- ## Attest formal-tier proof artifacts
73
- attest:
74
- python tools/cert_formal.py
75
-
76
- ## Full local bootstrap: up → apply → check
77
- install: up
78
- @echo "Waiting for db to be ready..."
79
- >>>>>>> origin/main
80
49
  @sleep 3
81
50
  $(MAKE) apply
82
51
  $(MAKE) check
83
52
 
84
- <<<<<<< HEAD
85
53
  ## Install Python packages in editable/dev mode
86
54
  dev-install:
87
55
  pip install -e ".[dev]"
@@ -112,10 +80,3 @@ reset-trunkit:
112
80
  reset-nerode:
113
81
  psql "$(NERODE_DSN)" -c "DROP SCHEMA IF EXISTS nerode CASCADE;"
114
82
  $(MAKE) apply-nerode
115
- =======
116
- ## Drop all Trunkit schemas and start fresh (destructive)
117
- reset:
118
- psql $(DSN) -c "DROP SCHEMA IF EXISTS cert, kan, curry, calx CASCADE;"
119
- $(MAKE) apply
120
- $(MAKE) check
121
- >>>>>>> origin/main
trunkit-0.2.2/PKG-INFO ADDED
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: trunkit
3
+ Version: 0.2.2
4
+ Summary: Trunkit — proof-carrying code and deterministic automata middleware on PostgreSQL, with Porter agent context handoff
5
+ Project-URL: Homepage, https://github.com/Athena-Pro/Trunkit
6
+ Project-URL: Repository, https://github.com/Athena-Pro/Trunkit
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Keywords: agent,automata,category-theory,dfa,formal-verification,handoff,integer-sequences,llm,minimization,nerode-equivalence,postgresql,proof-carrying-code
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: SQL
18
+ Classifier: Topic :: Database
19
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: psycopg<4,>=3.2
22
+ Provides-Extra: binary
23
+ Requires-Dist: psycopg[binary]<4,>=3.2; extra == 'binary'
24
+ Provides-Extra: dev
25
+ Requires-Dist: build>=1.0; extra == 'dev'
26
+ Requires-Dist: psycopg[binary]<4,>=3.2; extra == 'dev'
27
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
28
+ Requires-Dist: pytest>=8; extra == 'dev'
29
+ Requires-Dist: ruff>=0.6; extra == 'dev'
30
+ Requires-Dist: twine>=5.0; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ <p align="center">
34
+ <img src="assets/logo.png" alt="Trunkit" width="220" />
35
+ </p>
36
+
37
+ # Trunkit
38
+
39
+ > The smallest elephant in the room that's not too Coq-y and doesn't Lean too heavily on your system.
40
+
41
+ Proof-carrying code middleware on PostgreSQL. Trunkit is a self-contained schema stack
42
+ that attaches verifiable claims to mathematical objects, chains proofs compositionally,
43
+ and lets consumers re-verify results without trusting the producer — all inside a
44
+ database you already operate, with no specialist toolchain required.
45
+
46
+ No 3 GB compiler. No gigabytes of cached proof objects. No new runtime to learn.
47
+ Just PostgreSQL, Python, and ~1.5 MB of schemas.
48
+
49
+ ---
50
+
51
+ ## Stack
52
+
53
+ ```
54
+ ┌──────────────────────────────────────────────────────────────────┐
55
+ │ Porter — agent context handoff │
56
+ │ Precacher · Sources · close_session() · open_session() │
57
+ │ cybernetic DFAs · composite pattern detection │
58
+ ├──────────────────────────────────────────────────────────────────┤
59
+ │ Nerode — deterministic automata engine │
60
+ │ DFA construction · minimization · product · session DFAs │
61
+ │ sequence cache · cert-signed handoff envelopes │
62
+ ├──────────────────────────┬───────────────────────────────────────┤
63
+ │ cert │ kan │
64
+ │ proof-carrying │ category theory meta-layer │
65
+ │ attestation │ (monoidal · NTs · Kan · profunctors) │
66
+ ├──────────────────────────┼───────────────────────────────────────┤
67
+ │ curry │ calx │
68
+ │ versioned provenance │ integer arithmetic bedrock │
69
+ │ + immutable constants │ (primes · CRT · dynamics · OEIS) │
70
+ └──────────────────────────┴───────────────────────────────────────┘
71
+ Trunkit DB postgresql://trunk:trunk@localhost:5434/trunk
72
+ Nerode DB postgresql://nerode:nerode@localhost:5435/nerode
73
+ ```
74
+
75
+ | Layer | Role |
76
+ |-------|------|
77
+ | **calx** | Dense prime factorisation of ℤ[1..N]; aliquot/derivative dynamics; CRT; OEIS sequence matching |
78
+ | **curry** | Immutable versioned constants and functions; append-only computational provenance |
79
+ | **kan** | Category-theory meta-layer: base categories → monoidal → NTs → Kan extensions → enrichment → profunctors → adjunctions |
80
+ | **cert** | Proof-carrying attestation: five method tiers, structured witness storage, proof composition DAG, portable bundle export, consumer re-verification |
81
+ | **Nerode** | DFA/automata engine on PostgreSQL: construction, minimization, product, session DFAs, sequence cache, certified handoff envelopes |
82
+ | **Porter** | Agent context handoff: pre-pack external data, certify session boundaries, hand verified context to a new model with zero tool calls |
83
+
84
+ ---
85
+
86
+ ## Quick start
87
+
88
+ ```bash
89
+ # 1. Start both PostgreSQL instances
90
+ docker compose up -d db-trunkit db-nerode
91
+
92
+ # 2. Apply all schemas (idempotent)
93
+ make apply
94
+
95
+ # 3. Trunkit: populate integers and run reflexive closure
96
+ trunkit generate --limit 10000
97
+ trunkit close --write
98
+
99
+ # 4. Porter: pre-pack a morning brief and open it as Model B
100
+ python scripts/morning_brief_demo.py
101
+ ```
102
+
103
+ ```bash
104
+ # Install
105
+ pip install trunkit # proof kernel
106
+ pip install nerode # automata + porter layer
107
+ ```
108
+
109
+ Environment variable: `CALX_DSN=postgresql://trunk:trunk@localhost:5434/trunk`
110
+
111
+ ---
112
+
113
+ ## CLI
114
+
115
+ Trunkit ships a dual-surface CLI. Consumer commands are read-only and safe for LLM use.
116
+ Prover commands require `--write` to record; they dry-run without it.
117
+
118
+ ### Consumer — read-only
119
+
120
+ ```bash
121
+ trunkit verify <claim_id>
122
+ # Re-verifies a claim without inserting. Replays the stored witness or
123
+ # re-runs the probe SQL in a subtransaction. Exits 0 if valid.
124
+
125
+ trunkit standing [--method M] [--status S]
126
+ # Lists all claims with their latest attestation status.
127
+ # Filter by method (comp_sql, struct_kan, formal_external,
128
+ # empirical_corpus, witness_carry) or status (valid, refuted, unverified).
129
+
130
+ trunkit export <id> [<id> ...]
131
+ # Emits a self-contained JSONB bundle to stdout:
132
+ # claims + certificates + witnesses + derivations.
133
+ # Portable — consumers can re-verify without a Trunkit install.
134
+ ```
135
+
136
+ ```
137
+ $ trunkit standing
138
+ [✓] # 1 comp_sql valid 2026-05-19 14:32 28 is a perfect number: σ(28) − 28 = 28
139
+ [✓] # 2 witness_carry valid 2026-05-19 14:32 12 has p-adic stratification {2:2, 3:1}
140
+ [✓] # 3 struct_kan valid 2026-05-19 14:33 calx → curry functor is faithful
141
+ [?] # 4 formal_external unverified — σ(28) = 56 (external Python proof)
142
+
143
+ $ trunkit verify 2
144
+ [✓] claim 2 → VALID
145
+ evidence : {
146
+ "v2": 2,
147
+ "v3": 1
148
+ }
149
+ witness : {
150
+ "kind": "term",
151
+ "levels": {"prime_2": 2, "prime_3": 1},
152
+ "reconstruction": "2^2 * 3^1 = 12"
153
+ }
154
+ ```
155
+
156
+ ### Prover — require `--write`
157
+
158
+ ```bash
159
+ trunkit check <claim_id> [--write]
160
+ # Dry-run: shows what the claim would attest as (via cert.verify).
161
+ # With --write: runs cert.check() and records a certificate.
162
+
163
+ trunkit attest [--write]
164
+ # Dry-run: reports formal-tier claims that would be attested.
165
+ # With --write: runs cert_formal.py and records all formal-tier certificates.
166
+
167
+ trunkit close [--write]
168
+ # Dry-run: reports intent without side effects.
169
+ # With --write: computes reflexive closure — curry fixed points
170
+ # (primitive eigenforms) + kan Perron-Frobenius attractor — and
171
+ # records eigenform claims.
172
+
173
+ trunkit witness <claim_id> --kind KIND --body JSON [--write]
174
+ # Attach a structured proof witness to a claim.
175
+ # KIND: term | trace | counterexample | hash_chain | kan_diagram
176
+ ```
177
+
178
+ ### calx data
179
+
180
+ ```bash
181
+ trunkit init # apply schema DDL
182
+ trunkit generate --limit N # populate integers 1..N
183
+ trunkit validate [--limit N] # compare ω/Ω against OEIS
184
+ trunkit reset # drop all calx tables
185
+ trunkit oeis-load [--family F] # fetch curated OEIS b-files
186
+ trunkit oeis-match [--orbit-id ID | --all]
187
+ trunkit compose-match
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Porter — model-to-model context handoff
193
+
194
+ Each model session starts with no memory of what the previous session fetched, proved,
195
+ or decided. Porter pre-packs that context — external data, DFA states, proof certificates
196
+ — into an envelope before the session closes. The next model calls
197
+ `Precacher.open(envelope, session_id)` and has everything ready, cert verified, with
198
+ zero tool calls.
199
+
200
+ ```python
201
+ from datetime import date
202
+ from nerode.precache import Precacher
203
+ from nerode.sources import WeatherSource, TickerSource, HNSource
204
+
205
+ today = date.today().isoformat()
206
+
207
+ # Model A — fetch and pack before closing
208
+ with Precacher(f"brief-{today}") as pc:
209
+ pc.fetch(f"weather:london:{today}", WeatherSource(51.5, -0.1, label="London"))
210
+ pc.fetch(f"ticker:AAPL:{today}", TickerSource("AAPL"))
211
+ pc.fetch(f"news:hn:top5:{today}", HNSource(5))
212
+ # __exit__ calls close_session(); pc.envelope is now set
213
+
214
+ # Model B — open the envelope in a separate process/connection
215
+ ctx = Precacher.open(pc.envelope, "model-b-001")
216
+ resolved = ctx["resolved"] # {"weather:london:…": {…}, "ticker:AAPL:…": {…}, …}
217
+ cert_ok = ctx["prior_session"]["cert_valid"] # True
218
+ ```
219
+
220
+ ### Cybernetic monitoring
221
+
222
+ Porter includes DFA-based pattern detectors that fire over metric and control streams:
223
+
224
+ | DFA | Pattern | Meaning |
225
+ |-----|---------|---------|
226
+ | `metric_rise_3` | `U{3,}` | 3+ consecutive rises |
227
+ | `metric_oscillate` | `(UD){3,}` | oscillation / gain too high |
228
+ | `dead_time_5/10/20` | `A_{k,}` | action without response in k steps |
229
+ | `homeostasis_alarm_5` | `O{5,}` | 5+ steps outside target band |
230
+ | `dead_time_5_x_metric_oscillate` | composite | oscillating AND unresponsive |
231
+
232
+ ```python
233
+ # Log a paired (metric, control) event and scan all relevant DFAs
234
+ conn.execute(
235
+ "SELECT nerode.log_cybernetic(%s, 'metric_x_control', %s)",
236
+ (session_id, "UA") # metric rose (U), action taken (A)
237
+ )
238
+ # pg_notify('nerode_control_warn', ...) fires if any pattern matches
239
+ ```
240
+
241
+ ---
242
+
243
+ ## cert method tiers
244
+
245
+ | Method | Trust root | Use |
246
+ |--------|-----------|-----|
247
+ | `comp_sql` | In-DB probe | Computational facts about integers or categorical counts |
248
+ | `struct_kan` | Existing kan invariant | Naturality, triangle identities, faithfulness checks |
249
+ | `formal_external` | SHA256-pinned external artifact | Python/Lean/Agda proof scripts |
250
+ | `empirical_corpus` | Provenance only | Corpus document assertions |
251
+ | `witness_carry` | In-DB witness term | Structured proof terms stored alongside certificates; consumer-replayable |
252
+
253
+ ---
254
+
255
+ ## PCC properties
256
+
257
+ | Property | Mechanism |
258
+ |----------|-----------|
259
+ | Proof travels with code | `cert.witness` stores structured proof terms alongside every certificate |
260
+ | Proofs compose | `cert.derivation` encodes a DAG of premises → conclusion under named rules |
261
+ | Consumer re-verifies | `cert.verify(claim_id)` replays without INSERTing — safe for untrusted callers |
262
+ | Bundle is portable | `cert.export_bundle(ids[])` emits self-contained JSONB: claims + certs + witnesses + derivations |
263
+
264
+ ---
265
+
266
+ ## Bundle size
267
+
268
+ | Component | Files | Size |
269
+ |-----------|-------|------|
270
+ | SQL (94 files, 00–97) | 94 | ~534 KB |
271
+ | Python tools | 39 | ~342 KB |
272
+ | Proof scripts | 4 | ~23 KB |
273
+ | Src + tests + config | ~58 | ~483 KB |
274
+ | **Total (no virtualenv)** | **~199** | **~1.4 MB** |
275
+
276
+ Compare: Lean 4 toolchain ≈ 2.9 GB per version; Mathlib compiled ≈ 4–10 GB per project.
277
+
278
+ ---
279
+
280
+ ## Repository layout
281
+
282
+ ```
283
+ src/
284
+ calx/ — Trunkit Python package (calx + kan + curry + cert)
285
+ nerode/ — Nerode/Porter Python package
286
+ sql/ — 23 idempotent SQL schema files (00_bootstrap → 97_composite_dfa)
287
+ precache.py — Precacher context manager (Porter API)
288
+ sources.py — WeatherSource, TickerSource, HNSource, TickerHistorySource
289
+ adapters.py — HttpSource, CallableSource, resolve(), with_retry()
290
+ db.py — connection utilities + SCHEMA_FILES list
291
+ scripts/
292
+ morning_brief_demo.py — end-to-end Porter demo
293
+ tests/
294
+ test_sources.py — network tests (pytest -m network)
295
+ test_cybernetic.py — cybernetic DFA tests
296
+ test_composite_dfa.py — paired-alphabet composite DFA tests
297
+ test_dead_time_factory.py
298
+ test_*.py — unit tests for all schema layers
299
+ proofs/
300
+ *.py — Trunkit proof scripts
301
+ tools/
302
+ kan_in_kan.py — Trunkit reflexive closure tool
303
+ ```
304
+
305
+ ---
306
+
307
+ ## License
308
+
309
+ MIT
@@ -0,0 +1,277 @@
1
+ <p align="center">
2
+ <img src="assets/logo.png" alt="Trunkit" width="220" />
3
+ </p>
4
+
5
+ # Trunkit
6
+
7
+ > The smallest elephant in the room that's not too Coq-y and doesn't Lean too heavily on your system.
8
+
9
+ Proof-carrying code middleware on PostgreSQL. Trunkit is a self-contained schema stack
10
+ that attaches verifiable claims to mathematical objects, chains proofs compositionally,
11
+ and lets consumers re-verify results without trusting the producer — all inside a
12
+ database you already operate, with no specialist toolchain required.
13
+
14
+ No 3 GB compiler. No gigabytes of cached proof objects. No new runtime to learn.
15
+ Just PostgreSQL, Python, and ~1.5 MB of schemas.
16
+
17
+ ---
18
+
19
+ ## Stack
20
+
21
+ ```
22
+ ┌──────────────────────────────────────────────────────────────────┐
23
+ │ Porter — agent context handoff │
24
+ │ Precacher · Sources · close_session() · open_session() │
25
+ │ cybernetic DFAs · composite pattern detection │
26
+ ├──────────────────────────────────────────────────────────────────┤
27
+ │ Nerode — deterministic automata engine │
28
+ │ DFA construction · minimization · product · session DFAs │
29
+ │ sequence cache · cert-signed handoff envelopes │
30
+ ├──────────────────────────┬───────────────────────────────────────┤
31
+ │ cert │ kan │
32
+ │ proof-carrying │ category theory meta-layer │
33
+ │ attestation │ (monoidal · NTs · Kan · profunctors) │
34
+ ├──────────────────────────┼───────────────────────────────────────┤
35
+ │ curry │ calx │
36
+ │ versioned provenance │ integer arithmetic bedrock │
37
+ │ + immutable constants │ (primes · CRT · dynamics · OEIS) │
38
+ └──────────────────────────┴───────────────────────────────────────┘
39
+ Trunkit DB postgresql://trunk:trunk@localhost:5434/trunk
40
+ Nerode DB postgresql://nerode:nerode@localhost:5435/nerode
41
+ ```
42
+
43
+ | Layer | Role |
44
+ |-------|------|
45
+ | **calx** | Dense prime factorisation of ℤ[1..N]; aliquot/derivative dynamics; CRT; OEIS sequence matching |
46
+ | **curry** | Immutable versioned constants and functions; append-only computational provenance |
47
+ | **kan** | Category-theory meta-layer: base categories → monoidal → NTs → Kan extensions → enrichment → profunctors → adjunctions |
48
+ | **cert** | Proof-carrying attestation: five method tiers, structured witness storage, proof composition DAG, portable bundle export, consumer re-verification |
49
+ | **Nerode** | DFA/automata engine on PostgreSQL: construction, minimization, product, session DFAs, sequence cache, certified handoff envelopes |
50
+ | **Porter** | Agent context handoff: pre-pack external data, certify session boundaries, hand verified context to a new model with zero tool calls |
51
+
52
+ ---
53
+
54
+ ## Quick start
55
+
56
+ ```bash
57
+ # 1. Start both PostgreSQL instances
58
+ docker compose up -d db-trunkit db-nerode
59
+
60
+ # 2. Apply all schemas (idempotent)
61
+ make apply
62
+
63
+ # 3. Trunkit: populate integers and run reflexive closure
64
+ trunkit generate --limit 10000
65
+ trunkit close --write
66
+
67
+ # 4. Porter: pre-pack a morning brief and open it as Model B
68
+ python scripts/morning_brief_demo.py
69
+ ```
70
+
71
+ ```bash
72
+ # Install
73
+ pip install trunkit # proof kernel
74
+ pip install nerode # automata + porter layer
75
+ ```
76
+
77
+ Environment variable: `CALX_DSN=postgresql://trunk:trunk@localhost:5434/trunk`
78
+
79
+ ---
80
+
81
+ ## CLI
82
+
83
+ Trunkit ships a dual-surface CLI. Consumer commands are read-only and safe for LLM use.
84
+ Prover commands require `--write` to record; they dry-run without it.
85
+
86
+ ### Consumer — read-only
87
+
88
+ ```bash
89
+ trunkit verify <claim_id>
90
+ # Re-verifies a claim without inserting. Replays the stored witness or
91
+ # re-runs the probe SQL in a subtransaction. Exits 0 if valid.
92
+
93
+ trunkit standing [--method M] [--status S]
94
+ # Lists all claims with their latest attestation status.
95
+ # Filter by method (comp_sql, struct_kan, formal_external,
96
+ # empirical_corpus, witness_carry) or status (valid, refuted, unverified).
97
+
98
+ trunkit export <id> [<id> ...]
99
+ # Emits a self-contained JSONB bundle to stdout:
100
+ # claims + certificates + witnesses + derivations.
101
+ # Portable — consumers can re-verify without a Trunkit install.
102
+ ```
103
+
104
+ ```
105
+ $ trunkit standing
106
+ [✓] # 1 comp_sql valid 2026-05-19 14:32 28 is a perfect number: σ(28) − 28 = 28
107
+ [✓] # 2 witness_carry valid 2026-05-19 14:32 12 has p-adic stratification {2:2, 3:1}
108
+ [✓] # 3 struct_kan valid 2026-05-19 14:33 calx → curry functor is faithful
109
+ [?] # 4 formal_external unverified — σ(28) = 56 (external Python proof)
110
+
111
+ $ trunkit verify 2
112
+ [✓] claim 2 → VALID
113
+ evidence : {
114
+ "v2": 2,
115
+ "v3": 1
116
+ }
117
+ witness : {
118
+ "kind": "term",
119
+ "levels": {"prime_2": 2, "prime_3": 1},
120
+ "reconstruction": "2^2 * 3^1 = 12"
121
+ }
122
+ ```
123
+
124
+ ### Prover — require `--write`
125
+
126
+ ```bash
127
+ trunkit check <claim_id> [--write]
128
+ # Dry-run: shows what the claim would attest as (via cert.verify).
129
+ # With --write: runs cert.check() and records a certificate.
130
+
131
+ trunkit attest [--write]
132
+ # Dry-run: reports formal-tier claims that would be attested.
133
+ # With --write: runs cert_formal.py and records all formal-tier certificates.
134
+
135
+ trunkit close [--write]
136
+ # Dry-run: reports intent without side effects.
137
+ # With --write: computes reflexive closure — curry fixed points
138
+ # (primitive eigenforms) + kan Perron-Frobenius attractor — and
139
+ # records eigenform claims.
140
+
141
+ trunkit witness <claim_id> --kind KIND --body JSON [--write]
142
+ # Attach a structured proof witness to a claim.
143
+ # KIND: term | trace | counterexample | hash_chain | kan_diagram
144
+ ```
145
+
146
+ ### calx data
147
+
148
+ ```bash
149
+ trunkit init # apply schema DDL
150
+ trunkit generate --limit N # populate integers 1..N
151
+ trunkit validate [--limit N] # compare ω/Ω against OEIS
152
+ trunkit reset # drop all calx tables
153
+ trunkit oeis-load [--family F] # fetch curated OEIS b-files
154
+ trunkit oeis-match [--orbit-id ID | --all]
155
+ trunkit compose-match
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Porter — model-to-model context handoff
161
+
162
+ Each model session starts with no memory of what the previous session fetched, proved,
163
+ or decided. Porter pre-packs that context — external data, DFA states, proof certificates
164
+ — into an envelope before the session closes. The next model calls
165
+ `Precacher.open(envelope, session_id)` and has everything ready, cert verified, with
166
+ zero tool calls.
167
+
168
+ ```python
169
+ from datetime import date
170
+ from nerode.precache import Precacher
171
+ from nerode.sources import WeatherSource, TickerSource, HNSource
172
+
173
+ today = date.today().isoformat()
174
+
175
+ # Model A — fetch and pack before closing
176
+ with Precacher(f"brief-{today}") as pc:
177
+ pc.fetch(f"weather:london:{today}", WeatherSource(51.5, -0.1, label="London"))
178
+ pc.fetch(f"ticker:AAPL:{today}", TickerSource("AAPL"))
179
+ pc.fetch(f"news:hn:top5:{today}", HNSource(5))
180
+ # __exit__ calls close_session(); pc.envelope is now set
181
+
182
+ # Model B — open the envelope in a separate process/connection
183
+ ctx = Precacher.open(pc.envelope, "model-b-001")
184
+ resolved = ctx["resolved"] # {"weather:london:…": {…}, "ticker:AAPL:…": {…}, …}
185
+ cert_ok = ctx["prior_session"]["cert_valid"] # True
186
+ ```
187
+
188
+ ### Cybernetic monitoring
189
+
190
+ Porter includes DFA-based pattern detectors that fire over metric and control streams:
191
+
192
+ | DFA | Pattern | Meaning |
193
+ |-----|---------|---------|
194
+ | `metric_rise_3` | `U{3,}` | 3+ consecutive rises |
195
+ | `metric_oscillate` | `(UD){3,}` | oscillation / gain too high |
196
+ | `dead_time_5/10/20` | `A_{k,}` | action without response in k steps |
197
+ | `homeostasis_alarm_5` | `O{5,}` | 5+ steps outside target band |
198
+ | `dead_time_5_x_metric_oscillate` | composite | oscillating AND unresponsive |
199
+
200
+ ```python
201
+ # Log a paired (metric, control) event and scan all relevant DFAs
202
+ conn.execute(
203
+ "SELECT nerode.log_cybernetic(%s, 'metric_x_control', %s)",
204
+ (session_id, "UA") # metric rose (U), action taken (A)
205
+ )
206
+ # pg_notify('nerode_control_warn', ...) fires if any pattern matches
207
+ ```
208
+
209
+ ---
210
+
211
+ ## cert method tiers
212
+
213
+ | Method | Trust root | Use |
214
+ |--------|-----------|-----|
215
+ | `comp_sql` | In-DB probe | Computational facts about integers or categorical counts |
216
+ | `struct_kan` | Existing kan invariant | Naturality, triangle identities, faithfulness checks |
217
+ | `formal_external` | SHA256-pinned external artifact | Python/Lean/Agda proof scripts |
218
+ | `empirical_corpus` | Provenance only | Corpus document assertions |
219
+ | `witness_carry` | In-DB witness term | Structured proof terms stored alongside certificates; consumer-replayable |
220
+
221
+ ---
222
+
223
+ ## PCC properties
224
+
225
+ | Property | Mechanism |
226
+ |----------|-----------|
227
+ | Proof travels with code | `cert.witness` stores structured proof terms alongside every certificate |
228
+ | Proofs compose | `cert.derivation` encodes a DAG of premises → conclusion under named rules |
229
+ | Consumer re-verifies | `cert.verify(claim_id)` replays without INSERTing — safe for untrusted callers |
230
+ | Bundle is portable | `cert.export_bundle(ids[])` emits self-contained JSONB: claims + certs + witnesses + derivations |
231
+
232
+ ---
233
+
234
+ ## Bundle size
235
+
236
+ | Component | Files | Size |
237
+ |-----------|-------|------|
238
+ | SQL (94 files, 00–97) | 94 | ~534 KB |
239
+ | Python tools | 39 | ~342 KB |
240
+ | Proof scripts | 4 | ~23 KB |
241
+ | Src + tests + config | ~58 | ~483 KB |
242
+ | **Total (no virtualenv)** | **~199** | **~1.4 MB** |
243
+
244
+ Compare: Lean 4 toolchain ≈ 2.9 GB per version; Mathlib compiled ≈ 4–10 GB per project.
245
+
246
+ ---
247
+
248
+ ## Repository layout
249
+
250
+ ```
251
+ src/
252
+ calx/ — Trunkit Python package (calx + kan + curry + cert)
253
+ nerode/ — Nerode/Porter Python package
254
+ sql/ — 23 idempotent SQL schema files (00_bootstrap → 97_composite_dfa)
255
+ precache.py — Precacher context manager (Porter API)
256
+ sources.py — WeatherSource, TickerSource, HNSource, TickerHistorySource
257
+ adapters.py — HttpSource, CallableSource, resolve(), with_retry()
258
+ db.py — connection utilities + SCHEMA_FILES list
259
+ scripts/
260
+ morning_brief_demo.py — end-to-end Porter demo
261
+ tests/
262
+ test_sources.py — network tests (pytest -m network)
263
+ test_cybernetic.py — cybernetic DFA tests
264
+ test_composite_dfa.py — paired-alphabet composite DFA tests
265
+ test_dead_time_factory.py
266
+ test_*.py — unit tests for all schema layers
267
+ proofs/
268
+ *.py — Trunkit proof scripts
269
+ tools/
270
+ kan_in_kan.py — Trunkit reflexive closure tool
271
+ ```
272
+
273
+ ---
274
+
275
+ ## License
276
+
277
+ MIT