Docs
y⁴ − φy² + α = 0

The Golden Phase Runtime

A whitepaper: the architecture, the source code, and the reasoning behind every part — written for someone building their first operating system.

Metatron Research Project · Richard Careaga, with Claude

Honesty first

This paper describes a real, working software system and explains its design faithfully. It also states plainly what the system is not (it is not physics, not hardware, not a Windows/Linux replacement) and where the original framing overreached. The engineering is real; the honest version is the strong version.

Abstract

The Golden Phase Runtime is a complete, self-contained software computer built on a four-state algebra derived from a single equation. It has a verified mathematical core, a virtual machine, a binary instruction set with an assembler, and an operating-system kernel (Golden Phase OS) with processes, a scheduler, and memory management — about 2,500 lines of Python, 266 passing tests, plus a Rust port of the core.

1

The big picture

A normal computer is built in layers: physics → logic gates → CPU → machine code → operating system → applications. Each layer hides the one below it and offers a cleaner interface upward. The Golden Phase Runtime is the same shape, but every layer is grounded in one mathematical object instead of in silicon.

Why layers at all?

The single most important architectural rule: each layer imports only the layer below it and never reimplements the algebra. The kernel does not contain its own copy of compose; it calls the core. This means there is exactly one definition of the math, so the kernel, the VM, the checksum, and the scheduler can never disagree about what 1 ∘ 1 is.

2

The mathematical kernel

Everything starts with one equation, the biquadratic kernel: y⁴ − φ·y² + α = 0. φ (phi) is the golden ratio, (1 + √5)/2 ≈ 1.618. α (alpha) is a small constant, ≈ 0.00730. Substituting u = y² turns the quartic into an ordinary quadratic u² − φu + α = 0, which has two roots. Taking square roots (with signs) gives the four real solutions — and those four numbers become the four states.

Why compute the states instead of just writing them down?

We never hardcode 0.919408. The code derives it from φ and α every run. Because it keeps a single source of truth: the states are defined as roots of the kernel, and a test checks that each computed root actually satisfies the equation to 12 decimal places.

3

From geometry to the operation table

The compose operation combines two states into a third — the equivalent of AND or + but for four states. It works in three steps: (1) Add the two states' rail positions. (2) Fold: if the sum goes past the end of the rail, reflect it back (2·RAIL − x). Because the rail is an interval and not a circle, going off the top bounces back rather than wrapping to zero. (3) Snap: round the result to whichever of the four states is nearest.

Why not just use modular arithmetic?

Modular arithmetic would wrap around and lose the reflection property. The fold-and-snap gives the algebra its non-associativity — the property that makes Golden Phase OS able to detect reordering from the algebra alone.

4

The Associator–Reflection Theorem

The algebra is non-associative: for some triples, (a∘b)∘c ≠ a∘(b∘c). The Associator–Reflection Theorem characterises exactly which triples fail associativity and proves that the failure is caused by the reflection step in compose. This is the mathematical foundation for Golden Phase OS's ability to detect reordering without timestamps.

Why does non-associativity matter?

In a binary system, (a AND b) AND c always equals a AND (b AND c). You cannot tell from the result alone whether the grouping changed. In the Golden Phase algebra, some groupings produce different results — so the algebra itself carries ordering information.

5

Validation: tests & propositions

The runtime ships with 266 passing tests across 32 Rust integration-test crates, terminal tests, VM tests, SSH smoke tests, phase-stability tests, engineering-tool tests, exact-result benchmark comparisons, and a full test-suite pass. Every mathematical proposition is verified by a test that checks the result to 12 decimal places.

Verification philosophy

Every figure in this document is produced by the test suite or by a reproducible experiment in the repository. Where the framing is aspirational or where a result is weaker than it might first appear, it is labelled as such.

6

The Rust port

The core algebra, VM, and kernel have been ported to Rust. The Rust port is the basis for Golden Phase OS — the production operating system layer. It delivers the full operator environment, phase engine, audit system, networking, AI bridge, filesystem tools, and security surface in approximately 4.15 MB (hosted runtime) and 4.61 MB (SSH-enabled runtime), from 1.16 MB of Rust source across 278 files.

Why Rust?

Rust's ownership model maps naturally onto the phase-state model: a value in a given phase state has a well-defined owner and lifetime. The borrow checker enforces the same discipline that the phase algebra enforces at the mathematical level.