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
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.
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.
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.
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.
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.
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.
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.
The contract sits at the seam.
Written in LogicScript, kept as data. Tests live in the contract, so changing a test changes the promise.
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 }
{
"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_hashOver the promise: ports, side, effects, tests. Moves when the promise moves.
impl_hashOver the body and its language. Moves when the code moves, never on a comment elsewhere.
receiptThe verdict for one pair. Reused across machines, agents and models.
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.
Acceptance first
Agents drift without a finish line. Agree the checks before the first line of code.
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.
Test effects on doubles
Code that touches the world goes untested. Every declared effect gets a double; the calls are recorded and compared.
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.
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.
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.
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 →$ logicblocks verify text.words.count
pass checked 9f3a·41be fence isolate tests 2/2
$ logicblocks verify text.words.count
pass checked 9f3a·41be receipt reused, nothing ran
$ logicblocks run count-words
stopped before report.save: needs blob.write, not granted
$ logicblocks run count-words --allow blob.write=blob:out/*
done 3 blocks · 2 receipts reused · 1 effect under grant