YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

                         ·  ✦  ·
                    ·  ✦     ·    ✦
               ✦  ·    ·  ✦    ·    ✦  ·
          ·  ✦     ·  ✦     ·  ✦     ·  ✦     ·
     ─────────────────────────────────────────────
     ─────────────────────────────────────────────
         β•±β•²       β•±β•²       β•±β•²       β•±β•²       β•±β•²
        β•±  β•²     β•±  β•²     β•±  β•²     β•±  β•²     β•±  β•²
       ╱────╲   ╱────╲   ╱────╲   ╱────╲   ╱────╲
      β•±  ✦   β•² β•±      β•² β•±      β•² β•±      β•² β•±   ✦  β•²
     ╱────────╳────────╳────────╳────────╳────────╲
    β”‚  ╔══════════════════════════════════════════╗  β”‚
    β”‚  β•‘     C O S M I C   I N V A R I A N T     β•‘  β”‚
    β”‚  β•‘           S I E V E                      β•‘  β”‚
    β”‚  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•  β”‚
     ╲────────╱╲────────╱╲────────╱╲────────╱╲────╱
      β•²  ✦   β•± β•²      β•± β•²      β•± β•²      β•± β•²   ✦  β•±
       ╲────╱   ╲────╱   ╲────╱   ╲────╱   ╲────╱
        β•²  β•±     β•²  β•±     β•²  β•±     β•²  β•±     β•²  β•±
         β•²β•±       β•²β•±       β•²β•±       β•²β•±       β•²β•±
     ─────────────────────────────────────────────
     ─────────────────────────────────────────────
          ·  ✦     ·  ✦     ·  ✦     ·  ✦     ·
               ✦  ·    ·  ✦    ·    ✦  ·
                    ·  ✦     ·    ✦
                         ·  ✦  ·

COSMIC INVARIANT SIEVE

Formal Verification + Sovereign Borrow Chain + Julia Execution

A compiler-shaped customs checkpoint for agent-generated code.

Every patch passes through mathematical proof, policy evaluation, structural analysis, and a hostile borrow-chain tripwire before producing a signed binary.


Live Repo Β· Architecture Β· Borrow Chain Β· Agent Policy


    ╔═══════════════════════════════════════════════════════════════════════╗
    β•‘  CLASSIFICATION:  Sovereign Compute β€” Aerospace-Grade Verification    β•‘
    β•‘  TRUST MODEL:     10-Gate Pipeline + Borrow-Chain Tripwire           β•‘
    β•‘  PROOF ENGINE:    Isabelle/HOL + ASP/Clingo + Julia + INTERCAL       β•‘
    β•‘  POLICY:          NO PROOF β†’ NO SAT β†’ NO BORROW CHAIN β†’ NO BINARY   β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

The Cosmic Theorem

Theorem (Cosmic Invariant Sieve Correctness). Let S be agent-generated source code. Let P be the set of formal invariants. Let V be the verification pipeline. Then:

V(S) = PASS  ⟹  S satisfies all invariants in P
V(S) = FAIL  ⟹  S is quarantined and cannot produce a binary

