Commit be29c41
committed
feat(viz): add viz monitor web dashboard
Introduces the `humanize monitor web` command and its Flask + SPA
dashboard for RLCR sessions, plus the accumulated review-phase
fixes and UX polish.
Feature
- Per-project session discovery and summary (state.md, goal tracker,
round summaries, review results, methodology reports).
- Pipeline canvas with snake-path node layout, SVG connectors, pan /
zoom, and per-round flyout details.
- Session-detail page carries a below-canvas live-log panel with a
three-state toggle (collapsed / normal / expanded) driven by
--log-h and a single grid-template-rows declaration. Clicking a
pipeline node auto-collapses the log; closing the flyout restores
the prior state.
- Incremental pipeline update (_updatePipelineIncremental) appends
or replaces individual nodes and redraws only the SVG connectors,
preserving zoom / pan across round additions.
- Diff-based home refresh: only cards whose rendered HTML changed
are replaced; unchanged cards stay untouched.
- Per-session SSE live-log streaming from ~/.cache/humanize with
snapshot / append / resync / eof / retained-replay protocol.
- Active-log selection mirrors the CLI monitor: pick the top
round's codex-run log, with codex-review / gemini-run /
gemini-review fallbacks.
- REST + WebSocket + SSE transports. Localhost binds skip auth;
remote binds require a bearer token (Authorization header for
fetch, ?token= query for SSE) plus origin-matched CSRF gating on
every mutating route.
- Ops-menu Preview Issue flow: calls local Claude CLI to generate
a sanitized methodology report (humanize issue taxonomy), shows
a preview modal, and submits via `gh issue create --repo
humania-org/humanize`. Falls back to a copy-to-clipboard path
when gh is unauthenticated.
- Active-session dynamic progress visualization, methodology report
generation via local Claude CLI, and a comprehensive frontend test
suite.
Correctness and safety
- broadcast_message uses set.difference_update to avoid the
UnboundLocalError from Python treating `-=` as a local rebind.
- Session path validation rejects `..`, dotfiles, symlink escapes;
plan-file reads are constrained to the project / session dir.
- Remote-mode auth fail-closed when no token is configured.
- CSRF layer enforced on every mutating route, including wildcard
binds and IPv6 literals.
- Parser accepts table-form acceptance criteria and legacy /
single-letter criterion ids; multi-id table cells are split
correctly; COMPLETE verdict only fires on terminal lines.
- Finalize-phase classification scoped to the live round, and
skip-impl sessions correctly classify round 0 as review-only.
Transport and watcher
- watcher.py starts a cache-log observer per active session that
broadcasts `round_added` when a new round-N-*.log file appears,
so the dashboard switches the live-log pane to the new round
without waiting for the next state.md write.
- SessionWatcher.on_session_created hook primes cache-log observers
for brand-new sessions; every event retries the hook so the
state-dir-before-cache-dir race eventually heals.
- Non-destructive toggleTheme (no DOM rebuild). The analytics route
is the only surface whose charts bake CSS vars into SVG at render
time, so that route alone re-renders on theme change.
- Remote-mode slow polling (10s) uses the same targeted refresh
helpers as the WS path so card counters and pipeline nodes catch
up without a full-page reload.
- Session-detail refresh race guard: after awaiting
/api/sessions/<id>, re-check the active route + layout skeleton
before mutating DOM.
Install and CLI
- Preflight codex_hooks and idempotent hook merge when paths contain
spaces.
- Relaxed runtime detection and tolerate unwritable default shim
paths.
- `humanize monitor web` foreground mode passes --host explicitly,
IPv6 brackets in the printed URL, readiness probe is fail-closed.
Parser and API
- /api/sessions summary carries every field the terminal
`humanize monitor rlcr` status bar needs (push_every_round,
ask_codex_question, agent_teams, drift, stall count,
ultimate_goal, tasks_active / deferred, active_log_path,
git_status, etc.).
- cache_logs entries carry round / tool / role / path / basename
for deterministic client-side selection.
Version: 1.17.0.
Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>1 parent 5990827 commit be29c41
41 files changed
Lines changed: 12847 additions & 7 deletions
File tree
- docs
- drafts
- plans
- scripts
- lib
- tests
- viz
- scripts
- server
- static
- css
- js
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments