diff --git a/CITATION.cff b/CITATION.cff index c147360..6bef67e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -18,7 +18,7 @@ authors: affiliation: Better To Best Research Hub email: BetterToBestResearch@gmail.com - name: "Claude (Anthropic)" -version: 5.9.2 +version: 5.9.3 doi: 10.17605/OSF.IO/QWTE2 url: "https://bettertobest.github.io/compassionism-simulation/" repository-code: "https://github.com/BetterToBest/compassionism-simulation" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f51108..6ef41c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -359,7 +359,7 @@ The simulation is a single HTML file with no build tooling — runs directly fro - Test in Chrome, Firefox, and Safari - **New in v4.20:** `npm install` once (it installs jsdom, the only dev dependency, pinned in `package.json`), then `npm test`, which runs `node harness.js validate`, `node harness.js unit` and `node domtest.js`. GitHub Actions runs the same three on every push and pull request (`.github/workflows/checks.yml`); a red check means a figure, a unit test, or page/harness parity broke. *(v5.3: the engine has one copy. `harness.js` reads it out of `index.html` when it loads, so an engine change is made once, in `index.html`; `dev/tools/port_engine.py` and the five listed differences between the two files are retired. `domtest.js` still compares the page with the script `harness.js` runs.)* If your change moves the seed-42 figures on purpose, update `validate`'s documented values in the same pull request and say why. -- **New in v4.13:** run `node domtest.js` for any change touching markup, CSS classes, or a render function. It takes ~3 minutes (158 checks; `domtest` fails if this number is stale, and `node domtest.js --write-counts` refreshes it, as `node harness.js unit --write-counts` does for the 384 unit tests) and asserts DOM behaviour the existing checklist cannot see — the two defects it was written to catch had both been live for eight releases precisely because every prior check read the file rather than running it. It does **not** cover CSS layout, tooltip positioning, or Chart.js output; those still need a human look at a few zoom levels and viewport widths after deploying. +- **New in v4.13:** run `node domtest.js` for any change touching markup, CSS classes, or a render function. It takes ~3 minutes (159 checks; `domtest` fails if this number is stale, and `node domtest.js --write-counts` refreshes it, as `node harness.js unit --write-counts` does for the 384 unit tests) and asserts DOM behaviour the existing checklist cannot see — the two defects it was written to catch had both been live for eight releases precisely because every prior check read the file rather than running it. It does **not** cover CSS layout, tooltip positioning, or Chart.js output; those still need a human look at a few zoom levels and viewport widths after deploying. - Ensure seeded RNG produces identical output before and after your change, for a fixed configuration (seed `42`, Full Integration, 20 years — record Median BLEI, BLEI Poverty, and Gini as regression metrics) — unless your change is intentionally a mechanics fix, in which case say so explicitly in the PR - Do not introduce external dependencies beyond the existing Chart.js CDN (the page) and jsdom (dev-only, v4.20) - Follow existing code style: vanilla JS, CSS variables, inline documentation, `CFG` object for all calibration constants @@ -453,7 +453,7 @@ If you're contributing code (a pull request touching `index.html` or a harness s --- -*Better To Best Research Hub · Compassionism Framework Simulation v5.9.2* +*Better To Best Research Hub · Compassionism Framework Simulation v5.9.3* *Principal Investigator: Duke Johnson (pseudonymous)* 384 tests and `domtest` 158 checks; each run fails if these numbers are stale, and `--write-counts` (for either) refreshes them. +The same three run automatically on every push (`.github/workflows/checks.yml`). CONTRIBUTING.md explains what each covers and what none of them can see. Today `unit` runs 384 tests and `domtest` 159 checks; each run fails if these numbers are stale, and `--write-counts` (for either) refreshes them. --- diff --git a/domtest.js b/domtest.js index ddaa7c0..c084b26 100644 --- a/domtest.js +++ b/domtest.js @@ -1221,6 +1221,10 @@ function phase14(done) { const sc = require(path.join(path.dirname(FILE), 'dev', 'tools', 'check_stale_claims.js')).run(); check('v5.2.2 (audit A2): no retired claim reappears on a public page (dev/tools/check_stale_claims.js; the replication page\'s version history and the notes headed as describing the v4.22 engine are history and skipped)', sc.pass, sc.pass ? sc.claims + ' retired claims, ' + sc.files + ' files' : sc.hits.slice(0, 4).join('; ')); + /* v5.9.3: the simulation page's guided sections must not start before the page's own script has parsed the release panels (REL.data, set in its DOMContentLoaded + * handler); starting on a bare timer raced it and left every chart and card below the headline blank on a slow load. */ + const sp = fs.readFileSync(path.join(path.dirname(FILE), 'site', 'simpage.js'), 'utf8'); + check('v5.9.3: site/simpage.js starts only once REL.data exists (waits for DOMContentLoaded while it is null; no bare timer race)', /readyState === 'loading' \|\| !REL\.data\) doc\.addEventListener\('DOMContentLoaded'/.test(sp), 'start line'); phase15(done); }) .catch(e => { check('v5.2.1: the figure check runs', false, String(e && e.stack || e).slice(0, 300)); phase15(done); }); } diff --git a/earlier-engine.html b/earlier-engine.html index d9f390b..997f2bd 100644 --- a/earlier-engine.html +++ b/earlier-engine.html @@ -11,7 +11,7 @@ -