Repository navigation
The admin portal: the whole flow in the browser - #10
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 portalcommand; aportaloptional extra; templates shipped as package data.Dockerfile+fly.tomlfor a one-command demo deploy (fly launch --no-deploythenfly deploy), scaled to zero so it costs ~nothing idle.tests/test_portal.py— the full flow viaTestClient, 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,
mypyclean, no network, no API key. CI now installs.[dev,portal].Generated by Claude Code