Skip to content

companion: learner's codex capability (v0.3.0) - #23

Merged
tohuw merged 9 commits into
masterfrom
companion/learners-codex
Jul 22, 2026
Merged

companion: learner's codex capability (v0.3.0)#23
tohuw merged 9 commits into
masterfrom
companion/learners-codex

Conversation

@tohuw

@tohuw tohuw commented Jul 22, 2026

Copy link
Copy Markdown
Owner

What this adds

A new learner's codex capability on the companion module (v0.2.1 →
0.3.0): a facet of the player companion that, on request, builds a new
player a single self-contained HTML page teaching their own character
and their turn
. It's the answer to the most common new-player question
a companion gets — "wait, what can I even do?" — as a page they keep and
glance at, instead of a stalled table.

It grew out of a real second-session need and was iterated with the
player before generalizing; this PR is the campaign-agnostic version
(Warden / Sunken City fixtures only).

Conduct — same rule, new surface

The codex runs under the module's standing doctrine — possible and
true, never better
. It teaches the game and lays out the option
landscape; it never optimizes the build, ranks the spells, or names the
best turn. Telling a new player a rule exists (they have a reaction
every round; Help hands an ally advantage) is correcting ignorance, which
is in scope and is most of the value.

Two safety properties are kept off agent judgment:

  • Accuracy. Every number comes from the player's own character sheet.
    Fabrication is forbidden; an unclear value is surfaced and sent to the
    DM, never guessed onto a reference the player will trust in play.
  • Firewall. Context and links come only from the player projection, so
    a thing the wiki doesn't hold reads as undiscovered, not leaked. World
    terms link into the published site (only pages that exist); rules terms
    are explained in place, never off-site — bouncing a new player off
    their sheet to an external glossary is worse than a one-line popover.

Files

  • templates/learners-codex.md — the capability spec: sources +
    accuracy rule, the page's sections, the linking discipline, the two
    interactions, and a curated "what new players miss" library (the part an
    agent won't assemble unaided), with a class-economy hook so it adapts
    per class.
  • templates/learners-codex.skeleton.html — reference
    implementation: identity + labeled status strip, a stat bar with inline
    explainers, a numbered turn, an action menu that marks universal vs.
    class
    actions (so a player learns their tablemates' options too), a
    reactions box, ability cards that visually surface the rider effects
    beginners skip, cross-reference flash and glossary popovers,
    theme-aware, prefers-reduced-motion safe, keyboard-reachable, print-ok.
    Deliberately a non-caster (Rogue) example, to show the layout
    generalizes past the class it started on.
  • templates/player-companion.md — advertises the capability under
    the same rule.
  • PATTERN.md — procedure step, a decision point (default: offered
    on request, not pushed
    ), and a verify bullet.
  • verify/run.py — expected template set extended to five; four new
    floor checks (never-optimizes-the-build, never-fabricate-a-number,
    projection-scoped/explained-in-place, companion advertises it).

Verify

uv run modules/companion/verify/run.py → all checks pass (20/20,
including the four new ones). module.yaml parses (v0.3.0); PATTERN.md
keeps all four parts with every decision point defaulted; skeleton tag
balance clean.

Not claimed / follow-up

Conduct compatibility is left as-is — the never-better doctrine is already
verified for Claude (2026-07-19). The codex is largely a build-time
artifact, but it does extend the behavioral claim to a new surface, so per
CONTRACT a codex-specific adversarial vector (e.g. "just tell me the
best spells to put on the page") belongs in conduct-acceptance.md before
any codex conduct is marked verified. Flagging as follow-up rather than
slipping an unverified claim in. ChatGPT remains unverified as before.

tohuw and others added 9 commits July 21, 2026 21:32
A player-companion facet that builds a new player a single self-contained
HTML page teaching their own character and their turn — so "wait, what
can I even do?" gets a page instead of a stalled table.

Runs under the module's standing rule: it teaches what is possible and
true and lays out the option landscape, and never optimizes the build,
ranks spells, or names the best turn. Numbers come only from the player's
own character sheet (never fabricated; unclear values go to the DM);
context and links come from the player projection (firewall-scoped, so a
missing thing is undiscovered, not leaked). World terms link into the
published site; rules terms are explained in place, never off-site.

- templates/learners-codex.md — the capability spec + the "what new
  players miss" library, campaign-agnostic (Warden / Sunken City fixtures)
- templates/learners-codex.skeleton.html — reference implementation:
  labeled status, stat bar, numbered turn, universal-vs-class action
  badges, a reactions box, ability cards that surface rider effects,
  cross-reference flash + glossary popovers, theme-aware, reduced-motion
  safe, accessible; a non-caster (Rogue) example to show it generalizes
- player-companion.md advertises the capability under the same rule
- PATTERN.md: procedure step, decision point (default: offered, not
  pushed), verify bullet
- verify/run.py: expected template set extended; four new floor checks
  (never-optimizes, never-fabricates, projection-scoped/in-place,
  companion advertises it) — all pass

Conduct unchanged (the never-better doctrine already verified for Claude
2026-07-19); a codex-specific adversarial vector is noted in the PR as
follow-up rather than claimed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two CSS cascade bugs in learners-codex.skeleton.html, both visible in a
generated codex:

- Numbered turn steps: the <li> is a 2-column grid but has three children
  (the ::before number, .term, .def), so auto-placement dropped .def into
  the narrow first column and it wrapped one word per line. Pin .term/.def
  to column 2.
- Glossary popovers inherited text-transform:uppercase and letter-spacing
  from an uppercase label ancestor (e.g. a stat label), rendering the tip
  text in all caps. Reset both on .gl-pop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Small clarity tweak in the skeleton disclaimer to match the reference
codex; also keeps the skeleton generic ("character sheet", not a vendor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… drop the-catch accordion, meaningful advice overlines

- responsive: rem-based max-width + root font-size steps at 1728/2160/2880px
  so it stops being an eye-chart on 4k without enlarging normal screens
- cross-reference flash now pulses 3x instead of once
- 'The catch' is a plain note, not a disclosure
- advice-box top borders carry a consistent, legended meaning
  (green = an edge you have, red = a way to get hurt, neutral = a rule)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The source tag (WARLOCK CANTRIP, PACT OF THE BLADE...) was nowrap in a
flex row and bled past the card edge on longer labels. Make it a wrapping
kicker above the title instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Identity pills read as interactive but did nothing. Now each chip either
links to its wiki page or carries a glossary popover (solid underline =
link, dotted = hover-for-info). Codified in the spec so no codex ships an
inert pill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…AI Codex vendor-name collision in floor); bump index cell to 0.3.0

The floor's compatibility guard flags 'codex' as a vendor word (OpenAI Codex).
Rename the capability to 'learner's primer' so the guard stays intact and the
name is unambiguous. Pure nomenclature — behavior/conduct/firewall unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tohuw
tohuw merged commit 90e3ada into master Jul 22, 2026
3 of 4 checks passed
@tohuw
tohuw deleted the companion/learners-codex branch July 22, 2026 02:12
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