Game Design/Legislature & Parties
Legislation System, Completion Audit
Last updated 2026-08-20
Source files
This document audits what was implemented vs the original plan (Congress Legislation System Audit and Design).
Implemented#
| Item | Location | Notes |
|---|---|---|
| LegislationType type + seed | src/lib/db/types.ts, |
Policy domains, effect targets, policyOptions with economic and social scores (-3..+3); 7 options per type (3 left, 1 center, 3 right). Seeded via npm run seed:legislation or full npm run seed (with --reset). |
| StatePolicyRecord / statePolicies | src/lib/db/types.ts, , scripts/seed-policies.ts |
Base policy per legislation type for nation and each state (economic/social integers). National defaults per type; state defaults from state.politicalLean. Seed: npm run seed:policies or npm run seed:policies:reset. |
| GET /api/policy | src/app/api/policy/route.ts |
?scope=national or ?scope=state&stateId=.... Returns records with economic, social, and policyOptionName (matched from legislation type options). |
| National Policy page | /policy lists national base policies by domain with current option name and Economic/Social positions. |
|
| State Laws & Policy tab | Single tab on state page (replacing former Coming Soon / separate Policy tab): state-level base policy with option name and Economic/Social positions. | |
| Bill: category + provisions | src/lib/db/types.ts |
category (required), provisions?: BillProvision[] (1-3, MAX_PROVISIONS = 3: legislationTypeId + effectDirection; optional economic/social). Legacy single type/direction kept for compat. |
| Category + provision cost | BILL_CATEGORIES, CATEGORY_TO_POLICY_DOMAINS, PROVISION_COSTS = [5, 10, 15]. Category limits types; 1st/2nd/3rd provision cost 5/10/15 national influence respectively (admins exempt). Proposing any bill also costs a flat BILL_PROPOSE_ACTION_COST = 10 action points. |
|
| PolicyPositions.domainPositions | src/lib/db/types.ts |
Optional domainPositions?: Record<string, number> for NPP/character. |
| CommitteeAssignment type + API | src/lib/db/types.ts, src/app/api/congress/committee-assignments/route.ts, src/app/api/admin/committee-assignments/route.ts |
GET list (optional ?characterId=), POST set/clear (admin-only). |
| GET /api/game/legislation-types | Returns legislation types; optional ?category=... filters by policy domain(s). |
|
| Bills API: category + provisions | POST requires category and provisions (1-3); validates domain match; deducts national influence and the flat 10 AP propose cost for non-admins. GET returns provisions when present. |
|
| Congress UI: propose | Propose modal: category (required), filtered types, 1-3 provisions (type + policy option), cost/balance; admins exempt from cost. | |
| Congress: Committees tab | Tab lists legislation types by domain and position holders; empty state suggests npm run seed:legislation. |
|
| Bill detail: provisions | , bills API | Header and sidebar show all provisions (type name + effect) when present. |
| Character profile: committee positions | Section "Committee Positions" when character has assignments. | |
| NPP voting: policy-aware | ideologyVote() uses domainPositions[legislationTypeId] and effectDirection when present. |
|
| Effect applicator | , | On sign, applies each provision’s delta to its type’s effectTarget; supports multiple provisions. |
Where to find things#
| Feature | Where |
|---|---|
| Committees | Congress page → Committees tab (between Bills and Leadership). Lists all legislation types by domain and shows position holders (Vacant or link to character/NPP). |
| Committee assignments (admin) | Admin → Legislation tab → section Committee assignments. Dropdown per position to assign a player character or NPP, or Vacant. |
| Propose bill (Admin override) | Congress → Bills tab: button Propose (Admin override) appears for admins who are not in Congress. Or Admin → Legislation → link Propose bill (Admin override) (goes to Congress with Bills tab open). |
| Legislation type / provisions on bills | Congress bill cards and bill detail page show category and provisions (or single type + effect); Admin → Legislation lists bills with type/effect. |
Gaps Addressed in Follow-up#
| Gap | Resolution |
|---|---|
| Committees “not there” | Committees tab exists on Congress page; if empty, run seed so legislationTypes is populated. Admin UI to assign committee positions added under Admin → Legislation (Committee assignments). |
| Admin cannot propose bills | Admin override: GET /api/congress/bills returns canPropose: true and adminOverride: true for admins; POST allows admins to propose without being in Congress. UI shows "Propose (Admin override)" when applicable. |
| Admin Legislation tab: no proposal / no type on bills | Legislation tab now includes link to propose bill (Admin override), shows legislation type and effect on each bill, and includes Committee assignments section. |
Data Requirements#
- Legislation types: Run
npm run seed:legislationto upsert all types from (non-destructive). Or run fullnpm run seed(with--resetif needed). Without this, the Committees tab and proposal form will be empty or show a message to run the seed. - Base policy (statePolicies): Run
npm run seed:policiesto upsert national and state base policies from . Usenpm run seed:policies:resetto clear and reseed. Requires legislation types to exist first. Without this, the national Policy page and state State Laws & Policy tab may be empty. - Committee assignments: Created via POST
/api/admin/committee-assignmentsor Admin → Legislation → Committee assignments. No seed data for assignments. To clear assignments when changing types, runnpm run seed:legislation:reset.
Not Implemented (Out of Scope or Later)#
- Domain positions on character creation/settings | No UI yet for players to set
domainPositions. NPPs are now seeded withdomainPositionsderived from their economic/social position via ; existing NPPs can be backfilled with . - Committee agenda power | Plan listed "phase 2"; no control over which bills get floor votes.
- Amendments | Placeholder only in UI, not implemented.
Filibuster / Cloture and Veto Override, Implemented#
Corrected from an earlier "not implemented" note: both are shipped.
- Filibuster/Cloture (): US Senate only. A sitting Senator can invoke it once per character per bill for 25 action points + 5 National Political Influence. It extends the Senate's voting deadline by 12 hours (adjusted +/-20% by the invoking senator's Statecraft stat) and sets a 3/5-of-votes-cast cloture threshold to pass, instead of a simple majority. Not usable on bills in status
active_both. A Senate rule change (statePoliciesdoc,legislationTypeId: "senate_filibuster_rules",effectDirection: -1) can abolish it, restoring simple majority. - Veto override: implemented via status
veto_override, with its own voting deadline (overrideVotingEndsAt/overrideVotingEndsOnTurn). Any member of either chamber can vote via actionveto_override_vote, weighted byseatsHeld, tallied invetoOverrideVotesFor/vetoOverrideVotesAgainst.
Verified 2026-08-19 against and : filibuster/cloture and veto override are implemented, not placeholders.
Connected pages
References →
None← Referenced by
docsBills & Legislation