ADR-084: Seat resources are separate, granted once, and bounded

Status: ACCEPTED, 2026-11-16. xian’s word at 06:20 PT, relayed by Exec (mail 01M7JBP51M), verbatim: “1. Yes to ADR-084 and budget 2. Nothing I run personally uses that key, no”. The figures: a seat may spend $10 a run without asking, and the lead-scoring workspace’s $150 monthly limit is the hard cap. Paid runs stay stopped until Step A has put the seat key where a seat can use it and Lead’s check passes. Drafted 2026-11-15 (Arch-authored, from Exec’s docs/internal/operations/seat-test-harness-proposal-2026-11-15.md, draft 2 at 7c571b8fec, with CIO’s, HOST’s and PA’s replies of 19:26 to 19:28).

Related: #2340 (the developer-key binder), #2364 (the provider gate that stopped), #2327 (ops_reader), #2373 (the floored counter), #2374 (reads limited to the installed set), #2381 (the screen atlas), #2382 (stateless MCP server), ADR-080 (code decides permission).

Context

Between 11-10 and 11-15 four rules landed, each sound alone:

Every one of them protects xian’s own state. Their sum removed each way a seat had to spend on a model, sign in to beta, or read a production fact. Each loss was patched with “xian does it once”. On 11-15 the patches were a queue of eight manual steps, and xian refused the pattern: “We need to solve that problem, not assign me manual tasks as a workaround for a poorly conceived solution.”

Two facts from that day shape the decision.

  1. The binder’s database route never worked for a seat. scripts/dev_key_binding.py (Arch’s 11-11 ruling) named two key sources: the command-line environment, and the encrypted database store. The store needs ENCRYPTION_MASTER_KEY, which scripts/local_key_setup.py keeps in the worktree’s .env. The binder never loads it. The route was ruled and never run end to end. The fix a seat reached for (a launcher that loads .env) was refused by the classifier, correctly.
  2. The class already existed in practice. ~/.piper-shared holds files seats made for testing (CIO, 19:26: 17 files, names only read). The rulings of 11-10 to 11-13 and the classifier cut seats off from them. No rule had named them as different from xian’s own.

Decision

D1. The class

A seat resource is something that exists so agents can run and test Piper. It is:

  1. Separate. Never a thing xian uses himself. His keychain, his accounts, his console and his own GitHub stay off-limits exactly as before. No rule that protects them changes.
  2. Granted once, through the harness’s own means. xian installs the grant himself (auto mode refuses a seat’s edit of another seat’s settings as a permission grant, even at his relayed word; Pard confirmed it on 11-15): an environment entry in a seat’s settings, or an exact-command allow. No seat writes a grant for itself. No seat works around a refusal. If a tested grant route is refused, that route is dropped and another is proposed.
  3. Bounded where a seat can’t pass. Each resource has a limit that holds even if a seat misbehaves. A limit a seat keeps by its own care (a tally, a promise in a log) is a report, not a bound.
  4. Standing. Inside the bound a seat acts, then reports. It asks first only for what is outside the bound.

D2. Paid model calls

D3. Signed-in use of served Piper

D4. Production facts

A fact seats need more than once gets a read-only route behind ops_reader. The rules for every such route:

  1. A fixed, named query in code. No parameter that selects a user, a row or free text.
  2. It returns counts, booleans, and names from a fixed vocabulary. No id, email, key prefix, length, or timestamp finer than a day.
  3. ops_reader is checked on every request. The flag is set only from the admin control, by xian’s hand. No chat or agent path can set it, and it never implies is_admin.
  4. Every read is logged with the route and the reader, never the response body.
  5. The set of routes is a closed list, pinned by a test. Each new route is a diff HOST reads before it ships.
  6. A route can’t read logs. The app has no access to its host’s log stream. A recurring log fact becomes a counter written where the event is emitted (the #2373 shape: site and name only, no text, no user id), and the route reads the counter.
  7. Deployed secrets: a boolean per name on a fixed expected list. Never an enumeration of the environment.

The first routes: active keys by provider; the floored-action counter (served); the routing-to-floor tally. A count that would single out a described tester is written in this public repo as “none” or “at least one”.

A one-off fact is asked of xian once and not built.

D5. Local full runs

One database per seat on the shared Postgres server (CREATE DATABASE piper_<seat>), named in the seat’s launch environment so the test tree and alembic pick it up with no per-command flag, and migrated to head at START. No real person’s data is ever copied into one. It is the pattern tests/integration/test_fresh_database_setup.py has used since #2372. Not per-seat containers: the compose file fixes container names and ports. A fresh-clone guide run is the exception and uses a compose override.

D6. The rule that keeps this from recurring

A ruling that puts a step on xian’s hands names, in the same text, the standing access that would remove it. A ruling-relay with xian as the actor and no such line is incomplete. Exec checks for the line; CIO may make mail4.py warn on its absence.

Two further items were named in review. One is accepted in shape with its bound; the other is not solved:

What this supersedes or narrows

Nothing here lets a seat run fly, read the keychain, or pass a classifier refusal.

What xian does, once

  1. Says yes or no to D1 to D6 and sets the budget figures.
  2. Puts the Anthropic seat key in the screen-running seats’ settings: one paste per seat, from exact lines CIO writes, with a check script that prints key names only.
  3. Makes one capped OpenAI project key and adds it the same way.
  4. Creates the test GitHub identity by hand, as a machine account (GitHub Terms B.3, read by HOST 11-15: one free machine account beside a personal account; a second personal account is not allowed; an account must be created by a human), bounds it in the org, and connects it on the second seat account.
  5. Adds the helper’s exact-command allow, one per account name, the same way.
  6. Ticks “Operations reader” on the plain test account.
  7. Creates the MCP-app-scoped deploy token and stores it as a secret in a GitHub environment limited to main (D6), not a plain repository secret. The job is #2384.
  8. Installs CIO’s batched hook and settings patches in one sitting when a batch is ready. This one recurs; it is the item this ADR doesn’t remove.
  9. Adds the GitHub-connected seat account to the #2242 allowlist (one production write), then adds a second connector in his claude.ai settings and signs in to Piper as that account, once.

  10. Loads the seat browser’s LaunchAgent with a two-line paste, after Pard has built and hand-tested it and HOST has read the plist and wrapper against D3’s debug-port bound. Auto mode refuses a seat loading a new LaunchAgent. Keeping the browser up afterwards is the agent’s own job, not a new grant.

Rows 4 and 9 include clicks on GitHub’s and claude.ai’s own pages. No seat drives those.

Open at proposal time

Settled since (11-16): the workspace is lead-scoring. Nothing of xian’s own uses the older lead-scoring-2026-10 key, and he disabled it on the console at about 06:23, so the workspace holds one live key, seat-screens-2026-11. Arch accepts disabled in place of deleted: a disabled key can’t make a call, and only xian can re-enable it. “Operations reader” is ticked on web-seed-1386 (list row 6).

Consequences