Proof sketch. The pipeline is a monotone consequence operator: each gate either preserves the invariant set or rejects. The INTERCAL tripwire encodes the borrow chain into a compiler-enforced checksum that cannot be bypassed. The receipt seals the exact proof path. ∎

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                    THE SIEVE THEOREM                            β”‚
    β”‚                                                                 β”‚
    β”‚   βˆ€ S ∈ Source:                                                 β”‚
    β”‚     V(S) = PASS  ⟺  ∧_{i=1}^{10} Gate_i(S) = PASS            β”‚
    β”‚                                                                 β”‚
    β”‚   Where:                                                        β”‚
    β”‚     Gate 1:  Parses into canonical IR                           β”‚
    β”‚     Gate 2:  Mathematical invariants compile in Isabelle/HOL    β”‚
    β”‚     Gate 3:  All required invariant tokens are present          β”‚
    β”‚     Gate 4:  ASP/Clingo returns SATISFIABLE                     β”‚
    β”‚     Gate 5:  Julia reports type stability                       β”‚
    β”‚     Gate 6:  Julia reports valid ownership                      β”‚
    β”‚     Gate 7:  Julia reports valid borrow scopes                  β”‚
    β”‚     Gate 8:  Julia reports declared effects only                β”‚
    β”‚     Gate 9:  INTERCAL tripwire compiles and exits correctly     β”‚
    β”‚     Gate 10: Julia native artifact matches source hash          β”‚
    β”‚                                                                 β”‚
    β”‚   Failure at any gate:                                          β”‚
    β”‚     freeze source β†’ quarantine β†’ emit receipt β†’ block merge     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architecture

    LaTeX / source model / agent-generated code
                    β”‚
                    β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  CANONICAL IR   β”‚
          β”‚  Normalized Form β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  ISABELLE/HOL   β”‚
          β”‚  Mathematical    β”‚
          β”‚  Proofs          β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
            PROVED ──┴── REJECTED
               β”‚             β”‚
               β–Ό             └── HARD STOP
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ INVARIANT TOKENS β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  ASP / CLINGO   β”‚
          β”‚  Closed-World    β”‚
          β”‚  Policy Eval     β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
            SAT ───┴─── UNSAT
             β”‚             β”‚
             β–Ό             └── HARD STOP
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  JULIA STRUCTURAL   β”‚
          β”‚  ANALYZER           β”‚
          β”‚  Type, Allocation,  β”‚
          β”‚  Effect, Graph      β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  INTERCAL BORROW-   β”‚
          β”‚  CHAIN TRIPWIRE     β”‚
          β”‚  Adversarial        β”‚
          β”‚  Structural Gate    β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
            PASS ──┴── FAIL
             β”‚           β”‚
             β–Ό           └── QUARANTINE
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  JULIA NATIVE   β”‚
          β”‚  COMPILATION     β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  SIGNED BINARY  β”‚
          β”‚  + PROOF RECEIPT β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pipeline Stages

Stage Component Input Output Gate
10 Normalize Source Raw source Canonical IR Gate 1
20 Isabelle/HOL Canonical IR Proof certificates Gate 2
30 Export Invariants Proof certificates Invariant tokens Gate 3
40 ASP/Clingo Tokens + policies SAT/UNSAT Gate 4
50 Julia Analysis IR + tokens Structural report Gates 5-8
60 Emit INTERCAL Structural report Tripwire source β€”
70 Run Tripwire INTERCAL source PASS/FAIL Gate 9
80 Julia Compile Verified IR Native binary Gate 10
90 Seal Receipt All outputs Signed receipt β€”

Core Policy

    ╔═══════════════════════════════════════════════════════════════╗
    β•‘                                                               β•‘
    β•‘   NO PROOF           β†’  NO SAT                                β•‘
    β•‘   NO SAT             β†’  NO BORROW CHAIN                       β•‘
    β•‘   NO VALID BORROW    β†’  NO INTERCAL PASS                      β•‘
    β•‘   NO INTERCAL PASS   β†’  NO JULIA BINARY                       β•‘
    β•‘   NO RECEIPT         β†’  NO RELEASE                            β•‘
    β•‘                                                               β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Borrow Chain

Every generated value carries a governance record:

struct BorrowEvent
    resource_id::UInt128
    owner_id::UInt128
    borrower_id::UInt128
    mode::Symbol          # :own, :shared, :exclusive, :moved, :released, :destroyed
    scope_start::UInt64
    scope_end::UInt64
    mutable::Bool
    effect_class::Symbol
    dependency_parents::Vector{UInt128}
    destruction_event::Union{Nothing,UInt128}
    receipt_hash::String
end

