This file defines the checkpoint-based implementation plan for Code Koans.
The agent must work through these checkpoints in order.
Do not skip ahead unless explicitly instructed.
Each checkpoint should leave the app in a working, reviewable state.
Create the initial React/Vite application shell with routing and placeholder pages.
- React + TypeScript + Vite project
- React Router configured
- global layout/navigation
- placeholder pages:
- Home
- Vega landing
- Vega koan browser
- Vega koan page
- Profile
- app runs locally
- navigation works
- all listed routes render
- code structure is simple and readable
- real koan data
- Vega rendering
- validation
- persistence
- not started
Introduce a simple in-repo koan data structure for Vega.
Koantype definition- 2–3 sample Vega koans stored in code/files
- koan browser page renders koan list from data
- koan detail page loads based on route param
- koan list is data-driven
- each koan page shows the correct title/instructions
- missing/unknown koan IDs are handled clearly
- target chart rendering
- live editor
- validation
- not started
Render the target Vega chart for each koan.
- chart rendering component
- target chart displayed on koan page
- koan data includes target spec and dataset
- sample koans render a target chart correctly
- chart errors are surfaced visibly
- editable user spec
- live preview
- validation
- not started
Allow the user to edit a Vega spec and see a live preview.
- editor component
- user spec initialised from koan starting code
- live preview chart
- visible JSON/spec error handling
- user can edit the spec
- preview updates in response
- broken specs show clear errors
- submit/check logic
- completion tracking
- not started
Add a basic submit/check flow using temporary spec-based checks.
- submit/check button
- simple validator
- result panel showing passed/failed checks
- validation config attached to koan definitions
- user can submit the current solution
- checks run and display results
- validation logic is clearly separable from the UI
- output-based validation
- persistence
- not started
Track koan completion locally in the browser.
- local storage progress mechanism
- koan browser displays completion state
- completion survives refresh
- completed koans remain marked after refresh
- progress display is coherent on browser and koan pages
- server persistence
- user accounts
- not started
Make the Vega koan page feel coherent and usable.
- improved layout
- clearer distinction between target chart and user preview
- clearer instructions
- local draft persistence for the editable spec
- reset-to-starting-spec
- optional dataset viewer
- improved results panel
- koan page is easy to use
- in-progress spec edits survive refresh in the same browser
- user can recover from mistakes easily
- backend persistence
- advanced validation
- not started
Begin replacing spec-based validation with deterministic output-oriented validation.
- validation layer that inspects rendered result
- support for a few output-based checks such as:
- mark type
- mark count
- expected categories
- simple expected values/order
- at least one sample koan is validated by rendered outcome rather than spec shape
- validation logic remains understandable and testable
- full chart equivalence engine
- fuzzy visual matching
- LLM hints
- not started
Introduce minimal backend persistence using Cloudflare Workers, making the Worker the canonical source of persisted progress once available.
- Worker API endpoints
- Cloudflare D1-backed store for progress and submission attempts
- store/load progress with the Worker as the primary persisted record
- store submission attempts
- frontend persistence layer or service boundary so UI code does not directly manage separate local and Worker persistence paths
- local storage retained as fallback/cache behavior
- local development instructions using local Worker/D1 development rather than requiring deployed remote infrastructure
- app still runs locally
- app can be run and exercised locally with a local Worker/D1 setup
- progress can be persisted through Worker endpoints and read back as the canonical stored state
- the UI does not duplicate persistence logic across separate local-only and Worker-specific codepaths
- architecture stays simple
- backend draft-spec persistence
- full auth system
- analytics platform
- production hardening
- not started
Make the profile page useful.
- completed koan count
- attempt count
- per-koan status summary
- placeholder user identity if needed
- profile page shows coherent tracked data
- stats match actual recorded progress/attempts
- social features
- badges/gamification
- not started
Make it straightforward to add new Vega koans.
- documented koan schema
- koan validation rules
- clear example koan
- documented process for adding a new koan
- adding a koan is low-friction
- koan files remain readable
- CMS/admin UI
- completed
Ensure the structure can support future tracks such as Regex.
- explicit track/tool concept in routing/data
- Vega remains the only implemented track
- no unnecessary over-generalisation
- future
/regexroute shape is obvious - current implementation remains simple
- actual Regex implementation
- completed
Deploy the React app and Worker API as a single Cloudflare Worker-backed application.
checkpoint-13-worker-production-hosting
- Cloudflare Worker serves the Vite build output as static assets
/api/*requests are handled by the Worker- client-side routes use a single-page app fallback
- production deploy script
- local Worker development instructions
- generated Worker build output removed from source control if present
- app can be built and deployed to Cloudflare Workers
- deployed app serves static assets and API routes from the same Worker
- direct visits and refreshes work for client routes such as:
//vega/vega/koans/vega/koans/bar-chart-basics/profile
- existing local development flow still works
- deployment steps are documented clearly
- user authentication
- account-specific progress
- production auth hardening
- UI redesign
- completed
Prepare the backend data model for real user accounts and account-specific progress.
checkpoint-14-user-scoped-d1
- D1 migration for user/account tables
- D1 migration for user-scoped progress
- D1 migration for user-scoped submission attempts
- D1 migration for session storage if sessions will be owned by the app
- backend data-access helpers for user-scoped progress reads/writes
- temporary development user path only if needed to keep endpoints testable before login exists
- migrations apply locally
- migrations are safe to apply remotely
- backend progress logic is structured around an explicit user identity
- existing app behavior remains runnable during the transition
- old anonymous/global tables are not destructively removed until the replacement path is proven
- GitHub OAuth
- login UI
- local-to-account progress merge
- profile page redesign
- completed
Allow a user to sign in with GitHub and keep a server-backed session.
checkpoint-15-github-login
- GitHub OAuth login route
- GitHub OAuth callback route
- logout route
/api/meendpoint- secure HttpOnly session cookie
- user upsert logic in D1
- minimal signed-in/signed-out UI state
- documented required Cloudflare secrets
- user can start login from the app
- GitHub redirects back successfully
- app can identify the signed-in user after refresh
- logout clears the session
- unauthenticated API responses are clear and intentional
- secrets are not committed
- account progress sync
- social profile features
- password auth
- multi-provider auth
- completed
Make cross-device koan progress work for signed-in users.
checkpoint-16-account-progress-sync
- signed-in progress reads from D1 as the canonical source
- signed-in submissions write to D1
- anonymous users retain local storage fallback behavior
- frontend persistence boundary handles authenticated, anonymous, cached, and failed states clearly
- optional local progress merge after first login
- koan browser and koan page use the canonical progress snapshot when available
- completing a koan while signed in persists to D1
- the same account sees completion on another browser/device
- anonymous usage still works without login
- local storage remains a cache/fallback rather than a competing canonical store
- UI does not duplicate separate local-only and Worker-specific persistence logic
- backend draft-spec persistence
- advanced conflict resolution
- analytics
- gamification
- completed
Make the production account and deployment flow coherent enough to run publicly.
checkpoint-17-production-polish
- profile page reflects the signed-in account and real account progress
- clear signed-out state
- tighter API error responses
- same-origin API assumptions reviewed and CORS simplified where appropriate
- production smoke-test checklist
- deployment, migration, and secret-management documentation
- profile page shows real account identity and stats when signed in
- profile page is useful and clear when signed out
- production deploy steps can be followed from the repo docs
- Worker/D1 migration workflow is documented
- no unrelated UI redesign is mixed into production hardening
- advanced user settings
- admin tools
- analytics platform
- full visual redesign
- completed
Replace the early rendered-summary validation path with a reusable scenegraph extraction layer.
vega-validation-engine
- validation-only Vega render helper
- normalized scenegraph item extraction
- scenegraph-oriented checks:
markCountmarkTypedatumFieldValuesrelativePositionrelativeSize
bar-chart-basicsmigrated to scenegraph checks- validation fixtures for passing and failing bar chart submissions
- a visually correct alternative solution for
bar-chart-basicspasses - wrong mark type fails
- missing category fails
- wrong category order fails when order matters
- wrong relative bar heights fail
- validation failures remain readable
- existing spec-shape checks continue to work for older koans
- dataflow checks
- semantic chart helper APIs
- line, area, facet, or interaction checks
- pixel comparison
- LLM-assisted evaluation
- completed
Validate named Vega datasets and simple runtime signals from the running validation view.
vega-validation-engine
- learner-defined Vega data blocks preserved alongside the injected koan dataset
- runtime data extraction from validation renders
- runtime signal extraction from validation renders
- dataflow-oriented checks:
dataRowCountdataFieldValuesdataFieldOrdersignalValue
- transform-focused fixture tests
- one koan using dataflow checks
- filter outputs can be validated without spec-shape checks
- derived datasets can be checked by row count, expected values, and order
- simple signal defaults can be checked
- dataflow and scenegraph checks can be combined in one koan
- missing runtime data fails cleanly rather than crashing validation
- semantic chart helper APIs
- nested group data
- interaction simulation
- line, area, facet, or pixel checks
- LLM-assisted evaluation
- completed
Make validation checks easy to author, review, and extend without changing engine internals for ordinary beginner koans.
vega-validation-engine
- current koan schema documentation
- current validation check schema documentation
- example recipes for bar, scatterplot, transform, and signal koans
- fixture test pattern documented for new koans
- committed target specs covered by validation tests
- stable ordered koan export for browser/profile display
- a new beginner bar, scatterplot, transform, or signal koan can be authored from documentation
- koan checks read like intended learning outcomes
- tests show both correct target specs and representative failures
- koan ids, slugs, and display order are checked for uniqueness
- semantic helper APIs are deliberately deferred until repetition justifies them
- semantic chart helper implementation
- text label checks
- line, area, facet, interaction, or pixel checks
- broad validation error explanation system
- LLM-assisted evaluation
- completed