SELFish documentation

Rust libraries and a command-line tool for the platform's own file formats - read and written in one place. The executable format as the platform spells it, the signed-executable container, packages and the filesystem inside them, and the import hash. Nothing else.

New here? The root README has the pitch. Then:

The words

Guide

The command

The binary is selfish, and it has two ways in.

Building is one invocation, four axes:

selfish --input <file> --target <orbis|neo|prospero|trinity> --format <elf|prx|eboot|title|pkg> --output <path>

--target carries the generation, so nothing passes one. Each format writes exactly --output and puts nothing beside it.

Everything else is a diagnostic somebody runs by hand on a file they already have: nid, elf, imports, sections, reloc, container, title, pkg, extract, derive and audit. image and pack build a package's parts separately, and shader builds an AGC shader container (compute, pixel or vertex).

There are no layer verbs for stamping or wrapping. --format prx is a shared library, and --privilege and --sdk are pipeline options for the formats that build a container - which were the only two reasons stamp and wrap existed alongside the pipeline.

selfish --help is the authority and this paragraph is not a list, which is the point: the enumeration that used to be here advertised build and native after both had been deleted from the enum, while claiming in the very next sentence that --help "cannot drift from it the way this list can". It had drifted, in the same edit that wrote the claim. Naming the shape rather than the verbs is what stops that recurring.

Why this repository exists

Three projects need these formats. orbistoun reads them to load a title, obSCEne writes them to produce one, Prosperous inspects them over a wire. Before this repository the knowledge lived in whichever project happened to need it first, and the cost was not hypothetical: a container builder shipped emitting the previous generation's magic, while the current value sat recorded in another project's decision log one directory away.

The full argument, and the admission test for what belongs here, is in CLAUDE.md.

The rules this is held to

Formats come from sources that can be named. A real file is an oracle, never a source - used to confirm or refute a structure taken from cited material, never to derive one. Nothing is invented: where a field's meaning is unknown it is named unknown and left alone, because an absent row is visible and a wrong one is not.

CLAUDE.md principle 2 is the canonical statement of that rule; this is a summary and defers to it.

Shared rules - provenance, naming, decision logs, worklogs, gates - are in the OOPS conventions and not restated here.

Project memory

Adding to a log

The long-running documents are directories with a generated index. Add a file under decisions/, backlog/ or worklog/, then regenerate the table:

tools/split-decisions.sh --index selfish
tools/split-doc.sh --index selfish BACKLOG 2 backlog

Do not edit the index by hand - it is overwritten. The split exists because two sessions appending to one file collide, which is where the duplicate numbers and out-of-order entries came from, and because a log past half a megabyte stops rendering on GitHub entirely.