Core Rules

    1.  One resource has one active owner.
    2.  Many shared borrows allowed only when no exclusive exists.
    3.  One exclusive borrow allowed only when no shared exists.
    4.  A moved resource cannot be read from the former owner.
    5.  A destroyed resource cannot be borrowed.
    6.  Borrow scopes must form a properly nested chain.
    7.  Cycles in ownership or effect dependencies are rejected.
    8.  Mutation must be explicitly authorized.
    9.  Every side effect must be declared before execution.

Append-Only Event Chain

    GENESIS
      ↓
    RESOURCE_CREATED
      ↓
    OWNER_ASSIGNED
      ↓
    BORROW_OPENED
      ↓
    MUTATION_AUTHORIZED
      ↓
    BORROW_CLOSED
      ↓
    RESOURCE_MOVED
      ↓
    RESOURCE_DESTROYED

    Every transition: h_k = SHA256(h_{k-1} β€– event_k)

Spaghetti-Code Detection

Reject generated code when it crosses thresholds for:

Metric Threshold Description
max_function_lines 80 Lines per function
max_cyclomatic_complexity 12 Branching factor
max_call_depth 16 Nesting depth
max_module_fan_out 8 Dependencies outward
max_mutation_sites 6 Mutation points
max_dynamic_dispatch_sites 0 Dynamic dispatch
max_allocations_per_hot_path 4 Heap allocations
require_type_stability true Must be type-stable

Violation Classes

    alias_violation       β†’  invalid SELECT mask
    ownership_cycle       β†’  unresolved label dependency
    use_after_move        β†’  missing resource array slot
    hidden_mutation       β†’  etiquette imbalance marker
    undeclared_effect     β†’  forbidden COME FROM edge
    type_instability      β†’  invalid width transition
    spaghetti             β†’  structural complexity overflow

Isabelle/HOL Theories

Theory Purpose
Cosmic_Invariant_Sieve.thy Top-level entry: core types, ownership model, lifecycle operations
Quantum_State.thy Quantum state types, gate operations, norm preservation
Matrix_Operators.thy Matrix types, Hermitian/unitary predicates, trace properties
Program_Invariants.thy Function declarations, effect kinds, complexity predicates
Ownership_Model.thy Ownership records, mode transitions, graph acyclicity
Borrow_Chain.thy Borrow events, scope nesting, conflict detection
Effect_Safety.thy Effect declarations, policy compliance, authorization
Token_Extraction.thy Invariant tokens, proof hashes, consistency predicates

Key Theorems

theorem single_owner_invariant:
  "βˆ€ s rid. worm_sealed s ⟢ single_owner_check s rid"

theorem borrow_preserves_owner:
  "βˆ€ s rid aid s'. borrow_shared s rid aid = Some s' ⟢ ..."

theorem acquire_release_symmetry:
  "βˆ€ s rid aid s' s''. acquire_resource s rid aid = Some s' ⟢ ..."

theorem scopes_nested_no_conflict:
  "scopes_properly_nested chain ⟢ no_conflicting_borrows chain"

ASP/Clingo Rules

Rule File Purpose
cosmic_invariants.lp Top-level aggregation, SAT/UNSAT determination
ownership_rules.lp Single-owner invariant enforcement
borrow_rules.lp Borrow chain mode validation
effect_rules.lp Effect declaration and safety
dependency_rules.lp Module dependency cycle detection
spaghetti_rules.lp Structural complexity rejection

Julia Modules

Module Purpose
CosmicSieve.jl Entry point: analyze_source, emit_tripwire, compile_verified
CanonicalIR.jl Source parsing, hash computation, IR construction
CodeGraph.jl Dependency graph building, cycle detection, fan-out/in
Ownership.jl Single-owner validation, dual-ownership detection
BorrowChain.jl Scope nesting, mode conflict, cycle detection
EffectAnalysis.jl Forbidden effect detection, shell execution blocking
AllocationAnalysis.jl Heap allocation budgeting per hot path
TypeStability.jl Dynamic dispatch detection, type mismatch finding
IntercalEmitter.jl INTERCAL source generation from violation reports
NativeCompiler.jl Verified source compilation to native binary
Receipts.jl Cryptographic receipt generation and sealing

