A dashboard tab that stays open for a week keeps the memory of a fresh tab. A broadcast with no change does no DOM work. One tab holds one WebSocket. Large analytics answers do not stop the event loop. The service can report where its memory goes, to loopback callers only.
jacked/data/web/index.html:23), a fixed cost.content.innerHTML = renderAccounts(...) (app.js:289), about 19 KB for each rebuild. The data fetches alone and the countdown ticks alone are flat.sessions_changed broadcast every 60 s with no change (jacked/api/watchers.py:49-73), the poll (app.js:378), and the visibility handler.forceReconnect() (websocket.js:154) closes a socket that is still connecting; that socket's onclose (:106) then calls _scheduleReconnect() and connect() overwrites this.ws (:69). The replaced socket stays open with its onmessage, so each broadcast is handled once per orphan. Five wakes left six open sockets.sessions_changed per 10 minutes, 10 of them forced and 3 from real changes./api/admin/debug/tasks (jacked/api/routes/system.py:150) says "the dashboard binds to 127.0.0.1, so no auth is layered here". With remote access on, the dashboard serves the tailnet, so that route answers remote callers.node from pytest, like tests/unit/test_web_js_account_menu.py (skip when node is absent). Python tests run with uv run python -m pytest.Files: modify jacked/data/web/js/websocket.js; test tests/unit/test_web_js_websocket_single_socket.py.
connect() detaches the four handlers of the previous socket (sets them to null) and closes it, before it makes a new one.const ws = new WebSocket(...)) and returns at once when ws !== this.ws.forceReconnect() clears _reconnectTimer, and does nothing while the current socket is CONNECTING.onclose schedules a reconnect.WebSocket class in node:
def test_five_wakes_while_connecting_leave_one_socket_open() def test_a_message_on_a_replaced_socket_runs_no_handler() def test_the_close_of_a_replaced_socket_schedules_no_reconnect() def test_force_reconnect_clears_a_pending_reconnect_timer() def test_a_broadcast_runs_each_handler_once_after_three_reconnects()
tests/unit/test_web_js_*.py file that reads websocket.js.fix(dashboard): a page holds one WebSocket, and a replaced socket runs no handler.Files: modify jacked/api/watchers.py (session_accounts_watch_loop and the sweeper's broadcast); create jacked/api/session_diff.py (a pure diff function); test tests/unit/test_session_watcher_broadcast.py.
force_broadcast_seconds).PRAGMA data_version change, read db.get_active_session_states(MAX_SESSION_STALENESS_MINUTES) (database.py:3176). For each session keep two values: a hash of the whole row with the pure event-time columns removed (last_activity_at and observed_at; read the query and the page code, and name in the docstring every column you remove and why), and the activity time.database.py): a resurrection. This rule is structural: any column the page can show triggers it, so a reassign (database.py:3588), an observation-state change (:3286), an account switch inside one session (a new span) and an evidence or credential-scope write all broadcast, with no list of cases.watchers.py:291) goes through the same diff; say in its docstring whether it still broadcasts.PRAGMA data_version moves only for another connection, and an in-memory database makes the loop return at watchers.py:35-40):
def test_an_unchanged_set_of_sessions_broadcasts_nothing_for_an_hour() def test_a_new_session_broadcasts_once() def test_an_ended_session_broadcasts_once() def test_a_heartbeat_inside_an_active_session_broadcasts_nothing() def test_a_heartbeat_after_six_idle_minutes_broadcasts_once() def test_a_reassigned_session_broadcasts_once() def test_an_observation_state_change_broadcasts_once() def test_an_account_switch_inside_one_session_broadcasts_once() def test_an_evidence_or_scope_write_broadcasts_once() def test_the_loop_sees_a_write_from_a_second_connection()
watchers.fix(dashboard): sessions_changed is sent for each visible change, not every minute.Files: modify jacked/api/watchers.py, jacked/api/main.py (start the new loops), jacked/api/routes/settings_remote.py, the identity watcher, jacked/data/web/js/websocket.js, jacked/data/web/js/app.js; test tests/unit/test_dashboard_push_events.py, tests/unit/test_web_js_push_inventory.py.
The inventory. Each row is one value the poll at app.js:378 catches today. The implementer confirms each writer by reading the code and adds any row it finds.
| Value | Writers | Event | Page action |
|---|---|---|---|
| Sessions | hooks, the sweeper, reassign | sessions_changed (Task 2) | refetch session states |
| Accounts list and fields | routes, the CLI, other jacked processes | new accounts_changed from an accounts-table data_version watcher (same pattern as logs_watch_loop) | refetch accounts |
| Usage | usage loops | usage_updated (exists) | patch the card in place (exists) |
| Active credential identity | Claude Code /login, the CLI, other processes | credentials_changed sent by the identity watcher or the active poll loop when the identity changes; the client handler at websocket.js:216 exists and no server code sends it today | refetch the active credential |
Remote-access scope and allow_credential_activation | PUT /remote-access (settings_remote.py:129-139) | new remote_access_changed; it carries no value, because the answer depends on each client's address | refetch /api/auth/active-credential |
| Swap history | the swap write path | name the event that the write sends, or add one | reload the swap log only, no view rebuild |
| Decision log | the decision writer | decision_log_entry (exists) | re-render the log (exists) |
!jackedWS.isConnected().def test_an_accounts_write_from_a_second_connection_sends_accounts_changed() def test_an_identity_change_sends_credentials_changed_once() def test_the_remote_access_put_sends_remote_access_changed() def test_each_event_makes_the_page_refetch_its_endpoint() def test_no_poll_runs_while_the_socket_is_open() def test_the_poll_runs_while_the_socket_is_closed() def test_a_swap_write_reloads_the_swap_log_without_a_view_rebuild()
feat(dashboard): every value on the page has a push event, so an open socket replaces the poll.Files: modify jacked/data/web/js/app.js, jacked/data/web/js/components/accounts.js, sessions.js, usage.js, account-actions.js; test tests/unit/test_web_js_accounts_rerender_gate.py.
#content on the Accounts route: rerenderAccountsView() and renderRoute()/refreshAndRender() (the visibility handler, onopen, auto_swap_triggered, the bulk usage refresh). A write for another route clears the gate state.Date.now() and new Date() in the renderAccounts call graph. Known: session "Xm ago" labels (sessions.js:90, 202, 280), "Usage updated" (accounts.js:118, 136), the poll countdown (accounts.js:124-133), reset times with a "today" branch (usage.js:249-258), the token-expiry status class (accounts.js:39-41). Each text renders as an element with an absolute time in data-ts and a format kind in data-fmt, with no text. One formatter fills those texts after each write and on the existing tick.data-ts values blanked. When it skips, it writes the new data-ts values in place and runs the formatter.sessions.js:302-309).{force: true}, with the reason written beside it.def test_a_rerender_with_the_same_data_does_no_dom_write() def test_render_route_on_accounts_with_the_same_data_does_no_dom_write() def test_a_rerender_with_a_changed_account_writes_the_dom_once() def test_another_route_then_accounts_rebuilds() def test_a_heartbeat_only_change_patches_the_time_and_does_no_dom_write() def test_at_a_fade_time_the_page_refetches_and_keeps_a_live_session() def test_at_a_fade_time_an_idle_session_leaves_the_view() def test_a_token_expiry_threshold_changes_the_status_once() def test_midnight_changes_the_reset_text() def test_the_menu_rows_lookup_text_and_oauth_banner_survive_a_real_rebuild()
tests/unit/test_web_js_*.py file that reads a changed file.fix(dashboard): an update with no visible change does no DOM work.Files: create scripts/build_css.sh, jacked/data/web/tailwind.config.js, jacked/data/web/css/tailwind.css (generated, committed); modify jacked/data/web/index.html, jacked/data/web/js/vendor/LICENSES.md, tests/unit/test_web_vendor_scripts.py; delete jacked/data/web/js/vendor/tailwindcss-3.4.17.js; test tests/unit/test_web_tailwind_build.py.
npx.tailwind.config from index.html, darkMode: 'class' included. Content: each .html and .js under jacked/data/web except vendor/.safelist with its source file:line in a comment.<head>, after style.css, token-pills.css and swal-dark.css (index.html:39-41), so Tailwind wins ties today. The new link is the last element of <head>.def test_no_page_loads_the_tailwind_runtime() def test_the_tailwind_link_is_the_last_element_of_head() def test_every_class_in_a_class_context_is_in_the_css_or_is_a_house_class() def test_every_safelisted_class_is_in_the_css() def test_the_build_script_pins_the_cli_hash()The class test reads tokens only from class contexts (
class="...", className, classList).index.html:16-18), at a desktop and a mobile viewport, and with each open state (account menu, modals and alerts, toasts, the OAuth banner, the swap and exhaustion banners). A screenshot and a computed-style dump of every element on master and on the branch. Zero differences, or each difference named and fixed.perf(dashboard): ship prebuilt Tailwind CSS instead of the in-browser compiler.Files: create jacked/api/threaded_json.py; modify jacked/api/routes/analytics.py and each other route whose answer grows with stored data, sync and async (the sweep includes logs.py:15, auth.py:1076, the session states and the swap log); test tests/unit/test_threaded_json.py.
response_model (analytics.py:79, 124, 178) keeps its validation and field filtering: validate the model and call model_dump_json in a worker thread.JSONResponse.render (ensure_ascii=False, allow_nan=False, separators (",", ":")), after jsonable_encoder, in a worker thread. An async route awaits asyncio.to_thread for this.def test_each_listed_route_gives_the_same_bytes_as_a_default_twin_route() def test_a_model_route_still_filters_and_validates() def test_the_encoding_runs_off_the_event_loop_thread() def test_a_listed_route_answer_holds_every_row()
perf(api): large answers are encoded in a worker thread.Ruling (2026-11-28, split). Task 7 (the memory report, the loop switches and the one local-request rule) and Task 7b (the raw TCP forward lock) are now the branch jack_20261128_local_request_rule. That branch is stacked on this one. Five fix rounds of Task 7b each found new defects that the branch introduced, so by the owner's review rule the work leaves this pull request. The cut is before Task 7, because the Task 7 debug routes (with the loop-switch writes) are safe only with the raw TCP forward lock beside them.
Files: create tests/secret_env.py and tests/unit/test_secret_env.py; modify conftest.py and tests/conftest.py.
5e871488: the module, its canary test, the root conftest.py call before any test module loads, and the session-scoped autouse _no_secret_env fixture in tests/conftest.py. Port nothing else from those files.Files: modify tests/unit/test_module_size_ratchet.py (or a sibling test that reuses its helpers); split the JavaScript files that this branch grew past 500 lines.
jacked/data/web/js/**/*.js, except js/vendor/. Its baseline for a file that is over 500 lines on master is the master line count. A file that is 500 lines or fewer on master has no baseline entry.websocket.js 755 on master). Do not raise a baseline. The script order in index.html and the JS test harness load lists follow the split.Root cause (measured 2026-11-28). Chrome 158's user-agent stylesheet has thead, tfoot { break-inside: if(media(overflow-block: paged): avoid;) }. For each new <thead> or <tfoot>, the style engine keeps one more functional media-query set in a strongly keyed map, and never removes it. The page makes a new <thead> each time it rebuilds a table, for example the decision log on each decision_log_entry. Each kept set is a few small Blink heap objects. With the other render work in between, each set holds a heap page that is otherwise empty, and the Blink heap does not compact those pages. The soak shows 1,265 kept sets and about 22 KB of heap per simulated minute. A soak without the decision log drops to 4.7 KB per minute. microsoft/vscode #337444i shows the same pattern, tracked upstream as Chromium issue 578309740.
Files: modify jacked/data/web/css/style.css; test in a tests/unit/test_web_*.py file of its concern.
thead, tfoot { break-inside: avoid; } to style.css, with a comment in ASD-STE100 that gives the cause and the two references above. An author declaration wins the cascade, so Chrome never evaluates the user-agent if(). The value avoid keeps the print behavior that the user-agent rule wants for paged media. On screen, break-inside has no effect.blink::MediaQuerySet in a heap snapshot stays flat (14 to 14 over 46 decision-log rebuilds). Without it, the count grows (18 to 85).style.css and finds the rule, and a test that every page that loads a script that builds a <thead> or <tfoot> also loads style.css.Measured (2026-11-28). The A/B soak proves that the Task 7d rule stops the Blink heap growth (fix arm flat after cycle 500, frozen and varied). But renderDecisionLog (js/components/auto-swap.js:494-518) still rewrites the whole container on each decision_log_entry: about 6,000 identical rewrites of about 50 KB of markup per simulated week, because most entries are checks that the default "swaps only" view does not show. Each rewrite also closes a detail row that the user opened, so an open row closes within a minute while nothing on the screen changed.
Files: modify jacked/data/web/js/components/auto-swap.js; test in a tests/unit/test_web_js_*.py file of its concern, in node.
WeakMap. If the new string is equal to the last one for that element, do no DOM write. A new container element (a rebuild of the Accounts view) has no entry, so it gets a full write.def test_a_decision_log_render_with_the_same_entries_does_no_dom_write() def test_an_open_detail_row_stays_open_after_a_render_with_the_same_entries() def test_a_new_shown_entry_writes_the_log_once() def test_the_filter_toggle_writes_the_log() def test_a_new_container_element_gets_a_full_write()
tests/unit/test_web_js_*.py file that reads auto-swap.js, with -n auto when more than a few files.fix(dashboard): a decision log update with no visible change does no DOM work.sessions_changed per 10 minutes, account and usage changes, subagent rows). Bar: the week-old tab is within twice the fresh-tab noise of a fresh tab, and one socket after five wakes while connecting. Put the before and after table in the PR./qa of every route in a browser on the demo rig./dcr, then open the PR and stop.Generated with the jacked HTML artifact template. Edit freely.