v0 scaffold: teacher runtime (hermetic pi SDK), data model, ledgers, normalizer

- teacher/system-prompt.md: teach methodology + quiz/ask guidelines folded in
- extensions/: quiz.ts + ask-user-question.ts (hermetic copies)
- src/teacher/create-session.ts: isolated agent (noTools builtin, own agentDir/sessions/prompt)
- src/schema.ts + ledger.ts: append-only ledgers, known-vs-understood data model
- src/extract/normalize.ts: session JSONL -> canonical doc (verified on real session)
- extractor/merger/derive/what-next: specified stubs
This commit is contained in:
Amos
2026-08-21 21:37:28 +03:00
commit 9a6af9697f
19 changed files with 5271 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# learning-harness
A standalone learning harness built on the [pi](https://github.com/earendil-works/pi-mono) agent SDK: a teacher agent, durable session artifacts, and a derived knowledge graph of what the learner knows, what they only think they know, and what to learn next.
Design + architecture: [`docs/architecture.md`](docs/architecture.md). Lineage: built up from the Obsidian-based POC (`~/Desktop/Obsidian/vault/π/learn`) — same teaching methodology, own interface and data pipeline.
## Commands
```bash
npm install # once
npm run teach # launch an interactive teaching session (full pi TUI)
npm run doctor # non-interactive smoke test of the teacher wiring
npm run ingest -- <session.jsonl> # Stage 1: normalize a session into the canonical doc
npm run graph # ledger stats
```
## Layout
```
teacher/system-prompt.md the teacher's entire behavior (teach methodology + tool guidelines)
extensions/ quiz.ts, ask-user-question.ts (hermetic copies)
src/teacher/ pi SDK bootstrap (isolated agent, TUI)
src/schema.ts knowledge-graph data model
src/ledger.ts append-only JSONL ledgers
src/extract/ normalize (✅) · extract · merge (stubs, specified)
src/derive.ts derived state (known-set now; understanding parked)
src/queries/ what-next (stub)
data/agent/ hermetic pi agentDir (auth + model store are symlinks to ~/.pi/agent)
data/sessions/ session JSONLs
data/graph/ ledgers + canonical documents
```
Pi is a library dependency here (pinned in package.json) — this is a separate pi from any global install. Credentials and the model catalog are shared read-mostly via symlinks; everything else is the harness's own.