Where portal is heading
You write down how the system should work, and the map shows how far the code has got. Anything a parser can read is drawn from the code. Calls that only happen in production come from traces. Anything in the spec that the code doesn't do yet is shown as planned.
This is an example system. Most of it works today (see How it works), and the rest is on the roadmap. In a real repo the spec is your architecture/*.c4, and rules are written as element metadata (only_writes_from, never_calls).
Planned dashed border
A box or call in the spec, not in the code yet. Turns solid when the code lands; stale if it stays planned for 28 days.
In the code solid border
Read from code and config by a parser. Links to the file and line.
Seen in traces solid border
Seen in traces only: calls the code makes through config or discovery. Shows the call count.
Unresolved dotted border
A call the parser found but can't name the target of. Listed, not guessed, until the spec names it.
Start with the spec
Someone on the team, or their coding agent, writes the spec. Domains group the boxes, and each domain becomes a column on the map. A box or call in the spec with no code behind it yet is shown as planned. The map shows both kinds of gap: planned but not built, and built but not planned.
architecture/intent.c4written by a person// the plan: what we intend
domain Checkout {
orders-api, payments-api, postgres
fraud-check // new, not built yet
orders-api -> fraud-check "screens orders"
}
domain Messaging {
notifier, order-events
}
rule only Checkout writes postgres
rule payments-api never calls orders-apiArrows the code already makes are drawn from the code. A box or call it doesn't make yet stays planned, dashed, until it does.
orders/wrangler.jsoncpayments/wrangler…hyperdrive · :18intent.c4:4 · no codetraces · 3,102 callswrangler.jsonc:31sync/wrangler.jsoncledger-sync writes postgres, but the spec says only Checkout does.
src/sync.ts:30 · rule at intent.c4:10Put ledger-sync in Checkout? It writes the same tables as orders-api.
The portal facts check fails on PR #212 until someone decides whether to move the write or change the spec. The suggestion can't draw a box or pass a check on its own.
Or start from an existing repo
You can also start from the code. Install the GitHub App and the map is there after the first read, with no agent and no setup. Add the spec later. Here orders-api is selected, and the panel lists each of its connections and how portal knows about it.
orders/wrangler.jsoncpayments/wrangler…traces · 3,102 callsfetch(env.FRAUD_URL)wrangler.jsonc:31hyperdrive · :18payments · d1 · :22