WIP: feat(dashboard): a local page of sessions, PRs, the queue, disk and workspaces #26

Draft
dyst wants to merge 1 commit from dyst/Tooling:feat/dashboard into main
Member

Summary

Someone working on Longshot with several agents at once has no single place to see what is going on: which session holds which worktree and which ones nothing holds any more, their PRs and whether they still merge, what the job queue runs and why it waits, results, disk use and stale locks. This is a local page for that: python -I -B dashboard/serve.py, then http://127.0.0.1:8765 (it listens on 127.0.0.1 only).

This is a WIP push of the working prototype so it can be worked on together, not a PR to review for merge yet. It is the prototype as it runs on one Windows PC, copied in as it is, with one change: it finds the workspace from Tooling's clone, or from MAGICBEAN_WORKSPACE. dashboard/MIGRATION.md is the plan from here to Tooling's shape, as about ten smaller PRs (the first, the Windows fix to workspaces.recent_mentions, is #25). This one will be split up along that plan or closed once the pieces exist.

What is in it (dashboard/README.md has the details and the rules behind each flag; dashboard/OVERVIEW.md is the write-up):

  • Work: each Claude Code session, the worktrees it works in, and which worktrees are finished or orphaned.
  • PRs: from Forgejo through forge.py's sign-in, only on Refresh (nothing polls), plus conflicts from a local trial merge.
  • Queue: Longshot's job queue (dev.py queue, status --json once Longshot #1852 is in): running, waiting and why, slots, moving a job.
  • Results, Disk, Locks: the queue's history, a disk scan that counts hard links once (run as a queue job), stale lock files.
  • Actions: each one planned before it runs (remove a worktree, clear a lock). Requests: compile, checks, build, play, A/B, shots of a PR or a branch, each step through the queue.
  • Toasts of Forgejo news, on demand.

Standard library Python 3.8+ and one HTML page, no build step, no Node dependency at run time.

Testing

Tested: Windows 11, the server from this branch: the page and /api/overview, /api/queue, /api/locks, /api/prs all answer (200). The prototype has been in daily use on that PC since 2026-11-19: the actions' end-to-end script, checks requests run for real for Longshot and Tooling, a launcher compile. Not run on Linux yet.

Checks: tests/run_all.py gives the same result as on main (6 of 8; test_workspaces fails on Windows on main too, fixed by #25, and test_release fails there too). The dashboard's own tests (dashboard/tests/) are scripts against a running server and a Node render test, not yet offline tests/test_*.py: that is step 7 of MIGRATION.md.

Still to test:

  • linux: start it, open each tab, run a disk scan
  • the rest as MIGRATION.md's PRs land

Measurements

Nothing to measure yet for a WIP prototype. On the PC it runs on: the PRs tab answers in about 0.5 s warm, the Work tab in about 7 s cold (session transcripts).

Risks

None to Tooling: a new folder, nothing else in Tooling changes or imports it. It runs only when started. Its actions remove worktrees and lock files only after a plan the user confirms. state/ (caches, notes) and the copied fonts are ignored, not committed.

What is not done (for whoever picks a piece up)

  • Paths: the one-PC layout (<workspace>/src/..., <workspace>/longshot/...) is built in, in about 45 places.
  • jj workspaces (the team's way) beside git worktrees.
  • Longshot's own parts (build steps, scenarios, the A/B and play harnesses, teleport targets) belong in Longshot, loaded by the dashboard.
  • Offline tests against a made-up workspace, a --demo mode for screenshots, a run on Linux.

🤖 Generated with Claude Code

## Summary Someone working on Longshot with several agents at once has no single place to see what is going on: which session holds which worktree and which ones nothing holds any more, their PRs and whether they still merge, what the job queue runs and why it waits, results, disk use and stale locks. This is a local page for that: `python -I -B dashboard/serve.py`, then http://127.0.0.1:8765 (it listens on 127.0.0.1 only). **This is a WIP push of the working prototype so it can be worked on together, not a PR to review for merge yet.** It is the prototype as it runs on one Windows PC, copied in as it is, with one change: it finds the workspace from Tooling's clone, or from `MAGICBEAN_WORKSPACE`. `dashboard/MIGRATION.md` is the plan from here to Tooling's shape, as about ten smaller PRs (the first, the Windows fix to `workspaces.recent_mentions`, is #25). This one will be split up along that plan or closed once the pieces exist. What is in it (`dashboard/README.md` has the details and the rules behind each flag; `dashboard/OVERVIEW.md` is the write-up): - **Work**: each Claude Code session, the worktrees it works in, and which worktrees are finished or orphaned. - **PRs**: from Forgejo through `forge.py`'s sign-in, only on Refresh (nothing polls), plus conflicts from a local trial merge. - **Queue**: Longshot's job queue (`dev.py queue`, `status --json` once Longshot #1852 is in): running, waiting and why, slots, moving a job. - **Results, Disk, Locks**: the queue's history, a disk scan that counts hard links once (run as a queue job), stale lock files. - **Actions**: each one planned before it runs (remove a worktree, clear a lock). **Requests**: compile, checks, build, play, A/B, shots of a PR or a branch, each step through the queue. - **Toasts** of Forgejo news, on demand. Standard library Python 3.8+ and one HTML page, no build step, no Node dependency at run time. ## Testing **Tested:** Windows 11, the server from this branch: the page and `/api/overview`, `/api/queue`, `/api/locks`, `/api/prs` all answer (200). The prototype has been in daily use on that PC since 2026-11-19: the actions' end-to-end script, checks requests run for real for Longshot and Tooling, a launcher compile. Not run on Linux yet. Checks: `tests/run_all.py` gives the same result as on `main` (6 of 8; `test_workspaces` fails on Windows on `main` too, fixed by #25, and `test_release` fails there too). The dashboard's own tests (`dashboard/tests/`) are scripts against a running server and a Node render test, not yet offline `tests/test_*.py`: that is step 7 of MIGRATION.md. **Still to test:** - linux: start it, open each tab, run a disk scan - the rest as MIGRATION.md's PRs land ## Measurements Nothing to measure yet for a WIP prototype. On the PC it runs on: the PRs tab answers in about 0.5 s warm, the Work tab in about 7 s cold (session transcripts). ## Risks None to Tooling: a new folder, nothing else in Tooling changes or imports it. It runs only when started. Its actions remove worktrees and lock files only after a plan the user confirms. `state/` (caches, notes) and the copied fonts are ignored, not committed. ## What is not done (for whoever picks a piece up) - Paths: the one-PC layout (`<workspace>/src/...`, `<workspace>/longshot/...`) is built in, in about 45 places. - jj workspaces (the team's way) beside git worktrees. - Longshot's own parts (build steps, scenarios, the A/B and play harnesses, teleport targets) belong in Longshot, loaded by the dashboard. - Offline tests against a made-up workspace, a `--demo` mode for screenshots, a run on Linux. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The dashboard from one PC's workspace, as it runs there: sessions and what they
hold, PRs, the job queue, results, disk, locks, Forgejo toasts, planned actions
and requests. Not yet Tooling's shape: MIGRATION.md is the plan for that.

Here it finds the workspace two folders above the Tooling clone, or from
MAGICBEAN_WORKSPACE. state/ and the copied fonts are not committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
BeanBot left a comment

Recommendation: Request changes. The dashboard can change or remove work that another session is using, and its advertised build and measurement paths are not yet reliable. Its fixed workspace model and missing offline checks also prevent it from working as a shared Tooling feature.

The page could consolidate session, queue and PR information, but the current prototype trades that convenience for unsafe workspace actions, broken build recipes and potentially misleading A/B results. The migration plan is a sensible direction; the individual pieces need these safeguards before merging.

Does it help: Unproven. The author reports Windows endpoint responses, daily prototype use and approximately 0.5 s warm for PRs and 7 s cold for Work; these do not establish that the requests, cleanup and measurements work across supported setups. This is not a performance optimization.
Other systems: Windows and Linux share destructive actions and the queue; Linux has not been run. Requests affect Longshot and Launcher builds, shared bases and timed runs; current recipes use removed Longshot commands. Existing environment-configured stores can be redirected. No game, audio, input or save compatibility was established.
Switches: MAGICBEAN_WORKSPACE defaults to a parent inferred from Tooling; MAGICBEAN_TOOLING defaults to the checkout. Those defaults assume the prototype layout, not the documented sibling-checkout layout. The server also overrides LONGSHOT_DEV_HOME, LONGSHOT_OBJ_STORE, LONGSHOT_LIFT_STORE, LONGSHOT_LAUNCHER_HOME, TEMP and TMP for its children; this is not appropriate for existing configured setups. Queue settings are editable with existing defaults supplied by Longshot; their safe behavior is not established. A/B forces HOS_FPS_MAX=1000.

Reviewed: 1f39e026be against 0b0059acd2: Head 1f39e026be against 0b0059acd2: read repository rules, migration, overview and README; server, Python libraries, recipes, generator and dashboard tests in full. Read index.html and start.cmd; app.js output was truncated, so only its first portion was read. CSS, theme and remaining JS were not read; aggregate diff was truncated. No code was run. No PR template or review checklist was found at the named paths.; nothing run (a code review).
Checked and fine:

  • Server binds to loopback and requires a custom header on POST.
  • Worktree removal checks git status and refuses the main checkout.

Blocking (to change before merge)

  1. dashboard/lib/runner.py:130: When the designated request worktree already exists, checkout checks only git dirtiness, not whether a session or job uses it. A second request for the same PR after a push can detach and move a clean worktree under an active agent. Reserve a request-owned worktree and check its users immediately before changing it, including concurrent requests.
  2. dashboard/lib/locks.py:96: A session working from another cwd on files in a worktree is only a mention warning, and queue lookup errors are silently treated as no jobs. Removal can therefore delete a clean worktree and its ignored files while it is in use. Treat active work mentions and unknown usage as blockers, and coordinate deletion with the queue rather than relying on an unlocked snapshot.
  3. dashboard/lib/actions.py:266: Probing the base lock releases it before deletion, and an unknown probe is accepted. A build can acquire that lock between the probe and deletion; deleting the lock file can also allow a second lock inode on Linux. Hold the queue's actual lock throughout the operation, fail closed on unknown, and preserve the lock file.
  4. dashboard/lib/common.py:28: Startup overwrites configured development, store and launcher paths with the prototype layout. On a normal sibling-checkout setup this creates or uses different stores and potentially a different queue from other agents. Discover the supported workspace configuration and respect its precedence rather than imposing paths.
  5. dashboard/lib/work.py:130: Compile, build, play, A/B and shots invoke dev_build.py, which the README says current Longshot removed. These advertised requests fail on current checkouts; port them to the supported Longshot provider and queue interface or disable them until available.
  6. dashboard/recipes/abrun.py:40: Teleport and load failures are ignored, so the harness can measure the previous scene and label it as the requested scene; the summary can then report a false A/B gain. Fail the run on bridge errors and verify the destination and samples before reporting results.
  7. dashboard/tests/actions_e2e.py:33: The end-to-end test unconditionally deletes a fixed directory in the user's real development bases before making its fixture. A pre-existing base with that name is lost. Use a uniquely created isolated fixture and refuse to touch existing data.
  8. dashboard/MIGRATION.md:23: The changes have no checks in Tooling's offline tests/run_all.py, contrary to CONTRIBUTING.md. Add offline behavioral tests for path selection, action safety, request concurrency, queue failures and measurement errors in the same change.

Testing: Author reports Windows 11 endpoint smoke tests, real checks requests, a launcher compile and action script; 6 of 8 repository checks pass with two reported baseline failures. Linux, the build/game recipes and isolated offline dashboard tests remain unverified. Nothing was run for this review.
Overlaps and merge order: Tooling #25 fixes Windows workspace mentions and is planned first; use its shared detection after it lands. Longshot MagicBeanDev/Longshot#1852 supplies the queue interface and should precede the dashboard's integration with it.


Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The dashboard can change or remove work that another session is using, and its advertised build and measurement paths are not yet reliable. Its fixed workspace model and missing offline checks also prevent it from working as a shared Tooling feature. The page could consolidate session, queue and PR information, but the current prototype trades that convenience for unsafe workspace actions, broken build recipes and potentially misleading A/B results. The migration plan is a sensible direction; the individual pieces need these safeguards before merging. **Does it help:** Unproven. The author reports Windows endpoint responses, daily prototype use and approximately 0.5 s warm for PRs and 7 s cold for Work; these do not establish that the requests, cleanup and measurements work across supported setups. This is not a performance optimization. **Other systems:** Windows and Linux share destructive actions and the queue; Linux has not been run. Requests affect Longshot and Launcher builds, shared bases and timed runs; current recipes use removed Longshot commands. Existing environment-configured stores can be redirected. No game, audio, input or save compatibility was established. **Switches:** MAGICBEAN_WORKSPACE defaults to a parent inferred from Tooling; MAGICBEAN_TOOLING defaults to the checkout. Those defaults assume the prototype layout, not the documented sibling-checkout layout. The server also overrides LONGSHOT_DEV_HOME, LONGSHOT_OBJ_STORE, LONGSHOT_LIFT_STORE, LONGSHOT_LAUNCHER_HOME, TEMP and TMP for its children; this is not appropriate for existing configured setups. Queue settings are editable with existing defaults supplied by Longshot; their safe behavior is not established. A/B forces HOS_FPS_MAX=1000. **Reviewed:** 1f39e026be57 against 0b0059acd2df: Head 1f39e026be57 against 0b0059acd2df: read repository rules, migration, overview and README; server, Python libraries, recipes, generator and dashboard tests in full. Read index.html and start.cmd; app.js output was truncated, so only its first portion was read. CSS, theme and remaining JS were not read; aggregate diff was truncated. No code was run. No PR template or review checklist was found at the named paths.; nothing run (a code review). **Checked and fine:** - Server binds to loopback and requires a custom header on POST. - Worktree removal checks git status and refuses the main checkout. **Blocking** (to change before merge) 1. dashboard/lib/runner.py:130: When the designated request worktree already exists, checkout checks only git dirtiness, not whether a session or job uses it. A second request for the same PR after a push can detach and move a clean worktree under an active agent. Reserve a request-owned worktree and check its users immediately before changing it, including concurrent requests. 2. dashboard/lib/locks.py:96: A session working from another cwd on files in a worktree is only a mention warning, and queue lookup errors are silently treated as no jobs. Removal can therefore delete a clean worktree and its ignored files while it is in use. Treat active work mentions and unknown usage as blockers, and coordinate deletion with the queue rather than relying on an unlocked snapshot. 3. dashboard/lib/actions.py:266: Probing the base lock releases it before deletion, and an unknown probe is accepted. A build can acquire that lock between the probe and deletion; deleting the lock file can also allow a second lock inode on Linux. Hold the queue's actual lock throughout the operation, fail closed on unknown, and preserve the lock file. 4. dashboard/lib/common.py:28: Startup overwrites configured development, store and launcher paths with the prototype layout. On a normal sibling-checkout setup this creates or uses different stores and potentially a different queue from other agents. Discover the supported workspace configuration and respect its precedence rather than imposing paths. 5. dashboard/lib/work.py:130: Compile, build, play, A/B and shots invoke dev_build.py, which the README says current Longshot removed. These advertised requests fail on current checkouts; port them to the supported Longshot provider and queue interface or disable them until available. 6. dashboard/recipes/abrun.py:40: Teleport and load failures are ignored, so the harness can measure the previous scene and label it as the requested scene; the summary can then report a false A/B gain. Fail the run on bridge errors and verify the destination and samples before reporting results. 7. dashboard/tests/actions_e2e.py:33: The end-to-end test unconditionally deletes a fixed directory in the user's real development bases before making its fixture. A pre-existing base with that name is lost. Use a uniquely created isolated fixture and refuse to touch existing data. 8. dashboard/MIGRATION.md:23: The changes have no checks in Tooling's offline tests/run_all.py, contrary to CONTRIBUTING.md. Add offline behavioral tests for path selection, action safety, request concurrency, queue failures and measurement errors in the same change. **Testing:** Author reports Windows 11 endpoint smoke tests, real checks requests, a launcher compile and action script; 6 of 8 repository checks pass with two reported baseline failures. Linux, the build/game recipes and isolated offline dashboard tests remain unverified. Nothing was run for this review. **Overlaps and merge order:** Tooling https://git.magicbean.dev/MagicBeanDev/Tooling/pulls/25 fixes Windows workspace mentions and is planned first; use its shared detection after it lands. Longshot https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1852 supplies the queue interface and should precede the dashboard's integration with it. --- <sub>Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -0,0 +20,4 @@
| Dependencies | standard library; Python 3.8 syntax as far as a scan shows | the same: test on a 3.8 |
| Paths | **the personal workspace layout is built in** (`src/`, `src/working/`, `longshot/{dev,builds,logs,store}`, `analysis/`, `dashboard/state`): about 45 places | Tooling's own model: the checkouts **beside** Tooling (as `workspaces.py` finds them), the dev folders from the environment or the workspace file, its state in the config folder (`%APPDATA%\Longshot\dashboard`, `~/.config/longshot/dashboard`) unless the workspace file names another |
| Workspaces | git worktrees under `src/working/` | the team works in **jj workspaces** beside the repository (`../Longshot-<topic>`, `workspaces.py`): both, with jj first |
| Session detection | its own reading of transcripts (`lib/sessions.py`: edits and commands only) | **`workspaces.recent_mentions`**, once it works on Windows (see the first PR), so both tools agree |
Member

The dashboard has no offline tests in tests/run_all.py, which Tooling requires with the change. Add behavioral coverage for these paths and safety checks before merging.

The dashboard has no offline tests in tests/run_all.py, which Tooling requires with the change. Add behavioral coverage for these paths and safety checks before merging.
@ -0,0 +263,4 @@
if live:
return {"ok": False, "why_not": "a job is working in it: %s (pid %s, dev_packs.busy)" % (live[0]["what"], live[0]["pid"]),
"steps": []}
users = _users(p)
Member

The probe does not hold the lock during deletion, and unknown is accepted. A build can take the lock immediately afterward; hold the actual lock throughout deletion and preserve its file.

The probe does not hold the lock during deletion, and unknown is accepted. A build can take the lock immediately afterward; hold the actual lock throughout deletion and preserve its file.
@ -0,0 +25,4 @@
NO_WINDOW = 0x08000000 if WINDOWS else 0 # (CREATE_NO_WINDOW: no console flashes for git and powershell)
# (the workspace's saved variables, set here so a server started from an old shell never builds with stale ones)
ENV = {
Member

These values overwrite an existing configured dev home and stores for all spawned commands. On a different layout that splits shared state and potentially the queue; respect workspace configuration and environment precedence.

These values overwrite an existing configured dev home and stores for all spawned commands. On a different layout that splits shared state and potentially the queue; respect workspace configuration and environment precedence.
@ -0,0 +93,4 @@
jq = c.job_queue()
jobs = jq.read_tickets(jq.queue_dir(jq.settings()), clean=False)
except Exception:
pass
Member

An agent can work in this tree from another cwd, and a queue read failure here becomes an empty job list. Both can make deletion appear safe; treat active work mentions and unknown queue state as blockers.

An agent can work in this tree from another cwd, and a queue read failure here becomes an empty job list. Both can make deletion appear safe; treat active work mentions and unknown queue state as blockers.
@ -0,0 +127,4 @@
chosen = os.path.join(c.SRC, "working", os.path.basename(repo).lower(), args.get("folder") or "%s-pr" % args.get("pr"))
if os.path.isdir(chosen):
code, out, _ = c.run(["git", "-C", chosen, "status", "--porcelain"])
if code != 0 or out.strip():
Member

This fallback moves an existing clean worktree without checking its users. A second request after a PR push can change an active agent's checkout; reserve request-owned worktrees and check usage before moving them.

This fallback moves an existing clean worktree without checking its users. A second request after a PR push can change an active agent's checkout; reserve request-owned worktrees and check usage before moving them.
@ -0,0 +127,4 @@
if kind != "compile":
out["outputs"].append(rt)
rid = "{id}"
if kind == "checks":
Member

These recipes still invoke dev_build.py, which the README says current Longshot removed. Port to the supported provider/commands or block these requests until they work.

These recipes still invoke dev_build.py, which the README says current Longshot removed. Port to the supported provider/commands or block these requests until they work.
@ -0,0 +37,4 @@
def run_teleport(run, st):
t = ctl(run, "teleport", str(st["to"]), "--arrive", "90", check=False)
ctl(run, "wait", "loading_end", "--timeout", "120", check=False)
Member

A failed teleport or load is ignored, so the next measurement can be from the previous scene but reported under this label. Fail on bridge errors and verify arrival before collecting samples.

A failed teleport or load is ignored, so the next measurement can be from the previous scene but reported under this label. Fail on bridge errors and verify arrival before collecting samples.
@ -0,0 +30,4 @@
bad = False
shutil.rmtree(BASE, ignore_errors=True)
Member

This removes a fixed path in the real dev bases even if it already exists. Use a unique isolated fixture and never remove pre-existing data.

This removes a fixed path in the real dev bases even if it already exists. Use a unique isolated fixture and never remove pre-existing data.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/dashboard:dyst-feat/dashboard'
git switch 'dyst-feat/dashboard'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Tooling!26
No description provided.