Skip to content

v2.4.0 — Copy class configuration between classes, time logic through one resolver, and hardened production checks

Choose a tag to compare

@timwonderer timwonderer released this 29 Oct 12:07
· 449 commits to main since this release
Immutable release. Only release title and notes can be modified.
3ce50ec

Released 2026-10-29 at 03:07 UTC. Migrations c8f1a2b3d490, e3b7c1d9a2f4.

Highlights

  • Class-scoped configuration file export/import with authenticated five-day files, atomic imports, and temporary retry receipts
  • All time logic goes through the canonical temporal resolver, and a guard now actually checks it

Fixed

  • Store purchases failed with "Incorrect passphrase"
Full details
  • Store purchases failed with "Incorrect passphrase" for students whose browser had saved their PIN as the site password: the transfer page's PIN field was marked autocomplete="current-password", so Chrome offered to save the PIN and then autofilled it into passphrase prompts. The field is now autocomplete="off", like the dashboard PIN field (support ticket #13).

Security & Reliability

  • All time logic goes through the canonical temporal resolver, and a guard now actually checks it
  • The status collector reads nothing from the application during maintenance
  • The sysadmin bug reward is retired until badges are formally implemented
  • The production deploy workflows installed Tailscale 1.94.2
  • The pre-release backup script left an SSH tunnel to the production database open indefinitely
  • Logs and URLs no longer carry internal identities
  • /metrics answered the internet, and the health checks could be polled without limit (#1661)
Full details
  • All time logic goes through the canonical temporal resolver, and a guard now actually checks it (SPEC-TIME-001 1.3, INV-ARC-015 §VII; owner rulings 2026-10-24). The time guardrail in tests/dom/operation/test_time_money_guardrails.py had scanned tests/dom/app, a directory that does not exist, since it was moved on 2026-07-18, so it passed while checking nothing; the separate policy_guardrails.py rule banned only timedelta, in three directories, with an allowlist. Together they let 464 prohibited time operations stand in 72 application files: direct clock reads, utc_now()/ensure_utc() helpers outside the resolver, astimezone/pytz conversions, timedelta date arithmetic and UTC .date() derivations. Every one now goes through a resolver primitive. The resolver gains shift_calendar_days (calendar-day shifts that keep local midnight or the local clock across DST), localize_timestamp (an instant in the class timezone) and same_instant; elapsed_duration now sums intervals exactly and truncates once instead of per interval; ensure_utc and advance_local_calendar_days are gone, and private helpers that only forwarded to the resolver are inlined. tests/test_SPEC_TIME_001__resolver_is_the_only_time_tool.py parses every file in app/, fails if it scans fewer than 150, and proves each prohibited pattern with a mutation case, including the two shipped DST defects the retired timedelta rule recorded; that rule and its allowlist are removed. Corrected behaviour: "Transactions today" on the teacher dashboard counts the class's day, not the UTC day; recurring rent late fees count class-local calendar days (INV-ARC-015 §VIII.1), not 24-hour blocks; custom N-month rent steps count from the anchor date instead of drifting (no production class uses them). Timestamps without a timezone are now rejected where they were silently read as UTC; nothing in the application writes one. Dead rent-period and waiver helpers that added fixed periods to UTC instants are deleted. Tests take time from tests/helpers/temporal.py, thin wrappers over the resolver (SPEC-TEST-001 1.1). Displayed times are built by page builders, not templates (INV-ARC-022 §V.8, SPEC-UI-001 §VI–§XI; owner rulings 2026-10-25, resolved by authority): the fmt_timestamp/fmt_date/fmt_compact_date/fmt_time Jinja filters and the format_utc_iso template global are removed, along with every strftime/isoformat and time comparison in templates and every time format in route bodies; each page's builder produces the text through the resolver and the template prints it. A guard (tests/test_INV_ARC_022__templates_do_not_format_time.py) holds templates and routes to this, with mutation cases. Display corrections found on the way: the rent page's waiver tab showed blank due and waived dates (nothing filled the local-timestamp spans since an earlier rework) and now prints them in class time; the hall-pass verification kiosk showed UTC to an anonymous visitor and now uses the verified class's time zone; the insurance-claim transaction picker and the admin issue page's recent transactions showed UTC dates and now show class-local ones; the teacher recovery pages show their deadlines in UTC explicitly instead of whatever class session the browser held.
  • The status collector reads nothing from the application during maintenance (owner ruling 2026-10-23; DOM-OPS-001 2.14, SPEC-OPS-006 1.6). It probes the Access gate first; while the gate is closed it stores only that gate check, makes no health read and stores no request telemetry, and records the endpoint and database as Unknown under the new diagnostic NOT_COLLECTED. The page already shows "Under maintenance" from the gate alone. The collector no longer sends the Cloudflare Access service token, which existed only to reach production during maintenance; the health endpoints are public, and the deploy no longer injects the token's secrets into the collector. SOP-DEP-001 2.11 and SOP-DEP-002 1.16 drop "public health probes require service-token headers". Found by the #1656 outside check.
  • The sysadmin bug reward is retired until badges are formally implemented (owner ruling 2026-10-27). Resolving an escalated ticket records the technical fix and returns it to the teacher; the form no longer offers a reward, and the resolve route ignores eligible_for_reward and reward_amount if a request still sends them, so a hand-built POST can no longer credit a student. Production has never issued one. DOM-SUP-001 v1.10 and SPEC-OPS-004 v1.5 record the change; the issues.eligible_for_reward column and the bug_reward ledger type are dropped by a follow-up contract migration.
  • The production deploy workflows installed Tailscale 1.94.2 (release-v2.yml, login-notice.yml, tailscale-ssh-smoke-test.yml). Pinning tailscale/github-action by SHA did not pin the client: v4.2.0 defaults version to 1.94.2, which predates Tailscale's 2026-10-21 bulletin TS-2026-013 (distrust of the compromised eMudhra certificate authorities, fixed in 1.104.2). The three workflows now pin the action at v4.3.0 (99a8333), whose default is 1.104.2; Dependabot's weekly github-actions update keeps the client current with the SHA. The production host was upgraded from Tailscale 1.102.4 to 1.104.2 on 2026-10-24 (docs/ops/audits/HOST_UPGRADE_2026-10-24_TAILSCALE.md); the host package sits outside unattended-upgrades, tracked in #1665. No exploitation was found and no credentials were rotated.
  • The pre-release backup script left an SSH tunnel to the production database open indefinitely (infra/db-backup/prerelease.sh). backup started ssh -f -N -L 55433:… and nothing closed it; the v2.2.4 tunnel was still listening six days later and made the v2.3.0 backup refuse to start. The tunnel is now owned through a control socket (~/cth-backup/tunnel.sock). backup keeps it on success, because counts and restore need it, and closes it on failure. counts and restore reuse or reopen it. restore, the last step, closes it on exit alongside deleting the identity, which now falls back to rm -f so a failed rm -P cannot skip the close. close-tunnel handles an abandoned run. tests/test_prerelease_tunnel.py runs the real script against stub ssh, docker and tools in a throwaway HOME; 6 of its 7 tests fail on the previous script. SOP-DEP-002 1.13 step 7 and infra/db-backup/README.md describe the lifecycle.
  • Logs and URLs no longer carry internal identities (DOM-OPS-001 v2.15, owner ruling 2026-10-27). Every application log line named its class by the internal class_id, and several messages printed internal seat and user ids (for example DASHBOARD DEBUG: Student 211, TAP success - seat 211, user_id=…). The line prefix now carries class_public_id; every log call that printed one now names seats by seats.public_id and classes by class_public_id, or drops the id where the prefix already names the actor, and the authentication principal is omitted. FEAT-ENTRY and FEAT-COMMIT-OWNERSHIP print idempotency keys and correlation ids as label plus fingerprint (loggable_token), since a composed key carries the ids it was built from; stored keys are unchanged. /student/switch-class/ and /admin/student/…/adjust-hall-pass-entitlements take public ids, so nginx no longer logs the internal ones; the hall-pass adjustment now also resolves the seat within the teacher's active class only. Teacher-facing fallbacks that showed Seat 211 read Unnamed student. Fresh support and identity-bind correlation ids no longer embed the class or user id. A structural guard (tests/test_DOM_OPS_001__logs_carry_no_internal_identity.py) rejects any log call reading an internal identity; it reports 103 on the previous tree.
  • /metrics answered the internet, and the health checks could be polled without limit (#1661). The /metrics guard allowed any request whose remote_addr was loopback, but nginx proxies every public request to gunicorn over loopback, so the guard never refused anything. It now uses the same host-local test as the Cloudflare-bypass check, ip_handler.is_host_local_request(): loopback and none of the proxy headers nginx always sets. The Prometheus scrape (127.0.0.1:8000, no proxy headers) is unaffected. The exposed payload carried no personal or tenant data (SPEC-OPS-003), only runtime and traffic statistics. /health and /health/status are no longer exempt from rate limiting: each carries "30 per minute" per visitor in place of the daily defaults that the once-a-minute status collector exhausted on 2026-10-20, so the collector stays far inside it and no one can drive the database check without limit. Found by the #1656 outside check.

Accessibility

  • Accessibility: configuration transfer forms have explicit labels and grouped selections; Copy Configuration navigation announces the current page
Full details
  • Accessibility: configuration transfer forms have explicit labels and grouped selections; Copy Configuration navigation announces the current page. Rendered start, upload, and confirmation stages are covered by accessibility smoke assertions. The page has a contextual help panel, its alerts use the shared alert cards, every switch and checkbox has its own label, a feature's items are hidden and disabled while its switch is off, and the import review shows labeled tables instead of raw field names. Headings follow the page outline (h1, then h2 cards, h3 features, h4 items); cards.top_card and cards.nested_card take a heading_tag, defaulting to their previous h5/h6.

Internal Changes

  • Class-scoped configuration file export/import with authenticated five-day files, atomic imports, and temporary retry receipts
  • One tab icon across every Classroom Token Hub site
  • The developer docs at classroomtokenhub.com/docs are now built with Hugo + Hextra instead of Docusaurus
  • The Hugo + Hextra developer-doc proof builds on its own and matches the brand rules
  • The backlog moves to GitHub Issues and the CTH Backlog project
  • Release notes are grouped for readers instead of copying the CHANGELOG section
  • The README stops keeping its own copy of release state
  • bug_reward is no longer a lawful ledger transaction type
  • The Docusaurus workspace docs-site/ is retired
  • A support ticket's request trace could miss the requests that explained it
  • The scheduled Full Test Suite's unsafe-markup guard now runs at all
Full details
  • Class-scoped configuration file export/import with authenticated five-day files, atomic imports, and temporary retry receipts. Insurance tier groups now use canonical identities; migration preserves existing coverage through explicit successors. Requires the new CONFIGURATION_EXPORT_KEY secret (SOP-DEP-001 2.12); without it the page loads but every export and import is refused. The import review shows each setting as its settings page does (pay rate per hour, times with units, class-local dates) instead of stored values. Teacher guide: docs/user-guides/features/teacher/settings/copy-configuration.md.
  • One tab icon across every Classroom Token Hub site. The icon is now the gold store symbol from the wordmark's middle row on Advisor Green (static/images/icon-192.png, icon-512.png), replacing the text-and-dollar icon. The public site (classroomtokenhub.com) and the status page had no tab icon; they now carry byte-identical copies (github-pages/assets/icon-192.png, status_service/static/icon-192.png), since each publishes only its own directory. tests/test_favicon_mirrors.py fails if a copy drifts from the source, with a mutation proof. The service worker cache moves to classroom-token-hub-v13 so installed apps pick up the new icon. A tab icon is browser chrome, not the on-page brand mark, so SPEC-DES-001 §IX is unchanged.
  • The developer docs at classroomtokenhub.com/docs are now built with Hugo + Hextra instead of Docusaurus (SOP-DOC-000 3.6, SPEC-DES-001 2.5). .github/workflows/github-pages.yml runs docs-generator-proof/bootstrap.py, build.py and check.py and publishes the result; a failing check stops the deploy. Every Docusaurus page URL is preserved, and 2,891 of its 2,892 heading anchors (the one exception is a catalog anchor nothing links to). The engineering notes are no longer published. Publication now follows an allowlist in build.py, which fails closed, instead of Docusaurus's exclude list, which failed open; tests/test_docs_site_publishes_no_working_state.py and the platform-split guards now read that allowlist. The bootstrap downloads and checksums Hugo for Linux as well as macOS, the noindex tag used during evaluation is removed, and the site's stylesheet is a gated SPEC-DES-001 §XIV surface. Heading-structure defects inside six canonical documents are reported as build warnings rather than blocking publication; they still need fixing at the source. docs-site/ stays in the repository as a fallback until the Hugo site is confirmed live.
  • The Hugo + Hextra developer-doc proof builds on its own and matches the brand rules (docs-generator-proof/; unpublished, the production docs site is unchanged). Hugo's build had been running the Zensical prototype's staging code from another worktree, so it could not be built from a fresh checkout; build.py now owns the SOP-DOC-000 §X publication allowlist and the catalog, and check.py replaces the Zensical comparison with fixed artifact rules (exact page set, links, anchors, assets, headings, search scope, canonical edit links). A design review against SPEC-DES-001 removed Hextra's own favicons and "Hextra" web manifest (the tab icon is now the application's), labels every catalog entry with the document's own title instead of filename-derived text such as "No pii leakage" or the retired "Advance bill cycle", and stops publishing the unauthorized engineering notes. Accessibility (INV-ARC-020 §VII.D): nav links turned gold on hover over the green header at 4.34:1, below AA for that text size; hover now underlines instead. axe reports 0 violations across 11 sampled desktop and mobile states. COMPARISON.md and evidence/ remain as the record of why Hugo was selected.
  • The backlog moves to GitHub Issues and the CTH Backlog project. docs/TRACKING/POST_LAUNCH_TRACKER_2026.md called itself canonical but was last brought up to date for v2.1.1; later follow-ups lived only in release records. Its open items were re-verified against main and filed as #1635–#1659 (two folded into #1505 and #1507), and the file is archived to docs/archive/v2-tracking-2026/. SOP-DEP-002 1.15: release-record follow-ups are filed as issues and linked. SPEC-ECON-001 1.4 and SOP-DB-001 1.8 cite their issues instead of the tracker (no rule changes); SOP-DOC-001 3.38. DEVELOPMENT.md "Next" points at the project.
  • Release notes are grouped for readers instead of copying the CHANGELOG section (scripts/release_notes.py, SOP-DEP-002 1.14). v2.3.0's verbatim notes ran to about 20,000 characters, with single entries past 2,000 and fixes for students mixed with test and document changes. The notes are now Highlights, Fixed, Security & Reliability, Accessibility and Internal Changes. Each section lists one headline per entry with the PRs that entry cites as its own, and the full entries are collapsed beneath it. The deployment record and release run are linked at the end. Each CHANGELOG entry names its section in an invisible tag after its bullet (<!-- notes: … -->, optionally highlight), and the script refuses an untagged entry. v2.3.0's 22 entries are tagged. --raw prints the section verbatim. tests/test_release_notes.py adds the section order, the headlines, PR attribution, the hidden tags and the refusals.
  • The README stops keeping its own copy of release state. It re-stated each release four times (the production line, a tag-by-tag sentence, a narrative of untagged releases, and a "Known limits" snapshot frozen at v2.0.1), so it went stale with every release. It now names the release in production once and points to the release records, the GitHub releases and the CHANGELOG; known limits live in the current release record.
  • bug_reward is no longer a lawful ledger transaction type (DOM-LED-001 v2.18). Migration e3b7c1d9a2f4 re-creates ck_ledger_transaction_type_closed_vocabulary without it, still NOT VALID, and refuses to run while any bug_reward row exists; production has none. It also leaves the idempotent-type set and the insurance non-loss list. Downgrade re-admits it exactly.
  • The Docusaurus workspace docs-site/ is retired (SOP-DOC-000 3.7, SPEC-DES-001 2.6). The developer docs have been built with Hugo + Hextra since the cutover, so the Docusaurus config, its npm package.json and lockfile (the project's only Node dependencies), the React pages, sidebars and engineering-notes blog are deleted. The brand fonts and token layer the Hugo build still uses moved to docs-generator-proof/brand/, and the map of renamed developer-doc paths moved to app/utils/docs_route_map.json, beside the helper that reads it. The Docusaurus design-linter surface and tests/test_docs_site_image_advisory_guard.py (which guarded a Docusaurus-only image-size advisory) are removed; the docs brand-conformance tests now check the Hugo site. requirements.txt is unchanged: it carried no Docusaurus dependency.
  • A support ticket's request trace could miss the requests that explained it. The dashboard polls /api/student-status every 10 seconds, and the per-student trace keeps only the latest 20 requests, so a few minutes of idling replaced real requests with status checks before the ticket was filed. Successful status checks are no longer recorded (a failed one still is), and the sysadmin ticket page now shows each traced request's status code; on ticket #13 the trace held seven 403 purchase refusals that the page did not show.
  • The scheduled Full Test Suite's unsafe-markup guard now runs at all. tests/test_no_unsafe_jinja_markup.py requires JINJA_GUARD_BASE_SHA in CI, and every other gate derives it from a pull request's base SHA; the scheduled full-suite.yml run has no pull request, so the guard errored on every scheduled run. It now passes the commit under test (${{ github.sha }}), so the scheduled run checks main against its own committed baseline while constitutional-ci keeps checking pull requests against theirs. (The other two scheduled-suite failures, on the Copy Class Configuration page's help panel and alert markup, are fixed by #1676.)

Deployment record: DEPLOY_2026-10-29_3ce50ec.md · Release run: 40810333156

Dispatched before the maintenance window opened and before SOP-DEP-002 §VII.A steps 4-8 ran (backup, restore check, balance baseline) — see the Security entry under [2.4.1]. The record was written afterwards and names those checks as not run; the infra/release-gate work in [2.4.1] exists because of this gap.