Both cover the same site: the quick guide walks you through reading the forecasts in plain language; the full guide adds every detail, including how the platform is operated.

On this page12 sections

HitungKerusi User Guide

Last updated: 2026-11-17 (the nightly job runs on the operator's MacBook, not in the cloud; backup step renamed)

How to read the forecast site and how to operate the pipeline. The mathematical specification behind everything here is the methodology paper. The site renders this guide alongside a plain-language companion (user-guide-plain.md) — the quick guide is the default reading and a toggle at the top of the page switches between them.

1. What this site is

HitungKerusi forecasts Malaysia's 222 Dewan Rakyat seats ("kerusi") and five state assemblies (Melaka, Sarawak, Johor, Negeri Sembilan, Sabah). Nightly — and more often during election campaigns — the platform collects political news, re-checks its electoral database, and publishes a new forecast: per-seat win probabilities for each bloc (PH, BN, PN, GPS, GRS, WARISAN, Others), seat-count ranges per bloc, and headline probabilities. The public site at hitungkerusi.fyi renders each page straight from the platform's live database — a completed update publishes itself on the next page view, with no deployment step. Forecasts are estimates with uncertainty, not predictions of certainty — every screen shows the ranges, and the methodology page shows exactly how the numbers are made. It opens with a plain-language guide ("How HitungKerusi works", the default) and a toggle at the top switches to the full technical specification — both readings describe the same model, in both languages.

The site is bilingual — English and Bahasa Malaysia. Every page has its own address (/ms/… for BM), the EN | BM toggle in the header switches and remembers your choice, and first-time visitors get their language from browser settings. The interface, the guide, the methodology paper, data sources and the changelog are all translated. The site is also themable: it follows your device's light/dark setting by default, and the header toggle (Auto → Light → Dark) overrides and remembers it. The two choices are stored independently — switching language never touches the theme, and both survive reloads and later visits. On phones the header stacks into three tidy rows: the logo with the language and theme switches, the election pills, then the section menu.

Navigation is two-level: Overview (the landing page), Parliament, States, Seats, Movement, Report, and About (which gathers the Guide, Methodology, Data sources and What's-new pages). Picking a section reveals its own submenu row — Dashboard and By state under Parliament, the five state assemblies under States, chamber scopes under Seats and Movement.

2. Reading the site

The Overview landing opens with the current story in one line, written fresh by the model on every cycle from that cycle's own figures — and refusing to print a number that the run did not produce: while a state election is announced it leads with that campaign — days to polling, the leading bloc against the chamber's majority line — and otherwise with the parliamentary verdict ("no bloc can govern alone"…); either way the sentence closes with what moved since the previous run (or an explicit "unchanged"), and the line beneath carries the run number and date, the parliament strip, and the biggest seat mover. Then comes an election spotlight for every state election due within about four months — the announced one first, then any not yet called, which shows a due-by deadline instead of a polling day and flags nomination as pending: the countdown and campaign progress, that chamber's own verdict, a seat strip coloured by each seat's most-likely winner with the majority line marked (toss-ups faded; every square opens its seat page), live campaign figures — toss-up count, candidates declared and in how many seats, stories tagged to this chamber's own seats in the last seven days (national coalition stories are not counted here), the forecast run number and date, and what moved since the previous run — and the three latest headlines tagged to that chamber. Below it, one tile per chamber showing its leader and seat share, and the latest daily report headline. The full Parliament dashboard lives one click deeper, and every state assembly has the same dashboard shape.

On a chamber dashboard:

  • "Why this forecast" — a short paragraph sitting directly beneath the hemicycle as its caption, explaining in plain language what the forecast stands on and what moved it: the baseline election it starts from, whether polls or by-elections contribute, which seats the news layer touches most, what changed since the previous run (or an explicit "unchanged"), and the volatility of the current horizon. Written fresh from each run's inputs, in English and Bahasa Malaysia — see the methodology's "plain-language explanations".
  • The hemicycle is the chamber: one dot per seat, government blocs seated left in contiguous bands. Each dot is coloured by the seat's most-likely winning bloc, and the gold line marks the majority threshold — half the seats plus one, drawn at the same place whatever the result, so you can see at a glance whether the government side crosses it. Dot size adapts to the chamber — small assemblies get larger dots so the arc reads densely, while the 222-seat parliament arc stays fine-grained. Faded dots with a grey ring are toss-ups — seats where the leading bloc is below 60% win probability. Hover any dot for its code and probability; click to open the seat page.
  • The constituency map (parliament and every state page) colours each constituency by its most-likely winner, with toss-ups faded. Hovering a constituency opens a popup with the seat's name and code, its most-likely winner, the win probability, who currently holds the seat, and a toss-up badge; clicking opens the seat page. Each map card also carries a "Full seat list" link straight to that chamber's or state's table on the Seats page.
  • Seats by bloc shows each bloc's median seat count with its 80% interval in brackets — e.g. 87 [84–91] means half of simulations land at 87 or fewer, and 80% land between 84 and 91 — plus the movement since the current composition ("now").
  • Two counts of "seats", and the site says which is which. The median above is the middle of a bloc's seat range. The hemicycle, the seat strip and the single-figure headlines (the Overview sentence, the chamber tiles, "Gov seats") instead count seats where the bloc is the most likely winner, one seat at a time — "if every seat went the way it is most likely to". They can differ by a seat or two (Melaka's BN leads 21 seats on a median total of 20), so the distribution view always carries the word median while the headline figures match the graphic beside them. Methodology §9a has the arithmetic.
  • The stat strip (one compact line above the graphics): P(gov ≥ majority) — the probability the governing arrangement retains a working majority; P(hung) — probability no single bloc reaches majority (Malaysia's coalitions make this the norm, not a crisis); the two-thirds line where it applies; largest bloc — who most likely holds the most seats; governing-bloc seats; and the toss-up count. Hover any figure for its full wording.
  • Who can form the government? ranks the plausible coalition scenarios by their probability of reaching the majority (see §5).
  • Latest news closes every dashboard (keeping room for both the chamber's own seat-level stories and the newest national ones, since the latter outnumber the former many times over), and the News page (main menu) holds the full, filterable list. Every entry ends with what the platform tagged it to — bloc chips in the bloc's colour with the tagger's sentiment for that bloc (−1 to +1), the parties named, and the seats named as links; a National chip marks a story that names no constituency (a bloc- or party-level event such as a party's registration being cancelled) — followed by "Why it matters", the tagger's one-sentence reason the story bears on those blocs' electoral standing, in English or Bahasa Malaysia. A rationale beginning "Keyword tagger only" means the story has so far been read by the deterministic matcher and awaits the LLM's assessment. The News page filters by chamber, bloc, period, free text, and scope — seat-level stories, national ones, or both (the default). National stories are shown for context: as the methodology explains, bloc-level news is read but not applied to seat forecasts. The News page also carries a "Share today's news" box with two ready-made posts that refresh with every update: news of the day — how many stories the last 24 hours tagged, the most-named bloc, and the latest story with its one-line "why it matters" — and the incoming election — the countdown, candidates declared, and a link to what the day's news did to the seats. Same X / Threads / Facebook switch as the report pages, in English and Bahasa Malaysia.

3. Reading a seat

The seat explorer covers every chamber — 222 parliamentary constituencies plus all five state assemblies, switchable from the submenu (or the States pages). Default sort is most competitive first (smallest margin). Filter by state or leaning bloc; click any column to sort. "Margin" is the gap between the top two blocs' expected vote shares — single digits mean a knife-edge seat (36 seats were decided by under 5 points at GE15, which is why small national swings move many seats). Deep links from the by-state pages (/seats?chamber=parliament&state=johor) open the explorer with that state's filter already applied.

A seat page groups the constituency's actual results per election — GE12 through GE15 for federal seats, each state's PRNs, by-elections — newest first, with per-election vote totals, winner badges and candidate names (older elections are collapsed behind a summary line). A "Why this forecast" note explains in plain language why the numbers are what they are — the seat's baseline result, how shrinkage/swings/news moved it, and what changed since the previous run and why — regenerated with every run, in English and Bahasa Malaysia. Beneath the note: the current forecast (expected share + win probability per bloc), the candidate card for a coming election, and recent news tagged to that seat by the cycle.

The candidate card is labelled by where the election stands, because the two are not the same thing: "Declared candidates" while parties are still announcing names (nothing binding yet), and "Registered candidates (nomination accepted)" from nomination day onward — those are the names on the ballot, as accepted by the Returning Officer. In the forecast beside it, a bloc with no candidate in that seat is shown at zero: a bloc that is not standing cannot win, so where the filed field is complete the seat is restricted to the blocs actually contesting it. Where two blocs are running on one ticket (a seat pact), a bloc that sits a seat out passes its historical vote to its partner on that ballot rather than splitting it — the rule Melaka 2026 proved necessary, when BN's stood-aside seats went to PN, not half to PH.

4. State assemblies

The States section holds chamber-specific forecasts for five assemblies. Melaka (28 seats, majority 15) is live for the PRN on 14 November 2026 — the campaign forecast, with declared candidates on seat pages as they are announced. Sarawak (82 seats, majority 42) polls on 12 December 2026 (nomination 28 November) — its forecast runs on blocs at that horizon until the candidate field is final. Johor (56), Negeri Sembilan (36) and Sabah (73) held their PRNs in 2025–2026, so their pages forecast the next cycle (~2030–2031) — long-horizon bands, by design. Each state page shows its own hemicycle, intervals, probabilities and map, plus a campaign banner with the baseline result the forecast builds on. State baselines are single-election (each state's latest PRN), so during campaigns these forecasts move with the news layer — read the ranges.

Parliament seats by state (Parliament → By state) covers the other side: all sixteen states and federal territories, each with a page for its Dewan Rakyat delegation — the federal forecast sliced to that state's seats. An index card grid shows every delegation as a stacked bar of most-likely winners with the count of seats changing hands; each state page adds a map zoomed to the state's constituencies, a KPI strip (governing-bloc seats, GE15 holders, toss-ups, seats changing hands), the bloc tally, and the full seat table most competitive first. These pages are deliberately a slice of the national parliament run — no hemicycle, no majority line, no formation probabilities — because a delegation does not form a government; the national medians stay on the Parliament dashboard. The five states with DUN dashboards cross-link both ways between their state-assembly page and their delegation page.

Election links in the main menu: whenever a state election or by-election is announced (a dated row in the elections table) or a state's PRN comes within ~4 months of its due date, the menu bar carries a direct link to it — an amber pill for announced elections ("Melaka PRN · 28d"), a quieter green pill for due-date outlooks ("Sarawak PRN · 106d"). By-election pills link straight to the seat's page. The links appear and disappear by the calendar (via /api/v1/elections/upcoming, snapshot-backed), so a snap by-election shows up the moment its election row is entered.

5. Movement and government formation

The Movement page charts each bloc's median seat count across recent immutable runs — the platform's honest memory of how the forecast evolved, one dated input at a time. Every dashboard also carries a "Who can form the government?" card: the probability each plausible coalition reaches the majority across the 10,000 simulated outcomes — pure arithmetic on the seat maps, not an endorsement.

Two further series sit beside it, one point per day back to the first run: expected vote share (weighted by registered electors, so the bloc rows sum to 100%) and expected seats (the sum of per-seat win probabilities — a mean, not the most likely outcome the seat strip draws). They are worth reading together because they answer different questions. In Melaka's final run the model gives PH 45.0% of the vote against BN 42.4%, yet BN 19.7 expected seats against PH's 7.3: a plurality of votes and a majority of seats are not the same thing under first-past-the-post. Every seat page carries the same pair for that seat alone — share and win probability across runs — where the steps become legible: a vertical jump is a news nudge, a swing update, or the contest layer barring blocs that are not on that ballot. Charts appear only where at least two dated runs exist; nothing is extrapolated or back-filled.

6. The daily report

The Report page narrates the latest run per chamber — headline numbers, bloc intervals, and the seats whose win probabilities moved most since the previous run — generated deterministically from immutable runs (the same inputs always produce the same words), built from the same live database as the dashboards, and covering all six chambers including Sabah. Clicking a chamber's name (or "Explained") on any card opens a plain-language explainer for that report: the one-sentence takeaway, what the 10,000-simulation model actually does, each bracketed seat line decoded, the movers in out-of-100-replays terms, the small print translated, and an honest list of what the report is not — in English and Bahasa Malaysia. During campaigns this is the fastest way to see what a day of news actually moved, and the explainer is the fastest way to understand it. The Report submenu in the main menu opens each chamber's full report page directly (Parliament, Melaka, Sarawak, Johor, Negeri Sembilan, Sabah); the overview page with all six cards lives one click up at Report itself.

The final report for an election. When a state election reaches polling day, its forecast is frozen and a compiled final report is published — for Melaka 2026 at /final-report/melaka, linked from the Melaka dashboard and the daily report. It gathers everything in one place: the chamber summary and seat strip, the final campaign's news, every seat individually (predicted winner and probability, expected vote share, movement vs the previous day, the 2021 baseline it started from, the model's own explanation, and the news that moved it), a full win-probability matrix, and the method notes. It exists in three forms you can keep: the web page itself, a Word (.docx) edition and a PDF edition (download buttons at the top of the page), plus a browser print button. The frozen forecast is immutable — results night will be scored against exactly these numbers.

Sharing a report is built for manual posting and never touches any platform's API, so it is free and needs no accounts beyond the ones you already have. Every report card carries a "Post on X" button that opens X's composer with a ready-made post — a natural-language one-liner of today's result ("If PRN Melaka were held today, Barisan Nasional would win around 20 of 28 seats — past the 15 needed to govern."), the report link, and a hashtag line for the election. Each report page goes further with a "Share this report" box: a switch between X, Threads and Facebook, and several ready-made angles — today's story (which names the election), the biggest seat mover of the day, the too-close-to-call seat count, and the majority/coalition arithmetic (phrased to match the actual result: a secure majority reads differently from a hung chamber). X and Threads open their composers pre-filled; Facebook cannot be pre-filled, so its buttons copy the text and open Facebook, including a composed long version of the day's story written for Facebook's format. A "Copy thread" button copies every angle as one numbered thread. Review, post — the decision always stays yours.

7. Interpreting the numbers responsibly

  • A 70% favourite loses three times in ten. Watch the ranges, not just the medians.
  • Interval width scales with time-to-election. Uncertainty grows with the horizon (a damped random walk — methodology §9): the Melaka PRN a month out shows a tight band, while the parliament forecast at its 2027-2028 deadline spans 15+ seats. Long-horizon bands are still somewhat optimistic in width — the GE14→GE15 replay reached 43% coverage of the nominal 80% — so treat far-out ranges as a floor on the true uncertainty.
  • The notional baseline means bloc labels reflect today's coalitions — history is re-bucketed onto current blocs (a 2018 PPBM vote counts for PN today), so historical bars and forecasts are always comparable.
  • "Hung parliament" here means no single bloc reaches 112. Post-2022 Malaysian governments are multi-bloc by construction; the government-majority metric tracks the incumbent PH+BN arrangement.

8. Operating the pipeline

Everything is a make target or an hk command (full details in the development guide):

What you wantCommand
Refresh news + all-chamber forecastsmake weekly
Forecast onlymake forecast
Collect news onlymake collect
Re-run tagging (LLM if key set)make tag
Data quality reportmake qa
Model vs GE15 replaymake backtest
Enter a poll (sourced, never unsourced)edit data/seed/polls.csv, then hk load-polls
Run testsmake test

Automatic operation (LIVE): the platform updates itself automatically every night against its production database — during quiet periods the inputs barely change, and the same fixed pipeline runs through campaigns with the cadence they need (collect news → tag → refresh electoral data → quality gates → forecast). Quality-gate blockers stop the update rather than publish on bad data, and an off-site backup is taken every night. The nightly job runs on the operator's MacBook at 19:00 (see "Missed nights").

Missed nights. The update clock is a scheduled job on the operator's MacBook, at 19:00 daily. A night missed while the Mac sleeps runs once on wake, so it is delayed rather than lost; if the Mac is off for days the site keeps serving the last good forecast (every run is immutable), feeds are re-pulled in full on the next update, and the news layer looks back weeks. A 21:00 health check flags a stale cycle. If the numbers ever look stale, refresh the page first; if a data problem is suspected, make qa (see the development guide) reports data quality directly.

How the site updates itself (trigger map)

StepWhat triggers itWhat happens
Cycle startThe clock: an automatic nightly update (more often by manual dispatch when events demand it)Runs the fixed pipeline below against the production database — nothing else ever touches it
News inCycle step 1RSS pulls (static feeds + auto-generated campaign feeds for states within 90 days of polling); articles stored immutable, deduplicated by URL; dead feeds are skipped, never fatal
TaggingCycle step 2 (only untagged articles)LLM extracts seats/parties/coalitions + sentiment if LLM_API_KEY is set; deterministic keyword tagger otherwise; results link articles to seat codes and score bloc sentiment
EmbeddingsCycle step 3pgvector vectors for semantic dedupe (skipped without a key)
Notional refreshCycle step 4Re-aggregates all loaded elections onto today's blocs — coalition-map edits take effect on the next cycle
QA gatesCycle step 5Any blocker aborts before forecasting; the site keeps serving the last good run
ForecastCycle step 6Every loaded chamber re-forecast (baseline → swings → polls → news nudges → simulation + formations) and appended as an immutable, input-hashed run
BackupCycle step 7The nightly run takes an off-site backup of the database automatically
Web updateEvery page viewThe site renders straight from the live database; after an update the next visitor sees the new numbers, and /movement gains its point automatically
Alliance watchEvening data-entry watch, 19:35 MYThk unknown-terms flags trending proper-noun phrases no registry knows — a repeated unknown coalition name is the cue to curate it via the reviewed recipe; the watch never edits data
Election menu linksAny page viewThe main menu shows links for announced elections (future-dated elections rows — by-elections, PRNs, PRUs) and for state PRNs within ~4 months of their due date; announced elections get the amber pill, due-date outlooks the green one

Not automatic (deliberately): poll entry (hk load-polls — never unsourced), candidate ingestion at nomination (hk ingest-candidates), new election/results loaders, and any code or config change. These are human/assistant-triggered so every input is a reviewed decision. One partial exception: the daily watch hunts polls automatically (web search for pollster releases) but only reports candidates for entry — a poll enters exclusively through the curated CSV with a source URL. Current poll status: no enterable poll exists for any live chamber yet; Ilham Centre's Melaka fieldwork began mid-October 2026 and the watch will flag the release the day it publishes numbers.

Smarter news analysis: set LLM_API_KEY in .env (any OpenAI-compatible endpoint). The LLM then performs entity extraction, per-bloc sentiment scoring and the bilingual "why it matters" rationale shown under each headline, with embeddings for semantic dedupe; without a key everything still runs on the deterministic keyword tagger, whose rationale says so. Each cycle also upgrades a bounded batch of keyword-only tags to LLM tags (hk retag-fallback runs it by hand, hk retag-fallback --drain clears a whole backlog an outage left behind), and hk llm-check is the one-call preflight the cycle runs first — a broken gateway becomes a visible warning on the run instead of days of silent fallback. An exhausted account quota (weekly usage cap, unpaid balance) also trips a breaker: the first such failure disables the LLM for the rest of that run, so a dead provider costs one request instead of hundreds.

9. The data behind it

Electoral results come from open datasets (TindakMalaysia for GE15, Wikipedia for GE14 and by-elections) verified against official counts; coalition history is human-curated in-repo. Full provenance and known caveats: data sources.

10. FAQ

How often does the forecast change? Automatically on every cycle — daily in campaign mode, weekly otherwise. Manually after any reviewed data edit (poll, candidates, coalition change) plus make forecast.

Is the site available in Bahasa Malaysia? Yes — toggle EN | BM in the header or visit any page under /ms. The choice is remembered, both languages are indexed by search engines, and the core documents (guide, methodology, data sources, changelog) are translated in full.

Why does a small swing move so many seats? Malaysian margins are thin and FPTP amplifies: dozens of seats sit within a few points, so a 2–3 point national movement routinely shifts 10+ seats.

Why is GPS/GRS forecast almost entirely from history? National news barely observes Sabah/Sarawak interior politics, so the semantic layer contributes little there — the baseline (which is mostly their own recent results) does the work. That is arguably correct.

Can I get the raw numbers? Every figure on the site comes from immutable, input-hashed forecast runs — any figure can be reproduced, and the methodology plus data sources documents trace exactly where each number comes from.

Something looks wrong. Check make qa first, then the seat page's underlying history. Data fixes happen in the seed files and re-seed — never by editing forecast outputs.

Update triggers for this document

Site pages added or changed meaningfully; CLI/make commands changed; configuration knobs added; FAQ entries added; interpretation caveats changed (e.g. after regional-shock modelling lands).