Builder Sessions¶
A builder session binds the spec, loaders, catalog and commands for one workspace folder, which the app, caliper dev and caliper shot each hold.
| Field | Value |
|---|---|
| ID | SPC-06 |
| Status | Shipped |
| Scope | Core |
| Pillar | Builder and Specs |
| Sprint | None |
| Depends On | Spec Format (SPC-01)Catalog ( SPC-04)Command Layer ( SPC-05) |
| Unblocks | Managed Runs (RUN-14)Builder Pane ( SPC-07)Command Script ( SPC-29) |
| Docs | CLI, Workspace |
| Branches | None |
| Design | Builder session |
Coverage Ledger¶
- Branch
sprint3-int-hostbuild, 0 commits that main lacks (87 ahead of the merge base). Work on the CALIPER_WITH_BUILDER build option, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-session, 0 commits that main lacks (92 ahead of the merge base). Work on the builder session in the app, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-rebase-trial, 0 commits that main lacks (75 ahead of the merge base). Work on moving the builder design pages to design/, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-session, 0 commits that main lacks (59 ahead of the merge base). Work on builder sessions and dry runs of spec edits, which reached main through a pull request (patch ids and subjects match). - design/builder-overview.md, under The parts. Parts diagram and table: spec format, loaders, catalog, command layer, session, caliper-mcp, side chat, widget agent, caliper-agent.
- design/builder-overview.md, under What is built. The libraries and tools under src/builder/ build with the host when CALIPER_WITH_BUILDER is on, default off on Windows.
- design/builder-overview.md, under What is built. Session binds every command that needs no window; a headless test builds a three-panel dashboard.
- design/builder-overview.md, under What is built. The app, caliper dev and caliper shot own a session for their workspace.
- design/builder-overview.md, under The integration order after sprint 2. Item 2: the session in the app, built.
- design/builder-overview.md, under The integration branch. The work is rebased onto sprint 2 on the branch sprint3-integration; the standalone build of src/builder/ stays.
- design/builder-session.md, under What is built and what is planned. The library caliper_builder_session: Session, SessionHost, spec edits as pure functions, a line diff, the loader catalog provider, resolved panel data, stacked previews, review of spec edits and the widget agent's context bundle.
- design/builder-session.md, under What is built and what is planned. The library caliper_builder_session_host and the tool caliper-builder-host, a development stand-in for the app's command endpoints.
- design/builder-session.md, under What is built and what is planned. The seam for sources the app serves: CatalogDataSource, DataSources, the generation of a panel with its probe, and the cache of transformed tensors.
- design/builder-session.md, under What is built and what is planned. The session in the app: the app, caliper dev and caliper shot own one session, drain its queue on the frame thread, run long commands on the job system and show each journaled command in Activity.
- design/builder-session.md, under The session. Session::open(workspace) holds the loader store, the catalog, the open spec, the journal, the registry and the queue.
- design/builder-session.md, under The commands it binds. The table of command groups the session binds: catalog, data, loader, spec, source, panel, layout, preview, applet, review and history.
- design/builder-session.md, under What SessionHost leaves to the app. Five commands (app.info, app.applets, app.launch, panel.render, capture.frame) need the running app and are bound through SessionHost.
- design/builder-session.md, under Editing the open spec. Every spec edit goes through apply_spec_edit(), validated with a catalog-backed resolver, with dry_run, diff and no_effect handling.
- design/builder-session.md, under Diffs. unified_line_diff() writes a diff -u style diff with three lines of context and bounded work.
- design/builder-session.md, under Resolving a panel's data. Session::resolve() follows from-chains, maps tensors, applies transforms with size bounds, reads tables through a bounded query and reads served roots through data sources.
- design/builder-session.md, under Refresh. A generation per served source, a cheap panel_generation() probe and a cache of transformed tensors keyed by generation make a live panel cost a microsecond when nothing changed.
- design/builder-session.md, under The session in the app. AppSession owns the Session, drains its queue on the frame thread and implements SessionHost; a build without the builder opens nothing.
- design/builder-session.md, under The workspace. The workspace is the folder of --workspace, else CALIPER_WORKSPACE, else workspace/ under the app-data folder.
- design/builder-session.md, under Opening. A chosen workspace opens on a worker after the first frame and the default workspace only when first needed.
- design/builder-session.md, under The frame loop. frame() drains the queue within a 4 ms budget and sends long commands to a worker, holds the queue for capture.frame and runs the rest on the frame thread.
- design/builder-session.md, under Long commands and the registry's lock. While a loader runs on the worker the frame thread leaves the queue, registry and store alone, so later commands wait in order.
- design/builder-session.md, under Caliper API. AppSession::command_gateway() serves the command table at once and opens the workspace on a first command.
- design/builder-session.md, under SessionHost. The app implements app.info, app.applets, app.launch, capture.frame and panel.render for the session.
- design/builder-session.md, under Activity. Every journaled command becomes one Activity line with the origin, the command and its error code.
- design/builder-session.md, under Shutdown. close() shuts the queue down, waits for the worker and the script, then closes the journal and the database before main() returns.
- design/builder-session.md, under The start-up cost. Measured start-up cost: the session adds nothing distinguishable from noise and a workspace opens in 5 to 6 ms.
- design/builder-session.md, under Tests. The tests caliper_app_session and caliper_app_session_hidden drive the app's session with a fake frame loop and a real hidden app.
- design/builder-session.md, under The stand-in host. caliper-builder-host serves GET /v0/commands and POST /v0/commands/{name} with strict HTTP/1.1, origin by token, approval holds and options for review and approval; a development tool, not part of the product.
- design/builder-session.md, under The acceptance tests. Two headless acceptance tests: an in-process build of the dashboard with undo, redo, save, reopen and replay, and a run over HTTP against the stand-in with approvals.
- design/builder-session.md, under Decisions. Recorded decisions of the session: dry_run and diff on every edit, no_effect decided by the handler, outside paths granted only by the person, long commands on a worker and a command script as the test path.
- design/builder-session.md, under Changes to the contracts and to the earlier pages. Fixes to contracts section 8, the command layer page and the widget agent page: agent origin for the sidecar, diff and applied, preview and review, and the replacement of planned Session calls by preview commands.
- design/builder-session.md, under Limits. The session reads live views, feed channels and metrics only through data sources the app registers.
- design/builder-session.md, under Limits. The stand-in serves no stream, info, applets or capture and runs on macOS and Linux only.
- design/builder-session.md, under Limits. Going Home from an applet joins every job of the host's job system, so it waits for a running loader up to five seconds.
- design/catalog.md, under What is built and what is planned. Planned: the app calls register_catalog_providers() when it opens its session and the live catalog's update() once per frame.
- design/command-layer.md, under What is built and what is planned. The builder session builds the review of spec edits for the origins agent and mcp and stacked previews on these.
- design/command-layer.md, under What is built and what is planned. Planned: handlers bound by the builder session, the app binding app.info, app.applets, app.launch, capture.frame and panel.render, the live catalog providers and setting the command gateway on the API server.
- design/command-layer.md, under Open items. Two launches in one frame share one pending open; a queue of pending opens, each with its origin, would keep both.
- design/spec-format.md, under What is built and what is planned. The command handlers that edit a spec (spec.*, source.*, panel.*, layout.*) live in the builder session.
- CLI, Workspace. The --workspace option and the builder session that the app, caliper dev and caliper shot hold.
- Pull request #17. Pull request 17 (merged) delivers sprint 3: the builder libraries, spec format, loaders, catalog, command layer and session, caliper-mcp, the side chat, the widget agent, command endpoints of Caliper API, the spec runtime and applets, the builder pane, drag and drop, approval cards and the first slice of the browser spec page.
- Orchestrators' notes,
_notes/HANDOFF-sprint3.md. Pull request 1 of sprint 3 (the builder libraries, caliper-mcp, the side chat, the widget agent, the builder pane) was pushed as PR 17 and merged into main. - Orchestrators' notes,
sprint3-integration/PR.md. Libraries under src/builder: the spec format, validator and schema, loaders, the catalog, the command layer and the session. - Orchestrators' notes,
sprint3-integration/PR.md. CALIPER_WITH_BUILDER is off on Windows and in the wheel; thirteen units are skipped by the Windows include check.