Thanks for looking. This is a small project with an unusual property worth knowing before you start: the site has no build step and never will. The pages are standalone HTML that open straight from the filesystem. Everything below is development tooling — it tests the site, it does not build it.
git clone https://github.com/Protonmatter/cosmos.git
cd cosmos
npm install
npm run serve # http://localhost:8000You can also just open index.html in a browser. Both work.
On Windows, clone after
.gitattributesexists (it does, onmain). The vendored React bundles are loaded with a Subresource Integrity digest, and a checkout that rewrites LF to CRLF changes their bytes, fails the integrity check, and renders every deck completely blank with no obvious cause.npm run test:validationdetects this in about a second if it ever happens to you.
npm test # everything the pull-request gate runs
npm run test:validation # static checks, ~1s, no browser
npm run test:trace # requirement ↔ test traceability
npm run test:functional # per-page behaviour
npm run test:e2e # journeys across pages
npm run test:regression # invariants and past defects
npm run test:visual # screenshots; Linux only, see docs/specs/visual.spec.mdTo run only the tests covering one requirement:
npx playwright test --grep "@REQ DECK-005"- Does it need an RFC? Substantive changes do. See docs/SDLC.md for the substantive/routine split — it is deliberately generous about what counts as routine.
- Is it specified? New behaviour needs a requirement in
docs/specs/. - Is it tested? Every MUST-level requirement needs a test annotated
@REQ <ID>. CI fails otherwise, on purpose. - Does
npm testpass?
The Solar System and Moons decks show their photographs in several WebP widths.
To add or replace one, run the image tool on the original (--out moons for the
Moons deck):
python3 tools/image-variants.py path/to/original.jpg venus --max 4096It needs Python 3 and Pillow (pip install Pillow). It writes
planets/venus-<width>.webp and prints the srcset and the image viewer's
attributes to paste into the slide. Commit the files it writes; the site has no
build step, so nothing regenerates them. Keep widths above about 3000 pixels out
of the slide's srcset and use the largest only for the viewer. Credit the image
on the deck's Sources slide and in the README.
RFC 0005 has the reasoning.
The deck's cover shows every body at one scale and is drawn from those files. If
you replace one, or change a radius, redraw it with python3 tools/cover-lineup.py
(it also needs NumPy), and move the names on the cover slide to the positions it
prints.
The house rules, in full:
- No fixed sleeps. Wait on observable state. The helpers in
tests/support/pages.jsknow how each kind of page signals readiness — the deck pages in particular render nothing until their runtime has booted, so waiting onloadasserts against a blank document. - Address pages the way a reader does — by role, label, and visible text. Fall back to the documented data attributes only where the runtime provides no accessible handle.
- Say why, not what. A test called
checks the countertells a future reader nothing;reports position and total in the counter @REQ DECK-011tells them what broke and which decision it protects.
Open an issue with the bug template. The single most useful thing you can include is which page, at what viewport, in which browser — the decks scale to fit, so layout problems are often viewport-specific.
Be decent. The imagery in this repository was processed by volunteers who did it for the pleasure of it; that is the spirit to work in.