portal

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-api

Arrows the code already makes are drawn from the code. A box or call it doesn't make yet stays planned, dashed, until it does.

Checkout domain · intent.c4:2
orders-apiorders/wrangler.jsonc
payments-apipayments/wrangler…
postgreshyperdrive · :18
planned · 12 daysfraud-checkintent.c4:4 · no code
orders-api will call fraud-checkPlanned call · intent.c4:5 · "screens orders". Dashed until the code makes it.
Messaging domain · intent.c4:7
notifiertraces · 3,102 calls
order-eventswrangler.jsonc:31
Unplanned · in the code, not in the spec · PR #212
✕ breaks a ruleledger-syncsync/wrangler.jsonc

ledger-sync writes postgres, but the spec says only Checkout does.

src/sync.ts:30 · rule at intent.c4:10
Suggested · not confirmed from AI, changes intent only

Put 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.

Services
orders-apiorders/wrangler.jsonc
orders-api callspayments-apipayments/wrangler…
orders-api callsnotifiertraces · 3,102 calls
orders-api calls?Unresolved targetfetch(env.FRAUD_URL)
Events
orders-api publishesorder-eventswrangler.jsonc:31
Data
orders-api writespostgreshyperdrive · :18
ledgerpayments · d1 · :22