ALPQ

Sealed Flow Manifest

DRAFT 0.12026-11-01ALPQ Lab spec · draft for comment

Written for GOVW's own use and published openly: take what's useful, and tell us what's wrong.

Redirect loops, retry storms and runaway costs live in the paths nobody walks. This draft has a site write its flows as state diagrams, with a guard on every cycle and a cost on every step, then seal them so only its monitor can read them. The monitor walks the real production paths and reports what it covered, what looped, and what it cost.

Status: a draft for review, not a standard. Key discovery: the monitor's encryption key is found with DNS Key Quorum. Honest scope: it checks the flows a site declares; an undeclared flow is still invisible.

1Terms

2Writing flows

Each flow is a Mermaid state diagram kept in the site's repository at flows/*.mmd. Transitions carry an event, an optional guard and their costs:

stateDiagram-v2
  [*] --> SignedOut
  SignedOut --> Redirecting: visit [redirects < 2 per 60s] / cost=req:1
  Redirecting --> Callback: idp_ok / cost=req:2
  Callback --> SignedIn: token_ok / cost=req:1
  Callback --> Stopped: token_bad / cost=req:0
  SignedOut --> Stopped: visit [redirects >= 2 per 60s] / cost=req:0
  Stopped --> SignedOut: try_again [user clicked] / cost=req:0
  SignedIn --> [*]
  Stopped --> [*]

The label grammar is event [guard] / cost=unit:amount, …, limit=…. Units are free-form but SHOULD be consistent across a site (for example usd, sms, req, cpu_s).

3Rules

4Sealing

At deploy, the site bundles its flows and encrypts them to the monitor's encryption key with JWE (RFC 7516) or HPKE (RFC 9180). The RECOMMENDED key is hybrid X25519 plus ML-KEM-768 (FIPS 203), so a recording made today stays sealed if large quantum computers arrive later. The site MUST verify the monitor's key with DNS Key Quorum before sealing. The monitor's encryption key MUST NOT be its signing key.

5Publishing

The sealed file is published at /.well-known/flows.jwe. It SHOULD be padded to a fixed size bucket, so its length doesn't reveal how many flows a site has.

6Walking real paths

A test sandbox is a different system, so the monitor walks the real production path. To keep that safe:

7Planning a run

8The report

After each run the monitor reports: paths covered and missed, loops found, real cost spent per unit, resources used, records left behind after cleanup, and any step whose observed cost exceeded its declared cost.

9Security considerations

10Known gaps and questions

11References