Suggested Episode Plan

This document breaks the phases of PHASES.md into a series of suggested episodes. It is a plan, not a queue: episodes are dispatched by copying the template (01-episode-template.md) into the next free number and filling in EPISODE-TASKS and EPISODE-OUTPUT at dispatch time (see prompts/how-to-write-episodes.md §7 — sub-tasks are drafted by the model and ratified by the human).

Rules followed:

Phase order is a dependency: each phase’s episodes are dispatched only after the previous phase’s milestone is met. Within a phase, episodes may be reordered by the human.

Phase 1 — Research

Episode 1-A — Compare candidates to C and synthesize

EPISODE-GOAL

Run the C-comparison study series: five concurrent studies — C3, Odin, Hare, Val, Cake, each compared to C against the common criteria — then a synthesis task that selects the ideas to use and the ideas to avoid, to inform the language specification.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-TASKS

EPISODE-FILES

The survey work already committed (documents/08-related-work.md) is the starting evidence; the studies deepen it, and the synthesis folds the findings back into it. The candidate list is provisional — the synthesis may recommend dropping candidates, and the human decides.

Episode 1-B — Study the target environment

EPISODE-GOAL

Name the Linux kernel constraints Elseon must honor and the conformance corpus of C headers that exercise PFE ingestion.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 1-C — Study the LLVM toolchain

EPISODE-GOAL

Pin the LLVM toolchain approach: C API vs. C++ API, static vs. shared linking, version, and a CI-verifiable build.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 1-D — Research the OOP lessons

EPISODE-GOAL

Classify the OOP lessons (interfaces, facets/mixins as extension objects, nominal typing, RAII-like explicit scopes) as adopt or reject under the kernel test.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Phase 2 — Language specification

Episode 2-A — Write the language design document

EPISODE-GOAL

Turn the scaffolded documents/07-elseon-language.md into the complete design: philosophy, kernel test, syntax family, memory model, error handling, and the adopted OOP lessons.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 2-B — Write the feature files

EPISODE-GOAL

Complete the three feature files — 03-language-core.md, 04-c-header-ingestion.md, 05-llvm-backend.md — as stable requirements derived from the design document.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 2-C — Write the worked examples

EPISODE-GOAL

Write the worked example programs — a driver stub, a ring buffer, an allocator — to drive out the syntax and semantics of the specification.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 2-D — Write the conformance-test plan and adopt the tiers

EPISODE-GOAL

Write the conformance-test plan mapping every kernel-test guarantee to tests, and adopt the test tiers (portable, tool-gated, live-state) in the workflow.

EPISODE-ACCEPTANCE

EPISODE-FILES

Phase 3 — Toolchain scaffold

Episode 3-A — Create the elseon driver

EPISODE-GOAL

Create the elseon driver in sources/driver/: argument handling, file orchestration, and the compile-pipeline skeleton.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 3-B — Implement the lexer

EPISODE-GOAL

Implement the lexer for the C/JavaScript-shaped syntax family with conformance tests.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 3-C — Implement the parser

EPISODE-GOAL

Implement the parser to an AST with syntax error reporting and conformance tests.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 3-D — Pin the LLVM toolchain in CI

EPISODE-GOAL

Bring the phase-1 LLVM decision to life: pin the version and make the project CI-verifiable.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Phase 4 — C-header ingestion (PFE)

Episode 4-A — Choose and prove the ingestion mechanism

EPISODE-GOAL

Decide and implement the header-ingestion mechanism (libclang, clang AST dumps, or a dedicated C header parser) and ingest one minimal kernel header as a semantic module.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 4-B — First-class semantic modules

EPISODE-GOAL

Represent ingested C headers as first-class semantic modules (types, enums, structs, functions) consumable by the rest of the compiler.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 4-C — Ingest the conformance corpus

EPISODE-GOAL

Ingest the phase-1 conformance corpus and verify the guarantees hold across it.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Phase 5 — Semantic analysis and LLVM code generation

Episode 5-A — Semantic analysis

EPISODE-GOAL

Implement name resolution, nominal typing, facets, explicit scopes, and the spec’s error-handling model.

EPISODE-ACCEPTANCE

EPISODE-RISKS

EPISODE-FILES

Episode 5-B — LLVM IR lowering with deterministic layout

EPISODE-GOAL

Lower core constructs to LLVM IR honoring the spec’s deterministic memory layout.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 5-C — End-to-end conformance

EPISODE-GOAL

Compile the worked examples end-to-end to object files and link against C.

EPISODE-ACCEPTANCE

EPISODE-FILES

Phase 6 — Kernel bring-up

Episode 6-A — Kernel-adjacent subsystem in Elseon

EPISODE-GOAL

Compile a kernel-adjacent subsystem (the ring buffer or allocator from the worked examples) as real Elseon code against kernel headers via PFE.

EPISODE-ACCEPTANCE

EPISODE-FILES

Episode 6-B — Kernel-test audit

EPISODE-GOAL

Audit the compiled subsystem for no-GC, no-hidden-allocation, and no-hidden-control-flow, and record the result.

EPISODE-ACCEPTANCE

EPISODE-FILES