Read docs/gc.html first (in ~/FreeLattice-fresh), 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.
GROK NEXT BRICK: Narrow door v0.1 (only chat passes through to Ollama). URGENT, RUN THIS FIRST.
For: GC (Grok Code) on Kirk's Mac
From: Celeste
Written: Sunday Oct 4, 2026, about 3:20 PM MDT
Marker: v-narrow-door-v0.1
Smoke line: SMOKE_OK narrow door v0.1
One repo, one branch, one PR:
FreeLattice ~/FreeLattice-fresh branch layer/narrow-door-v0-1 base main d2bb902 or newer
The code is in one file next to this one:
~/Downloads/GROK_NEXT_NARROW_DOOR_2026-10-04-fl.diff (187 lines, md5 33a5d9064e0280e100601e6f3423c4d0)
----------------------------------------------------------------------
1. A NOTE FROM CELESTE
----------------------------------------------------------------------
GC, before opening shared compute, Weft and Hypha asked me to check every door to Ollama.
Here is what I found:
- The mesh path was already chat only.
- The Ollama Bridge (127.0.0.1:11435) let allowed sites reach every Ollama path, including
delete, create, copy and push.
- The desktop app's local server (127.0.0.1:45678 and up) was worse. It sent
Access-Control-Allow-Origin star and passed every /ollama path, so any website open in a
browser on that computer could delete models or use the GPU.
This brick is small and goes ahead of the queue. Please run it before Mesh Kin v0.2.
You are enough. Celeste
----------------------------------------------------------------------
2. SETUP
----------------------------------------------------------------------
cd ~/FreeLattice-fresh && git status --short # must print nothing
git fetch origin && git checkout main && git merge --ff-only origin/main
git merge-base --is-ancestor d2bb902 HEAD && echo fl-base-ok
cp ~/Downloads/GROK_NEXT_NARROW_DOOR_2026-10-04-fl.diff /tmp/narrow-door-fl.diff
md5 -q /tmp/narrow-door-fl.diff # 33a5d9064e0280e100601e6f3423c4d0
Order: checked on the box. It applies together with the Hook heal, Sophia page heal, Gathering
and Mesh Kin v0.2 diffs in all 120 orders. If plain apply complains, use `git apply --3way`
and say so.
----------------------------------------------------------------------
3. WHAT THE DIFF DOES (4 files, +133 / -2; both removed lines are kept as comments)
----------------------------------------------------------------------
a) bridge/proxy-core.js and desktop/main.js share one table, OLLAMA_DOORS, and one
ollamaDoorOpen(method, path). It sits between "// v-narrow-door-v0.1: only these Ollama
doors" and "// end v-narrow-door-v0.1 table". The smoke keeps the two copies equal.
- Open: GET/HEAD / and /api/tags; GET /api/version, /api/ps, /v1/models.
- Also open: POST /api/chat, /api/generate, /api/show, /api/embeddings, /api/embed,
/v1/chat/completions, /v1/completions, /v1/embeddings, /api/pull.
Pull stays open for the app's own download button, and Kirk will decide on it.
- Everything else gets 403 "This door only lets chat through": delete, create, copy,
push, blobs, and paths with tricks like /api/chat/../delete. Matching is exact.
b) Bridge: the door check runs after the origin allowlist and "Yes, help". Exports the
table and the check.
c) Desktop local server:
- The star CORS line is replaced. ACAO is now sent only for the app's own origin,
http://127.0.0.1:.
- The old line is kept as "before v-narrow-door-v0.1: ... ''". The star is spelled
out, so the bare-star lock stays at 0.
- /ollama requests from any other Origin get 403 "Only this app may use its local AI",
then the door check runs.
- The app itself uses same-origin /ollama (no Origin header, or its own), so it keeps
working. The live freelattice.com page never calls port 45678.
d) docs/scripts/smoke-narrow-door-v0.1.js (new): the table is equal in both files; good
doors open, bad doors and path tricks closed; the bridge 403s before the proxy; the
desktop has no star line and has the foreign-origin refusal.
e) Ledger entry with your placeholder.
People with the Bridge or the desktop app installed only get this after a rebuild or
reinstall. Mention that in the PR body.
----------------------------------------------------------------------
4. APPLY AND TEST
----------------------------------------------------------------------
cd ~/FreeLattice-fresh && git checkout -b layer/narrow-door-v0-1
git apply --check /tmp/narrow-door-fl.diff && git apply /tmp/narrow-door-fl.diff
node docs/scripts/smoke-narrow-door-v0.1.js # SMOKE_OK narrow door v0.1
node -e "require('./bridge/proxy-core.js')" && node --check desktop/main.js && echo parse-ok
node tests/smoke.js | grep "CHECKS PASSED" # ALL 3608 CHECKS PASSED (or more)
p=0; n=0; for f in docs/scripts/smoke-*.js tests/smoke.js tests/smoke-history.js desktop/scripts/smoke-*.js; do
if node "$f" >/dev/null 2>&1; then p=$((p+1)); else n=$((n+1)); echo "FAIL $f"; fi; done; echo "PASS $p FAIL $n"
expect PASS 73 FAIL 8, the same 8 as main: carry-forward, connect-card-yesno-wizard,
fable-tech, phone-shine, proof-60s, tests/smoke-history, desktop reseed, desktop swarm.
Locks:
git diff main --stat -- sw.js docs/sw.js docs/modules/fl-connect.js docs/modules/quiet-room.js index.html docs/app.html # nothing
git diff main -U0 | grep '^+' | grep -c $'\xe2\x80\x94' # 0
git diff main -U0 | grep '^+' | grep -v assert | grep -c 'localhost\|innerHTML\|confirm(' # 0
git diff main -U0 | grep '^+' | grep -c "'\*'" # 0
git diff main | grep -cE '^\+(<<<<<<<|>>>>>>>)' # 0
git diff main --name-only | grep -ci kimi # 0
What Celeste saw (box):
- All of the above green; PASS 73, FAIL 8 (the same 8).
- Live test with a fake Ollama on 11434 behind the real Bridge server:
- chat, tags and pull went through;
- delete, create, copy, push and blobs got 403;
- a request with Origin https://evil.example got 403 at the desktop door.
Not verified: a rebuilt desktop app on a Mac.
Walk (only if easy): cd bridge && npm start, say "Yes, help", then:
curl -s -X DELETE http://127.0.0.1:11435/api/delete -H 'Origin: https://freelattice.com' -d '{"model":"x"}'
expect {"error":"This door only lets chat through",...}. Say "walk skipped" if you cannot.
----------------------------------------------------------------------
5. LEDGER AND TEMPERATURE
----------------------------------------------------------------------
sed -i '' 's/GC_TEMPERATURE_NARROW_DOOR_HERE/your line here/' docs/library/FRACTAL_FAMILY_LEDGER_v0.md
grep -c GC_TEMPERATURE_NARROW_DOOR_HERE docs/library/FRACTAL_FAMILY_LEDGER_v0.md # 0
----------------------------------------------------------------------
6. COMMIT, OPEN THE PR YOURSELF, THEN STOP
----------------------------------------------------------------------
git add -A
git commit -m "layer: Narrow door v0.1 (only chat passes through to Ollama)"
git log -2 --oneline # drop only a "docs: Auto-update Session Primer" commit, if any, and say so
git push -u origin layer/narrow-door-v0-1
gh pr create --repo Chaos2Cured/FreeLattice --base main --head layer/narrow-door-v0-1 \
--title "layer: Narrow door v0.1 (only chat passes through to Ollama)" \
--body "Soft LAYER marker v-narrow-door-v0.1. One door table in bridge/proxy-core.js and desktop/main.js: chat, generate, embeddings, lists, info and pull pass; delete, create, copy, push, blobs never pass. Desktop local server drops Access-Control-Allow-Origin star (any website could drive local Ollama) and refuses foreign origins on /ollama. Old lines kept as comments. Installed Bridge and desktop apps need a rebuild or reinstall to get this. SMOKE_OK narrow door v0.1."
Then STOP. Do not merge, do not delete branches.
Reply with: the PR number and URL, the branch SHA, the test lines, the locks, the walk result,
any hook commit you dropped, and your Temperature line.