DecisionBoundALPHA 0.13.0a2 · RESEARCHConcept demo

Local client synchronization: CLI, browser and VS Code

** · v0.10.0a1 · read-only editor + setup diagnostics.** This page documents code that actually ships in the source tree, not the proposed multi-tenant cloud control plane. Native VS Code host execution and live browser-to-server Chromium navigation still require a connected developer environment.

The architecture and trust boundary

  dbound client ...                Local control webpage            VS Code extension host
  Python CLI (in-process)          same-origin JS                    Node.js JavaScript
             |                            |                               |
             |                            | Bearer token                  | VS Code SecretStorage
             |                            v                               v
             +-----------------> authenticated FastAPI <------------------+
                                          |
                                    LocalClientSync
                                          |
                       canonical WorkflowJournal + ReviewGate
                                          |
                           one user-owned SQLite database

There is one authoritative workflow journal, not a separate session database per client. CLI commands call that journal in-process. The browser and extension connect to the loopback server using a local bearer token. Session states, approval revisions, and event sequences originate on the server, not from IDE or browser state.

This alpha's session means a durable workflow, identified by wf_ followed by 32 hexadecimal characters. Other legacy run IDs are not automatically synchronized. One local OS user may have many prj_ project IDs; the local token permits access to the user's runtime as a whole, while session requests require an explicit project ID as a scoping control. This is not multi-user RBAC.

End-user setup

Install DecisionBound with the local API and initialize your working repository:

python -m pip install -e '.[web]'
cd /path/to/your/git/repository
dbound init --technologies python
dbound status              # note project.project_id

Start the authenticated local control server in one terminal:

dbound serve --host 127.0.0.1 --port 8765

In another terminal, reveal the pairing token only when you can keep the terminal private:

dbound client pair                  # path only; safe default
dbound client pair --show-token     # opt-in secret disclosure

The token is stored under the user's private DecisionBound state directory (~/.decisionbound/local_token, or DBOUND_HOME if explicitly overridden). Do not check it into Git, share it through chat, or put it in settings.json.

CLI

dbound client capabilities
dbound client sessions --path . --limit 25
dbound client inspect wf_<32hex> --path .
dbound client changes --path . --after 0 --limit 50

For a reconnecting script, record the returned next_after cursor and request the next change page with --after. A cursor is an exclusive, globally monotonic event ID; gaps across projects are normal. It does not have to increase by one. Session list next_before is a different, stable creation-order cursor.

Browser

Open http://127.0.0.1:8765 and enter your local pairing token. Enter the project ID from dbound status, then select List sessions or Watch changes. Click a session to open the existing task graph and review controls. The browser polls only while explicitly watching, and requires separate review confirmation before an export-only approval. The bearer token is held in the page's current input, not written to browser localStorage or included in the HTML.

VS Code

The working extension source is at apps/vscode/ with package.json and src/extension.js (Node.js/CommonJS, no runtime npm dependencies). To develop/test:

cd apps/vscode
npm run check
npm test

Open the apps/vscode/ folder in a VS Code Extension Development Host (VS Code's Run Extension workflow) or use an editor host capable of loading an unpacked extension. A prebuilt signed Marketplace/VSIX package is not included or certified.

Open exactly one trusted, initialized local project folder in the extension host. Run DecisionBound: Pair Local Runtime, paste the token generated by the CLI, and find DecisionBound Sessions in Explorer. Select a session to inspect its stages, current export-review decision and event timeline in the output channel. Polling only continues while a session is selected; workspace changes clear the selection and stop polling. No write tool, agent execution, approval action, or export is available from the extension.

The extension token is kept in VS Code SecretStorage rather than workspace/user settings. DecisionBound: Forget Local Pairing Token deletes it. Connection settings accept only http://127.0.0.1, http://localhost or http://[::1] origins and disallow redirects and URL credentials. This is a local trusted-user integration, not remote transport security.

Versioned local client API

All HTTP endpoints require Authorization: Bearer <local token>. The server rejects non-loopback Host and unsafe cross-origin requests. Clients must call GET /api/client/v1/capabilities before using other versioned routes. Unknown protocol versions fail closed.

HTTP endpoint Response / behavior
GET /api/client/v1/capabilities Protocol version, supported session kinds and permissions
GET /api/client/v1/sessions?project_id=...&limit=25&before=... Stable, creation-ordered session page
GET /api/client/v1/sessions/wf_...?project_id=... Canonical workflow snapshot, no raw task instructions
GET /api/client/v1/sessions/wf_.../events?project_id=...&after=...&limit=50 Incremental workflow event page
GET /api/client/v1/changes?project_id=...&after=...&limit=50 Project change feed, including committed approval/revocation events
GET /api/client/v1/sessions/wf_.../review?project_id=... Current evidence metadata and historical approval revision, no patch text

All list pages are capped at 100 items. Invalid projects, foreign workflow identifiers and malformed cursors fail closed. A review approval/revocation commits in the same SQLite transaction as its review_decision change event; export records a review_exported event. A fresh review state distinguishes current inspectable evidence from an old approval referencing a now-tampered patch.

Important: event delivery uses polling, not SSE. The API is version 1 alpha; it does not promise indefinite event retention across future migrations. Clients must refresh a snapshot after reconnect. task_completed=false is not silently promoted by review approvals.

Extension and Python override contracts

decisionbound.client_sync.LocalClientSync is a documented Python service with list_sessions, snapshot, session_events, changes, and review_state. Override implementations for other storage backends only if they preserve project scoping, exclusive cursor semantics, immutable receipt metadata, and bounded pages. Do not bypass WorkflowJournal verification or ReviewGate evidence checks.

The extension's LocalControlClient takes a dependency-injected fetchImpl and enforces redirect refusal, URL validation and response protocol negotiation. createExtension(vscode, context) is injected in Node tests, while the actual entry point calls require('vscode') in the Extension Development Host. No credentials are logged or included in workspace state.

Verification and what remains

The regression suite tests CLI/API/SQLite consistency, stable cursors, cross-project isolation, malicious Host/Origin requests, approval propagation, file tampering, concurrent readers/writers, and VS Code transport mocks. A real Chromium DOM test exercises the new session panel with mocked HTTP responses.

Connected CI results: the real VS Code Extension Development Host launch, browser-to-server Chromium navigation, Docker test sandbox and official MCP v2 protocol jobs each passed in GitHub Actions run 43940948953 (branch bench/carrybench-real-v1), behind the skip guard in scripts/require_executed.py. Those jobs cover the paths their tests exercise, not real project workflows.

Not yet certified: native Claude/Codex CLI runs, cross-machine sessions, multi-tenant auth, production-grade SSE/replay guarantees, and research benchmarking. Follow Security, Roadmap, and CONNECTED_INTEGRATION_TEST_PLAN.md for the next gates.

connected-host certification

apps/vscode/test/host/runner.cjs uses the official VS Code test harness to launch a genuine Extension Development Host in connected CI; it checks extension activation and command contributions. npm run package:vsix builds a reviewable VSIX in the connected packaging job, but is not Marketplace publication or a certification of real project workflows. Neither has been run in the restricted local sandbox. In GitHub Actions run 43948004993 on main (commit cbf6368), the real-host and VSIX-packaging steps of the Real VS Code extension host jobs passed on Ubuntu and Windows.

The new DecisionBound: Check Local Setup command fetches the authenticated GET /api/setup/v1/status endpoint, displays prerequisite readiness without exposing keys, and makes no provider calls. dbound setup and dbound doctor can be used without the editor. See Setup & diagnostics.