The source toolchain

Puffer

Puffer is Tetrodotoxin's command-line and language-server executable. It gives the toolchain a place to receive a request, retain the relevant source state and expose the result to a user or editor. That makes it a useful consumer of the same contracts being exercised in the Godot work.

The earlier implementation coupled much of that behavior to native C++ language classes. Separating it has meant asking which facts belong to Source, which belong to a type or execution model, and which are choices made by the dialect interpreting the text. The aim is for Puffer to arrange the work without becoming the owner of every participant's implementation.

Following a source request

A Source observation supplies content and provenance. The selected tokenizer publishes tokens, and a Cursor carries a position with access to that provider. A dialect can then execute a range of the command stream and return the retained result of its invocation, called a Monograph.

A Monograph may contain results from other dialects or forward one unchanged. It doesn't have to represent a whole file. That lets an enclosing invocation decide how to use a child result while each provider keeps its own storage and policy.

The Library dialect constructs Type and Execution facts and attaches the information that comes from authored source. A terminal consumes the model it understands and emits a result under its own lifetime. Another language or a loaded package should be able to supply those model contracts without reproducing Library's parser objects.

Bringing the toolchain onto those interfaces

The focused Source and Library tests exercise compact tokens, cursor forks, C/C++ providers, nested invocation ownership and emitted code that remains usable after discovery is released. Releasing the source graph before calling the emitted program exposes a dependency that a successful compilation alone could hide.

Broader Library interpretation, Build bootstrapping and Package/Workspace ownership still need to move onto the same model. An editor also has to keep an older source observation usable while a replacement is being processed. Its session owns that lifetime; a dialect shouldn't have to become the editor's memory manager to answer a question about the source.

A longer-term goal is navigation that can follow meaning across languages. If a TTX reference leads to a C declaration, the language service should ask the system that understands that declaration for its relationships and provenance. Puffer would host the interaction rather than reconstruct the other language's private compiler model.

The Godot lab is the more direct runnable introduction to the architecture. The development guide and Source chapter follow how the same boundaries are being applied to the toolchain.