LogicBlocks
Framework · Method

Think in blocks.
Build with agents.

LogicBlocks is a way to build software with LLMs that stays trustworthy as it grows. Every piece of logic is a typed block with a contract at its seam. Pure logic is proven once and remembered. Effects pass a gate. Agents write the code; people read the plan.

status: early · runtime in private testing, opening piece by piece

graph: count-words3 blocks · 1 gate
PURE text.split c:9f3a · i:41be ✓ PURE list.count c:07d2 · i:c81f ✓ gate EFFECT · blob.write report.save grant: blob:out/* doubles: 1 test ✓ receipts reused: 2 of 3 · checked now: 0 · run blocked until grant
01 · The method

Six rules that keep agent written code honest.

Models get better every month and still guess. The method does not try to make them guess less. It makes every guess small, typed, checked and remembered.

01

A block is a promise

Ports with types, the effects it may cause, what it costs. The promise is written before the code and outlives every rewrite of it.

02

Contract and code are hashed apart

A contract hash for the promise, an implementation hash for the body. A new model that rewrites the body must earn trust again against the same promise.

03

Prove once, remember

A verdict is a receipt for one pair of hashes. The same pair is never checked twice, so a large system stays fast to verify.

04

Pure by default

Pure logic runs isolated: no network, no clock, no file it was not given. Everything else is an effect and passes a gate with a named grant.

05

Agents write, people read the plan

The person reads what will change, block by block, before anything runs. The plan a person approves is the plan that runs.

06

Annotate before you rewrite

Existing code gets a contract next to it first. Levels say how far it is trusted: documented, checked, or due for a rewrite.

02 · Anatomy of a block

The contract sits at the seam.

Written in LogicScript, kept as data. Tests live in the contract, so changing a test changes the promise.

words.lsLogicScript
module text.words : core {
  // pure: isolated, cached by hash
  pure count(text: string): int =>
    text.split(" ").filter(w => w != "").length

  test count("two  words") == 2
  test count("") == 0
}

module report.store : platform {
  use text.words
  // effect: runs only with a grant
  command save(name: string, n: int): void
    effects blob.write
}
receiptverdict for one pair
{
  "block":    "text.words.count@1",
  "contract": "9f3a…e1",
  "impl":     "41be…07",
  "verdict":  "pass",
  "level":    "checked",
  "checks":   ["fence", "isolate", "tests 2/2"]
}

// same pair again: read, never re-run
// new body from a new model: new impl hash,
// must pass the same contract
contract_hash

Over the promise: ports, side, effects, tests. Moves when the promise moves.

impl_hash

Over the body and its language. Moves when the code moves, never on a comment elsewhere.

receipt

The verdict for one pair. Reused across machines, agents and models.

03 · Practices

Collected from real work with agents.

Each practice is a problem we hit, the rule that fixed it, and how an agent checks it. The library grows as we find more.

Planning

Acceptance first

Agents drift without a finish line. Agree the checks before the first line of code.

rule: no block without its tests in the contract
Boundaries

Layers point down

Features grow sideways into each other. Declare layers and uses; an import that crosses up is an error, not a style note.

rule: core ← platform ← feature ← app
Effects

Test effects on doubles

Code that touches the world goes untested. Every declared effect gets a double; the calls are recorded and compared.

rule: an effect test doubles every effect it declares
Review

Check a suspicion at the callers

An agent finds a bug in a function that the callers never trigger. Before fixing, prove it shows up from a real call site.

rule: a bug report names the caller that reaches it
Trust

Pin the source

A verdict on a moving file means nothing. Read the body from a full commit sha, never from a branch name or the working tree.

rule: receipts point at a 40 character sha
Running

The plan that is read is the plan that runs

Re-planning at run time makes every run different. The agent writes the plan once; the run follows it step by step.

rule: no improvising between approve and run
04 · Two sides of one coin

The method and the language.

LogicBlocks

How to think: blocks, contracts, receipts, gates, and the practices that make agent work reliable. Works with any stack.

The method ↑

LogicScript

What you write: a small language that reads like TypeScript, describes modules and boundaries, and compiles to TypeScript and Rust.

logicscript.dev →