Project Info
Inspiration
Generated tutoring content has an asymmetric failure mode: a polished activity can still be wrong, weakly sourced, answer-leaking, or badly matched to the learner, and it fails quietly. One wrong practice item in a 1,200-seat course is 1,200 wrong learning events. I wanted to answer a stricter question than "can a model write a lesson?" — what must an AI learning system prove before an activity is allowed to shape a learner's future? That produced two product primitives: proof-carrying learning objects, and challengeable adaptation.
What it does
ChalkTrace is a durable, multi-organization course studio plus a signed sample learning workspace. An educator registers, creates a course, and imports their own material — text-bearing PDFs, IMS Common Cartridge / Canvas .imscc, Moodle .mbz, ZIP, QTI/XML, HTML, Markdown, or plain text. The upload is parsed as inert data behind archive-traversal, symlink, zip-bomb, and XML defenses, then split into content-addressed source regions. A lesson candidate — drafted deterministically or proposed by GPT-5.6 — carries a public activity and a separate, server-only grading contract. Learners and browsers never receive canonical answers or private grading rationales. Publication runs an eight-check policy against the exact candidate bytes: schema, source support, executable correctness, adversarial solvability, hint leakage, accessibility, runtime safety, and an independent educator review where an authorized educator solves and approves the draft. Only an organization owner performs the final publish, and only through a single verification gate. A released lesson receives an Ed25519 ProofCard bound to its exact hash and every computed check. Learners then practice against a synchronized motion model, staged hints, and server-side grading — and can challenge any claim. A supported challenge withdraws the claim, drops its planning weight to zero, rebuilds the dependent rationale, and revokes the stale cached projection in front of the learner. Every account, course, draft, publication, attempt, challenge, and audit event is stored durably in SQLite and survives restart. How it works ChalkTrace separates proposal from authority. A candidate enters a strict typed contract; each check evaluates the exact candidate hash and records its verifier identity, version, and evidence digest. publish_candidate is the only publication boundary — missing, duplicate, stale, indeterminate, failed, or tampered evidence blocks delivery. The engineering-mechanics verifier runs 2,048 generated velocity/acceleration cases in Python, mirrored by the TypeScript implementation that drives the learner simulation, and both hashes are part of the correctness evidence. On a committed 50-candidate corpus with seeded defects, all 30 defective candidates are blocked and all 20 clean candidates publish — zero false publishes, zero false blocks, deterministically recomputable by the release gate. The product moment A learner challenges an assessment-frequency claim. ChalkTrace checks the cited source, agrees the claim is unsupported, withdraws it, zeroes its planning influence, rebuilds the rationale, and revokes the stale projection — and rebuilds her path in front of her. Trust is an interaction, not a disclaimer. How I used GPT-5.6 and Codex GPT-5.6 planned the product — researching the problem, shaping the proof-carrying-learning thesis, and mapping risk — and has a runtime role as the course architect behind chalktrace ingest --propose, drafting candidates from content-addressed spans through a narrow, fail-closed provider boundary. Every draft lands quarantined with a hash-bound proposal trace, and still has to pass all eight checks and educator review before it can publish: the product's own thesis applied to its own model. Codex implemented and verified the repository — the contracts, trust boundary, cryptographic and verification kernels, adaptive policy, the durable studio, the web product, and the tests. The core /feedback IDs are: 019f5fcb-5f69-7892-a338-08c0c7c62573 019f6020-605c-71a3-848d-8aabf1385f62 019f6097-19af-7292-976c-0182284223d4 Human decisions The entrant chose the education theme, pushed back on a broad generate-everything implementation strategy, required one complete vertical slice, made ProofCards plus the challenge interaction the product signature, and kept consequential authority in deterministic code. Challenges The hardest engineering problem was making every consequential transition evidence-preserving. A rebuilt candidate must invalidate old checks. A helpful hint must not expose the answer too early. An adaptive estimate must show its uncertainty. A withdrawn claim must stop influencing future plans. A cached public projection must not outlive the evidence that justified it. The solution was to make evidence part of the product state: immutable source bindings, candidate hashes, verifier hashes, signatures, reason digests, dependency changes, state versions, and cache revocation paths are all inspectable. Accomplishments A polished non-chat learning experience where the trust architecture is visible and usable. Seven computed policy checks with exact-hash evidence and a fail-closed publication gate. A 2,048-case executable verifier tied to the interactive artifact. Real public-domain course material released through the same proof pipeline as the synthetic fixture. A measured gate yield — 30/30 seeded defects blocked, 20/20 clean candidates published — that the release gate recomputes deterministically. A working ingestion path from any course file to a gated, quarantined candidate. Trusted ProofCard attestations and session-signed adaptive DecisionCards. A challenge that causally changes the future learning path, and an Instructor view that shows the operations side of that loop. A private-answer boundary covered by tests and public-projection scans. A reproducible release with typing, lint, backend/web tests, SBOM, dependency audit, security policy, and hardened container. What I learned Trust becomes much more compelling when it is an interaction rather than a disclaimer. The strongest moment is not showing that a check passed; it is letting a learner disprove a system claim and watching every dependent decision update. I also learned that model agreement is not publication authority. Typed contracts, executable domain rules, adversarial cases, source hashes, accessibility checks, and cryptographic receipts create complementary evidence that can be inspected and falsified. The sharpest lesson came from turning the thesis on my own work. A system that invents the misconceptions it claims to find is grading its own homework, exactly the failure it was built to prevent. So every misconception ChalkTrace diagnoses now names a documented misconception family from peer-reviewed physics-education research — Trowbridge & McDermott (1981) for direction/sign and Δv/Δt errors, Beichner (1994) for graph-as-picture and slope/height confusion — and the release gate fails if any diagnosable misconception lacks a resolvable DOI. Those papers document the misconception family, not my items, and the product states that scope on screen rather than borrowing their authority.
What's next
Richer ingestion adapters and new subject domains, each earning release authority through the same verifier-qualification recipe physics proves end to end. The first adoption target is an engineering or science course team running high-enrollment assessment practice; the concrete two-week rollout is written up in docs/pilot-playbook.md. It uses only surfaces that ship in this repository.
ChalkTrace
ChalkTrace turns course files into source-bound lessons that cannot publish until the exact public candidate passes deterministic checks and an educator independently reviews it.
The application includes a durable multi-organization course studio and a signed sample learning workspace. It is designed around one hard boundary: learners and browsers never receive canonical answers or private grading rationales.
What works
- Account registration, Argon2id authentication, HTTP-only sessions, organization roles, course roles, and expiring invitations.
- Durable SQLite storage for courses, imports, drafts, private grading contracts, publications, attempts, challenges, audit events, and sample-session state.
- Import of text-bearing PDF, IMS Common Cartridge/Canvas
.imscc, Moodle.mbz, ZIP, QTI/XML, HTML, Markdown, text, CSV, JSON, and YAML. - Archive traversal, symbolic-link, expansion, entry-count, and compression-ratio defenses; hardened XML and non-executing HTML extraction.
- Deterministic local drafting and optional structured OpenAI drafting.
- Separate public candidate and server-only grading contract.
- Eight-check course publication policy, including source resolution, answer uniqueness, hint leakage, accessibility, runtime safety, and independent educator review.
- Owner-only final publication through the exact-object verification gate.
- Durable Ed25519 ProofCards and an in-product verification action.
- Learner attempts, durable challenges, educator resolution, and withdrawal from delivery.
- A sample adaptive-learning workspace with staged hints, signed decisions, evidence traces, and challenge-driven plan revision.
Scanned PDFs require OCR before import. SQLite is the supported local persistence layer; the code does not claim multi-node database scaling or institutional compliance certification.
Run locally
Requirements: Python 3.12, uv, Node.js 24, and npm.
uv sync --extra dev --locked
npm.cmd --prefix apps/web ci
npm.cmd --prefix apps/web run build
uv run chalktrace serve
Open http://127.0.0.1:7777, choose Course studio, and create an account. Then:
- create a course;
- import a supported course file;
- create a deterministic draft or an OpenAI draft;
- solve the draft independently and record review notes;
- publish the exact approved version as an organization owner; and
- verify its signed proof or resolve any learner challenge.
Local state and the product signing key are stored under .chalktrace/, which is excluded from
Git.
Optional OpenAI drafting
Copy .env.example to .env and set:
OPENAI_API_KEY=your-key
CHALKTRACE_OPENAI_ARCHITECT_MODEL=gpt-5.6-sol
The key stays server-side. Course material is serialized as untrusted data, model output is parsed against a strict schema, and a model draft still needs all deterministic checks and educator review. The deterministic drafting path needs no API key.
Docker
docker compose up --build
The compose file mounts a named volume at /app/.chalktrace, so accounts, courses, lesson state,
and the signing identity survive container replacement. The local compose profile uses HTTP and a
non-Secure development cookie. Set CHALKTRACE_ENVIRONMENT=production only behind HTTPS.
Architecture
course upload
│
▼
safe PDF / LMS extraction ──► content-addressed source regions ──► SQLite
│
▼
local or OpenAI proposal ──► public candidate + server-only grading contract
│
▼
seven automated exact-object checks ──► independent educator solve/review
│
▼
publish_candidate (eight-check policy) ──► Ed25519 ProofCard ──► learner delivery
│
learner challenge ──► durable review ──► uphold / reject / withdraw
Key modules:
chalktrace/ingest/documents.py: safe course-file extraction.chalktrace/product/database.py: durable identity, tenant, course, review, and challenge state.chalktrace/product/generation.py: deterministic and OpenAI lesson proposals.chalktrace/product/publication.py: exact-source checks and the eight-check gate policy.chalktrace/verification/gate.py: the only publication boundary.chalktrace/api/app.py: authenticated product API and sample delivery API.apps/web/src/Studio.tsx: writable course studio.apps/web/src/App.tsx: learner sample, proof inspection, and evidence traces.
The normative contract is
docs/PRODUCT_ENGINEERING_SPEC.md.
Verification
uv run pytest
uv run ruff check .
uv run mypy chalktrace
npm.cmd --prefix apps/web test
npm.cmd --prefix apps/web run typecheck
npm.cmd --prefix apps/web run build
uv run python scripts/release_check.py
The tests cover PDF and course-package import, malicious archive paths, complete long-document chunking, tenant isolation, password/session protection, private-answer non-disclosure, failed review, exact gated publication, signature validation, restart persistence, challenge resolution, sample learning behavior, accessibility, and offline-cache policy.
Security and privacy
- Course documents are untrusted data and are never executed as instructions.
- Passwords use Argon2id; session and invitation tokens are stored only as SHA-256 digests.
- Course authorization is enforced server-side on every operation.
- Draft API projections are explicit allowlists and exclude the private answer and review notes.
- Authentication and course responses use
Cache-Control: no-store. - Production-like modes disable development CORS and use Secure cookies.
- CSP limits scripts, connections, objects, frames, and workers to the application origin.
- The service worker caches only explicitly approved anonymous sample responses.
- Every publish action recomputes all checks for the stored candidate bytes.
See SECURITY.md for reporting and deployment boundaries and
docs/threat-model.md for the trust model.
License
Code is available under the MIT License. Sample-course material carries its own source and attribution metadata where applicable.
Analysis
View
Metric
- 5
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- TypeScriptIn code
8 of 8 appear in the indexed code.
AI coding agents
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
852 KB
Source files
136
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Marc-Dvci/ChalkTrace
165 files · 4.4 MB · @ 8e97113
Structure
Interface
1 file · 1%Screens, components and styles rendered to the user.
API & routing
2 files · 1%Request entry points: routes, handlers and controllers.
Application logic
74 files · 45%Domain rules, services and shared utilities.
+17 moreData & schema
7 files · 4%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python70%
- TypeScript16%
- CSS9%
- Markdown5%
- JavaScript0%
- YAML0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
pyproject.toml
pypi · 18- argon2-cffi
- cryptography
- defusedxml
- fastapi
- mcp
- openai
- pydantic
- pydantic-settings
- pypdf
- python-multipart
- typer
- uvicorn[standard]
- +6 more
apps/web/package.json
npm · 12- @vitejs/plugin-react
- react
- react-dom
- vite
- +8 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.