Compose your own windows and workspaces¶
Stock and user layouts use the same versioned S-expression specification.
stock.sexp supplies the base catalog and
default window composition. Silver embeds it at build time, appends the same
Editor definition used by the registry, and validates the complete catalog.
Start with custom.sexp for a smaller working
example: a run selector and two synthesis tiles, with independent presentation and
layout keys. Existing tile implementations remain compiled application features;
configurations compose them without writing OCaml.
Create a blank workspace from the palette¶
Open Space c c, choose Create blank workspace, and press Enter. Workbench
creates and switches to Workspace N using the next available name. Its first
tile is the same borderless, one-line workspace strip used in Overview.
In Fit mode it stays at the top, leaving the space below for tiles such as
Hierarchy. With the strip focused, j shows the next workspace and k
shows the previous one immediately. Focus stays on the strip: you can browse
past Editor without sending keys to Cobalt. Press Enter when you want to
work in the displayed workspace.
It belongs to the current window, follows Main context, and persists in the daemon
registry. Switching occurs only after successful creation.
To add other tiles, open Space c c again and choose an Add … tile command, such as Add run-selector tile, Add live-status tile, Add synthesis tile, or Add logs tile. Tile contents depend on the project's available evidence. Names are automatic; this command has no naming prompt.
Go to or rename a workspace¶
Open Space c c, type te, and press Enter to switch to Testing.
The global palette has these two-letter shortcuts:
| Palette query | Destination |
|---|---|
ov |
Overview |
te |
Testing |
wa |
Waveforms |
ti |
Timing |
re |
Resources |
wo |
Workloads (if present) |
ed |
Editor |
These shortcuts follow the built-in workspace even if you rename it. If it
is closed, Enter reopens its saved layout. For any workspace, including a
custom one, you can still type goto and part of its name, for example
goto ov. If several names match, use the arrow keys to choose.
To name a scratch workspace, switch to it and choose Rename current workspace
in the palette. Enter saves the new name; Esc cancels. You can then navigate
by that name: for example, goto hier for Hierarchy lab. Renaming changes
the label, not the workspace's ID, tiles or preset.
Close, reopen, or delete¶
To keep a workspace for later, just switch to another one. The active workspace is a client choice; switching does not remove its saved layout. To remove it from the workspace list for everyone using this project, choose Close current workspace. Reopen workspace: NAME brings the saved workspace back, with the same tile IDs, bindings and layout. This works for built-in workspaces such as Overview, Testing and Timing. Closing a view is not a job or service command.
For just one tile, choose Close focused tile. To bring it back, search the palette for Restore and its tile kind. To return a built-in workspace to the shipped layout, choose Restore default layout (current preset; hide extras). This is useful after experimenting with tiles; reopening alone preserves your edits. The built-in presets themselves remain available. You can close Overview, Timing, or Testing and reopen them later, but you cannot permanently delete a preset workspace or close the last open workspace in a window.
To permanently remove a custom workspace, switch to it, open Space c c, choose Delete current workspace, and confirm the named workspace. Its layout and tiles disappear from the project's workspace list, including after restart. Simulation runs, artifacts, and project files are not deleted.
From a script, use silver-workspace list -endpoint URL -project PROJECT-ID
to find the workspace ID, then
silver-workspace delete -endpoint URL -project PROJECT-ID WORKSPACE-ID.
The CLI also accepts close and reopen with the same arguments. list marks
closed entries. These commands act by ID, not by display name or the terminal's
current selection.
Keyboard navigation and layout modes¶
In Fit mode, the layout tree also defines Tab order: stacks top-to-bottom, columns left-to-right, completing each subtree before moving to the next. Shift-Tab reverses that sequence; both directions wrap. For stock Overview, after the workspace-tabs stop, this is Session → Runs → Resources → Stage checklist → Planned run → stage tiles. Configured leaf keys distinguish tiles even when they share a kind.
Hidden tiles are skipped, zoom restricts focus to the zoomed tile, and unmatched extra tiles follow the declared tiles in saved registry order. Existing sessions benefit without resetting their arrangement or migrating saved tile order.
Fit adjusts tile sizes to the terminal. If space forces a simpler grid or a focused-tile-only Compact view, Tab retains the semantic tree order and can still reach every eligible tile; fallback grid rows may differ from navigation order. Preferred uses saved/requested sizes and registry-order packing, with Tab following that registry order. Without a usable definition, registry order is the navigation fallback.
To select Fit, open the palette with Space → c → c and choose Layout: Fit tiles to window. This navigation fix requires restarting only the terminal client with the updated binary; the daemon can keep running. Launching an older installed/demo copy will retain the old behavior even after rebuilding the source checkout.
Export, edit and validate¶
With the native commands installed:
silver-workspace config export stock > stock.sexp
silver-workspace config export example -id my-desk > my-desk.sexp
silver-workspace config validate my-desk.sexp
For example, to keep a custom hierarchy workspace alongside the usual stock workspaces in a reusable startup layout:
silver-workspace export -endpoint "$URL" -project "$PROJECT_ID" "$WORKSPACE_ID" > hierarchy.sexp
silver-workspace config add-workspace -key hierarchy-desk hierarchy.sexp > my-desk.sexp
silver-workspace config validate my-desk.sexp
ag --project-root /path/to/project --workspace-config my-desk.sexp
add-workspace starts from stock unless you pass -base existing.sexp. It
writes the resulting composition to stdout. Use a new output filename; do not
redirect over the input file. The template copies tile kinds, order, visibility
and requested sizes, not run selections. For an existing session use explicit
config apply as described below; startup configuration initializes new sessions.
The new config entry gets its own workspace ID when first applied; it does not
take ownership of the live scratch workspace you exported.
Export and validation are offline. In a source checkout, use
_build_workbench/default/workspace_cli/main.exe in place of silver-workspace
after building Silver.
To customize a stock definition:
- Copy the desired definition from the stock export.
- Change its
keyto a nonreserved key such asmy-overview. - Remove
presetfrom its nestedtemplate(or use(preset ())). - Reference it with
(definition (Custom my-overview))in a workspace instance. - Change the top-level
idto identify your composition, and validate the file.
The reserved keys overview, timing, testing and waveforms identify immutable
built-ins. Complete stock exports are accepted while their reserved definitions
match the installed catalog. For upgrade-independent files, omit unchanged reserved
definitions and reference them with Builtin; copy and rename any definition you
want to own. Built-ins remain available even in an entirely custom composition.
Windows and reusable workspace definitions¶
This complete example uses built-ins without copying their definitions:
((version 1)
(id two-desks)
(definitions ())
(windows
(((key primary)
(name "Main desk")
(workspaces
(((key overview) (name "My overview") (definition (Builtin overview)))
((key tests) (name "Tests") (definition (Builtin testing))))))
((key analysis)
(name "Analysis desk")
(workspaces
(((key timing) (name "Timing") (definition (Builtin timing)))
((key waves) (name "Waves") (definition (Builtin waveforms)))))))))
definitions holds reusable custom definitions. windows contains ordered window
declarations, each containing ordered workspace instances. Several instances can
reference the same definition; each receives fresh live identities.
Keys and names have different roles:
ididentifies a configuration during repeated application.- A window
keyis unique within that configuration. - A workspace instance
keyis unique within its declared window. - A definition
keyidentifies reusable content. - Each definition's tile
keyidentifies a specific tile occurrence. nameis a display label, not an identity or matching rule.
Keys contain 1–128 alphanumeric, dash, underscore or dot characters. Keep keys stable when editing labels. Moving an instance declaration to another window changes its authoring identity; additive apply creates a new instance and retains the old one.
Tile membership, layout and presentation¶
A definition has a version-1 portable template, a parallel tiles list and an
optional layout. template.views owns ordered kinds, visibility and requested
geometry. Each corresponding tiles entry supplies its unique key and optional
presentation defaults. The lists must have equal length and matching order.
Layout leaves reference tile keys, not kinds. Two synthesis tiles can therefore
have different positions and policies even after live reorder/hide operations.
The existing responsive engine supports:
Leaf: tile key, minimum width/height and vertical growth weight.Stack: vertically arranged children.Columns: horizontally arranged children.Weighted_columns: positive width weights paired with child trees.Narrow: marks a narrow subtree using the shared engine's sizing policy.
Missing/hidden leaves collapse; visible tiles not claimed by a tree remain extras.
If a layout cannot fit, the renderer falls back to its grid or focused-tile view.
Weighted columns divide full available width and clamp against descendant minima.
Requested-size mode uses requested width/height rather than the Fit tree; saved
x/y are portable data, not arbitrary terminal free-placement coordinates.
Sparse presentation supports title, run_reference, freshness, hints, frame,
padding, binding_badge, visible_rows, compact_summary and horizontal_stages.
An omitted field inherits defaults. S-expression option values use parentheses:
(padding (1)), (hints (false)); badges are hidden, always or exceptions.
Explicit local appearance/header preferences take precedence over definition defaults.
Content-specific flags take effect on tiles implementing those capabilities.
First startup and saved sessions¶
hardcaml-workbench --project-root /absolute/project \
--workspace-config /absolute/my-desk.sexp
The terminal reads a bounded file on the client, resolves built-ins and sends data to the daemon. No daemon access to the client pathname is required.
- A fresh session receives the entire composition in one atomic operation.
- Without a selected file, fresh startup uses the stock window composition (Overview, Testing, Waveforms, Timing, Resources and Editor). The built-in Editor is also available alongside a custom composition.
- Existing sessions win over startup configuration, including sessions edited before the first terminal attaches. Legacy unfinished bootstrap remains supported.
- On first load of an older registry, Silver adds the Editor if missing without
replacing existing workspaces. A custom workspace named Editor keeps its own ID.
The built-in Editor keeps
workspace-editoreven when moved, renamed, or closed. - Live identities, context/run selections, pins, geometry and visibility are saved separately from portable files. New workspaces link to Main; new tiles Follow.
- Resolved definitions and tile-key mappings are persisted with the session. Remove
--workspace-configwhen reconnecting without the original file; layout still works. - An explicitly supplied missing or invalid file fails before connection. Launch without that flag to access saved state or stock defaults. Invalid saved registry data is reported rather than silently replaced.
Editing a file does not automatically change an existing session.
Explicit additive application¶
For an already-open project on a running daemon:
hardcaml-workbench-workspace config apply \
-endpoint http://127.0.0.1:8080 -project PROJECT-ID my-desk.sexp
Application is revision-checked and atomic across all declared windows/workspaces. It creates missing keyed windows, instances and tiles. Repeating the command does not duplicate existing keys. Invalid input or a stale revision publishes nothing; conflicts are reported without automatic retry.
Existing live edits and previously instantiated layout/presentation policy win. Changed names, kinds, trees or definition references do not reset an existing keyed instance. Removed keys remain live. New tiles appear as extras when not covered by the saved tree. To try a revised complete layout, give the workspace instance a new key and apply it as a fresh instance. Reset-to-config and removal reconciliation are not part of this delivery.
The older export, import, clone and starter commands still work with portable
workspace templates. Those templates contain membership/visibility/geometry and
optional preset identity; they do not export custom trees or presentation policy.
config export exports shipped examples, not the entire current live session.
Built-in recovery¶
The palette always offers Create built-in workspace: Overview / Timing / Testing / Waveforms, including from a custom-only session. This adds a workspace without replacing custom ones.
Restore default layout: NAME (hide extras) explicitly selects a shipped preset for the current workspace. It restores default membership/geometry/visibility, clears zoom and detaches saved configuration layout policy, while retaining IDs, pins, contexts and authoring mappings. Reapply does not reattach that frozen policy. The current-preset Restore is disabled for custom definitions; named built-in Restore is distinct from resetting to custom defaults. See recovery controls.
Compatibility and extending the specification¶
The composition envelope is version 1; portable template version 1 remains supported. New clients read legacy snapshots using defaulted configuration fields. Rebuild/restart daemon and clients together: older executables are not guaranteed to understand new operations or persisted configuration fields. No downgrade migration is provided.
The shared contract is protocol/workspace_config.ml. When adding a compositional
capability, extend this contract, validation and renderer projection together; update
stock examples to exercise it. Add compatibility defaults for genuinely optional
fields and a version/migration policy for incompatible changes. Avoid introducing
stock-only fields or a second layout table in OCaml.
Current limits: 4 MiB encoded configuration, 128 definitions, 32 windows, 256 workspace instances, 4,096 stored tiles and 4,096 instantiated tiles per application. Trees are bounded to depth 32 and 4,096 nodes per definition. Existing template geometry and label limits also apply. Windows are logical registry containers; live surface attachment/monitor orchestration remains WB-047 work.
Verification¶
Targeted protocol, backend persistence, workspace and terminal tests passed with
-j20; native daemon/client/CLI/setup build and @lint passed. Modified OCaml files
were formatted. Repository-wide @fmt still reports existing differences in untouched
backend/asic_service.ml and terminal/waveform_data.ml, .mli, and waveform_probe.ml.
Native evidence (2026-10-21):
- New composition CLI/HTTP/PTY checks:
/tmp/opencode/workspace-config-zbzojw2o/result.json. - Existing FS3 adoption:
/tmp/opencode/fs3-adoption-574hfszu/result.json. - Built-in restore, exact provenance preservation and viewport checks:
/tmp/opencode/default-layout-restore-gekveke6/result.json.
Reproduce the new focused acceptance with python3 scripts/test-workspace-config.py
after building matching native binaries. It uses private metadata-only fixtures and
does not run project builds or provider jobs.