[ SECTION / 001 ]
BEFORE AND AFTER THE MODEL

ONE TURN,
TWO GATES

INSTALLpi install git:github.com/686f6c61/Alfred-Pi
then /reload · no pi? pi.dev

/// tools do not reopen the first gate

/// first the turn is decided; then the model works; at the end it is logged.

You type. The model has not seen the sentence yet. Before a token is spent, Alfred closes three decisions, always in this order: whether the current model is down and the next one should take over; which craft this prompt belongs to; and whether today's spend needs a warning. Only then does the model speak.

The order is not plumbing. If the room were chosen after the model was already thinking, context would arrive late. If the budget ran before relay, you could pay for a model that does not answer. That is why this gate comes first, and why it does not reopen when the model calls tools.

001

Relay

If the current model is marked down (two HTTP or transport failures in the window), the next fb: link that exists in the registry and has a key is chosen. The hop happens here, before a token is spent, never mid-stream. The failed model is not exiled: its counter resets when a later turn of its own answers again.

002

Room

The radar scores prompt triggers. Whole word, not a fragment: «express» does not fire on «expression». Weight grows with length. If nobody reaches, repository hints are checked, one glob with a single * in the last segment, cwd root only. On a tie the earlier name alphabetically wins. One pack'scontext.md is injected. One.

003

Budget

Local sessions for the day are read. At 80% of the cap, one warning. At 100%, a frugality note in the system prompt: short answers, no fleets without asking. The cap does not cut the turn. There is no cut-off. Relay does not use price as a signal: it uses failure.

004

Persona

Alfred travels by default. Irony never touches prices, keys or production steps. If you chose Neutral, nobody travels. The persona does not pick the craft: the room does.

When the model finishes, Alfred records whether it answered or failed: an HTTP code, a network that did not reply. The status line shows model, room and budget. If a relay warning is due, it arrives here, in plain words.

While it answers, the model may use tools again and again. That does not reopen the first gate: the craft, the model and the persona are already chosen. A hop mid-response would lie about what you are reading. The next turn is the honest moment.

Module detail, intentions, watchdog and opt-in memory live in architecture (Spanish original). This page tells the craft of the turn, not the file map.