|
Download README.md from Snapkitty/carry-agent: direct link, hf CLI and curl.
- Browser
- Download file 19.9 kB
-
https://huggingface.co/Snapkitty/carry-agent/resolve/main/README.md
- Command line
-
hf download hf://Snapkitty/carry-agent/README.md
-
curl -L -o README.md https://huggingface.co/Snapkitty/carry-agent/resolve/main/README.md
19.9 kB
| license: agpl-3.0 | |
| tags: | |
| - snapkitty | |
| - agents | |
| - python | |
| > Source: [github.com/SNAPKITTYWEST/carry-agent](https://github.com/SNAPKITTYWEST/carry-agent) | |
| <p align="center"> | |
| <img src="docs/firecarry.png" alt="CARRY β CARTO's Evil Twin Made of Curry" width="360px" /> | |
| </p> | |
| <h1 align="center">CARRY</h1> | |
| <h3 align="center">Adversarial Twin of CARTO</h3> | |
| <p align="center"> | |
| <strong>CURRY_CRYSTAL_C3 Triad + Braid Topology + Sovereign Quantum Simulator</strong><br /> | |
| 7-state DAG-locked pipeline Β· Entropy-gated transitions Β· Tau-Prolog logic kernel<br /> | |
| Fibonacci anyons Β· ICP governance Β· BLAKE3 WORM audit chain<br /> | |
| <em>The FSM tells you WHERE you are. The braid tells you WHETHER you got there honestly.</em> | |
| </p> | |
| <p align="center"> | |
| <img src="https://img.shields.io/badge/lang-Rust-orange?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/logic-Tau--Prolog-blue?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/proof-Braid_Bβ-purple?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/quantum-Fibonacci_Anyons-cyan?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/formal-Lean_4_%2B_Agda-blueviolet?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/tests-14%2F14_PASS-brightgreen?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/sorry-0-brightgreen?style=flat-square" /> | |
| <img src="https://img.shields.io/badge/license-AGPL--3.0-green?style=flat-square" /> | |
| </p> | |
| --- | |
| <p align="center"> | |
| <img src="docs/carry_brand_banner.png" alt="CARRY FSM β Adversarial Twin System + Deterministic Compiler Engine" width="100%" /> | |
| </p> | |
| --- | |
| ``` | |
| βββββββ ββββββ βββββββ βββββββ βββ βββ | |
| ββββββββββββββββββββββββββββββββββββ ββββ | |
| βββ ββββββββββββββββββββββββ βββββββ | |
| βββ ββββββββββββββββββββββββ βββββ | |
| βββββββββββ ββββββ ββββββ βββ βββ | |
| ββββββββββ ββββββ ββββββ βββ βββ | |
| βββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β B R A I D T O P O L O G Y R U N T I M E β | |
| β Οβ Β· Οβ Β· Οβ = Οβ Β· Οβ Β· Οβ β | |
| β Yang-Baxter holds. The chain is honest. β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββ | |
| strand 0 βββ² β±ββ Οβ crossing | |
| strand 1 β²β± | |
| β±β² | |
| strand 2 βββ± β²ββ Οβ crossing | |
| β | |
| βΌ | |
| [C3 at pos 0] | |
| writhe = +2 | |
| INVARIANT HOLDS | |
| ``` | |
| --- | |
| ## What Is CARRY? | |
| CARRY is the **adversarial twin** of [CARTO](https://github.com/SNAPKITTYWEST/cartographer-agent). | |
| **CARTO** is the sovereign mapping agent β it models terrain, constructs pipelines, and produces outputs it claims are valid. | |
| **CARRY** attacks those outputs. If CARRY cannot break CARTO's pipeline, the pipeline is honest. CARRY is the red team that never sleeps β a formal adversary baked into the architecture itself rather than run as a separate audit process. | |
| The relationship: | |
| ``` | |
| CARTO CARRY | |
| βββββ βββββ | |
| Maps terrain ββ Attacks the map | |
| Claims pipeline is valid ββ Tries to falsify the claim | |
| Produces WORM output ββ Verifies the WORM seal | |
| GOTO (push semantics) ββ COME-FROM (pull semantics) | |
| Forward evolution (U) ββ Reversed evolution (Uβ ) | |
| ``` | |
| The braid topology encodes this duality formally: every GOTO crossing has a matching COME-FROM crossing. The writhe invariant proves that authority was transferred through the correct sequence of crossings β not just that it arrived at the right place, but that it took the right path. | |
| If the path is wrong, the braid is wrong. If the braid is wrong, the proof is rejected. No exceptions. | |
| --- | |
| ## Braid Authority Transfer | |
| ``` | |
| INITIAL: Curry ββββ Crystal ββββ C3 | |
| [0] [1] [2] (authority = pos 0) | |
| After Οβ: Curry ββββ C3 ββββ Crystal | |
| [0] [1] [2] (C3 crosses OVER Crystal) | |
| After Οβ: C3 ββββ Curry ββββ Crystal | |
| [0] [1] [2] (C3 crosses OVER Curry) | |
| Writhe W(Ξ²) = (+1) + (+1) = +2 | |
| C3 at position 0 β AUTHORITY TRANSFERRED | |
| INVARIANT HOLDS β | |
| ``` | |
| ``` | |
| BRAID WORD: Οβ Β· Οβ | |
| βββββββββββββββββββββ | |
| Curry ββββ\ββββββββββββββββ | |
| \ | |
| Crystal ββββXββ\ββββββββββ Οβ: C3 over Crystal | |
| / \ | |
| C3 βββββββ /ββββXββββββββ Οβ: C3 over Curry | |
| \ | |
| βΌ | |
| C3 at pos 0 | |
| W = +2 β | |
| ``` | |
| --- | |
| ## Architecture | |
| ``` | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β CARRY STACK β | |
| β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ | |
| β FORMAL LAYER Lean 4 + Agda β | |
| β 13 invariants Β· 0 sorry β | |
| β state_preservation proved β | |
| β duality_involution proved β | |
| β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ | |
| β QUANTUM LAYER Fibonacci Anyon Simulator β | |
| β Bβ braid group Β· Ο = 1.6180 β | |
| β StateVector + DensityMatrix engines β | |
| β ICP 6-stage governance pipeline β | |
| β ASP declarative constraint solver β | |
| β 6052 cycle-accurate emulator β | |
| β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ | |
| β GOVERNANCE LAYER Conditional Dual DAG β | |
| β GOTO β COME-FROM duality β | |
| β state preserved across ALL transitions β | |
| β BLAKE3 WORM audit chain β | |
| β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ | |
| β RUNTIME LAYER Rust (carry-fsm crate) β | |
| β 7-state DAG-locked FSM β | |
| β Entropy β€ 0.20 gate β | |
| β Tau-Prolog logic kernel β | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| --- | |
| ## 7-State Quantum FSM | |
| ``` | |
| ββββββββ βββββββββββ ββββββββββββ βββββββββββ | |
| β INIT βββββΆβ PREPARE βββββΆβ ENTANGLE βββββΆβ COMPUTE β | |
| ββββββββ βββββββββββ ββββββββββββ ββββββ¬βββββ | |
| β | |
| ββββββββββ ββββββββββ ββββββββββ β | |
| β COMMIT ββββββ VERIFY ββββββMEASURE βββββββββββββ | |
| βββββ¬βββββ ββββββββββ ββββββββββ | |
| β | |
| ββββΆ PREPARE (loop) βββ or βββ COMMIT (terminal) | |
| Any state βββΆ HALTED (emergency) | |
| Any state βββΆ CYCLE_LIMIT (budget exhausted, absorbing) | |
| Theorem (Lean 4, zero sorry): | |
| Halted and CYCLE_LIMIT are ABSORBING STATES. | |
| No transition exits them. Ever. | |
| ``` | |
| --- | |
| ## The Quantum Module | |
| CARRY ships a full first-principles quantum simulator: | |
| ``` | |
| runtime/quantum/ | |
| βββ core.rs StateVector |Οβ© + DensityMatrix Ο engines | |
| β Born rule measurement Β· noise models | |
| β H X Y Z S T Rx Ry Rz CNOT CZ SWAP | |
| βββ fsm.rs 7-state governance FSM (proved absorbing terminals) | |
| βββ agents.rs Primary + Partner agent pairs | |
| β Qubit ownership: pairwise disjoint (proved INV-7) | |
| βββ dag.rs Execution DAG + provenance hash chain | |
| βββ icp.rs Integrity Constraint Protocol | |
| β 6 stages: SetupβObserveβValidateβCheckβExecuteβVerify | |
| β HALT on any constraint breach | |
| βββ asp.rs Answer Set Programming constraint solver | |
| β QubitControl Β· Entangled Β· AgentControls rules | |
| βββ topological.rs Fibonacci anyon simulator | |
| β Bβ: Οβ Οβ Οββ»ΒΉ Οββ»ΒΉ Β· Ο β 1.6180 (golden ratio) | |
| β Fusion rules: tauβtau β {vacuum, tau} | |
| βββ ftb.rs Fibonacci-Taylor Braid synthesis [RESEARCH_HYPOTHESIS] | |
| βββ gitc.rs Governance Invariant Topological Cycle | |
| βββ emulator_6052.rs Cycle-accurate 6052 emulator Β· MAX_CYCLE hard budget | |
| βββ benchmarks.rs Bell Β· GHZ Β· Teleportation Β· Deutsch Β· Grover Β· QFT | |
| ``` | |
| Reference circuits: | |
| ``` | |
| Circuit Qubits Gates Expected state | |
| ββββββββββββ ββββββ βββββ ββββββββββββββββββββββββββ | |
| Bell 2 2 (|00β© + |11β©) / β2 | |
| GHZ-3 3 3 (|000β© + |111β©) / β2 | |
| Teleportation 3 7 State transfer protocol | |
| Deutsch-Jozsa 2 5 Constant/balanced oracle | |
| Grover-2Q 2 12 Amplitude amplification | |
| QFT-3Q 3 10 Quantum Fourier Transform | |
| ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| 14/14 tests PASS Β· all circuits SUCCESS | |
| ``` | |
| --- | |
| ## Formal Verification Layer | |
| ``` | |
| runtime/quantum/ | |
| βββ QuantumSpec.agda Dependent-type specification | |
| β Transition s s' encoded in the TYPE | |
| β Illegal transitions: unrepresentable | |
| β | |
| βββ QuantumInvariants.lean 13 machine-checked invariants | |
| β INV-1: norm preserved by unitary gates | |
| β INV-3: cycle counter strictly monotone | |
| β INV-4: FSM confined to DAG edges | |
| β INV-5: Halted/CycleLimit absorbing β | |
| β INV-7: agent qubit ownership disjoint | |
| β INV-9: Fibonacci fusion rules correct | |
| β INV-12: GITC invariant_holds iff all checks pass | |
| β ... 13 total Β· 0 sorry | |
| β | |
| βββ QuantumReference.fs F# executable reference backend | |
| 7 conformance tests | |
| Bell state Β· FSM terminal Β· ownership | |
| ``` | |
| The key post-quantum security property (ADR-002): | |
| ``` | |
| theorem state_preservation : | |
| Step P (lβ, sβ) (lβ, sβ) β sβ = sβ | |
| The governance layer is FORMALLY INERT with respect to state. | |
| A quantum adversary with full control of the navigator | |
| CANNOT touch the cryptographic state. | |
| Not policy. TYPE. | |
| ``` | |
| --- | |
| ## Trust Gate Invariants | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β GATE RULE BLOCKS β | |
| β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£ | |
| β Entropy entropy β€ 0.20 Acting on noise β | |
| β Writhe W(Ξ²) β₯ 2 Incomplete transfer β | |
| β Reidemeister ΟΒ·Οβ»ΒΉ rejected Fake crossings β | |
| β V1 Trust active β‘ trusted Untrusted execution β | |
| β Absorbing Halted stays Halted Re-entry after HALT β | |
| β Cycle cycle β€ max_cycle Infinite loops β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| --- | |
| ## Repository Structure | |
| ``` | |
| carry-agent/ | |
| β | |
| βββ Cargo.toml carry-fsm crate (AGPL-3.0) | |
| β | |
| βββ runtime/ | |
| β βββ carry-fsm.rs Core FSM library (7-state DAG) | |
| β βββ braid.rs Bβ braid topology module | |
| β βββ main.rs carry-cli binary | |
| β β | |
| β βββ quantum/ β SOVEREIGN QUANTUM SIMULATOR | |
| β βββ core.rs StateVector + DensityMatrix + gates | |
| β βββ fsm.rs Quantum governance FSM | |
| β βββ agents.rs Primary/partner agent pairs | |
| β βββ dag.rs Execution DAG + provenance | |
| β βββ icp.rs Integrity Constraint Protocol | |
| β βββ asp.rs ASP constraint solver | |
| β βββ topological.rs Fibonacci anyon simulator | |
| β βββ ftb.rs Fibonacci-Taylor Braids [HYPOTHESIS] | |
| β βββ gitc.rs Governance Invariant Topological Cycle | |
| β βββ emulator_6052.rs Cycle-accurate 6052 emulator | |
| β βββ benchmarks.rs Reference circuit suite | |
| β βββ mod.rs Module root | |
| β β | |
| β βββ QuantumSpec.agda β Dependent-type spec (Agda) | |
| β βββ QuantumInvariants.lean β 13 invariants, 0 sorry (Lean 4) | |
| β βββ QuantumReference.fs β F# conformance backend | |
| β | |
| βββ kernels/ | |
| β βββ carry-kernel.pl Original Prolog transition table | |
| β βββ tau-prolog/ | |
| β βββ braid_kernel.pl Braid logic engine (ISO Prolog) | |
| β βββ crossing_table.pl Crossing-to-DAG lookup | |
| β | |
| βββ logic/ | |
| β βββ constraint-graph.xml Constraint graph specification | |
| β | |
| βββ modules/ | |
| β βββ carry-manifest.json Full manifest (layers, DAG, rules) | |
| β | |
| βββ docs/ | |
| βββ firecarry.png Avatar | |
| βββ carry_brand_banner.png Architecture diagram | |
| βββ braid_animation.svg Animated braid crossing proof | |
| βββ CARRY_ARCHITECTURE.md Architecture specification | |
| ``` | |
| --- | |
| ## Run It | |
| ```bash | |
| # Full pipeline (FSM + braid proof) | |
| cargo run --bin carry-cli | |
| # Quantum benchmark suite | |
| cargo run --bin carry-cli -- quantum benchmark | |
| # Quantum governance verification (ICP + ASP) | |
| cargo run --bin carry-cli -- quantum verify | |
| # Fibonacci anyon topological simulation | |
| cargo run --bin carry-cli -- quantum topology | |
| # All 14 tests | |
| cargo test | |
| # Inspect FSM state | |
| cargo run --bin carry-cli -- quantum inspect | |
| ``` | |
| Expected output: | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| CARRY PIPELINE: BOTH PROOFS DISCHARGE | |
| FSM: DETERMINISTIC_COMPILATION_COMPLETE | |
| BRAID: INVARIANT_HOLDS (writhe=2, C3 at pos 0) | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ββ QUANTUM BENCHMARK SUITE βββββββββββββββββββββββββββββββββββ | |
| Circuit: Bell Qubits: 2 | Gates: 2 | Status: SUCCESS | |
| Circuit: GHZ-3 Qubits: 3 | Gates: 3 | Status: SUCCESS | |
| Circuit: Teleportation Qubits: 3 | Gates: 7 | Status: SUCCESS | |
| Circuit: Deutsch Qubits: 2 | Gates: 5 | Status: SUCCESS | |
| Circuit: Grover-2Q Qubits: 2 | Gates: 12 | Status: SUCCESS | |
| Circuit: QFT-3Q Qubits: 3 | Gates: 10 | Status: SUCCESS | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| --- | |
| ## The Math | |
| **Bβ braid group** β generators Οβ, Οβ, Yang-Baxter: | |
| ``` | |
| Οβ Β· Οβ Β· Οβ = Οβ Β· Οβ Β· Οβ | |
| ``` | |
| **Writhe invariant** for canonical pipeline Ξ² = Οβ Β· Οβ: | |
| ``` | |
| W(Ξ²) = (+1) + (+1) = +2 | |
| Ο(Ξ²): C3 β position 0 | |
| Invariant: W(Ξ²) β₯ 2 β§ Ο(Ξ²)(C3) = 0 | |
| ``` | |
| **Fibonacci anyons** β golden ratio quantum dimension: | |
| ``` | |
| Ο = (1 + β5) / 2 β 1.6180 | |
| tau β tau β vacuum w.p. 1/ΟΒ² β 0.382 | |
| tau β tau β tau w.p. 1 - 1/ΟΒ² β 0.618 | |
| ``` | |
| **Zβ duality** (proved in Lean 4 + Agda, from order-of-symmetry): | |
| ``` | |
| D β D = id (duality is an involution) | |
| D(P) β P (no fixed points β orbit size exactly 2) | |
| GOTO β COME-FROM (structural mirrors, Zβ group of order 2) | |
| ``` | |
| **State preservation** (proved, 0 sorry): | |
| ``` | |
| Step P (lβ, sβ) (lβ, sβ) β sβ = sβ | |
| The navigator cannot touch the payload. By type. Not by policy. | |
| ``` | |
| --- | |
| ``` | |
| βββββββββββββββββββββββββββββββββββββββββββββββ | |
| β CARRY: The adversarial twin that proves β | |
| β your pipeline is honest. β | |
| β β | |
| β The compiler says it runs. β | |
| β The braid says it's real. β | |
| β The Lean proof says it stays real. β | |
| βββββββββββββββββββββββββββββββββββββββββββββββ | |
| ``` | |
| --- | |
| ## License | |
| AGPL-3.0-only | |
| Copyright (C) 2026 Ahmad Ali Parr, Jessica L. Williams / SNAPKITTYWEST | |
| <p align="center"> | |
| <img src="docs/firecarry.png" alt="Firecarry" width="80px" /> | |
| </p> | |
| ### πΌ Commercial License | |
| Snapkitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations. | |
| **[β Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20carry-agent)** Β· A.parr@belespritdaccord.uk | |