Commit graph Vili/scripts
Author SHA1 Message Date
Meta Vens
f71aeedad1 Pin that a client hang-up mid-job leaves the slot held
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 03:09:06 +02:00
Meta Vens
9e79b00ce1 Drop access-control-allow-origin: * from every response
No browser caller exists, so no page needs to read the daemon. The wildcard let any page read /gpu-permission and /operator-state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 03:09:05 +02:00
Meta Vens
3fa19d7590 Delete GET /smoke, make GET read-only, listen on loopback and WireGuard only
GET /smoke ran docker run --gpus all and started the resident worker outside the gate, reachable by any page or LAN host while the household's switch was off. Its only callers were scripts/smoke-vili.mjs and the Eve Smoke button, so the route, the script, the button and the advertised endpoints go. refreshBackendStatus lost its includeKimodoHelp GPU branch and every service docker start: a GET now only asks. The worker starts only inside a job that holds the slot.

--host takes the addresses to listen on, one server each (Raven: 127.0.0.1,10.77.0.4); a wildcard refuses to start. Callers are the tray and health (loopback) and WireGuard peers (Starfire, services).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 03:09:05 +02:00
Meta Vens
e37a2ad3ec Pin the daemon's slot hold at the HTTP edge with a stubbed slow worker
A real daemon on stub wsl.exe and nvidia-smi.exe runs one job held open by the test; requests during
it are 503 source slot, the slot frees at the job's end, and the next job is admitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:29:49 +02:00
Meta Vens
cb36beb09a Refuse cross-site POSTs to the state-changing routes and grant no CORS preflight
POST /gpu-permission and POST /motion/generate now require Content-Type application/json and
refuse a request whose Origin is present and not the daemon's own loopback origin, 403 cross-site,
before the body is read. The blanket OPTIONS handler that approved any preflight is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:29:43 +02:00
Meta Vens
5a60255ac2 Make the slot's release idempotent so a stale second release cannot free another job's slot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:26:04 +02:00
Meta Vens
455cedb3c3 Mutation triage: drop a redundant null guard in parseFreeMiB
String(null) and String(undefined) already fail the integer test, so the
?? "" guard decided nothing; the Stryker mutant of it survived.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 01:49:01 +02:00
Meta Vens
375c2faf4e Add the household's tray toggle and its logon task
vili-gpu-tray.ps1 is one NotifyIcon in the interactive session: it lowers
GET /gpu-permission to an icon and tooltip and POSTs an absolute value on click.
It holds no state, reads no process list and writes no file.
install-vili-tray-task.ps1 registers only GameCult\ViliTray at logon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 01:45:44 +02:00
Meta Vens
736a1a7ab8 Build the GPU permission: the household's yes or no, owned by the daemon
gpu-tenancy.mjs judges permission, then the one slot, then one host free-VRAM
read per admission. The permission is a gamecult.vili.gpu_permission.v1
document in vili.service.cc, set only from loopback at POST /gpu-permission;
absent means not allowed. The daemon holds one CultCache instance. Tests pin
the gate with fake ports and the daemon edge over HTTP, including the slot
wiring through acquire() (finding s2 slot-wiring-unpinned).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 01:45:08 +02:00
Meta Vens
ed07c5a4af Delete the GPU detection gate: probe child, supervisor, thresholds and their tests
The household's use is no longer detected. gpu-probe.mjs, the PowerShell probe
child, the hysteresis/3D/full-screen/own-VRAM rules, three env variables and the
README paragraph go; the gate keeps only the single slot and the placement
refusal until the permission lands in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 01:42:33 +02:00
Meta Vens
a2b9983183 Mutation triage: drop two redundant guards in the probe, pin baseline, double release and env messages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 00:29:13 +02:00
Meta Vens
bacc3faaa0 Tests: probe respawn tests keep the watchdog out of the way; watchdog test timing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 00:20:29 +02:00
Meta Vens
4ac85a65a5 Tests: fix a broken string literal in the probe watchdog test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 00:19:58 +02:00
Meta Vens
5050de58b5 Gate: one slot judged where the GPU is taken, own VRAM discounted, truthful placement body, env refusal
acquire() judges at the slot: household signals first (admission), then a held slot (slot);
nothing queues, so a request can no longer wait on the worker lock past a changed gate. While
Vili's job holds the slot, and until free VRAM recovers to its pre-job level (capped), low free
VRAM is not the household's; full-screen and 3D always count. A sample with no resolved 3D
counters is a probe fault and the gate fails closed. The placement 503 carries no gate status.
A malformed VILI_GPU_* override refuses to start, naming the variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 00:19:08 +02:00
Meta Vens
9ec048844b Probe: own module, 3D counter path as a tested constant, engines count, hung-child watchdog
The probe's sample plumbing leaves the gate module (the gate never kills; the probe may kill
its own hung child). The counter path is one exported constant passed to the script as
-Util3dPath, the script reports how many 3D engine counters resolved, and a child that is
alive but silent for 3 intervals is killed and respawned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 00:19:07 +02:00
Meta Vens
62485dab15 Probe: read nvidia-smi's exit code after the pipeline drains
Select-Object -First 1 closes the pipe early and leaves LASTEXITCODE -1, so
every iteration threw and the probe wrote no samples (found on Raven).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:32:09 +02:00
Meta Vens
d921731a11 Tests: kill the mutants that were real (threshold edges, stale since, probe argv and respawn timing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:27:32 +02:00
Meta Vens
d9d396748d Tests: the clear hold counts from the first clear sample
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:24:20 +02:00
Meta Vens
2b5b900eca Tests: free the gate through a real clear hold before asserting transitions
The hold is measured between consecutive samples; a 180 s gap is a stale
probe, not a hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:22:08 +02:00
Meta Vens
880f1c2dcf Worker: error body carries the typed code (closes gpu-busy-untyped-http)
worker_error_body is the worker's one error wire shape; GpuBusy.code
reaches the daemon as a field. GpuBusy is documented as placement only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:13:50 +02:00
Meta Vens
38491f8917 Daemon: admit /motion/generate through the tenancy gate, typed 503 gpu-busy
Refuse a new job with 503 + retry-after 60 while the GPU is in use (source
admission); a placement refusal from the encoder child also answers 503
(source placement). Publish the gate as operator_state.gpu. A running job
is never touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:13:49 +02:00
Meta Vens
54e680f284 GPU tenancy gate: hysteresis gate, probe child and tests
One owner for "may heavy GPU work start": numbers-only samples (full-screen
state, sustained 3D use, host free VRAM) in, { inUse, since, checkedAt,
probeOk } out; fail closed at start and when the probe goes stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:13:49 +02:00
Meta Vens
02ca1cd6d8 Vili README and tests: describe the embedding cache and the transient encoder
Replaces the 2026-06-12 timing paragraph with the cache, the child, and the numbers
measured on Raven on 2026-10-22. Adds the tests hand mutation showed missing: the
exact 2 GiB boundary, a child answer with too few vectors, and the 4096 dimension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:40:42 +02:00
Meta Vens
f6acfc1c85 Vili worker: Kimodo's text encoder is the cache, not a resident 8B model
The worker builds CachedTextEncoder and passes it to load_model, so Kimodo's own
encoder selection (and the CPU encoder behind TEXT_ENCODER_DEVICE) is never built.
generate() returns the per-request encoder record (identity, hits, misses, seconds,
vector hashes) and the worker identity; /health adds the identity and stored count.
startKimodoWorker drops TEXT_ENCODER_DEVICE and mounts the scripts directory, the
cultcache-py source and .vili/embeddings, with the Kimodo commit and image id read
once per worker start. The encode clock is perf_counter: time.time went backwards
under WSL during a probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:18:17 +02:00
Meta Vens
76ab8308eb Vili: text-embedding cache and one-shot GPU encoder child
text_encoding.py holds the CultCache embedding store (gamecult.vili.text_embedding.v0
through cultcache-py), the encoder identity and key, plan_placement with its typed
gpu-busy refusal, and CachedTextEncoder, which sends a request's misses to one child
call. kimodo-text-encode.py is that child: it assembles Kimodo's LLM2Vec encoder in
bf16 with its own loader (operator ruling encoder-own-loader; peft's offload path
raises TypeError in Kimodo's loader), encodes each text alone, writes a MessagePack
answer and exits. GPU reserve 3 GiB: four cold runs on Raven's 16 GB card produced
identical vectors with no CUDA error. The worker and daemon are not wired yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:10:01 +02:00
Meta Vens
3778830df4 Vili: delete the unsigned Idunn RUDP health publisher
It published idunn.daemon_health to 10.77.0.2:17870 (the retired Windows Idunn)
every 15 s and failed each time; Idunn on Yggdrasil binds no RUDP health ingress.
Deletes idunn-rudp.cjs, the publisher and its status, the --idunn-* args in the
daemon and the three launcher scripts, operator_state slot 4, and the
cultnet-ts and direct @msgpack/msgpack dependencies. transportProfile now states
local-cultcache-only. All commits build (node --check passes); not yet run on Raven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:12:00 +02:00
Meta Vens
8773c153c8 Remove unused readFile import and dead backend-status.json initializer
REC-120:

- Removed the unused `readFile` import (`readFile(` had zero call
  sites in the file).
- Removed the never-read `backend-status.json` initializer block; the
  `backendStatus` in-memory object it snapshotted is still very much
  alive (read at lines 287, 378, 489, 504, 509, 515, 768) and untouched
  here.
- Also removed the `existsSync` import, which the initializer block
  was its only caller for; left in place it would have become a second
  dead import introduced by this same cut.

Kill attempts that failed: none.
- `rg -n "readFile\(" scripts/vili-daemon.mjs` -> no matches (repeated
  the census command against current HEAD).
- `rg -n -F --glob '!scripts/vili-daemon.mjs' 'backend-status.json' .`
  -> no matches in this repo; cross-repo `rg -n 'backend-status\.json'`
  over F:/Projects only turns up Odin's
  docs/transport-shortcut-inventory.md, which documents the shortcut
  rather than reading the file.

Checks run: `node --check scripts/vili-daemon.mjs` -> syntax OK. No
package.json/test suite exists in this repo to run beyond that.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-13 14:18:49 +02:00
Meta Vens
8627297a6e Write Vili service state to CultCache 2026-06-16 10:39:54 +01:00
Meta Vens
50c424380c Publish Vili health over Idunn RUDP 2026-06-16 10:22:31 +01:00
Meta Vens
7cb320d11f Keep Raven Vili task background-only 2026-06-16 02:25:13 +01:00
Meta Vens
16d74cb674 Expose Kimodo generation options 2026-06-13 00:55:34 +01:00
Meta Vens
3560548146 Make Kimodo generation resident 2026-06-12 18:04:43 +01:00
Meta Vens
c22913c041 Run Vili scheduled task hidden 2026-06-12 17:22:20 +01:00
Meta Vens
b7297acbcd Use Kimodo input folders for generation prompts 2026-06-12 15:07:01 +01:00
Meta Vens
2f6a5bd2ce Decode generation prompts inside WSL 2026-06-12 15:00:08 +01:00
Meta Vens
974656a13b Allow Kimodo containers to warm Hugging Face cache 2026-06-12 14:32:34 +01:00
Meta Vens
e8dc7d08d7 Use Kimodo output stem for generation jobs 2026-06-12 14:24:58 +01:00
Meta Vens
ea9c7f8845 Pass Hugging Face token into Kimodo containers 2026-06-12 13:57:14 +01:00
Meta Vens
01f6bb9c6e Run Vili task with Raven user WSL access 2026-06-12 12:49:19 +01:00
Meta Vens
d59a76d8ea Run Vili scheduled task as SYSTEM 2026-06-12 12:47:54 +01:00
Meta Vens
de2ad53e48 Run Vili through a Raven scheduled task 2026-06-12 12:46:44 +01:00
Meta Vens
ca6a172cdd Initial Vili animation daemon 2026-06-12 12:42:33 +01:00