Skip to content

Workspace ​

Current responsibility: own the browser's shared model, run, layer, and neuron selection, mode registry, layout context, theme, and onboarding tour. The first slice is implemented in selection.ts, modes.ts, layout.tsx, theme.tsx, and the tour files. WS-03, pinning and layout restoration, is not started. It also owns the online-visitor bar under Run history (WS-04), its only server slice: schemas.py → service.py → routes.py and api.ts → hooks.ts → Presence.tsx (hover shows a per-country world map, WorldMap.tsx). It does not own run data, solver state, or ACT commands. See the parent scope, the repository rules, and the development task guide.

Change Guide ​

GoalEdit hereConditional / reused path
Change selection/reset behaviorselection.ts and selection.test.tsUpdate app.tsx or consumers only when action/prop contracts change. No server change.
Add or remap a center modemodes.ts, its owning view, modes.test.tsExisting app composition uses the registry. A new engine method also needs verification/bridge support; a display-only mode does not.
Change tour wording or ordertourSteps.tsCopy-only changes need no prose-pinning tests. Change tour.tsx for interaction; app.tsx only for region targets or composition.
Change tour placementplaceCard in tourSteps.ts and its placement testsKeep viewport-boundary cases in tourSteps.test.ts; render desktop/mobile.
Change the online-visitor bar or its country mapPresence.tsx, WorldMap.tsx, hooks.ts (interval), service.py (window, country grouping)Wire changes go through schemas.py and npm run gen:types; keep test_workspace.py green.
Change context bar or themelayout.tsx, theme.tsx, relevant styles.cssOther feature modules only if their public selection/navigation contract changes.

Pinning and restoration are WS-03 future work, not an existing docking API.

Flow Diagram ​

The online-visitor bar is a heartbeat loop, independent of selection:

The context bar and theme are independent presentation helpers in layout.tsx and theme.tsx. The tour has its own path:

BlockImplementation and contract
User inputapp.tsx callbacks. Produces selection actions or mode changes.
SelectionselectionReducer in selection.ts. Returns a new context and revision; model changes clear run, layer, and neuron.
Modesmodes, modeForMethod, and modeForId in modes.ts. Maps fuzz, interval, and bab to visible center views.
Layout and themeContextBar in layout.tsx and theme state in theme.tsx. Renders shared context; it does not fetch.
TourTour in tour.tsx plus TOUR_STEPS in tourSteps.ts. Reads data-tour regions and ends on Finish, Skip, or Escape. A waitFor: "model" step (Build and load) lets only its region take clicks, keeps Next disabled until app.tsx reports a loaded model, then advances by itself so later steps spotlight the live center panels.
PresencePresenceService.beat in service.py: in-memory map of browser id to last heartbeat, pruned to a 90 s window, with the browser's country from Cloudflare's CF-IPCountry header (XX, Tor T1, or a direct local request count as unknown); no IPs, no persistence. The response carries only per-country totals. One id per browser (localStorage), so tabs are deduplicated. Correct only while the service runs as one process.
Neighbor handoffModule views receive selection and callbacks from app.tsx; their data path continues through the parent flow diagram.

Validation ​

Run the browser test suite:

bash
npm test
.venv/bin/python -m pytest visual_bench/workspace

Relevant observable behavior is that selection changes update the context bar and dependent views, mode methods select the corresponding center view, and the tour starts once, can be replayed from Guide, and exits with Finish, Skip, or Escape. These are validation instructions, not a new test result.

Reference and Backlog ​

Current files and routes

Current Files and Routes ​

Route: POST /api/presence (body PresenceHeartbeat, response PresenceOut), mounted by server.py. app.tsx is the composition root that consumes this module.

FileResponsibility
selection.tsPure reducer for modelId, runId, layerId, neuron, and monotonic revision. Changing model or run clears incompatible context.
selection.test.tsSelection transitions and stale-context behavior.
modes.tsThe Fuzzing, Verification, and BaB mode registry. Each entry maps a run method to a view. Add modes here, not in app.tsx.
modes.test.tsMode IDs and method mapping.
layout.tsxContext bar showing the current model, run, layer, and index.
theme.tsxLight and dark theme toggle with persistence.
tour.tsxSkippable first-visit tour, keyboard navigation, target measurement, the interactive Build-and-load gate, and portal rendering.
tourSteps.tsTour copy, order, target regions, and missing-region hints.
tourSteps.test.tsTour step and placement behavior.
schemas.pyPresenceHeartbeat and PresenceOut wire models.
service.pyPresenceService: in-memory online-visitor count.
routes.pyPOST /api/presence.
test_workspace.pyDeduplication, expiry, and route validation.
api.ts, hooks.tsHeartbeat call and the 20 s usePresence query.
Presence.tsxOnline-visitor bar under Run history; hover card with the country list.
WorldMap.tsxPer-country choropleth (d3-geo + world-atlas 110m), loaded on first hover.
countryCodes.tsGenerated ISO alpha-2 to atlas numeric id table.

Browser-wide HTTP, wire-number, query-key, and shared UI code lives in ../shared/. Views obtain server data through their module hooks.

Task acceptance, rationale, and planned capabilities

Tasks and Acceptance ​

All tasks remain tracked in the development plan. Dependencies are acceptance prerequisites, not import instructions.

IDDeliverableDepends onCompletion evidence
WS-01Define selection state and reducerBASE-02Given different layer/node IDs, actions preserve their object kinds and snapshot scope.
WS-02Link two panels through contextWS-01Select A then B; delaying A’s response cannot revert either active panel.
WS-03Add pinning and layout restorationWS-02A pinned panel survives active-context changes; invalid restored references have an explicit fallback.
WS-04Show the online-visitor count under Run historyBASE-02Two browsers count as two, two tabs of one browser as one, and a silent browser drops out after 90 s; hovering shows the countries from CF-IPCountry (test_workspace.py, hover screenshot).

Current status: WS-01 and WS-02 are implemented as the selection reducer and application wiring. WS-04 is implemented. WS-03 is planned.

Use pure state transitions and derived context rather than a feature-wide event bus. A layout library may be added later, but domain objects must not contain renderer instances or layout-library nodes. Pinning, restoration, and unavailable-object states belong to WS-03 and are not current capabilities.

Planned public operations are reduceWorkspace, getPanelContext, and navigateTo. Their names describe intended boundaries, not shipped APIs. The current equivalent is selectionReducer plus callbacks in app.tsx.

Owner: C. A reviews scientific identity and semantics. On task completion, record the implementation, fixture provenance, exact commands and results, ACT or provider dependencies, and unverified behavior here.