Skip to content

feat(course): record AI numbers lessons 13-21 with t27c test-report and a one-line sed - #1571

Merged
gHashTag merged 2 commits into
mainfrom
claude/ai-numbers-recordings
Oct 9, 2026
Merged

gHashTag merged 2 commits into
mainfrom
claude/ai-numbers-recordings

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Description

Owner's decision: lessons 13 to 21 of the "AI numbers" course said "Recording pending: it waits on tri test and tri mutate plant from gHashTag/t27#7400". #7400 is blocked, so the nine lessons are now recorded the way term/t27c-gfternary/ was: t27c test-report <spec>, a one-line sed mutation, t27c test-report again showing exactly the test the lesson names failing, then git checkout <spec> and sha256sum (the same hash as before the edit).

Recorded with t27c 0.5.1 and zig 0.16.0 in a Claude Code cloud container (Linux x86_64), from a clean worktree of gHashTag/t27 at 72f793357. Every lesson claim was first reproduced by hand, then recorded:

Lesson Spec Mutation (one sed line) Fails Matches the lesson text
13 a-sign-is-one-bit gft_smul.t27 sign always 0 m2 yes
14 opposite-signs-subtract gft_sadd.t27 magsub -> magadd in the branch a2 takes a2 yes
15 multiply-then-add gft_signed_mac.t27 sign XOR -> OR pp yes
16 a-bend-at-zero gft_relu.t27 negative inputs pass through negz yes
17 two-to-the-x gft_exp2.t27 minus sign of k dropped em1 yes
18 pick-the-largest gft_argmax4.t27 > -> >= for two positive scores tie_low yes
19 a-loss-in-bits gft_nll.t27 neg returns 65536 for 0 perfect yes
20 one-step-downhill gft_sgd_step.t27 smul(eta, g) -> smul(g, g) ascend yes
21 xor-needs-a-bend gft_xornet.t27 relu removed from h1 x00 yes

The lesson-18 side claim was checked too: reversing the comparison of two negative scores fails no test.

Related Issue

Related to gHashTag/t27#7400 (still blocked; no longer a dependency of these lessons). Related to gHashTag/t27#7370 (t27c test-report exits 0 on a failing test, so verdicts are read from the report text).

Changes Made

  • Feature: apps/website/scripts/t27c-mutation-casts.mjs -- recorder (reuses bareEnv from tri-help-casts.mjs). Staged: prompt and typing. Real: every byte the commands printed, at the time they printed it. It refuses to write a recording whose baseline is not all green, whose mutant does not fail exactly the named test, whose diff is not one line, or whose hash differs after git checkout; it requires a clean t27 checkout before and after.
  • Recordings: 9 x public/term/t27c-gft-*/ -- session.cast (asciicast v2), meta.json (no pending; gif: null; desc names container, t27c, zig, t27 commit), index.html, card.png; public/term/index.html relisted (count stays 104).
  • Docs: the nine lesson texts in specs/course/ai-numbers.t27 and i18n/ai-numbers.ru.json describe the recording that exists; gallery hooks in specs/widgets/gallery.t27; a dated update paragraph (EN + RU) in the two-courses blog post.
  • Tests: scripts/t27c-mutation-casts.test.mjs, wired into npm run test:course.
  • Regenerated with the repo's own generators: widgets-from-spec.mjs, course-from-spec.mjs, course-pages.mjs (18 lesson cards redrawn).

GIF

No GIF encoder was used, so gif is null and there is no session.gif. widgets-from-spec.mjs then uses the card in the gallery markdown (gif ?? image); no contract requires a GIF.

Test Results

All 65 steps of the checks job of .github/workflows/website-checks.yml were run locally, one command at a time: 63 pass. Two fail, the same way on origin/main:

  • Queen viewport matrix and Queen touch contract: sectors=0 / page never became ready - sectors 0/6. On origin/main a0d149e (a clean worktree, same container) both fail identically: Queen viewport matrix with the same 18 size/view combinations, Queen touch contract with sectors 0/6. Logs: local runner, steps 57 and 63.

