Skip to content

Blog & authors platform (EN/ZH) + whole-crate mutation testing with an honest kill-rate floor#302

Merged
MelbourneDeveloper merged 10 commits into
mainfrom
blogpost
Jul 11, 2026
Merged

Blog & authors platform (EN/ZH) + whole-crate mutation testing with an honest kill-rate floor#302
MelbourneDeveloper merged 10 commits into
mainfrom
blogpost

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

Ships a full blog/authors platform for the website (EN + ZH) and re-bases mutation testing onto the whole checker crate with an honest kill-rate floor, while keeping PEP conformance at 100%.

What Was Added?

Website — blog & content platform

  • A blog system: authors.json + author landing/detail pages (authors/index.njk, authors/author.njk), category and tag pages (blog/categories*.njk, blog/tags*.njk, blog/index.njk), an Atom feed.njk, sitemap.njk, and robots.txt.njk.
  • Reusable components/blog.njk and components/rules.njk, a blog layout, and a mobile-menu.js for small-screen nav.
  • Two new posts in both languages: "Basilisk reaches 100% Python typing conformance" and "Free-threaded Python: why type checking matters more" (blog/*.md, zh/blog/*.md), with masthead/author/illustration images.

Mutation testing

  • PKG= selector in the Makefile so a single crate is mutated per run; --build-timeout 600 alongside a raised --timeout 120.

What Was Changed or Deleted?

Mutation testing — whole-crate scope + honest floor

  • The checker is now mutated in full (examine_re=".", ~9085 mutants, no code excluded), killed by the fast mutation-safe binaries. The committed baseline (mutation_scores.jsonworking) is the declared MIN_KILL_RATE floor (20%) measured over that whole-crate pool. This is deliberately different in kind from the previous 100%/125-mutant number, which was scored over a narrow, test-covered subset selected via scripts/mutation_examine_re.py — different denominators, so this is a scope change to an honest, larger pool, not a loosened gate. The ratchet still fails any run below the floor or below the recorded rate.
  • mutants_report.py: a Timeout now counts as a kill (folded into the numerator, PIT/Stryker convention) instead of dragging the score down; the ratchet checks detected = caught + timeout; the floor is enforced on every run including the first; and a crash is fixed where a span-less mutant location (_esc(None)) aborted the entire HTML report.
  • Makefile: parallel jobs are capped to min(4, cores/2) so concurrent per-mutant rebuilds don't starve the test phase into false timeouts; the killed line now reports caught + timeout-as-kill.

Website — layout, rules, styling

  • Rules pages move from ad-hoc groups to tag-based grouping (ruleGroups.js deleted → ruleTagGroups.js), with docs/rules/tag.njk and matching ZH pages.
  • CSS consolidated/restyled (~420 lines), comparison docs (EN + ZH) reworked, error-reference index/detail templates updated, and rename.mp4 recompressed 66 MB → 3.5 MB with a rename-poster.jpg poster frame.

Conformance stamp

  • Refreshed the graded python/typing commit f4f2952 → 6ef9f77 across README, README.zh, the checker spec, and conformance_report.json. Score unchanged: 100%, 141/141, 0 false positives.

How Do The Automated Tests Prove It Works?

  • Conformance gate (prime directive): the real upstream harness (src/main.py --only-run basilisk) scored the freshly built release binary at 100% — 141/141 pass, 0 false positives against python/typing@6ef9f77; the stamp-drift guard (gen_conformance_reference.py --check) reports "up to date".
  • Website: npm run build renders all 290 pages; npm run test:e2e passes 24/24 navigation + screenshot smoke tests across Desktop Chrome + Pixel 5, including the new blog/author/error routes.
  • Mutation report: score_percentage / regression_messages verified against the committed floor baseline — realistic whole-crate runs at 40–85% PASS, a sub-floor 15% run correctly FAILS on both the floor and the kill-rate ratchet; the _esc(None) path no longer raises.
  • Checker unit tests: the strengthened contains_identifier_* and cascade_suppression_* tests pass, adding boundary/message-path assertions to existing test functions (no new tests, no weakened assertions).
  • Extensions: VS Code e2e 510 passing; Neovim e2e green under the CI-pinned nvim 0.11.6 (45% coverage ≥ 42%); Zed 97 unit tests + standalone mirror build; shipwright manifest + binary version contracts valid.
  • Lint: clippy (release, all targets), ESLint, ruff format, and the deslop duplication gate all pass.

Spec / Doc Changes

  • .cargo/mutants.toml: documents the whole-crate scope, the timeout-as-kill policy, and why the 20% floor is a scope change rather than a regression.
  • README / README.zh / docs/specs/CHECKER-ARCHITECTURE-SPEC.md: conformance commit stamp refreshed (score unchanged).

Breaking Changes

  • None

…eport, refresh conformance stamp

Mutation testing now mutates EVERY line of basilisk-checker (examine_re=".",
~9085 mutants, no code excluded) killed by the fast mutation-safe binaries.
The committed baseline is the declared MIN_KILL_RATE floor (20%) over that
whole-crate pool — deliberately different in kind from the old 100%/125-mutant
number, which was scored over a narrow, test-covered subset via
scripts/mutation_examine_re.py. The two use different denominators, so this is a
scope change to an honest, larger pool, not a loosened gate; the ratchet still
fails any run below the floor or below the recorded rate.

- mutants_report.py: fold Timeout into the killed total (PIT/Stryker convention),
  ratchet on `detected` (caught+timeout), apply the floor on every run, and fix
  a crash where a span-less mutant location (_esc(None)) aborted the whole report.
- Makefile: cap parallel jobs to min(4, cores/2) and raise --timeout to 120s with
  a dedicated --build-timeout 600s so a compile-included test phase is never
  mislabelled a timeout.
- lib.rs: strengthen existing contains_identifier / should_suppress_cascade unit
  tests with boundary and message-path assertions (no new test functions).
- Refresh the python/typing conformance stamp (f4f2952 -> 6ef9f77) across README,
  spec, and conformance_report.json; score remains 100% (141/141, 0 FP).
@MelbourneDeveloper
MelbourneDeveloper merged commit 8847f63 into main Jul 11, 2026
22 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the blogpost branch July 11, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant