06.1 · Drain absorption: trog drain/bench, conductor + bash profiles retire #22
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cmoriarty/trog#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 2 of the command layer (#21). The orchestrator already owns everything a drain needs — seat lifecycle, GPU-conflict parallelism (audio ∥ animate = the conductor's stage-B), brain bracketing with always-restore, and the queue — so batch drains move in and the bash stack retires.
trog drain— consumeorigin='drain'jobs through the orchestrator: image exclusive first, then audio ∥ animate (the existing runnable() matrix already encodes this), post-drain critics → review page → mirror (portpost_drainfrom conductor.sh into python)trog bench— queue the canned big-and-obvious spec (asset-bench.sh becomes a spec constant + submit call)trog updatereal story — wrap check-updates/try-updates + image build/redeploy reporting; decide what stays laptop-side (builds stay make)--from— cover/repaint routes on the audio seat (audio-server image work in agentic-game-dev: expose ACE src_audio/cover + SAO-style restyle if feasible), then the orchestrator route + spec field (the 422 guard drops)Exit:
make assets-drain/make asset-benchdeleted; a full drain runstrog drainend-to-end with the same guarantees (restore trap, per-item truth in the queue, review + mirror).Implemented in
2435df4(main).Done
trog drain— drain engine moved into the orchestrator (trog_lib.drain): stage A image exclusive, stage B audio ∥ animate via the existingrunnable()GPU matrix;POST /drain+GET /drainevent feed, CLI streams the same spinner UX as one-offs. Per-item truth stays in the queue; a lane's seat failure fails its job and the rest continues.trog_lib.review, async port of asset-review.py) → mirror via the Forgejo archive API into/mnt/output/games/(no git binary in the container).cycle()ported: 3-pass cap; commit-keyed verdict cache + prior-fail-never-requeues already live server-side.trog bench— spec constant +POST /bench;trog bench --drainchains into a drain.trog update— CLI self-update hint + runscheck-updates.pyfrom a checkout (cwd orTROG_SRC);--tryruns try-updates. Builds/deploys staymake deploy.assets-drain asset-bench cycle-test seat-*make targets. critic-test.sh now renders the review page in-container viapython -m trog_lib.review.reconcile()covers a crash mid-drain.Not done (blocked)
--from(cover/repaint) — needs ACE src_audio/cover routes in the audio-server image (agentic-game-dev). The 422 guard stays and now points here.72 tests pass (5 new in tests/test_drain.py), ruff clean. Ship:
make deploy+uv tool upgrade trog-cli. Mock cycle =trog drainagainst anORCH_SEAT_MODE=mockorchestrator until phase 3'strog test cycle.Test instructions (
2435df4)0. Unit tier (laptop, no deploy)
Expect: 72 pass (5 new in
tests/test_drain.py), ruff clean.1. Ship it
2. Mock cycle (plumbing, no GPUs, brain untouched)
Set
ORCH_SEAT_MODE=mockin the Portainer stack env, redeploy, then:Expect: stage A then "stage B: audio + animate in parallel" in the event stream; per-job done lines; critics summary line per game; "review page updated"; "mirrored -> http://trogdor:3923/games/asset-bench/assets/review.html". Open the review URL — cards render, mock checkerboards fine here. Queue empty after (
trog status).Unset
ORCH_SEAT_MODEand redeploy before step 3.3. Real bench (the actual quality regression, ~30 min)
Watch for: brain goes down once for stage A; audio and animate genuinely overlap in stage B; brain restored at the end (
trog statusshows brain up). Judge the review page by eye — big knight/apple/chest are the point.If critics fail anything first-time, expect a second pass in the same run ("critics requeued work — regeneration pass next"), capped at 3.
4. Guarantees to poke
trog drainre-attaches (409 → "already running — attaching").reconcile()removes orphan seats and restores the brain.trog sfx "finger snap"one-off during stage A: it must NOT be consumed by the drain (origin split) and runs when GPUs free up.5. Leftovers still on make
Regression watch:
make assets-drain/make asset-benchare gone — anything scripted against them needs the trog commands.Update (
5537f21): no stack-env fiddling needed for the mock tier anymore —--mockis a per-run flag.Step 2 becomes:
or in one line:
trog bench --mock --drain.Expect the same checks as before (stage A → "stage B: audio + animate in parallel", critics line, review page, mirror at
:3923/games/cycle-test/…) plus a first event line "mock drain: local stub seats, brain untouched". Critics/review/mirror stay real — only the seats are stubs.Guard ported from cycle-test.sh:
trog drain --mockrefuses (409, with the game list) while any real game has queued/claimed/running drain work — mock output overwriting real assets was the live-caught failure this guards against. Extra poke for step 4: queuetrog bench(real) then trytrog drain --mock— expect the refusal naming trog-games/asset-bench.ORCH_SEAT_MODE=mockstill exists for a fully GPU-less orchestrator (mocks one-offs too); the flag doesn't replace it, it just makes the plumbing tier one command.Naming pass (
7e9ced9) —drain/benchdescribed queue plumbing, not intent, andbenchdidn't run what it queued. New CLI surface:trog draintrog process-asset-queuetrog bench --mock --draintrog asset-mock-testtrog bench --draintrog asset-testBoth test commands take
--queue-onlyto just enqueue (thentrog process-asset-queuelater). The--draincombo flag is gone — tests run what they queue.Revised test instructions:
Step 4 guard poke:
trog asset-test --queue-onlythentrog asset-mock-test— expect the 409 naming trog-games/asset-bench.Server API (
POST /drain,POST /bench) andtrog_lib.drainkeep their internal names — only the user-facing layer renamed.Final report — closing
Everything on this ticket is implemented, deployed (stack + image current, CLI 0.4.2), and verified end-to-end on the real system.
Delivered
trog process-asset-queue— drain engine in the orchestrator (trog_lib.drain): image exclusive → audio ∥ animate, post-drain critics → review page (trog_lib.review) → mirror via Forgejo archive API, 3-pass regen cycle. Present-tenseactivemap drives the CLI spinner; events are dim history.trog asset-mock-test— end-to-end plumbing smoke test: canned spec with declared expectations (pass briefs describe the stub media, fail briefs are mismatch sentinels), per-run in-process stub seats, fresh judging,PLUMBING OK/FAILEDverdict,expected verdicts: N/Mbefore the review URL. Review page chips each declared assetexpected pass|fail+✓ as expected/✗ unexpectedwith a legend.trog asset-test— real-seat fixed-input quality check, end-to-end by default (--queue-onlyto just enqueue).trog update— CLI hint + check-updates/try-updates drift report (currently: brain image + docker pin behind).python -m trog_lib.reviewin-container (verified: 7 judged, orange sentinel fails, review served).Verified (final round)
asset-mock-test: PLUMBING OK, 7/7 expected verdicts, 193s, brain untouched.asset-test: full 34-min real run — brain swapped out once and restored, FLUX/Wan/audio all delivered, critics 8 judged / 2 failed (apple leaf color, chest style — legit #18 calibration data), review + mirror verified visually.process-asset-queueon empty queue: clean no-op.trog status,trog update: working.Live-caught bugs fixed along the way
last_usedonly moves on item completion; the sweep stopped the image seat under it.SeatManager.busy()hold now marks in-flight generations; sweep skips held seats. (The mock tier structurally can't catch this — stub items finish in ms.)path?ref=main(file in tree, raw 200) → every overwrite became a doomed create (422). Contents paths now %2F-encoded.[game]/[1/3]in CLI output; verdict cache pinned stale verdicts for never-changing stub bytes (mock runs judge fresh now).Left open (tracked elsewhere)
--from(cover/repaint): blocked on ACE src_audio/cover routes in the audio-server image (agentic-game-dev). The 422 guard stays.Exit criteria met:
make assets-drain/make asset-benchdeleted; a full drain runs throughtrogend-to-end with the same guarantees (restore trap via SeatManager + boot reconcile, per-item truth in the queue, review + mirror).