xonecas.io
8356
Wx

www-xonecas-io / commit 3fc3109

dev server uses the new Rats devnotes script, which works on any address (1012)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 3fc31093c85f1694d4925ac8a4a4c10a49eb38bd parent 7eb683c

2 files changed

cmd/site/devnotes.js+7−6
@@ -1,10 +1,11 @@
11 // Rats devnotes: Ctrl+click anything on this page and write a ticket about it.
2-// It works only on a loopback address, with `rat-king devnotes` running. See
3-// the rats skill. Embed it in development builds only.
2+// The Rats app on this machine files it on the server that has the project, so
3+// the page may be on any address. See the rats skill. Embed it in development
4+// builds only.
45 (() => {
56 const PORT = 7287;
6- const LOOPBACK = /^(localhost|127\.0\.0\.1|\[::1\]|.+\.localhost)$/;
7- if (!LOOPBACK.test(location.hostname) || window.__ratsDevnotes) return;
7+ const PROJECT = "prj_74ae87b16d2a";
8+ if (window.__ratsDevnotes) return;
89 window.__ratsDevnotes = true;
910
1011 const NAMED = "li, tr, p, pre, img, video, audio, h1, h2, h3, h4, blockquote, figure, button, a, label, summary, input, textarea, select";
@@ -67,11 +68,11 @@
6768 reply = await fetch(`http://127.0.0.1:${PORT}/ticket`, {
6869 method: "POST",
6970 headers: { "Content-Type": "application/json" },
70- body: JSON.stringify({ title: title.trim(), body: more ? `${more}\n\n${context}` : context }),
71+ body: JSON.stringify({ project: PROJECT, title: title.trim(), body: more ? `${more}\n\n${context}` : context }),
7172 });
7273 } catch {
7374 sending = false;
74- return say(`Nothing answers on port ${PORT}. Run rat-king devnotes in the project's folder.`);
75+ return say(`Nothing answers on 127.0.0.1:${PORT}. Open the Rats app on this machine.`);
7576 }
7677 const answer = await reply.json().catch(() => ({}));
7778 sending = false;
tickets/1012-rats-injection-script.md+12−2
@@ -5,10 +5,10 @@ type: feature
55 status: review
66 priority: p2
77 created: 2026-11-08T01:09:27Z
8-updated: 2026-11-08T02:45:41Z
8+updated: 2026-11-08T03:44:31Z
99 source: human
1010 area: site
11-moves: 2026-11-08T01:43:50Z inbox todo drag; 2026-11-08T02:43:19Z todo doing drag; 2026-11-08T02:45:41Z doing review agent
11+moves: 2026-11-08T01:43:50Z inbox todo drag; 2026-11-08T02:43:19Z todo doing drag; 2026-11-08T02:45:41Z doing review agent; 2026-11-08T03:42:10Z review todo drag; 2026-11-08T03:42:40Z todo doing drag; 2026-11-08T03:44:31Z doing review agent
1212 ---
1313
1414 Rats provides a script, should be in your skill some where or on the cli. It's experimental so let's see if it works
@@ -29,3 +29,13 @@ Rats provides a script, should be in your skill some where or on the cli. It's e
2929 CHECKED (in the VM, headless agent-browser on 127.0.0.1:8080): script loaded, Ctrl+click on the homepage opened the form, Enter sent the request, and with no 'rat-king devnotes' running it replied 'Nothing answers on port 7287'. On 192.168.122.10 it stayed off. curl: /, /projects/ and other .html pages carry it, site.css is unchanged, 404 and ../ traversal still 404, public/ has no copy. go vet and go test pass.
3030
3131 NOT CHECKED: a ticket actually filed through it. That needs 'rat-king devnotes' running and would put a test ticket on your board, so I left that first real one to you. The dev server is running with the change.
32+
33+- 2026-11-08 03:42Z (human): Rats was updated. this works different now. Check it out, set it up.
34+
35+- 2026-11-08 03:44Z (agent): Updated to the new Rats devnotes script. cmd/site/devnotes.js is the current 'rat-king devnotes script' output, vendored as is; devnotes.go is unchanged.
36+
37+ What changed in Rats: the script now carries this project's id (prj_74ae87b16d2a) and posts it to the Rats app on the browser's machine (127.0.0.1:7287), which files it on the server. No 'rat-king devnotes' process, no loopback-only check, no SSH tunnel. So the 1013 route works: open http://192.168.122.10:8080 from the host with the Rats app open, Ctrl+click anything.
38+
39+ CHECKED (in the VM): go vet and go test pass. Dev server restarted; / and /projects/ on 192.168.122.10:8080 carry the new script, public/index.html does not. agent-browser on http://192.168.122.10:8080: script active (it stayed off there before), Ctrl+click on the h1 opened the 'What should change?' form.
40+
41+ NOT CHECKED: sending a ticket. The VM has no Rats app on 7287, so the send has to come from your host browser; that first real ticket is yours. The page has no Content-Security-Policy, so connect-src needs nothing.