weft8-kit

a rule engine · five example rules · one 8-bit machine

Rules small enough
to sign off.

A rule is a Weft-8 program with a contract: the caller puts inputs in the ports, the rule writes one byte — pass, flag or stop. Twenty lines, no model, no inference, and a machine that cannot reach a file, a network or a page. If a rule matters enough to argue about, it matters enough to be readable.

card 03 · two red flags, high severity
        IN  IN0
        MOV R1, R0
        LDI 2
        MOV R2, R0
        CMP R1, R2
        JL  fine
        IN  IN1
        CMP R1, R2
        JL  fine
        LDI 2        ; stop
        OUT VERDICT
read & checked

What a kit buys you

Three properties that a rules engine in a general-purpose language struggles to promise, and that this one can state plainly.

Readable

A rule is twenty lines you can read aloud. No callbacks, no hidden state, no library deciding what "and" means.

Bounded

The machine has a step limit and 27 opcodes, none of which touch a file, a network or a page. A runaway rule stops and says so.

Provable

Every rule ships its cases, and the test suite runs them on the real machine — including the case where the comparison is flipped, to prove the test bites.

The limits, stated: this machine compares signed bytes, so an input above 127 reads as negative — every rule here says so where it matters. And the four rules shipped are examples of the pattern, not clinical guidance.

The contract

Inputs at 0xD0–0xD3, verdict at 0xD7. That is the whole interface — the same in the browser, in a test, and in any app that adopts the kit.

the weft-8 family — one machine, seven faces

the Loomthe machine and its editor — where it all starts Weft Puzzlesfive puzzles solved in assembly, a robot on a grid Clip Loomclipboard programs you can read: strip, squeeze, wrap Weft-8 on hardwarethe same machine in C, three-way parity with the JS one
weft8-kityou are here
Weft-8 Classroomeight exercises that teach how a computer works Weft-8 beside x86 and ARMthe same four jobs in three machines

Every one of these runs the same engine — weft8.js from the Loom, byte for byte. Learn it once and you have learned all seven.