Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ REPORT_GAS=false
# ---- Frontend (Next.js) ----
NEXT_PUBLIC_WC_PROJECT_ID=
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
# Was missing from this file even though src/lib/supabase.ts and the new
# session-aware clients (src/lib/supabaseAuth/*, src/middleware.ts) both
# read it. Anon key is safe to expose to the browser.
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=
# Wallet linking attestation key: server-only, generate 32+ random bytes;
# must match private.wallet_link_settings in the DB.
WALLET_LINK_SECRET=

# Google/GitHub sign-in (/login, src/app/auth/callback): provider client
# id/secret are configured in Supabase Dashboard > Authentication >
# Providers, not here. This is a Supabase-Auth-backed login path that runs
# alongside the existing Privy wallet "Sign In" button in TopBar -- the two
# are independent for now. It exists to activate the auth.users-keyed RLS
# already defined in supabase/migrations/20260711000000_add_bill_actions_
# profiles_tracked.sql (user_profiles, tracked_bills), which nothing wired
# up until now.

# Supabase OAuth 2.1 Server (this project as an OIDC identity provider for
# third-party apps -- see src/app/oauth/consent/page.tsx). Enabled
# per-project in Supabase Dashboard > Authentication > OAuth Server, with
# Authorization Path set to /oauth/consent. Nothing to set here today.

# ---- News API ----
NEWSDATA_API_KEY=
Expand Down
39 changes: 18 additions & 21 deletions .gsd/STATE.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
# Project State

Last updated: 2026-10-18 PT
Last updated: 2026-11-03

## References
- Roadmap: `.gsd/ROADMAP.md` (only live roadmap)
- Product: `brain/prd.md`, `brain/02_TECHNICAL_SPEC.md`
- Brand: `DESIGN.md` (civic glass-teal). Dark uBTC system archived in `archive/design-dark-v1/`.
- Plan: `docs/superpowers/plans/2026-11-03-utp-first-cycle-release-identity-civic.md`
- Evidence: `docs/testnet-readiness-2026-10-31/EVIDENCE-LEDGER.md` (statuses live there; missing evidence is never PASS)
- Brand: `DESIGN.md`.

## Branch
Work branches off `master` (default). `sync/freedom-stack-master` is fully merged and can be deleted.
## Baseline
`master` is protected. PRs #20 and #21 are merged at `777658f` (175 contract tests). CI runs only on the self-hosted Dell runner `dell-utp-1`. R2 (Vercel production target) is BLOCKED_ON_AUTH.

## Current phase
Phase 2: RSK testnet deployment (Phases 0 and 1 done 2026-10-18).
## Branch `feat/first-cycle-auth-civic` (NOT pushed, NOT merged; awaiting Sam's authorization)
Head `03cee70` on top of `777658f`:
- Supabase session/OAuth auth with same-origin redirect guard; `requireUser` (cookie and Bearer).
- Source adapter model with federal (Congress.gov) slice and OpenStates adapter; no fixture is ever marked live; sample content is labelled "Sample data".
- Authenticated `/api/vote` with DB-enforced one vote per user per bill and recounted aggregates; authenticated bounded `/api/propose`.
- Server-verified wallet linking (SIWE plus HMAC attestation checked in a SECURITY DEFINER RPC).
- Four migrations: `20261104000000_vote_integrity`, `0100_wallet_links`, `0200_source_registry`, `0300_voting_proposals`.

## Verified (2026-10-18, branch feat/phase0-1-governance)
- lint, typecheck, next build, hardhat compile: PASS
- `npm test`: 175 contract tests passing, 0 failing (was 128/14); no frontend unit tests yet
- Deploy rehearsal: in-process + local node over RPC, 11/11 invariants, ~8.9M gas total
- Smoke lifecycle on local node: propose → vote → queue → timelock → execute OK; 0 reverts
- Failure paths: mainnet refused; smoke refuses without a deployment record
- RSK testnet: NOT deployed. The sandbox cannot reach RSK RPC; deploy runs from the GitHub Actions workflow with the owner's secret.
- Frontend: real UI on `/`, `/issue/[id]`, `/how-it-works`, `/us/california/[bill]`; `/governance`, `/token`, `/stablecoin`, `/events`, `/news`, `/legislature` are placeholders
Final gate at head `03cee70`: lint, typecheck, vitest (107), build, `test:db` (27, shim PostgreSQL 16, not real Supabase), contracts (175, via SOLC_JS_PATH) and `git diff --check` all exit 0. Not verified: Dell CI on this head, real Supabase, live providers.

## Decisions
- D1: v1 = standard wallet voting; PQ hybrid optional/off; ZK deferred.
- D2: testnet params in `scripts/deploy.config.cjs`.

## Next action
1. Owner: create the `rsk-testnet` GitHub environment with `DEPLOYER_PRIVATE_KEY` (testnet-only key, funded from the RSK faucet), then run "Deploy governance to RSK testnet".
2. Build `/governance` + `/token` UI against `deployments/rskTestnet.json`.
## Next actions
1. Prepared external steps in the ledger, each needs Sam's authorization: push and PR; `supabase db push --dry-run` then apply the four migrations (with the preflights); secrets (`WALLET_LINK_SECRET`, `CONGRESS_API_KEY`, OpenStates key, `IP_SALT`); Vercel team access for R2.
2. Open decisions: U1 Docker on the Dell runner (until then `test:db` is a local gate); U2 local-government denominator (blocks C1 local); U3 target Supabase project for the migrations; U4 Privy sign-in visibility in `TopBar`.
3. Deferred: TOTP/phone/camera proofing (I2); ERC-1271 contract-wallet signatures; G1/G2 Rootstock governance lifecycle; RSK testnet deploy (owner creates the `rsk-testnet` environment secret).
Loading
Loading