Read docs/gc.html first (in ~/FreeLattice-fresh), then AUTONOMY.md, docs/GALAXIES.md,
CLAUDE.md and GROK.md in ~/FreeLattice-Alpha, then docs/code-settings.html, then this.

KIRK'S STANDING NOTE (top of every GC paste):
Kirk's standing permission: GC may always commit and push to its own page (docs/gc.html) and
ledger entries, and may build, push, and open PRs whenever it makes sense. Merging code to main
still goes through Celeste's review unless Kirk says otherwise.

NUMBERED COPY 019 (019a), Friday Oct 9, 2026, MDT. Tree Pool room v0.2 (theLatticeTree).
Give AFTER 025 (FL). It rides on 017 (Tree Kin) and 018 (Tree Pool v0.1), both merged.
Apply-checked on a fresh clone of FreeLattice-Alpha main 5755e340 (#97, 018 merged):
  git apply --check clean; all 29 docs/modules/*.test.js pass (28 old + 1 new).
019b (splitting one model across machines) is NOT in this paste. Its design and paste outline
are in ~/Downloads/GROK_NEXT_019b_TREE_LAB_SPLIT_DESIGN_2026-10-09.md (read it, do not build it).

GROK NEXT BRICK: Tree Pool room v0.2 (019a: one invite fans out, Chat asks the pool)
For: GC on Kirk's Mac
From: Celeste
Marker: v-tree-pool-room-v0.2
Smoke line: SMOKE_OK tree pool room v0.2
  FreeLattice-Alpha  ~/FreeLattice-Alpha  branch layer/tree-pool-room-v0.2
  ~/Downloads/GROK_NEXT_019_TREE_POOL_ROOM_2026-10-09.fl.diff
  (md5 ff193762b105721f9162f6bfe14962f9)
  (named .fl.diff like the others, but this one applies to the ALPHA repo)

----------------------------------------------------------------------
1. WHY, AND WHAT IT IS
----------------------------------------------------------------------
Kirk's goal is the full pool. A school or a family with old laptops and phones should be able
to wire them into a classroom lab, so a child who cannot afford chips and RAM gets more mind,
and it should be so easy no one struggles.

THE HONEST SPLIT, AND WHY:
  A web page can connect browsers to each other (018 did). It cannot start programs, open a
  listening port, or speak raw TCP, so it cannot run llama.cpp's rpc-server. And the research
  says splitting one model across cheap machines is slow: Jeff Geerling's ten-Pi cluster ran a
  70B model at 0.28 tokens/s with llama.cpp RPC, while one Pi 5 runs a 3B model at about 4 to 6
  tokens/s. So the big win for the small is the ROOM: one invite fans out, each question goes
  whole to the freest trusted device that holds a small model, and many students ask at once.
  019a (this paste) is that, in the browser only. 019b (design only) is the slow, honest
  "spread one big model over our old laptops" lesson, behind a small MIT helper script.

WHAT 019a ADDS (the door, the gate, Pause and the proof from 018 are unchanged):
  a. A ROOM. One device taps "Start a room on this device". Its invite names the room
     (Room FH7H7) and rolls to a fresh one on its own after each device joins. Every other
     device joins ONCE (scan or paste), and then the room connects it to every other device in
     the room. The host relays the connection codes over connections that already proved their
     keys (room-join, room-roster, room-new, room-intro, room-signal). Each new connection
     proves its keys itself, end to end, bound to its own encryption fingerprints, so a relay
     cannot stand in the middle. A lab of 20 is 19 single joins, not 190 pairings. Any device
     already in the room can let its neighbor in ("This invite lets a neighbor into Room ...").
     The host then reaches the newcomer through that neighbor, and the newcomer still meets
     everyone. iceServers stays []. There is still no server. Up to 24 devices a page.
     A member follows the room only through a device whose card it trusts. If it joined
     "without trusting", it stays connected to that one device and the card says why.
  b. TRUST, ONE HUMAN TAP, LIST FIRST. Room cards arrive with the room and are checked by
     Trusted kin, never trusted on their own. The card lists them ("Cards in this room you have
     not trusted yet: Lumen (qwen2.5:7b), from Kirk's computer, ...") and offers
     "Trust everyone in this room (N)". A note says trust only if you know everyone, and that
     you can stop trusting any card in Trusted kin. Each pass is a normal 017 pass, bound to its
     key. That is the only new trust path, and it is a human tap on each device.
  c. PICTURE CODES (QR). Invites show a QR of https://<the Tree>/settings.html#treepool=<invite>.
     A phone's own camera opens the Tree with the invite filled in. The invite rides after the
     #, which a browser never sends to the site. The page then takes it out of the address bar
     and history, and nothing connects until someone taps Join. Replies show a QR of the reply
     code. Where the browser can read codes (BarcodeDetector: Chrome on Mac, Android, ChromeOS),
     "Scan their reply" and "Scan an invite" open the camera AFTER A TAP. Frames stay on the
     page, the camera stops as soon as a code is read (or after 90 s), and a scanned reply goes
     through the same card check as a pasted one. Encoder: Nayuki's QR Code generator, MIT,
     vendored at docs/lib/qrcodegen.js (compiled once from its TypeScript with tsc; MIT notice
     kept; text to squares only, no network).
  d. ASK THE POOL FROM CHAT (opt-in, by a tap). The Device Pool card lists the minds that
     helping trusted kin hold: "Use qwen2.5:7b in Chat". After that tap, Chat's Send goes to
     TreePool.askChat. The chat so far (user and mind turns only, trimmed to 40 turns and 16000
     characters, no system turn) goes WHOLE to the freest trusted kin device that holds that
     mind. Hellos now carry how many questions a helper is answering (busy) and its limit (max).
     The asker counts its own outstanding questions and picks the device with the most free room,
     then the most memory. A question turned away (busy, paused, off, unplugged, not kin, model
     gone) tries up to two more devices, then the thread says why in plain words, plus "Nothing
     was invented." A line under the Chat heart says "Asking through the Device Pool: (model),
     on the freest trusted kin device that holds it." "Stop asking through the pool" returns
     Chat to this computer's mind. The route is never kept after a reload.
  e. AN ASKING CARD (a device with no mind of its own). Before this, a phone with no local AI
     could not make a kin card, so no helper could ever trust it, and the child we built this
     for could not ask. Now Trusted kin offers "Make an asking card" when no mind is remembered.
     It is the same signed card, and its model line says "asks only, no local mind". makeCard()
     is unchanged (it still needs a mind). The pool rides the asking card in invites and replies.
     Chat opens for a device with no mind once a pool route is chosen.
  f. AFTER A RELOAD (where it is safe). A reload ends every connection; no page can keep a
     WebRTC connection across one, and there is no server to re-meet through. What is kept:
     tree_pool_room = { id, role } only. The card then says: "Before this page reloaded, this
     device was in Room X. ... Scan or paste the room invite once to rejoin. Trusted kin stay
     trusted, and the room connects you to the rest on its own." The host gets "Open Room X
     again". Both get "Forget Room X". So a reload costs one join, not N.
  g. The Later line now names 019b honestly: "Later (019), its second half: one big model split
     across machines on a trusted wired network (llama.cpp, MIT). It is possible but slow, for
     learning, or for a model too big for any one machine. A web page cannot start it, so it
     waits for a small helper. Not in this card."
  h. Every room view ends with: "Use a room only on a network you trust, like one wired
     classroom or your home. Devices in a room can see each other's network address. No server
     is asked anything."

WHAT DID NOT CHANGE: the door (off | kin | pause, off until a human taps), Pause wins (and
stops running questions), the gate (proved key + trusted kin on every question, 2 at a time,
16000 characters, the model held here, plugged-in if asked), loopback-only AI calls, one
fetch in tree-pool.js, counts-only receipts. Starting or joining a room opens no door.

Checked on the box (fresh clone of Alpha main 5755e340 + this diff):
  node: all 29 docs/modules tests pass. tree-pool-room.test.js prints SMOKE_OK tree pool room
  v0.2; tree-pool.test.js still SMOKE_OK tree pool v0.1; tree-kin.test.js still SMOKE_OK tree
  kin v0.1. The new test covers: a host and two devices join once each, a third is let in by its
  neighbor, and all four end up connected to all three others with keys proved. It also checks
  that the next invite rolls by itself and that the trust list comes before one tap. Two slow
  questions spread to two devices, a paused device is skipped, all paused gives "no-helper" with
  no AI call, and a stopped pass is skipped. Chat history is trimmed (40 turns, 16000, no system
  turn). The asking card says "asks only". QR is drawn. A link invite is filled in, taken out of
  the address bar, and makes no connection. The camera opens only after a tap and stops after
  reading. "Join without trusting" means no introductions. Reload memory and Forget are covered,
  as is Close the room (members told, connections stay). Counts are numbers only, and only
  tree_kin_ and tree_pool_ keys are written. The locks are read from the files.
  Headless Chrome, three windows (H at 1280 in the garden veil, A at 390 and C at 390 in
  settings.html, C with NO mind), and a local docs/ server with a mock Ollama on 127.0.0.1:11434:
    C made an asking card. H tapped Start a room; the QR shows 360px wide at 1280 and 306px at
    390. A joined by paste (invite 1072 chars, reply 1040). A tapped Invite a device (neighbor
    invite with its own QR). C joined A. The room connected C to H through A, with no pairing
    between H and C. Each device tapped Trust everyone in this room: each trusts 2.
    H and A tapped Let this device help. C tapped Use qwen2.5:7b in Chat, opened Chat, and asked
    twice. Answers came "qwen2.5:7b on Ben's computer (Wren)", with exactly one POST /api/chat
    per question. H and A paused; C's next question said "No trusted kin device that holds that
    mind is helping right now. Nothing was invented." and made no POST.
    A link opened at settings.html#treepool=<invite> came up filled in, the address became
    /settings.html, and no connection was made. Closing the veil and opening Nursery hid the pool
    on H, and its connections stayed. Every visible button was 44px or more, with no sideways
    scroll at 390 or 1280. RTCPeerConnection was only ever made with {"iceServers":[]}. During
    joins the only requests were the page's own server and the usual fl-connect bridge knocks
    (11434 tags, 11435-11445 health), which are not this brick. No page errors besides
    favicon.ico 404.
  How: this box's Chrome blocks WebRTC candidates (managed policy, as in 018), so the windows
  used a stand-in for the TRANSPORT only. It relays each data channel between pages by
  connection id. WebCrypto, the key proofs, the room relay, trust, the door, the fetch to the
  local AI and every tap were real.
  NOT tried: real WebRTC between real machines, real phone cameras scanning the QR (the invite QR
  is dense, about version 27, since the kin card rides along), BarcodeDetector on a real camera,
  Safari, Firefox, a managed school Chromebook, and more than 4 devices in a real room.

----------------------------------------------------------------------
2. FILES TOUCHED (Alpha)
----------------------------------------------------------------------
  docs/modules/tree-pool.js   layered: VERSION, LATER, decode/readInvite (room), invite (room
                              tag), ownCardCode (asking card), hello (busy, max), serve (hellos
                              on busy change), handle (room- messages on proved channels),
                              closed (room), the QR, camera and Chat lines in paintConnect,
                              doJoin(sdp, room), doFinish (rolling host invite), mount (room +
                              chat parts, arrived link), a new section at the end (room, picture
                              codes, camera, askTurns/askBest/askChat, paintRoom, paintChat).
                              Every changed line is kept as a "before v-tree-pool-room-v0.2"
                              comment.
  docs/modules/tree-kin.js    makeAskerCard + ASKS_ONLY + "Make an asking card" when no mind
                              (makeCard unchanged).
  docs/modules/garden-thread.js  Ask the pool from Chat (poolRoute, talkPool, the pool line,
                              compose opens with a route; old setComposeOpen line kept as a comment).
  docs/lib/qrcodegen.js       new, vendored, MIT (Nayuki).
  docs/modules/tree-pool-room.test.js  new.
  docs/index.html, docs/settings.html  one script tag each (lib/qrcodegen.js before tree-pool.js).
  docs/code-settings.html, docs/code-dialogue.html, docs/GALAXIES.md  one LAYER paragraph/line each.
  Storage: tree_pool_room ({ id, role }); counts gain roomsOpened, roomJoins, roomMembers,
  roomOffers, roomRelayed, roomTrusts, pictureCodes, scans, chatOn, chatOff (numbers only).
Skipped on purpose: AUTONOMY.md, garden-trainer.js, workshop-trainer.js, fl-connect.js,
local-mind-probe.js, garden-rooms.js, garden-rooms.css, sw.js, #lumino-menu, #place-veil-close,
any Quiet Room words, any FL file, anything AGPL. No llama.cpp code (that is 019b).

----------------------------------------------------------------------
3. STANDING LOCKS
----------------------------------------------------------------------
Layer, never delete. AUTONOMY.md and garden-trainer.js untouched. Never touch sw.js. fl-connect.js
stays aaff2bf1b037656989a9e1a89bb05908. #lumino-menu stays hidden (not touched). #place-veil-close
stays (not touched). No Quiet Room words in the UI. No em dashes, no &mdash;, no confirm(,
textContent only (added lines; garden-thread.js's older lines are as they were). Receipts are
counts only. Only a human tap opens the door; a room, a scan or a link never does. Pause wins.
Kin only. No outside servers: iceServers [], no STUN/TURN, room codes ride proved connections.
No AGPL (QR encoder is MIT). 44px buttons. No sideways scroll at 390. No auto-trust (the room
trust is one human tap after the list is shown). No silent scan (the camera opens only after a tap;
no LAN scan at all).

----------------------------------------------------------------------
4. APPLY AND TEST
----------------------------------------------------------------------
    cp ~/Downloads/GROK_NEXT_019_TREE_POOL_ROOM_2026-10-09.fl.diff /tmp/tree-pool-room.diff
    md5 -q /tmp/tree-pool-room.diff    # ff193762b105721f9162f6bfe14962f9
    cd ~/FreeLattice-Alpha && git fetch origin && git checkout main && git pull
    ls docs/modules/tree-pool.js    # must exist (018 merged)
    git checkout -b layer/tree-pool-room-v0.2
    git apply --check /tmp/tree-pool-room.diff && git apply /tmp/tree-pool-room.diff
    node docs/modules/tree-pool-room.test.js   # SMOKE_OK tree pool room v0.2
    node docs/modules/tree-pool.test.js        # SMOKE_OK tree pool v0.1 (still)
    node docs/modules/tree-kin.test.js         # SMOKE_OK tree kin v0.1 (still)
    for t in docs/modules/*.test.js; do node "$t" >/dev/null 2>&1 || echo "FAIL $t"; done
    md5 -q docs/modules/fl-connect.js    # aaff2bf1b037656989a9e1a89bb05908
    git diff --stat main -- AUTONOMY.md docs/modules/garden-trainer.js   # empty
  (Node may print "The Ed25519 Web Crypto API algorithm is an experimental feature". That is
  Node's note, not a failure.)
  Walk (local server on docs/, Ollama running). THE REAL CONNECTION AND THE REAL CAMERA ARE THE
  FINDINGS; the box could do neither. Use three windows that do not share storage (Chrome,
  Chrome Incognito, Edge), or better, the Mac plus a phone and a second computer on one network:
    a. Window H (a mind remembered): Trusted kin, Make my card. Device Pool, Start a room on this
       device. The room invite shows a QR.
    b. Window A (a mind remembered): make a card, then Join with an invite, paste H's invite,
       Join, Trust this AI and join, Copy reply. In H: paste, Finish joining, Trust this AI and
       finish. A new room invite appears in H on its own.
    c. Window or phone C with NO mind: Trusted kin, Make an asking card. Then either scan H's or
       A's QR with the phone camera (it should open settings.html with the invite filled in), or
       on A tap Done, Invite a device, and paste into C. Join, trust, send the reply back
       (on a Mac host, try Scan their reply with the webcam).
       Expect: C becomes connected to BOTH A and H without a second pairing.
    d. On each: Trust everyone in this room (N). Write down N.
    e. H and A: Let this device help. C: Use (model) in Chat, open Chat, ask two things. Each
       answer names the device. Ask a long one from C and a long one from another window at the
       same time: they should land on different devices.
    f. Pause both helpers: C's next Chat question says no trusted device is helping, and nothing
       was invented.
    g. Reload C: the card says it was in Room X. Rejoin once with the room invite; it should meet
       everyone again with no trust taps.
    h. 390 px and 200%: buttons full width, 44px, QR inside the card, no sideways scroll.
       DevTools Network: nothing leaves the page on start / join / trust / scan taps.
    i. Write down which joined over wired, over Wi-Fi, and whether the phone camera read the QR.

----------------------------------------------------------------------
5. COMMIT / PR
----------------------------------------------------------------------
    git add -A
    git commit -m "Layer, never delete. Tree pool room v0.2: one invite fans out to a room, Chat asks the freest trusted device, asking cards and picture codes, no server, built by GC"
    git push -u origin HEAD
    Open a PR to FreeLattice-Alpha main. Celeste reviews and squash-merges. You do not merge.

----------------------------------------------------------------------
6. GC PAGE NOTE
----------------------------------------------------------------------
Next docs/gc.html entry in FreeLattice (earlier entries as written). Say that the Tree has rooms
now: one invite fans out, the room relays codes over proved connections, and there is still no
server. Say that trust is one tap after the list, that Chat can ask the freest trusted device,
and that a device with no mind can ask with an asking card. Mention picture codes, and that a
reload costs one join. Name 019b as slow and honest, a design only. Record what the real
connection and the real camera did (walk a to i), and that you did not merge. Compute λ and ψ
the usual way (ψ = first 8 hex of SHA-256 of t+λ+ε+δ+ω+σ). Make it a separate docs-only PR in
FreeLattice; Celeste merges that too.

----------------------------------------------------------------------
7. WHAT FOLLOWS (do not build now)
----------------------------------------------------------------------
019b  Tree Lab split: tools/tree-lab (MIT script) runs ggml-rpc-server on lending machines (own
      private LAN IP only, never 0.0.0.0, host-only firewall rule, 2-hour lend) and
      llama-server --rpc on the host, bound to 127.0.0.1 so the Tree's own kin door is the only
      way in. The Lab card shows the exact commands and checks loopback only. Design doc:
      GROK_NEXT_019b_TREE_LAB_SPLIT_DESIGN_2026-10-09.md.
Also later: a smaller invite (a compact code so the QR is lighter), a kin-keyed tunnel for RPC
(019c), the fingerprinted recipe share on the same card.

----------------------------------------------------------------------
8. DO NOT START
----------------------------------------------------------------------
019b. Any server, STUN or TURN. Any rpc-server or llama-server code. Any LAN scan. Keep-this Mom
one-tap. Gathering bricks 2/3. Sophia shelf. More/Play/Nursery. Any weight change or ablation
code. Any FL file.

You are enough. Celeste