Breaking Changes

  • No - backward compatible; URLs of the nine recordings are unchanged.

TOXIC VERDICT

What Works

  • Nine real recordings; each shows the baseline green, the one named test red, and the spec hash restored. The recorder refuses anything else, and a test re-checks the committed casts.

What Doesn't Work

  • No GIFs. t27c test-report exits 0 on a failure (t27#7370), so the exit codes in meta.json are all 0 and the verdict lives in the report text.

Tech Debt

  • The recorder's lesson table (lines to show, sed, failing test) lives in the script, next to the lesson text that states the same facts; the test ties the committed casts to that table.

Known Issues

  • Recorded in a cloud container, not on the t27c lab; the exact commit t27c 0.5.1 was built from is not recorded.
  • tri-test-now-runs-the-tests still says the lessons wait on #7400 (left as written on its date).

Overall Assessment: APPROVE once the Queen checks are confirmed green in CI. Self-Score: 8/10

TECH TREE Options

  1. GIFs for the nine -- render session.gif from the casts so the gallery shows motion. Low effort.
  2. Move the mutation table into a .t27 spec read by the recorder and the lesson text. Medium effort; one source for both.
  3. Land t27#7370 so t27c test-report exits non-zero on a failure, then re-record. Recommended: it removes the one caveat these recordings carry.

Checklist

  • Self-review of my own code
  • Tested locally (see above)
  • No secrets; home directories are not shown in any recording (redacted: [])
{
  "version": 1,
  "head_sha": "70b61bd4515ab69683a65f2ba9db2eae586c3660",
  "summary": "Lessons 13 to 21 of the AI numbers course now open real recordings instead of placeholders: each runs t27c test-report, plants one bug with a one-line sed, shows exactly the named test failing, and restores the spec with git checkout; all nine lesson claims reproduced.",
  "changes": [
    "apps/website/scripts/t27c-mutation-casts.mjs: a recorder in the shape of tri-help-casts.mjs (its bareEnv): staged prompt and typing, real output at the time it printed; refuses a recording whose baseline is not all green, whose mutant does not fail exactly the named test, whose diff is not one line, or whose spec hash differs after git checkout; writes session.cast, meta.json, index.html, card.png and relists public/term/index.html",
    "public/term/t27c-gft-{smul,sadd,signed-mac,relu,exp2,argmax4,nll,sgd-step,xornet}: real asciicast v2 recordings replace the placeholders; meta.json has no pending field, gif is null because no GIF encoder was used, desc names t27c 0.5.1, zig 0.16.0, a Claude Code cloud container and t27 72f793357",
    "specs/course/ai-numbers.t27 and i18n/ai-numbers.ru.json: the nine lesson texts no longer say the recording waits on t27#7400; they describe t27c test-report, the sed line, the second report, git checkout and sha256sum, keeping every other fact",
    "specs/widgets/gallery.t27: the nine widget hooks describe the recordings instead of the placeholder",
    "Regenerated with the repo's generators: widgets-from-spec, course-from-spec, course-pages (18 lesson cards redrawn, EN and RU)",
    "scripts/t27c-mutation-casts.test.mjs, added to npm run test:course: the committed casts show exactly the named test failing and the spec hash restored",
    "src/data/blog/bodies/two-courses-twenty-seven-lessons-each.ts: a dated update paragraph (EN and RU) says the recordings exist now and how they were made; the original paragraph is kept"
  ],
  "tests": [
    {
      "command": "t27c test-report specs/ternary/<spec>.t27, then sed -i <mutation>, then t27c test-report again, for all nine specs, by hand before recording",
      "status": "passed",
      "result": "baseline all pass, none vacuous; the mutants fail exactly m2, a2, pp, negz, em1, tie_low, perfect, ascend, x00",
      "evidence": "t27c 0.5.1, zig 0.16.0, clean worktree of gHashTag/t27 at 72f793357; the same runs are in public/term/t27c-gft-*/session.cast"
    },
    {
      "command": "node scripts/t27c-mutation-casts.mjs --t27 <clean t27 worktree> --t27c <t27c> --zig <zig>",
      "status": "passed",
      "result": "wrote 9 recordings, none refused; the t27 checkout was clean before and after every one",
      "evidence": "public/term/t27c-gft-*/meta.json (exit codes all 0, recorded 2026-10-09)"
    },
    {
      "command": "npm run test:course",
      "status": "passed",
      "result": "40 of 40 tests pass, 13 of them in the new t27c-mutation-casts.test.mjs",
      "evidence": "local run at this head"
    },
    {
      "command": "every step of .github/workflows/website-checks.yml (checks job), one command at a time",
      "status": "failed",
      "result": "63 of 65 steps pass; Queen viewport matrix and Queen touch contract fail with sectors=0 because the Queen board's live data is not reachable from this container",
      "evidence": "On origin/main a0d149e7 (a clean worktree, same container) both fail identically: Queen viewport matrix with the same 18 size/view combinations, Queen touch contract with sectors 0/6. Logs: local runner, steps 57 and 63."
    },
    {
      "command": "npm run check:course && npm run check:course-pages && npm run check:widgets && npm run check:widget-pages",
      "status": "passed",
      "result": "all up to date after regeneration; 392 pages, 392 cards, 194 widgets",
      "evidence": "local run at this head; part of the 63 passing steps"
    }
  ],
  "limitations": [
    "gHashTag/t27#7400 stays blocked; the recordings use t27c test-report, which still exits 0 when a test fails (t27#7370), so each verdict is read from the report text and the recorder checks that text",
    "The recordings were made in a Claude Code cloud container, not on the t27c lab machine that made the earlier casts; t27c 0.5.1 was built from a recent tree, its exact commit is not recorded",
    "No GIF: gif is null and the gallery links the card; there is no session.gif",
    "The blog post tri-test-now-runs-the-tests still says the nine lessons wait on #7400; it is left as written on its date",
    "Queen viewport matrix and Queen touch contract were not green locally, on this branch or on origin/main; they need the Queen's live data"
  ],
  "tags": [
    "courses",
    "recordings",
    "mutation",
    "ternary"
  ],
  "blog": {
    "title": "Nine lessons get their recordings without waiting for tri mutate plant",
    "summary": "Lessons 13 to 21 of the AI numbers course were placeholders waiting on a blocked PR; they now show t27c test-report passing, one planted bug failing exactly one named test, and git restoring the spec byte for byte.",
    "outline": [
      "The problem: nine lessons said their recording waited on tri test and tri mutate plant from t27#7400, and #7400 is blocked, so the lessons showed no run at all.",
      "How it works: the recordings use t27c test-report directly, one sed line per lesson and git checkout, and a recorder that refuses any run whose mutant does not fail exactly the named test.",
      "The boundary: t27c test-report still exits 0 on a failure, the recordings come from a cloud container rather than the lab, and there is no GIF."
    ],
    "cast": "term/t27c-gft-relu/session.cast",
    "reproduce": [
      "t27c test-report specs/ternary/gft_relu.t27",
      "sed -i 's/== 1) { return 0; }/== 1) { return x; }/' specs/ternary/gft_relu.t27 && t27c test-report specs/ternary/gft_relu.t27",
      "git checkout specs/ternary/gft_relu.t27 && sha256sum specs/ternary/gft_relu.t27"
    ]
  }
}

🤖 Generated with Claude Code

https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k


Generated by Claude Code

claude added 2 commits October 9, 2026 08:51
…nd a one-line sed

The nine gft lessons (gft_smul, gft_sadd, gft_signed_mac, gft_relu, gft_exp2,
gft_argmax4, gft_nll, gft_sgd_step, gft_xornet) said their recordings waited
on tri test and tri mutate plant from gHashTag/t27#7400, which is blocked.
They are now recorded the way t27c-gfternary was: t27c test-report on the
spec (every test passes, none vacuous), one sed line, t27c test-report again
(exactly the test the lesson names fails), then git checkout and sha256sum
(the same hash as before the edit).

Recorded with t27c 0.5.1 and zig 0.16.0 in a Claude Code cloud container,
from a clean worktree of gHashTag/t27 at 72f793357. Every lesson's claim
reproduced: m2, a2, pp, negz, em1, tie_low, perfect, ascend, x00.

- scripts/t27c-mutation-casts.mjs: the recorder. bareEnv from
  tri-help-casts.mjs; staged prompt and typing, real output at the time it
  printed; refuses a recording whose baseline is not all green, whose mutant
  does not fail exactly the named test, whose diff is not one line, or whose
  hash differs after git checkout. Writes session.cast, meta.json,
  index.html, card.png (headless Chromium) and relists public/term/index.html.
  No GIF encoder: "gif": null, and the gallery links the card.
- scripts/t27c-mutation-casts.test.mjs (in test:course): the committed casts
  show exactly the named test failing and the hash restored.
- Lesson texts (EN spec and RU bundle) describe the recording that exists;
  gallery hooks replace the placeholder words; course, widgets and lesson
  pages and cards regenerated with the repo's own generators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
The post said the nine gft recordings waited on gHashTag/t27#7400. They
exist now without it: one paragraph in English and one in Russian says
how they were made (t27c test-report, one sed line, t27c test-report,
git checkout and sha256sum), where (t27c 0.5.1, zig 0.16.0, a Claude Code
cloud container, t27 at 72f793357), and that t27c test-report still exits
0 on a failing test (t27#7370), so each verdict is read from the report.
The original paragraph stays as it was written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

X Brain Health Check

Score: 100.0/100
Status: 🟢 HEALTHY
Threshold: 80/100

X Brain is above merge threshold

@github-actions github-actions Bot added the status:in-progress 🔵 Agent working label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🧪 Brain Stress Test Results

Tests: 261/261 passed, 0 leaked
Status: 🟢 PASS
Gate: every test in zig build test-brain-stress passes and none leaks

@gHashTag
gHashTag marked this pull request as ready for review October 9, 2026 14:19
@gHashTag
gHashTag merged commit 2af816a into main Oct 9, 2026
31 checks passed
@github-actions github-actions Bot added status:completed Done and removed status:in-progress 🔵 Agent working labels Oct 9, 2026
github-actions Bot added a commit that referenced this pull request Oct 9, 2026
feat(course): record AI numbers lessons 13-21 with t27c test-report and a one-line sed (#1571)

The nine "recording pending" placeholders in the AI numbers course, lessons 13-21 (public/term/t27c-gft-*), are now real t27c recordings. Each one runs `t27c test-report` on the spec (all green, none vacuous), applies a one-line `sed` mutation, runs `test-report` again so the lesson's named test turns red, then restores the file with `git checkout` and re-checks its sha256.

- scripts/t27c-mutation-casts.mjs records each cast and refuses to write one if the base is not fully green, the mutant fails a test other than the named one, the diff is more than one line, or the restored hash differs.
- The lesson texts (specs/course/ai-numbers.t27, the RU bundle, the gallery hooks) describe the commands each recording runs instead of waiting on t27#7400; widgets, course and lesson pages regenerated with the repo's generators.
- The mutation-casts test is wired into `npm run test:course` (40/40). A dated paragraph is added to the two-courses post, as the course_post rule requires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
gHashTag added a commit that referenced this pull request Oct 9, 2026
Brings in #1571 (AI numbers lessons 13-21 recorded). Conflicts resolved:

- specs/widgets/gallery.t27: kept the PR's jtag-verdict entry in every
  array and applied main's nine WIDGET_HOOKS changes by widget id; no other
  array changed on main.
- public/widgets/gallery.t27, src/lib/queenWidgets.generated.ts,
  src/lib/course.generated.ts: regenerated with widgets-from-spec.mjs and
  course-from-spec.mjs.
- public/term/index.html: regenerated with t27c-mutation-casts.mjs
  --index-only, so main's nine recordings and tri-fpga-jtag-ir are all
  listed (105 recordings).

check:widgets, check:course, check:widget-pages, check:course-pages,
test:course (40/40), test:widgets-spec and test:widget-pages pass locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants