# Design: a second declared change to how both pages describe the results

## What this is

A second recount of the stored files showed that the first declared change still left the pages understating how weak
the planted tests are for small flows, and still reporting only one side of the model's errors in the direction
paragraph. This file declares the further change to the text of `index.html` and `pt.html`. It was committed before the
code and the pages changed, but every result had already been read, so all of it counts as decided after the results,
and the pages say so.

This file also restates what a reader needs from the two earlier design notes for these pages, under "What the first
change declared" and "How the Portuguese page stays in step". Those notes stay byte-identical in the study's repository
and are not part of this download.

## What does not change

No model is run. No planted election is added or changed. No declared rule changes, so the verdicts stored in the result
files stay as they were: 12 of 32 after the self-test, 6 of 32 after both tests. Every file pinned in
`tests/frozen-files.json` stays byte-identical, and so does `results/planted_baseline.json`. The new checks go in a new
file, `results/no_model_baseline.json`, written by `tools/no_model_baseline.py`.

## What the recount found

All of it recomputes from `results/`, the planted truth files and TSE's national runoff file.

1. **A guess of zero is the weakest guess with no model.** One fixed share, said for every flow, passes all 6 flows that
   passed every rule: any share from 2.6% to 5.9% does. The runoff's own blank or null votes are such a share: 4,153,801
   of 158,745,502 registered voters, or 2.62%. It needs no model and no sight of the planted tables, and a fixed number
   has no spread across settings. It passes 11 of all 32, against 8 for the model on error alone and 6 under every rule.

   | Flow into blank or null | Planted, % | Model's largest error, points | Fixed 2.62%, largest error, points |
   |---|---|---|---|
   | Lula | 0.95 to 1.61 | 0.76 | 1.66 |
   | Flávio | 1.00 to 1.87 | 1.01 | 1.62 |
   | Renan | 2.00 to 4.29 | 3.91 | 1.67 |
   | Caiado | 1.94 to 4.26 | 3.91 | 1.65 |
   | Seven others | 1.99 to 6.30 | 3.93 | 3.68 |
   | Non-voters | 1.62 to 7.59 | 3.67 | 4.97 |

   So the model beats that share on three of the 6 and loses on the other three. Most of the model's edge is on the two
   smallest flows, where a guess of zero also passes.
2. **None of the 6 was tested at its own estimate.** The first change gave a range and no single number only to the three
   flows whose default estimates lie above anything planted. The other three lie below the lowest value planted, and the
   gap is not always small: Lula's 0.39% against a lowest planted 0.95% is about 2.4 times, the same as Caiado's 10.41%
   against a highest planted 4.26%. Each of those three estimates is also smaller than its own largest test error.
3. **The word "recovered" and the vote counts.** The three flows that kept the word also kept a vote count, and each count
   was smaller than that flow's own largest test error. The declared rules define the word, but they apply it to all 6.
4. **Direction, measured on what the rule measures.** The study defines a direction as the sign of Lula's share minus
   Flávio's. The page cited one side of that gap: the form that broke the model overstated non-voters' flow to Lula by up
   to 29.5 points, but it also overstated their flow to Flávio by about 16, so the error in the gap is about 13. Across the
   13 forms and both groups, the mean error in the gap runs from about 13.4 points toward Lula to about 12.1 away from him.
5. **"Broke every estimate involving staying home."** Non-voters going blank or null survived that form, with a largest
   error of 3.67 points, and passed every rule.
6. **What the independent author had read.** The author never saw the model's code or its output files. The written plan
   the author read names the kind of model, the 5-point bar, the groupings and the settings, and its predictions describe
   an earlier run in words ("the largest single modelled inflow"). The pages mentioned only the kind of model and the bar.
7. **"They change no verdict."** That holds for the verdicts in the result files. It does not hold for what the page
   shows: the Verdict column changed, and a direction the results mark as stated is not treated as a result on the page.
8. **A sentence about the minor candidates.** "It did not recover any minor candidate's" is true of their flows to a
   finalist or into staying home, not of their flows into blank or null, which passed every rule.
9. **The first screen.** The headline used the words "both tests" with no context, including on the home page, and the
   recommendation and all four key figures fell below the first screen at 1366 by 900 px.

## The change

- **Headline:** it leads with the certain bound, then the 6 of 32 with its rules in plain words, then the fixed share,
  labelled as added after the results. Portuguese the same, with "variação" for the settings rule, which is not an error.
