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.
- {trunkit-0.2.1 → trunkit-0.2.2}/.github/workflows/python-package-conda.yml +6 -5
- {trunkit-0.2.1 → trunkit-0.2.2}/Makefile +2 -41
- trunkit-0.2.2/PKG-INFO +309 -0
- trunkit-0.2.2/README.md +277 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/SKILL.md +2 -146
- trunkit-0.2.2/assets/logo.png +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/pyproject.toml +1 -1
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/__init__.py +0 -2
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/db.py +1 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/generate.py +1 -1
- trunkit-0.2.2/src/calx/sql/89_nerode_bridge.sql +53 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/__init__.py +1 -1
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/cli.py +6 -10
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/conftest.py +0 -5
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_composite_dfa.py +1 -1
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_crt.py +16 -21
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_dynamics.py +3 -3
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_factorizations.py +2 -2
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_oeis_match.py +2 -2
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sieve.py +4 -12
- trunkit-0.2.1/PKG-INFO +0 -242
- trunkit-0.2.1/README.md +0 -210
- trunkit-0.2.1/assets/logo.png +0 -0
- trunkit-0.2.1/proofs/bigrading.py +0 -248
- trunkit-0.2.1/proofs/chromatic.py +0 -254
- trunkit-0.2.1/proofs/colimit_closure.py +0 -242
- trunkit-0.2.1/proofs/combined_scale.py +0 -346
- trunkit-0.2.1/proofs/developed_sequence.py +0 -433
- trunkit-0.2.1/proofs/f1_radix.py +0 -181
- trunkit-0.2.1/proofs/factorial_homology_signature.py +0 -261
- trunkit-0.2.1/proofs/grading.py +0 -237
- trunkit-0.2.1/proofs/identity_decomposition.py +0 -235
- trunkit-0.2.1/proofs/lithon.py +0 -190
- trunkit-0.2.1/proofs/moonshine.py +0 -192
- trunkit-0.2.1/proofs/omega_family.py +0 -215
- trunkit-0.2.1/proofs/omega_family_succ.py +0 -269
- trunkit-0.2.1/proofs/prime_members_functor.py +0 -188
- trunkit-0.2.1/proofs/self_shadow.py +0 -176
- trunkit-0.2.1/proofs/self_syzygy.py +0 -162
- trunkit-0.2.1/proofs/seq_homology_signature.py +0 -200
- trunkit-0.2.1/proofs/shadow.py +0 -185
- trunkit-0.2.1/proofs/shared_prime_h2.py +0 -220
- trunkit-0.2.1/proofs/strata_tower.py +0 -219
- {trunkit-0.2.1 → trunkit-0.2.2}/.dockerignore +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/.gitattributes +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/.gitignore +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/Dockerfile +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/LICENSE +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/_notify_demo.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/bench.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/bench_chomsky.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval_classify_retry.log +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/llm_eval_run.log +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/benchmarks/sequence_bench.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/docker-compose.yml +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/proofs/combined_signature.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/proofs/equipment.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/proofs/gap_homology_primes.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/proofs/perfect_28.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/scripts/morning_brief_demo.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/cli.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/curry_adapter.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/primesieve.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/00_rehome_to_calx.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/01_schema.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/02_views.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/03_generate.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/04_crt.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/05_dynamics.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/06_oeis_match.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/07_compositions.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/10_curry.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/20_kan.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/21_kan_functors.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/22_kan_elements.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/23_kan_monoidal.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/24_kan_natural_transformations.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/25_kan_extensions.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/26_kan_enrichment.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/27_kan_profunctors.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/28_kan_adjunctions.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/30_kan_corpus.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/40_cert.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/41_cert_formal.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/42_cert_gap_homology.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/43_kan_sequence_homology.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/44_cert_seq_homology.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/45_kan_factorial_homology.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/46_cert_factorial_homology.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/47_kan_combined_signature.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/48_cert_combined.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/49_kan_shared_prime_betti.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/50_cert_combined_scale.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/51_cert_shared_prime_h2.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/52_cert_developed_sequence.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/53_cert_omega_family.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/54_cert_omega_family_succ.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/55_kan_prime_members.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/56_cert_prime_members_functor.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/57_kan_strata_tower.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/58_cert_strata_tower.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/59_kan_grading.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/60_cert_grading.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/61_kan_identity_decomposition.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/62_cert_identity_decomposition.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/63_kan_bigrading.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/64_cert_bigrading.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/65_kan_chromatic.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/66_cert_chromatic.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/67_kan_lithon.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/68_cert_lithon.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/69_kan_shadow.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/70_cert_shadow.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/71_kan_self_syzygy.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/72_cert_self_syzygy.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/73_kan_self_shadow.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/74_cert_self_shadow.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/75_kan_f1_radix.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/76_cert_f1_radix.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/77_kan_moonshine.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/78_cert_moonshine.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/79_cert_kan_engines.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/80_kan_colimit_closure.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/81_cert_colimit_closure.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/82_kan_equipment.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/83_cert_equipment.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/84_cert_witness.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/85_cert_derivation.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/86_cert_verify.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/87_cert_export_bundle.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/88_cert_witness_carry.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/crt_examples.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/dynamics_examples.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/sql/examples/queries.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/calx/validate.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/adapters.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/automata.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/db.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/precache.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sources.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/00_bootstrap.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/01_schema.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/02_run.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/03_minimize.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/04_product.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/05_from_regex.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/10_cert.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/11_chomsky.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/20_calx_bridge.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/30_protocol.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/40_eigenform.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/50_corpus.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/60_product_corpus.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/70_morphism.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/80_categorical.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/90_sequence.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/91_sequence_cache.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/92_session_automata.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/93_handoff.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/94_open_session.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/95_cybernetic_automata.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/96_dead_time_factory.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/src/nerode/sql/97_composite_dfa.sql +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/__init__.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/fixtures/oeis/.gitkeep +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_aliquot.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_build.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_categorical.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_chomsky.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_compose_match.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_cybernetic.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_dead_time_factory.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_equivalent.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_minimize.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_morphisms.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1a.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1b.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase1c.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_phase2.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_product.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_run.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_schema.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sequence.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_sources.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tests/test_stream_interceptor.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/agent_demo.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_bigrading.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_chromatic.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_colimit_closure.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_equipment.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_f1_radix.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_grading.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_identity_decomposition.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_lithon.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_moonshine.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_self_shadow.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_self_syzygy.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_shadow.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/build_strata_tower.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/cert_formal.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/compose_match.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/cryptanalysis.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/develop_omega_family.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/develop_sequence.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/diagnostic_tests.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/factorial_homology.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/kan_in_kan.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/load_kan_corpus.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/oeis_loader.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/oeis_match.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/omega_equal_control.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/port_curry_sqlite_to_pg.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/prime_members_functor.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/register_calx_fn_deps.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/register_calx_in_curry.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/relationship_report.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/run_compose_discovery.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/run_discovery.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/seed_oeis_classics.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/seed_sequences.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/seq_homology.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/shared_prime_betti.py +0 -0
- {trunkit-0.2.1 → trunkit-0.2.2}/tools/smoke_curry_calx.py +0 -0
- {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
|
|
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
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
|
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
|
trunkit-0.2.2/README.md
ADDED
|
@@ -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
|