How the building blocks of chapter 5 work together in the scenarios that shape the architecture. A project generates its context, a task skill loads, a shipped hook runs in a project's CI, a fork takes an upstream change, and a project adopts a release.
The diagrams are UML sequence diagrams. Each block has a lifeline. A solid
line with a filled head is a call that waits for its answer, a dashed line
is the answer, and a solid line with an open head is a message that does
not wait. A frame marks a choice (alt) or a repeat (loop), with its
condition in brackets. The numbers on the messages are the steps of each
table.
The emitter builds the project's root file and task skills from the chain the resolver orders, and the agent fills in the project's facts. An agent without Python can still write an inline or hybrid file by hand, placing each rule where the output contract says.
| Step | What happens | Source |
|---|---|---|
| 1 | The team names a root, such as a stack, and the agent generates its context by reading Markdown | FR-05-01 |
| 2-3 | The questions live in the fork's interview. A conflict the rules cannot settle goes to the team, and the answer is recorded in the file | ADR-049, FR-05-03 |
| 4 | The resolver seeds the core tier, then walks depends_on depth-first, without duplicates, each dependency before what depends on it |
FR-03-02, FR-04-01 |
| 5-6 | An override replaces a section, and each extension of the same ID adds to it. An inline file copies in every adopted rule. A hybrid file copies in every rule whose breach is silent and which no tool enforces, and any other rule may stay a reference | FR-04-02, FR-04-03, ADR-052 |
| 7-8 | The agent writes both files to the output contract, then runs the contract's self-check against them | FR-05-02, FR-05-04 |
| 9 | The emitter leaves out overridden rules and the sections the project declines, places each remaining section by its load, copies each rule's text unchanged, and builds the same files from the same input | ADR-058; FR-06-03, FR-06-06 |
| 10 | The agent fills only the project's facts, such as names, paths and commands; a regeneration keeps them | ADR-058 |
| 11 | The team reviews the files like any other change | - |
Without Python, the agent walks the chain by hand. It loads every file in
the manifest's core: list, then every file in a fork's fork_core:
list, then the root's file and every file its dependency lines name,
transitively. Skipping either list loses rules with no error, because the
seeding, not a declaration, is what reliably reaches every core file.
The root file holds the rules for every turn; a procedure for one kind of task loads only when that task starts.
| Step | What happens | Source |
|---|---|---|
| 1 | A section with no load directive, and every rule guarding data, credentials or authentication, is in the root file | FR-06-01, FR-06-02 |
| 3 | The root file lists each skill with the task that triggers it | FR-06-04 |
| 4 | A skill is one folder under .agents/skills/, copied where an agent reads only its own folder |
ADR-058 |
| 5 | An agent that cannot load skills gets them inlined in the root file | ADR-058 |
A check too long for a fence ships as a hook, which pre-commit runs at the revision the project pinned.
| Step | What happens | Source |
|---|---|---|
| 1-2 | The project's pre-commit configuration names upstream, a revision and the hook IDs, which .pre-commit-hooks.yaml lists |
FR-07-02, ADR-055 |
| 3-4 | Every hook reads the tracked tree itself, so pre-commit passes it no file names | ADR-055 |
| 5-7 | A check exits 0 on a pass, 1 on a breach and 3 when it does not apply. Under pre-commit, 3 becomes a printed line and exit 0 | FR-07-03 |
A fork stays current by merging upstream, never by copying files. A commit
that removes what forks carry is marked Fork-merge: ours.
| Step | What happens | Source |
|---|---|---|
| 1 | The fork fetches upstream from GitHub | FR-08-01, ADR-049 |
| 2-5 | An ordinary merge of a marked commit would delete every file the fork left unchanged and upstream removed | ADR-049 |
| 5 | The fork's templates move out of upstream's keys, into keys of its own, and the core IDs upstream dropped move into fork_core: |
FR-08-02, FR-08-03 |
| 6-8 | The fork's smoke reads upstream through SAIT_UPSTREAM_REF |
FR-08-01 |
py tests/run.py fork_sync runs the same merge on every pull request
upstream, in a simulated fork that appends a stack and edits its own files.
A newer tag adopts nothing by itself. The team decides what the project takes, and only a regeneration or an edit changes its context files.
| Step | What happens | Source |
|---|---|---|
| 2 | Within 3.x, a release removes or renames nothing frozen, except for a security fix | FR-09-01 |
| 3-4 | Each template rule is a candidate, which the project adopts only for a named defect, requirement or risk | - |
| 5 | The project pins a released tag, by submodule, clone or copy | FR-08-04 |
| 6 | Moving the pin changes nothing in an existing context file. A regeneration with --emit takes every section the new tag holds except those the project declines, so the team reviews its diff before committing it |
FR-09-03, ADR-058 |
| Scenario | What happens | Source |
|---|---|---|
| A pull request upstream | CI runs smoke, conformance and fork sync, and the maintainer approves the merge | FR-10-01, FR-10-02 |
| Cutting a release | tools/cut_changelog.py writes an entry for each pull request merged since the previous tag whose changelog: label names a section, and cuts the Unreleased section into the version, and tools/check_release.py checks the section and the SemVer step before the tag |
QG-03-02, FR-09-04 |
| Deprecating a template | It keeps resolving until the next major, naming a live replacement | FR-09-02 |