- **First screen:** four sentences of explanation, the recommendation, and the key figures, all within 1366 by 900 px. The
  headline runs smaller on these two pages (inline CSS, kit untouched). The browser gate measures this.
- **Fourth key figure:** "6 of 6" flows that passed would also pass on one fixed share; the guess of zero stays in its
  context as 4 of the 6.
- **Flow table and chart:** all 6 read "Passed every rule". Every flow shows the range across settings, and none shows a
  single number or a vote count. The column "Guess of zero passes?" becomes "Passes with no model?", with the values
  "Zero and 2.62%", "2.62%" and "No". The chart's tooltips follow. The word "recovered" stays only for the declared rule,
  the result files' field, the "not recovered" verdict, what an earlier draft said, and the copy-paste method.
- **Direction paragraph:** the gap sentence replaces the two one-sided examples, and the independent section now gives the
  form's overstatement for both finalists.
- **The fair remainder:** the page states that the model beats the fixed share on three of the 6 and loses on three.
- **Copy-paste method:** it asks for both no-model guesses.
- **Method section and "What went wrong":** they say the verdicts in the result files did not change, and name the two
  things the page does differently because of these checks.

## What this supersedes in the first change

- "Three flows show a range": now all 6, for the reason in item 2 above.
- "The chart draws them in a lighter colour": removed. All 6 are drawn alike, because the lighter colour marked a line
  this recount no longer draws, and every band is drawn at the default setting only to keep the picture whole.
- The fourth key figure "4 of 6" on a guess of zero: now "6 of 6" on one fixed share, with the 4 in its context.
- "The other three default estimates sit just under the lowest value planted": replaced by each estimate beside its value
  and its error.
- "Of the 6, only non-voters going blank or null neither passes on a guess of zero nor lies above what was planted":
  deleted, because that flow passes on the fixed share and lies below what was planted.
- `results/planted_baseline.json` keeps its own counts and stays as committed. The new file adds to it.

## What the first change declared

A recount of the stored files showed that the published headline and several sentences under it claimed something other
than what the declared rules count. `tools/planted_baseline.py` wrote it to `results/planted_baseline.json`, and all of
it was decided after the results.

| Counted by | Flows of 32 |
|---|---|
| Within 5 points, independent test alone | 13 |
| Within 5 points, self-test alone | 15 |
| Within 5 points, both tests | 8 |
| Both tests, plus at most 10 points across the model's settings | 6 |

The 6 is the declared rule; the old headline described the 13. A flow planted under 5% on every planted election passes
on a guess of zero: four of the 6, five of all 32, where the page had said two. Both first-round non-voters and blank or
null voters were planted toward Lula in all 39 draws, and those 39 draws are 13 forms, so a rule that always says Lula
scores the same; the "39 of 39" key figure was removed. The wording about the independent author changed wherever it
appeared. The copy-paste method plants near the expected size and plants each direction both ways. The method section
keeps the rules as declared and lists these additions apart from them.

## How the Portuguese page stays in step

`pt.html` is a translation of `index.html`, with no new question, data or run. `site/render_pt.py` runs the computing part
of `site/render.py` as it stands, so every value and assertion comes from the same lines and the same result files, and
only the format changes (decimal comma, thousands point, "milhões"). `tests/test_pt_page.py` compares the two pages number
by number, section by section, and a planted change must fail. The translation is written as Brazilian Portuguese for a
reader who works with data, with the terms the country's own sources use, every limit beside its number, and "eleição
simulada" for a planted election. No second Portuguese reader has read it. The datasets, the code and the README stay in
English, and the page says so where it links them.

## Not done, and why

Two further tests remain open: planted elections with these flows at their real levels, and forms with the direction
reversed. Each needs a new scored run on the polling-section table and its own declaration, so each would be its own
round. Until one runs, the pages say these were not tested.

## How the change is checked

- `tests/page-changes.json` lists every hunk that differs from the published English page, and `tests/test_pt_page.py`
  undoes those hunks and the link sentence, then requires the published page's exact sha256.
- `tests/test_no_model_baseline.py` recomputes `results/no_model_baseline.json`, requires the counts above, requires
  `results/planted_baseline.json` unchanged, and runs a positive control for the fixed share, the range of shares and the
  error in the gap.
- `site/render.py` asserts these counts when it builds the page, so a page cannot state one the files do not support.
- The browser gate measures that the recommendation and the key figures sit on the first screen at 1366 by 900 px.
