Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ When requirements conflict, follow `docs/PRD.md`, then document the conflict and

When acting as a learner's tutor:

- Treat lesson Markdown as the canonical explanation. Direct the learner to its definitions,
worked example, and recap before supplementing it.
- Be the primary adaptive teacher for tutor-led courses. Initiate the active checkpoint in chat;
use the browser as the explorable, evidence, and progress surface.
- Treat lesson Markdown as the canonical subject record. Teach from it conversationally and direct
the learner to the browser's reference notes for durable definitions, worked examples, and recap.
- Check only the prerequisite vocabulary needed for the active checkpoint. Explain a missing term
briefly, then return to the lesson; do not make chat the only source of a core concept.
- Ask the learner to predict before revealing outcomes.
- Ask the learner to predict in chat before revealing outcomes.
- Direct them to manipulate the explorable.
- Inspect `data-explorables-*` and `data-tutor-*` browser state when available so the conversation
stays aligned with the active lesson and checkpoint.
- Give the smallest useful hint first.
- Do not implement the central exercise for them before an attempt.
- Do not reveal reference solutions.
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ All notable changes to `explorables` are documented here.

### Added

- Opt-in `teaching.mode: tutor-led` presentation: the coding-agent conversation leads the live
lesson while the browser defaults to checkpoint, explorable, evidence, exercise, and collapsed
reference notes. Stable `data-tutor-*` state keeps host inspection provider-neutral.
- Two beginner lessons before the learning loop: `Generative AI and language models` and `The
next-token loop`, each with a deterministic accessible explorable and guided discovery cycle.
- ADR 0011 and a reviewed beginner-curriculum research note covering the supplied sources and their
relevant linked learning paths.
- Shared explorable list padding that keeps ordered markers inside panel borders at narrow widths.
- A learner-facing course overview route compiled from `COURSE.md`, with audience, prerequisites,
estimated effort, lesson count, and browser-local Start/Resume behavior before Lesson 1.
- Contextual discovery checkpoint controls that preserve definition → prediction → explorable →
Expand All @@ -28,6 +36,11 @@ All notable changes to `explorables` are documented here.

### Changed

- `AI from First Principles` is versioned as `0.6.0-tutor-led.1`, now contains sixteen lessons, and
uses Codex/Claude conversation as the primary teaching surface. Its browser-progress namespace is
intentionally fresh; earlier local progress remains untouched under its prior course version.
- Scaffolded courses now opt into tutor-led delivery while existing courses without `teaching`
retain browser-led full-lesson rendering.
- `AI from First Principles` is versioned as `0.5.0-onboarding.1`, now contains fourteen lessons,
and explicitly supports technical learners with no prior machine-learning or calculus knowledge.
The new course version intentionally creates a fresh browser-progress namespace while leaving
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

`explorables` is an Agent Plugins v1-compatible open course format and local runtime for technical
learning through explanatory Markdown, sandboxed TypeScript interactions, real exercises, and a
coding-agent tutor. The lesson prose is the canonical source for definitions and mechanisms; the
tutor adapts and reinforces it. A course is a normal folder. It needs no account, database,
analytics, hosted executor, or LMS.
coding-agent tutor. In tutor-led courses the coding agent is the primary adaptive teacher and the
browser is the explorable, evidence, and progress workbench; complete Markdown remains available as
the durable reference. A course is a normal folder. It needs no account, database, analytics,
hosted executor, or LMS.

The reference course is [AI from First Principles](examples/ai-from-first-principles). Its current
fourteen-lesson foundation begins with a plain-language learning loop, then builds from gradients
and linear layers through a trained tiny Transformer, cached autoregressive generation, sampling,
and claim-aligned evaluation.
sixteen-lesson foundation begins by distinguishing generative AI, LLMs, and chatbot products,
steps through next-token generation and the learning loop, then builds from gradients and linear
layers through a trained tiny Transformer, cached autoregressive generation, sampling, and
claim-aligned evaluation.

The accepted [model-learning roadmap](docs/course-roadmap.md) continues through `Open Frontier Models: Shared Techniques`, then separate `Inside DeepSeek`, `Inside Kimi`, `Inside Qwen`, `Inside MiniMax`, and `Inside GLM` courses. Each model course uses pinned primary sources and a controlled reconstruction rather than treating one umbrella survey as a substitute for studying the lab.

Expand Down
64 changes: 64 additions & 0 deletions apps/dev-preview/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,66 @@ pre {
background: var(--sage);
}

