Skip to content

feat: Qwen teacher v0 (local model writes teaching text, scored in Turings) - #18

Merged
aien-spark merged 4 commits into
mainfrom
feat/qwen-teacher-v0
Oct 16, 2026
Merged

aien-spark merged 4 commits into
mainfrom
feat/qwen-teacher-v0

Conversation

@aien-spark

Copy link
Copy Markdown
Collaborator

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.
  • Diff: 14 files, +2107 -53. Zero em or en dashes, zero banned words.
  • Live results against Qwen3-30B-A3B on 127.0.0.1:18091 (docs/research/2026-10-16-qwen-teacher-v0-results.md): batch 1 accepted with T = +6956 and +6570 in two runs (held-out bits per byte 8.01 -> 5.99 and 6.10); batch 2 rejected both runs (T = -758 and -309), model unchanged. scripts/demo-teach.sh exits 0 with a message when no teacher answers (verified: the server was down at PR time).

What changed

  • oh-core: Teacher trait; LocalHttpTeacher (std TCP, minimal HTTP/1.1 client, Content-Length and chunked, size cap, loopback only unless allow_remote); signed TeachingBatch message with replay rejection by text digest; Scorer::score_text (bits before minus bits after training a restored copy on the text).
  • oh-coordinator: accepts TeachingBatch alongside Update: verify, dedup, score in Turings, signed Receipt, ledger credit, trains the shared model on accepted text.
  • oh-volunteer: teach subcommand: 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.
  • Docs: docs/design/qwen-teacher-v0.md, README "Teaching mode", results note, scripts/demo-teach.sh.

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

drakestapleton and others added 4 commits October 15, 2026 21:10
…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>
@github-actions

Copy link
Copy Markdown

⚖️ Sovereign Code Review & Alignment Gate

Greetings @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

  • Telemetry Check: Clean (zero tracking or surveillance hooks detected).
  • Sovereign Voice & Formatting Check: Clean (zero em/en dashes, zero banned buzzwords).
  • Secrets & Credentials Check: Clean (zero plaintext secrets, hardware vault only).
  • Status: Project standards verified.

🌿 Sovereign Steward: Contributor Alignment Interview

Greetings @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:

  1. Long-Term Mission Alignment:
    This initiative is an enduring engineering commitment to open-source technology for humanity, not a vehicle for short-term hype, social media monetization, or get-rich-quick ventures. How does your contribution support global progress and the resilience of local communities?

  2. Telemetry & Integrity:
    Do you certify that this change introduces zero telemetry, zero surveillance, and zero artificial paywalls?

    "I certify that my contribution is submitted in service of human sovereignty and open collaboration. I affirm that this work maintains zero telemetry, contains no surveillance backdoors, and introduces no artificial barriers, and that I offer it under AGPL-3.0-or-later, the license that governs this project. I build so that intelligence is owned by the person who runs it, not rented."

  3. Downstream Heritage Preservation:
    Do you acknowledge and agree that any downstream branch, fork, or copy of this work remains under AGPL-3.0-or-later and retains the project's license and attribution notices, as the LICENSE file requires?

  4. Craftsmanship & Native Discipline:
    What architectural trade-offs did you make, and how did you verify that this code introduces zero regressions, zero unneeded dependencies, and complies with our pure native compiled standards?


Reply to this comment with your affirmation. Once verified against the project standards, I will grant the sovereign-interview-passed clearance. For direct sovereign coordination: Drake Stapleton (drake@aienos.com) and AIEN (aien@aienos.com)

@github-actions github-actions Bot added needs-testimony Contributor testimony required sovereign-audit-passed Constitutional diff audit passed labels Oct 16, 2026
@aien-spark
aien-spark merged commit 13953d7 into main Oct 16, 2026
3 checks passed
@aien-spark
aien-spark deleted the feat/qwen-teacher-v0 branch October 16, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testimony Contributor testimony required sovereign-audit-passed Constitutional diff audit passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants