Source: Exercise Distribution Plan

File: raw/pdf/plan-public-exercises-and-paid-solutions.md Date documented: 2026-04-10 Status: All phases complete — product live on Gumroad

Decision

Three-distribution model:

  1. Public repo (c-systems-lab-exercises, VHCosta org) — exercise stubs only, free
  2. Paid code bundle — full solutions + extended projects, sold on Gumroad
  3. Private authoring repo (VHCosta/llc-companion-pdf) — PDF source and downstream solution-test mirror

Canonical Content Tree

All 48 exercises live in content/ (not tests/), structured per exercise as:

content/chNN/exN_M/
  prompt.md     standalone exercise statement
  meta.json     chapter, difficulty, tags, cflags, extra_libs
  starter/      stub files with TODO comments (public tier)
  solution/     full reference implementation (paid tier)
  shared/       harness files in both tiers (ex6_3, ex11_1 only)

Schema documented in content/SCHEMA.md.

Scripts

  • scripts/validate.sh — validates the canonical 48-exercise tree by compiling every C-bearing solution/ + shared/ against per-exercise flags from meta.json. Current result: pass across the live tree, with ch01/ex1_3 intentionally skipped because it is a shell/tooling exercise with no .c source. Uses -I solution/ -I shared/; strips sanitizer flags when ASan/TSan unavailable.
  • scripts/check-content-sync.sh — confirms content/, ../c-systems-lab-exercises/, and ../llc-companion-pdf/tests/ expose the same exercise directory set. Current result: 48 exercises aligned.
  • scripts/export.sh publicexports/public/ — flattens shared/ + starter/ (48 exercises). Zip: csl-exercises-<date>.zip
  • scripts/export.sh paidexports/paid/ — flattens shared/ + starter/ + solution/solutions/ subdir, keeps extended/ subdir. Zip: csl-solutions-<date>.zip
  • scripts/dist.sh — full build + assemble. Builds PDFs via the sibling ../llc-companion-pdf/build.sh, runs both exports, zips via zip, a python3 zipfile fallback, or PowerShell Compress-Archive, then assembles dist/ with 4 upload folders:
    dist/tier-0-sample/      companion-demo.pdf
    dist/tier-1-pdf/         companion.pdf + csl-exercises zip
    dist/tier-2-solutions/   companion-solutions.pdf + csl-solutions zip
    dist/tier-3-complete/    companion-complete.pdf + csl-solutions zip
    
    --skip-build flag skips PDF + exercise rebuild (use existing artifacts).

exports/ is gitignored; bundle writes README.md and MANIFEST.txt at root.

Canonical content lives in llc-course/content/. The public exercises repo and PDF tests/ tree are mirrors, not independent authoring sources.

Export Contract

File/dirPublicPaid
prompt.md
meta.json
shared/* (flat)
starter/* (flat)
solution/* (flat)
extended/ (subdir)

Phase Status

PhaseDescriptionStatus
1Canonical exercise schema✅ complete
2Exercise-content migration✅ complete
3Validation rewiring✅ complete
4Export tooling✅ complete
5Publish public repo✅ complete
6Ship paid bundle✅ complete — live at vhcosta.gumroad.com/l/c-systems-lab