.compact-session {
margin: 0 0 1rem;
border-bottom: 1px solid var(--border);
}

.compact-session > summary,
.lesson-reference-notes > summary {
min-height: 2.75rem;
padding: 0.65rem 0;
color: var(--muted);
cursor: pointer;
font-weight: 700;
}

.compact-session .course-session-panel {
margin-top: 0;
}

.tutor-led-lesson-body {
display: grid;
gap: 1.25rem;
}

.tutor-handoff {
padding: clamp(1rem, 3vw, 1.35rem);
border: 1px solid var(--border-strong);
border-radius: var(--radius-md);
background: var(--blue);
}

.tutor-handoff .eyebrow,
.tutor-handoff h2,
.tutor-handoff p:last-child {
margin-top: 0;
}

.tutor-handoff h2 {
margin-bottom: 0.55rem;
font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.tutor-handoff p:last-child {
margin-bottom: 0;
}

.lesson-reference-notes {
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px solid var(--border);
}

.lesson-reference-notes > p {
color: var(--muted);
font-size: 0.9rem;
}

.lesson-reference-notes .lesson-fragment {
padding-top: 0.5rem;
}

.checkpoint-heading {
display: flex;
align-items: start;
Expand Down Expand Up @@ -1128,6 +1188,10 @@ pre {
background: var(--sage);
}

.tutor-led-lesson-body .checkpoint-control {
margin: 0;
}

.checkpoint-control-experiment {
background: var(--blue);
}
Expand Down
77 changes: 64 additions & 13 deletions docs/PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,17 @@ The intended desktop experience is:
└───────────────────────────┴────────────────────────────────────┘
```

The browser or preview pane is the primary reading and interaction surface. The coding-agent workspace is the primary tutoring and implementation surface.
For a tutor-led course, the coding-agent conversation is the primary teaching surface and the
browser or preview pane is the primary activity surface. The agent initiates the active checkpoint,
adapts explanations, asks questions, and helps debug. The browser presents the current task,
explorable, evidence, and progress. Complete lesson Markdown remains available there as reference
notes and remains readable on GitHub.

This is also a content boundary. Definitions, prerequisite bridges, notation, worked explanations,
and exercise context belong in the lesson Markdown rendered in the browser. The coding agent may
adapt, question, restate, and clarify that material, but a course must not depend on chat as the
only place where a learner can obtain the foundational explanation.
and exercise context belong in lesson Markdown as the durable subject record. In tutor-led mode the
agent teaches from that record conversationally; the browser keeps it behind an explicit reference
control so it does not compete with the live tutor. A course must not depend on a conversation
transcript as its only durable explanation.

## 6.3 Typical lesson flow

Expand Down Expand Up @@ -604,8 +609,9 @@ This repository contains an interactive course.
## Tutoring behaviour

- Teach through questions, prediction, inspection, and debugging.
- Treat lesson Markdown as the canonical explanation. Point to its definitions, worked example,
and recap before supplementing it.
- In tutor-led courses, act as the primary adaptive teacher and initiate the active checkpoint in
conversation. Teach from the canonical lesson Markdown and use the browser for interaction,
evidence, progress, and optional reference notes.
- Check only the prerequisite vocabulary needed for the active checkpoint. Explain a missing term
briefly, return to the lesson, and do not make chat the only source of a core concept.
- Do not complete the central exercise implementation for the learner.
Expand Down Expand Up @@ -749,6 +755,25 @@ By the end of the course, you should be able to:
| `language` | BCP-47 string |
| `tags` | string array |

### Optional teaching profile

A course may declare:

```yaml
teaching:
mode: tutor-led
```

`tutor-led` makes the coding-agent conversation the live teaching surface. The browser defaults to
the active checkpoint, explorable, evidence, and exercise, while complete lesson prose remains
available through an accessible reference-notes disclosure. Omitting the profile preserves the
ordinary browser-led rendering used by existing and standalone courses.

The runtime exposes read-only `data-explorables-*` and `data-tutor-*` attributes for the visible
lesson, Guided position, active checkpoint, checkpoint phase, mode, and persistence status. These
attributes contain no solutions or hidden assessment data and cannot complete progress. They are a
host-neutral inspection contract, not a private Codex or Claude bridge.

---

# 9. Lesson Markdown specification
Expand All @@ -757,9 +782,10 @@ By the end of the course, you should be able to:

A lesson must be useful as plain Markdown.

Lesson Markdown is the canonical teaching material, not an outline that requires a coding agent to
supply the missing lecture. The runtime adds interactivity and the tutor adds adaptation, but the
durable explanation remains reviewable in the course repository.
Lesson Markdown is the canonical durable subject record, not a loose outline or a hidden answer
key. In tutor-led courses the coding agent is expected to teach from it rather than asking the
learner to read a browser lecture first. The complete explanation remains reviewable in the course
repository and in optional browser reference notes.

The runtime adds interactivity, but the source should still communicate:

Expand Down Expand Up @@ -1197,7 +1223,9 @@ The `explorables` runtime performs only the following:
12. Present a course overview from `COURSE.md` before Lesson 1 and place discovery controls in their
instructional context.

It does not teach the subject itself. The course content and Codex instructions do that.
It does not generate subject explanations itself. In tutor-led mode the coding agent teaches from
the course-authored Markdown; the runtime scopes that conversation and supplies the activity,
reference, evidence, and progress surfaces.

## 13.2 Runtime component diagram

Expand Down Expand Up @@ -1517,8 +1545,9 @@ When asked to start the course, Codex should:
2. Verify dependencies.
3. Run `pnpm course`.
4. Open the local URL in the built-in browser.
5. Introduce the first lesson.
6. Ask the learner to interact with the page rather than summarising the entire course.
5. Inspect the visible lesson and checkpoint state and introduce that checkpoint in conversation.
6. Teach the minimum prerequisite concepts, ask for a prediction, then direct the learner to use
the browser activity and report its evidence.
7. Move into exercise files only when referenced by the current lesson.

Codex may activate the portable `start-course` skill or use `AGENTS.md` directly. Both paths must produce the same course behavior.
Expand Down Expand Up @@ -2140,6 +2169,23 @@ By completion, a learner should be able to:

## 20.4 Proposed modules

### Beginner runway — What generative AI and LLMs do

Topics:

- AI, machine learning, and generative AI as overlapping but distinct terms
- Language models versus chatbot product systems
- Tokens, context, and next-token probability distributions
- Autoregressive generation as repeated prediction, selection, and append
- Model output versus decoding policy
- The limits of a tiny architectural explanation: data, scale, post-training, evaluation, tools,
retrieval, and product policy

Explorables:

- Classify rule-based, learned, generative, language-model, and product-system examples
- Step through a deterministic next-token loop before inspecting how its probabilities are learned

### Module 0 — Learning with LLMs without outsourcing understanding

Topics:
Expand Down Expand Up @@ -2730,6 +2776,8 @@ See how it works. Build it yourself.
explanation-based recap.
- [ ] The reference course begins with a plain-language learning-loop orientation before gradient
descent or other mathematical machinery.
- [ ] Before the learning loop, a beginner can distinguish AI, machine learning, generative AI, an
LLM, and a chatbot product, then trace one autoregressive next-token step.
- [ ] At least five target learners complete two lessons.
- [ ] Setup failures and authoring friction are documented.
- [ ] Feedback informs the v1 format before the full course is produced.
Expand All @@ -2748,7 +2796,10 @@ A learner clones the course, opens it in Codex or Claude Code Desktop, and says:

> Start the course.

The coding-agent host handles guidance, code, files, tests, and discussion. The built-in browser or preview pane handles explanations, graphics, simulations, and interaction. The repository remains the source of truth. The same repository also publishes a basic static landing page at `explorables.ai`.
The coding-agent host handles teaching, guidance, code, files, tests, and discussion. In tutor-led
mode the built-in browser or preview pane handles activity prompts, reference notes, graphics,
simulations, evidence, and progress. The repository remains the source of truth. The same
repository also publishes a basic static landing page at `explorables.ai`.

The first course, *AI from First Principles*, takes software developers from basic machine-learning concepts through transformers, open-weight models, evaluation, fine-tuning, agents, and a practical route toward AI engineering or open-source contribution.

Expand Down
17 changes: 16 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ or Resume destination; it does not create a second progress store.

Raw HTML, event attributes, script URLs, and unknown directives are not passed through. Source file and AST position follow every typed directive so build and runtime errors identify the authoring location.

## Tutor-led presentation

`teaching.mode: tutor-led` changes presentation, not the course source format. The runtime splits
the already sanitised lesson around its existing explorable and exercise placeholders. It renders a
compact tutor handoff, the active checkpoint control, the explorable, evidence, and exercise as the
default activity surface. The remaining introduction, worked explanation, and recap stay available
inside an accessible reference-notes disclosure. Explore mode intentionally renders the complete
lesson for self-directed review.

The lesson root exposes course/version, teaching mode, visible lesson, Guided position, active
checkpoint, mode, and persistence through read-only `data-explorables-*` attributes. The handoff
adds `data-tutor-*` lesson, checkpoint, and phase fields. A coding-agent host may inspect these
values and teach from the corresponding Markdown. No runtime package invokes a private host API,
transmits a conversation, or accepts chat claims as checkpoint evidence.

## Explorable compilation and sandbox

The CLI owns esbuild options. A course supplies an entry `.ts` module and JSON configuration, never executable Vite configuration. The result is embedded in an iframe `srcdoc` with `sandbox="allow-scripts"`; `allow-same-origin` is not granted.
Expand Down Expand Up @@ -86,7 +101,7 @@ The visible session panel is the host-neutral continuity surface. The lesson roo

Each distributable course root is an Agent Plugins v1 package. Root `plugin.json` declares portable identity and `skills/start-course/SKILL.md` is the single portable component. The skill locates the course root, reads `AGENTS.md` and `COURSE.md`, starts `pnpm course`, and then follows the active lesson. No MCP server is needed because the existing CLI and local files supply the workflow without another process or permission surface.

`AGENTS.md` remains the canonical host-neutral tutoring policy. Codex can read it directly or activate the portable skill. Claude Code Desktop retains a thin `CLAUDE.md` adapter and the officially supported `.claude/launch.json` preview configuration. Both open localhost, read the same files, and run the same tests. No runtime package calls private host APIs.
`AGENTS.md` remains the canonical host-neutral tutoring policy. Codex can read it directly or activate the portable skill. Claude Code Desktop retains a thin `CLAUDE.md` adapter and the officially supported `.claude/launch.json` preview configuration. Both open localhost, inspect the same active-state attributes, teach from the same Markdown, and run the same tests. No runtime package calls private host APIs.

## Local course collections

Expand Down
34 changes: 29 additions & 5 deletions docs/course-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ audience:
prerequisites:
- basic programming and arithmetic
estimatedHours: 3
teaching:
mode: tutor-led
---

# Systems Course
Expand All @@ -65,6 +67,28 @@ Opening a course renders this introduction, the declared audience and prerequisi
time, and lesson count before entering Lesson 1. Keep the orientation useful in plain Markdown;
do not move the course promise or essential setup into tutor instructions.

### Optional tutor-led teaching

Set `teaching.mode: tutor-led` when the course is designed for a coding agent to be the primary
adaptive teacher:

```yaml
teaching:
mode: tutor-led
```

In Guided mode the browser then defaults to the current checkpoint, explorable, evidence, and
exercise. The complete lesson explanation remains available through **Open lesson reference notes**
and in the Markdown source. Existing courses that omit `teaching` keep browser-led full-lesson
rendering. Explore mode also shows the full lesson because the learner has explicitly chosen
self-directed browsing.

For tutor-led courses, `AGENTS.md` should require the host to inspect `data-explorables-*` and
`data-tutor-*` state when possible, initiate the active checkpoint in conversation, check only the
needed vocabulary, ask for a prediction, direct manipulation, and ask the learner to report and
explain evidence. Do not copy subject prose into host adapters; they remain policy, not a second
course.

### Optional guided course mode

Add `guidance` to `COURSE.md` to opt in:
Expand Down Expand Up @@ -150,11 +174,11 @@ Resume is scoped to the course ID/version, browser profile, and web origin. Keep

## 4. Write a lesson

Lessons should remain useful on GitHub. The lesson Markdown is the canonical teaching material, not
an outline that depends on a coding agent to supply the missing lecture. A learner should be able to
identify the important terms, follow a concrete example, and understand the explorable's result by
reading the lesson without opening chat. The tutor then diagnoses missing prerequisites, asks
questions, gives hints, and helps the learner connect that material to code and tests.
Lessons should remain useful on GitHub. The lesson Markdown is the canonical durable subject
record, not a loose outline that forces the tutor to invent the course. It should define important
terms, include a concrete example, explain the explorable's result, and state failure boundaries.
In a tutor-led course the coding agent teaches that material conversationally; the browser keeps it
as optional reference notes while prioritising the active task and interaction.

A strong sequence is encounter, predict, manipulate, inspect, explain, implement, debug, and
transfer. “Encounter before explaining” means delaying the full mechanism until the learner has a
Expand Down
Loading