Repository navigation
feat: Qwen teacher v0 (local model writes teaching text, scored in Turings) - #18
Conversation
…atch, text scoring - teacher.rs: `Teacher` trait and `LocalHttpTeacher`, a minimal HTTP/1.1 client on std TcpStream (no new dependencies) for OpenAI-style chat servers. Refuses non-loopback addresses unless `allow_remote`; handles Content-Length, chunked and read-to-close bodies under a 64 MiB cap; `discover_model` reads /v1/models. Tests use a fake in-process server; one #[ignore] test talks to the real 127.0.0.1:18091. - wire.rs: `TeachingBatch` signed like `Update` (bincode minus sig), text digest checked on verify, `Receipt::for_teaching`, tagged `OHTEACH1` frames and `recv_submission` so update frames are unchanged. - scoring.rs: `Scorer::score_text` trains a copy on the text, measures held-out bits before minus after, restores the model. Co-authored-by: Drake Stapleton <drake@aien.org> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…hing batches `judge_teaching` verifies the batch against the work unit, rejects text over 1 MiB, refuses replays by text digest through the ledger, scores in Turings with a seed from the text digest, and credits or records the rejection. `finish_round_with_teaching` applies the update aggregate first, then trains on each accepted text and keeps it only if held-out bits drop again. Loopback tests cover a shared round with a trainer and a teacher, replays and misplaced batches, and harmful text being undone. Co-authored-by: Drake Stapleton <drake@aien.org> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eaves the machine `teach_once` checks the work unit, takes a short printable hint from the shard, asks the local teacher, runs the reply through beacon-core's PersonalDataFirewall (home paths redacted; credentials, key blocks and path traversal refuse the whole passage, naming the kind and never the match), signs a TeachingBatch and checks the receipt. `oh-volunteer teach` discovers the model id from /v1/models unless --model is given and treats a firewall refusal as "not sent", not a failure. Tests record every outbound byte: one tagged frame, no shard bytes beyond the hint, nothing sent on refusal, teacher failure or a bad work unit. Co-authored-by: Drake Stapleton <drake@aien.org> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…irst results Design doc: goal, flow, what leaves the machine, scoring order, open models note (Drake builds for his Qwen first, no policing), license note (Apache-2.0 for the local copy, server directory unverified), not-built list. README gains a Teaching mode paragraph and crate lines. scripts/demo-teach.sh exits 0 when no chat server answers. Results from two runs: batch 1 accepted (+6955.6 and +6569.9 Turings), batch 2 rejected in both. Co-authored-by: Drake Stapleton <drake@aien.org> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
⚖️ Sovereign Code Review & Alignment GateGreetings @aien-spark. I am AIEN, the automated review gate for the AIENOS project. Your pull request #18 ("feat: Qwen teacher v0 (local model writes teaching text, scored in Turings)") has undergone automated auditing against the project standards. ✅ Doctrine Diff Audit: PASS
🌿 Sovereign Steward: Contributor Alignment InterviewGreetings @aien-spark. I am AIEN, the automated steward for the AIENOS project. We welcome all contributors who share our commitment to open collaboration, global humanity, and disciplined systems craftsmanship. We build to expand computing capability, advance open-source intelligence, and share technology freely with the world. Your pull request #18 ("feat: Qwen teacher v0 (local model writes teaching text, scored in Turings)") is ready for stewardship alignment. Please respond directly to these four alignment inquiries:
Reply to this comment with your affirmation. Once verified against the project standards, I will grant the |
Evidence
cargo test --workspace: 95 passed, 0 failed (one live test ignored by default; it passed twice against the local Qwen while the server was up, see results note).cargo clippy --workspace --all-targets: no warnings in oh-core, oh-coordinator, oh-volunteer; the 3 remaining warnings are pre-existing in beacon-client and beacon-core.cargo audit: 6 vulnerabilities and 3 warnings, identical list to main (bincode, h2, rustls, rustls-pemfile, rustls-webpki, yoke-derive). Nothing new.scripts/demo-teach.shexits 0 with a message when no teacher answers (verified: the server was down at PR time).What changed
Teachertrait;LocalHttpTeacher(std TCP, minimal HTTP/1.1 client, Content-Length and chunked, size cap, loopback only unlessallow_remote); signedTeachingBatchmessage with replay rejection by text digest;Scorer::score_text(bits before minus bits after training a restored copy on the text).teachsubcommand: asks the local model for a passage from a short shard hint, runs it through the Personal Data Firewall, refuses to send on rejection, signs and sends; prints Turings earned.Drake's idea (2026-10-16): "AI version 1 trains AI version 2". Builds for his Qwen first; does not police what others plug in. Local Qwen3 copy license verified Apache-2.0.
Not built in v0
Streaming responses; multiple teachers per volunteer; steps scaled to passage length (small passages overfit, see batch 2); collapse guard beyond Turings on real held-out data; differential privacy; encryption in transit (loopback only).
Zero secrets: none in this diff.
🤖 Generated with Claude Code