Analysis Output

{
  "status": "STRUCTURALLY_VALID",
  "type_stable": true,
  "allocation_budget_passed": true,
  "borrow_chain_valid": true,
  "effect_policy_valid": true,
  "dependency_cycles": [],
  "violations": [],
  "code_hash": "sha256:..."
}

INTERCAL Tripwire

INTERCAL does not execute production workloads. It acts as a compiler-shaped customs checkpoint: unpleasant, deterministic, and impossible for spaghetti code to charm its way through.

    Julia and ASP decide whether code is safe.
    INTERCAL encodes their decision into a compiler-enforced tripwire.

Violation Encoding

Violation INTERCAL Artifact
Alias violation Invalid SELECT mask
Ownership cycle Unresolved label dependency
Use-after-move Missing resource array slot
Hidden mutation Etiquette imbalance marker
Undeclared effect Forbidden COME FROM edge
Type instability Invalid width transition

Valid Chain Template

10 REM BORROW CHAIN VERIFIED
20 MINGLE (SOURCE HASH)
30 SELECT (VALID MASK)
40 PRINT "CHAIN VERIFIED"
50 GOTO 50

Trust States

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  UNTRUSTED  β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 1 (parse)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  PARSEABLE  β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 2 (Isabelle proof)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   PROVEN    β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 3+4 (ASP policy)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ POLICY_COMPLIANT β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 5-8 (Julia structural)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ STRUCTURALLY_VALIDβ”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 9 (INTERCAL tripwire)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ CHAIN_VERIFIED  β”‚
    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Gate 10 (receipt match)
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   RELEASABLE    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Failure Behavior

Any failed gate triggers:

  • Freeze β€” source cannot be modified
  • Quarantine β€” moved to quarantine/ directory
  • Receipt β€” violation receipt emitted
  • Block β€” merge prevented
  • No Binary β€” publication prevented
  • Return β€” exact failed invariant returned to agent

Receipt Structure

{
  "receipt_id": "rcpt_<16-hex>",
  "source_hash": "sha256:<64-hex>",
  "binary_hash": "sha256:<64-hex>",
  "stages": {
    "isabelle": {"status": "PROVED", "tokens": ["inv_..."]},
    "asp": {"status": "SAT", "violations": []},
    "julia_analysis": {"status": "STRUCTURALLY_VALID", ...},
    "intercal": {"status": "PASS", "violation_class": "none"},
    "julia_compile": {"status": "COMPILED", "binary_path": "..."}
  },
  "overall_status": "RELEASABLE",
  "performance": {
    "type_stable": true,
    "allocations": 2,
    "median_ns": 184,
    "p99_ns": 211,
    "threads": 1
  },
  "signature": "ed25519:...",
  "timestamp": "2026-07-12T..."
}

Quick Start

# Clone
git clone https://github.com/SNAPKITTYWEST/cosmic-invariant-sieve.git
cd cosmic-invariant-sieve

# Full pipeline
make pipeline SOURCE=examples/valid/simple_function.jl

# Run tests
make test

# Verify a single source
make verify SOURCE=path/to/source.jl

# Run individual stages
make isabelle SOURCE=examples/valid/simple_function.jl
make asp SOURCE=examples/valid/simple_function.jl
make julia SOURCE=examples/valid/simple_function.jl
make intercal SOURCE=examples/valid/simple_function.jl

Repository Structure

