Skip to content

The admin portal: the whole flow in the browser - #10

Merged
TAM-DS merged 1 commit into
mainfrom
week-6-portal
Nov 14, 2026
Merged

TAM-DS merged 1 commit into
mainfrom
week-6-portal

Conversation

@TAM-DS

@TAM-DS TAM-DS commented Nov 14, 2026

Copy link
Copy Markdown
Owner

The last unbuilt piece. The portal is the human-facing half — where a person does the one thing the model cannot: authorize.

What it is

A server-rendered FastAPI app that walks an administrator through the lifecycle in the browser:

connect → review mappings → dry-run preview → approve → migrate → report

pip install -e ".[portal]"
firstsync portal          # http://localhost:8000

It never calls the model

Every page reads state the engines wrote, and approve / migrate / sync are server-side calls behind the same gates the CLI uses — there is still no path by which the model authorizes anything. So the whole portal runs with no API key: for the demo it loads the proposals Claude produced in the evaluation runs (real output, pre-computed), and the review, dry-run, approve and migrate steps downstream are genuine. On org D that is 387 loaded, 9 held back — exactly what the dry-run and the migration tests establish.

What's here

  • src/firstsync/portal/ — the FastAPI app, demo-proposal seeding, and Jinja templates (index, org, mappings, dry-run, report). No client-side framework: plain pages with POST-redirect-GET, so the back button and refresh behave.
  • firstsync portal command; a portal optional extra; templates shipped as package data.
  • Dockerfile + fly.toml for a one-command demo deploy (fly launch --no-deploy then fly deploy), scaled to zero so it costs ~nothing idle.
  • tests/test_portal.py — the full flow via TestClient, plus: migrate refused without approval, reset clears state, unknown org → 404.

Docs

README gains a Portal section (with local-run steps) and updated Hosting steps; the status line and roadmap now reflect that the portal exists and only a public deploy remains.

220 tests, mypy clean, no network, no API key. CI now installs .[dev,portal].


Generated by Claude Code

The portal is the human-facing half - where a person authorizes, the
one thing the model cannot. A server-rendered FastAPI app walks an
admin through connect -> review mappings -> dry-run preview -> approve
-> migrate -> report, in the browser.

It never calls the model. Every page reads state the engines wrote,
and approve/migrate/sync are server-side calls behind the same gates
the CLI uses, so the whole portal runs with no API key: for the demo
it loads the proposals Claude produced in the evaluation runs (real
output, pre-computed) and the steps downstream are genuine. On org D
that is 387 loaded, 9 held back - exactly what the dry-run and the
migration tests establish.

- src/firstsync/portal/: FastAPI app, demo-proposal seeding, Jinja
  templates (index, org, mappings, dryrun, report). No JS framework;
  plain pages with POST-redirect-GET so back and refresh behave.
- firstsync portal command; portal optional extra; templates shipped
  as package data; mypy and ruff clean; CI installs .[dev,portal].
- Dockerfile + fly.toml for a one-command demo deploy, scale-to-zero.
- tests/test_portal.py: the full flow via TestClient, migrate refused
  without approval, reset, unknown org -> 404.

README gains a Portal section and deploy steps; Hosting and the status
line updated now that the portal exists. 220 tests, no network, no key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ggB2HHn8zjybwfaJG1g3R
@TAM-DS
TAM-DS merged commit b9dc734 into main Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants