A House Divided A House DividedDocumentation
Changelog
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#

Not Implemented (Out of Scope or Later)#

Filibuster / Cloture and Veto Override, Implemented#

Corrected from an earlier "not implemented" note: both are shipped.

Verified 2026-08-19 against and : filibuster/cloture and veto override are implemented, not placeholders.

Connected pages

References →
None
← Referenced by
docsBills & Legislation