cosmic-invariant-sieve/
β”œβ”€β”€ README.md                    ← you are here
β”œβ”€β”€ LICENSE                      ← Sovereign Source License v1.0
β”œβ”€β”€ Project.toml                 ← Julia package definition
β”œβ”€β”€ Makefile                     ← build orchestration
β”‚
β”œβ”€β”€ docs/                        ← architecture documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   β”œβ”€β”€ BORROW_CHAIN.md
β”‚   β”œβ”€β”€ JULIA_EXECUTION_MODEL.md
β”‚   β”œβ”€β”€ FORMAL_TRUST_BOUNDARY.md
β”‚   β”œβ”€β”€ INTERCAL_TRIPWIRE.md
β”‚   └── AGENT_CODE_POLICY.md
β”‚
β”œβ”€β”€ schemas/                     ← JSON schemas for all data types
β”‚   β”œβ”€β”€ source-unit.schema.json
β”‚   β”œβ”€β”€ invariant-token.schema.json
β”‚   β”œβ”€β”€ borrow-event.schema.json
β”‚   β”œβ”€β”€ code-graph.schema.json
β”‚   β”œβ”€β”€ tripwire-result.schema.json
β”‚   └── build-receipt.schema.json
β”‚
β”œβ”€β”€ isabelle/                    ← formal proofs (Isabelle/HOL)
β”‚   β”œβ”€β”€ ROOT
β”‚   β”œβ”€β”€ Cosmic_Invariant_Sieve.thy
β”‚   β”œβ”€β”€ Quantum_State.thy
β”‚   β”œβ”€β”€ Matrix_Operators.thy
β”‚   β”œβ”€β”€ Program_Invariants.thy
β”‚   β”œβ”€β”€ Ownership_Model.thy
β”‚   β”œβ”€β”€ Borrow_Chain.thy
β”‚   β”œβ”€β”€ Effect_Safety.thy
β”‚   └── Token_Extraction.thy
β”‚
β”œβ”€β”€ asp/                         ← policy evaluation (Clingo)
β”‚   β”œβ”€β”€ cosmic_invariants.lp
β”‚   β”œβ”€β”€ ownership_rules.lp
β”‚   β”œβ”€β”€ borrow_rules.lp
β”‚   β”œβ”€β”€ effect_rules.lp
β”‚   β”œβ”€β”€ dependency_rules.lp
β”‚   β”œβ”€β”€ spaghetti_rules.lp
β”‚   β”œβ”€β”€ emit_status.lp
β”‚   └── tests/
β”‚
β”œβ”€β”€ julia/                       ← analysis + execution (Julia)
β”‚   β”œβ”€β”€ Project.toml
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ CosmicSieve.jl
β”‚   β”‚   β”œβ”€β”€ CanonicalIR.jl
β”‚   β”‚   β”œβ”€β”€ CodeGraph.jl
β”‚   β”‚   β”œβ”€β”€ Ownership.jl
β”‚   β”‚   β”œβ”€β”€ BorrowChain.jl
β”‚   β”‚   β”œβ”€β”€ EffectAnalysis.jl
β”‚   β”‚   β”œβ”€β”€ AllocationAnalysis.jl
β”‚   β”‚   β”œβ”€β”€ TypeStability.jl
β”‚   β”‚   β”œβ”€β”€ IntercalEmitter.jl
β”‚   β”‚   β”œβ”€β”€ NativeCompiler.jl
β”‚   β”‚   └── Receipts.jl
β”‚   β”œβ”€β”€ test/
β”‚   └── benchmarks/
β”‚
β”œβ”€β”€ intercal/                    ← borrow-chain tripwire
β”‚   β”œβ”€β”€ profiles/
β”‚   β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ generated/
β”‚   β”œβ”€β”€ compiler_adapter.sh
β”‚   └── tripwire_runner.sh
β”‚
β”œβ”€β”€ pipeline/                    ← orchestration
β”‚   β”œβ”€β”€ cosmic-sieve
β”‚   β”œβ”€β”€ stages/
β”‚   β”‚   β”œβ”€β”€ 10-normalize-source.sh
β”‚   β”‚   β”œβ”€β”€ 20-run-isabelle.sh
β”‚   β”‚   β”œβ”€β”€ 30-export-invariants.sh
β”‚   β”‚   β”œβ”€β”€ 40-run-asp.sh
β”‚   β”‚   β”œβ”€β”€ 50-run-julia-analysis.sh
β”‚   β”‚   β”œβ”€β”€ 60-emit-intercal-chain.sh
β”‚   β”‚   β”œβ”€β”€ 70-run-tripwire.sh
β”‚   β”‚   β”œβ”€β”€ 80-compile-julia-native.sh
β”‚   β”‚   └── 90-seal-receipt.sh
β”‚   └── lib/
β”‚       β”œβ”€β”€ common.sh
β”‚       β”œβ”€β”€ hashing.sh
β”‚       β”œβ”€β”€ quarantine.sh
β”‚       └── receipts.sh
β”‚
β”œβ”€β”€ policies/                    ← TOML policy definitions
β”‚   β”œβ”€β”€ no-hidden-mutation.toml
β”‚   β”œβ”€β”€ no-unsafe-aliasing.toml
β”‚   β”œβ”€β”€ bounded-complexity.toml
β”‚   β”œβ”€β”€ deterministic-effects.toml
β”‚   β”œβ”€β”€ allocation-budget.toml
β”‚   └── agent-output-policy.toml
β”‚
β”œβ”€β”€ examples/                    ← test sources
β”‚   β”œβ”€β”€ valid/
β”‚   └── rejected/
β”‚
β”œβ”€β”€ receipts/                    ← build receipts (append-only)
β”œβ”€β”€ quarantine/                  ← quarantined sources
└── tests/                       ← integration tests
    β”œβ”€β”€ run-all.sh
    β”œβ”€β”€ valid_pipeline.sh
    β”œβ”€β”€ reject_alias_cycle.sh
    β”œβ”€β”€ reject_spaghetti_graph.sh
    └── reject_unproved_invariant.sh

