Prescriptive minimum viable scaffold
Adopted structure comes first. Implementation may fill content and expand only the points the Map declares.
A failing tax case provides a concrete anchor:
FAIL test_calculate_income_tax_high_earner_scenario
expected: 42_750
actual: 43_500
The model receives one bounded slice rather than the whole repository:
flowchart TB
A[Anchor<br/>Failing case or target] --> E[Expand<br/>Authority + evidence]
E --> P[Prune<br/>Scope + relevance + budgets]
P --> S[Bounded input]
Part I established a bounded loop. Chapter 5 showed that useful refinement depends on feedback specific enough to guide a correction. This chapter asks what the loop should receive so it can act on that feedback without guessing. The answer is not the largest available prompt. It is the smallest reproducible input that contains the authority and evidence required for that change.
Long context can still be useful, but capacity does not imply uniform use. In controlled multi-document question-answering and key-value retrieval experiments, performance often declined when relevant information appeared in the middle of long inputs.1 Those experiments establish positional fragility in those tasks. They do not establish that repository slicing prevents scope errors. The Software Development as Code (SDaC) hypothesis is narrower and must be tested locally: bounded, structured inputs should reduce irrelevant context, invented structure, and unauthorized effects compared with broad repository dumps.
A supporting semantic layer is any source a workflow can consult: documentation, a contract catalog, a knowledge base, an ontology, a retrieval index, a runbook, or structured operational memory. One goal is to concentrate meaning that can change the decision. The book calls that property Semantic Density, and it must be considered with two other qualities:
Dense falsehood is dangerous. Correct but irrelevant material is noise. Relevant material padded with repetition wastes attention. Context quality therefore cannot be reduced to token count or one universal score. A useful slice carries enough meaning to act, enough evidence to check the result, and little that invites unsupported work.
Authority remains separate from relevance. A retrieved incident report may explain an observed failure without authorizing a code change. A current implementation may show what the system does without defining what it ought to do. Every included source needs a declared role and provenance.
Semantic layers also preserve only what an organization makes explicit. They can retain contracts, decisions, incident findings, and provenance. They do not automatically preserve tacit judgment, apprenticeship, or the reasons people recognize a bad solution before a check does. Context Architecture should expose decision-bearing relationships without pretending that encoded context is complete institutional knowledge.
The larger structure behind one slice is a versioned relationship graph from which the bounded input is selected. The book calls this structure a Context Graph. It can begin as a repository-local index over files, symbols, and their direct relationships; it does not require an organization-wide graph platform.
Its nodes are addressable sources such as files, symbols, documentation sections, schemas, policy clauses, test cases, runbook steps, or incident records. Typed edges record why one source relates to another—for example, calls, depends on, implements, is documented by, or is checked by.
Whatever its size, the graph needs stable identity, provenance, deterministic ordering, and explicit failure. Given the same source identities and extractor version named by the Mission, extraction outside candidate authority should produce the same graph snapshot or fail loudly.
Project identity and tooling should come from repository metadata outside candidate authority rather than model inference. Manifests, ownership records, registered schemas, and policy identify whether a target belongs to code, documentation, infrastructure, or data, and which extraction and checking rules apply. File extensions alone are weak evidence: the same Markdown format may contain approved policy, generated reference material, or untrusted background text.
Slicing then applies the same three moves used in the tax example:
The result is a bounded input assembled for one run: a Context Packet. Its serialization is incidental. Its claims are not.
| Property | What the packet must establish |
|---|---|
| Identity | The Mission; its bound source revision, graph snapshot, extractor, slicer, and request-template identities; and this packet instance’s content digest |
| Anchor | The machine-addressable case, symbol, contract, or finding from which selection began |
| Authority | Which included sources may instruct the run and which adopted policy grants that role |
| Evidence | Which sources are observations only, with provenance, trust classification, and integrity identity |
| Selection | The allowed relationships, deterministic order, included surfaces, and deliberate exclusions |
| Scope | Separate read and write boundaries, including explicitly denied surfaces |
| Budgets | Finite limits on context, effects, attempts, and other governed resources |
| Verification | The checks needed to grade packet integrity and the eventual candidate |
Before final review and Activation, the Mission binds the source revision, graph snapshot, extractor, slicer, request template, selection rules, and read authority. Given those bindings, the extractor and slicer must produce the same ordered packet or fail. Once used, a packet instance is immutable. Later findings may justify a new packet instance only under the same bindings and existing read authority; record its new identity. Changing a binding, writable scope, budget, or required check requires a new Mission revision and Activation.
Give each Context Packet and referenced source a stable, verified identity, such as a Git commit for repository content or a content digest for a packet. Once used by a run, those versions remain immutable. Reuse their references across attempts instead of copying the same material into each attempt, and retain them long enough to reconstruct the run input later. If a bound context reference cannot be loaded and verified within read authority, preparation stops rather than silently widening the packet.
Before generation, preparation must establish that:
A defect here is a context defect, not evidence that the model needs a broader prompt.
Retrieval can propose relevant nodes, but it does not decide the slice. Apply read policy before retrieval, retain source provenance, and filter results through the same relationship, trust, and budget rules used for deterministic discovery. Summaries are lossy evidence; they cannot replace adopted intent, current findings, or authoritative contracts.
If all required context cannot fit, split the work along a real semantic boundary instead of dropping a required contract. If the activated Mission already declares that decomposition, each smaller candidate uses the same baseline, ordering, and overlap policy, and the workflow validates the combined result. Otherwise, stop and propose split Missions. Local success does not establish that the combined candidate satisfies the required checks.
The opening tax case already shows why a concrete anchor matters. Two broader failure classes complete the picture:
| Failure | What goes wrong | Correct response |
|---|---|---|
| Too small | The packet omits required authority, a failing case, a direct dependency, or a checking surface; the generator must guess. | The slicer produces a new packet instance under the existing bindings and read authority. If the missing material is outside either, the current run stops; resolution requires a new Mission. |
| Too large | Irrelevant material dilutes the governing property and exposes unrelated surfaces, encouraging broad or unauthorized changes. | The slicer produces a smaller packet under the existing selection rules and budget. If either must change, the current run stops; resolution requires a new Mission. |
Slicing cannot guarantee a good candidate. It makes the input boundary reproducible so a failure can be attributed more accurately to the candidate, the context, or the governing contract.
Chapter 2 demonstrated one use of Skeleton-First: deterministic extraction records structure already present in Terrain, and probabilistic generation supplies only permitted variable material around it. The broader rule is to fix the structural basis before variable work begins. Authority direction determines where that basis comes from and what it may do.
In Map-to-Terrain work that produces implementation, an adopted design, specification, or schema supplies a prescriptive minimum scaffold: it fixes invariants and declares where implementation may expand. In Terrain-to-Map work, deterministic extraction supplies descriptive structure for exact comparison, aggregation, and bounded Map candidates.
Typical skeleton surfaces include:
In one extension of the tax example, the adopted tax policy supplies a requirement hierarchy: the policy at the root, jurisdictions beneath it, and bracket and rate rules at the leaves. Those requirement nodes remain fixed authority for the run. The skeleton declares where permitted implementation and test children may be elaborated beneath them. Once each child is checked against its parent rule, the workflow can fold those results upward into derived jurisdiction summaries and then a policy-wide view. A changed rule or child result makes every dependent parent view stale. The same downward elaboration and upward aggregation may repeat at any depth allowed by the active specification.
The expansion contract may begin as an outline or schema. If recurring cases reveal a stable grammar, a separate Map change may adopt a domain-specific language (DSL) that expresses nodes, expansion rules, and checks more precisely. The active Workflow cannot promote its own successful convention into governing syntax.
The content hierarchy, Context Graph, and Workflow remain separate. The hierarchy relates content nodes. The Context Graph identifies sources from which policy selects bounded authority and evidence. The governed Workflow controls which operations may run, with what effects and checks. Their topologies need not match.
Preparation and validation enforce the direction. A prescriptive skeleton accepts only declared expansions. A descriptive skeleton traces aggregates to Sensor observations, while judgment-heavy summaries remain candidates. Traversal grants authority in neither case.
A skeleton can prescribe the minimum structure implementation must preserve, or describe exact structure observed in Terrain. Authority direction determines which one it is.
Adopted structure comes first. Implementation may fill content and expand only the points the Map declares.
Terrain-to-Map work records exact observed structure first. It preserves provenance and leaves judgment-heavy prose as a proposal.
The updater compares this observation with the selected Map surface. Any change to that surface, rationale, or judgment-heavy prose remains a proposal until separately reviewed and adopted.
Skeleton-First protects structure, not correctness. Context Architecture makes the authority and evidence slice used to construct or check that structure reproducible. In the tax example, it establishes which rule, failing case, implementation surface, and direct dependency the generator received. The governed Workflow and its checks still decide whether the candidate satisfies the rule.
With drift, refinement, and bounded context established, Part III can package work as explicit authority and compose these loops across recurring tasks.