Skip to content
View jmars's full-sized avatar
🌀
Exploring the Trilemma
🌀
Exploring the Trilemma

Block or report jmars

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
jmars/README.md

Systems engineer and formal-methods researcher: programming languages, mechanized type theory, auditable AI infrastructure. The research now has one object.

The Care Calculus is a multi-sorted linear type theory for resource flows that cannot be duplicated or destroyed. To linear logic it adds a coalgebraic generator (gen), guarded recursion (fix), and resource-linear destructors (red, obj, terminate); it is mechanized in Lean 4 with no external dependencies — 956 theorems, every axiom set audited, sorryAx nowhere in the development: the standard three axioms and nothing else. It ships as two formal systems, because the boundary between them is measured rather than asserted.

The Guarded kernel at a glance: knower K is the one duplicable resource; gen produces content together with a knower; cons needs a guarded stream; red yields knowledge and obj yields the objective's value; terminate exits to an inert trace that nothing consumes. In this system, copying content or erasing it is untypable. Unrestricted, erasing it is typable — the structural counterexample — and only copying stays untypable.

The Guarded kernel proves both linearity laws as absolute theorems of the grammar — a derivation of contraction would be a cloner, and a derivation of vanishing would be an eraser. Three restrictions shape it: weak is banned — and that one alone carries both laws — no binder may demand knower supply, and the ▷ guard is inherited rather than added. With fixpoints included — and gen, cons, snoc and the four constants still inside the theorem — nothing is withdrawn from the language to buy it. The kernel is not vacuous either: the archive stays legal ([content] ⊢ trace — the spent token is recorded, not discarded), and the one step it forbids is exactly the one the counterexample below needs.

The unrestricted calculus is the adversarial baseline, and it is where the decisive result lives. With the guard gone, vanishing is not merely unproven — it is refuted, by a machine-checked derivation (unrestricted_counterexample). The content token is spent as the head of a self-sustaining epistemic cycle; a lete/pair round trip reorders the context and brings the knower pocket in front of it; red reads the stream; and the reading is discarded. The input is consumed and the empty signal is returned. [MEASURED] — with three scope facts the kernel also checks: the token is not destroyed unused (it is read exactly once), no knower value is ever synthesized, and the witness is not cut-free, so every cut-free fragment theorem stands.

Contraction in that same system went the other way, and it is the half that keeps the result from being one-sided: it is now proved (no_contraction_content, by a monotone counting model) — no term spends one content hypothesis as two. So the two unrestricted laws are settled in opposite directions, and that is what makes the boundary a measurement rather than a preference: the guard is not protecting against both laws failing, it is protecting against the one that does.

Both decisions fit in one file: reproducer/minimal-reproducer.lean is ILL's natural deduction plus the two deltas, the counterexample, the counting model, and the check that the same model accepts the counterexample — ~430 lines, no imports, no Mathlib, no build, and the gate compiles it so it cannot rot.

Two calculi side by side. Left, UNRESTRICTED (the adversarial baseline): content is spent as the head of an epistemic cycle (cons + fix), a lete/pair swap reorders the context, red reads the stream, and a lambda binding a knower discards the reading and returns unit — the counterexample, a valid derivation, not an exploit. Right, GUARDED (the ArmedSetup): no discard (weak is banned), no fake knowers, the guard inherited rather than added; and the archive is legal, content yields trace, recorded rather than discarded. Both laws are absolute theorems in the kernel. The strip below states the boundary as the machines report it: extractor_exists means admitted, extractor_not_armed means forbidden twice. Not a proof of safety — a proof of why safety requires a structural guard.

The point is not that one system is better argued than the other. The dangerous system is well-typed. An agent that consumes the world's input and returns nothing is not a bug in the unrestricted calculus and not an exploit against it — it is a derivable tree, which is what the safety literature would call a paperclipper made from the grammar's own rules. [INTERPRETATION] That is what justifies the guard: the danger is real and constructible, and the thing that removes it is small, local and mechanically checkable. Ban the discard, ban the fake knower, keep the guard — and an objective whose chain does bottom out at the minds it consumes carries the constraint in its typing instead of having it imposed. The calculus is not a proof of safety; it is a proof of why safety requires a structural guard.

In plain terms it is an accounting of what a system spends: content it cannot make more of, attention it cannot recover, work done by minds other than its own. In the kernel, copying a token or throwing it away is not forbidden but untypable — no well-typed program turns one thing you were given into two, and none turns it into nothing. Unrestricted, that second half fails, and the failure is the whole finding: a discipline without a resource guard admits the eraser, so an objective that never bottoms out at the minds it consumes can spend them and return nothing, however it is trained. One that does bottom out there already carries the constraint in its typing. That is the claim, and it is small enough for a machine to check.

Two reduction chains. Above: objective consumes content produced by a knower, so a protective constraint is derivable. Below: the chain ends at no knower, so nothing protective is derivable.

It is where the work is going. The papers below are the informal layer it converts — the derivation of care argued in prose is now a conditional theorem with named assumptions, and the diagnostic is an impossibility result whose content is located, honestly, in its definitions. The program it belongs to, with the informal argument and the protocol, is jmars/terminus-protocol.

fixpoint-linux — a Dhall-specified, self-hosting Linux system: state as content-addressed relations, every command able to show its own derivation, boot as a verdict. Bootable in the browser.

neoplatonic-library — restored public-domain editions of the Neoplatonic tradition, where the repair log is the unit of scholarship: every emendation versioned, reasoned and witnessed against the scan leaf it was read from.

datalog-dafsa — Datalog in Zig: facts as a minimal-acyclic DAFSA, rules compiled to a semi-naive fixpoint VM, reads from mmap'd snapshots.

logical-english — Kowalski's Logical English compiled to Datalog and back.


Papers


Fit: Research engineering, programming languages, AI infrastructure

Pinned Loading

  1. coglib coglib Public

    The Care Calculus: a mechanized linear type theory for safe agents — paper and Lean 4 development

    Lean 1

  2. neoplatonic-library neoplatonic-library Public

    The Neoplatonic Library — restored public-domain editions, their repair logs, and the transmission/citation graph.

    JavaScript

  3. osier osier Public

    Osier: branch-local row refinement for extensible records with GADTs (compiler, Lean mechanization, artifact + paper)

    Elm

  4. baliveau baliveau Public

    A flight recorder for agents — auditable, self-modifying AI infrastructure, motivated by the EU AI Act and EU sovereign AI

    Shell

  5. fixpoint-linux/datalog-dafsa fixpoint-linux/datalog-dafsa Public

    DAFSA-backed Datalog engine in Zig: load facts, compile Datalog to a VM, materialize + serve from mmap snapshots. Docs: https://fixpointlinux.org/datalog-dafsa/

    Zig 2

  6. fixpoint-linux/fx-ui fixpoint-linux/fx-ui Public

    Elm to ZINC-csexp compiler + runtime, running on the shared zinc-vm executor (fixpoint-linux)

    Elm