Agent Enforcement Model

Every agent-generated patch must pass all 10 gates:

    Gate 1  β€” Parses into canonical IR
    Gate 2  β€” Mathematical invariants compile in Isabelle
    Gate 3  β€” All required invariant tokens are present
    Gate 4  β€” ASP returns SATISFIABLE
    Gate 5  β€” Julia reports type stability
    Gate 6  β€” Julia reports valid ownership
    Gate 7  β€” Julia reports valid borrow scopes
    Gate 8  β€” Julia reports declared effects only
    Gate 9  β€” INTERCAL tripwire compiles and exits correctly
    Gate 10 β€” Julia native artifact matches source hash

Performance Principles

    type-stable hot paths
    precompiled sysimage
    minimal dynamic dispatch
    bounded allocations
    immutable structures where practical
    StaticArrays for small fixed matrices
    LoopVectorization only where verified
    multithreading only under deterministic partitioning
    native compilation with PackageCompiler
    benchmark receipts for every release

Citation

@software{cosmic-invariant-sieve2026,
  author = {Ahmad Ali Parr},
  title = {Cosmic Invariant Sieve: Formal Verification + Sovereign Borrow Chain},
  year = {2026},
  url = {https://github.com/SNAPKITTYWEST/cosmic-invariant-sieve}
}

License

Sovereign Source License v1.0 β€” See LICENSE

  • Viewing, reading, auditing the source
  • Running for personal or research use
  • Forking for non-commercial, sovereign-aligned purposes
  • Commercial use requires explicit written permission
  • Modified versions cannot be redistributed under a different name
  • Use in systems violating the sovereignty principle is prohibited

    ·  ✦  ·    ·  ✦  ·    ·  ✦  ·    ·  ✦  ·
         NO PROOF β†’ NO SAT β†’ NO BINARY
              THE SIEVE HOLDS.
    ·  ✦  ·    ·  ✦  ·    ·  ✦  ·    ·  ✦  ·

Cosmic Invariant Sieve Β· Sovereign Compute Architecture Β· 2026 Ahmad Ali Parr

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using Snapkitty/cosmic-invariant-sieve 1

Collection including Snapkitty/cosmic-invariant-sieve