Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,50 @@ $ torq evidence verify --run-root torq-demo-runs/run-0d04c989291241d58830a964ce5
| `torq run` | The governed orchestration boundary. Dry-run by default; live needs `--allow-live` and `--policy-allow-live`. |
| `torq evidence verify --run-root DIR` | Verify a run's receipt chain and artifacts. |
| `torq fleet --run-root DIR --serve` | Evidence-backed Fleet control surface with attended chat. |
| `torq fleet --serve --task-project ID=DIR ...` | Open New task for bounded candidate generation and structural checks. |
| `torq setup` / `torq auth` | Interactive config; credentials stored as opaque handles in the OS keychain or an attended encrypted file vault. |
| `torq status` / `torq profile validate` / `torq harness inspect` | Attest the machine, the role profile, and the live harness before a run. |
| `torq config import-v5-*` | Import normalized or raw Console V5 configuration (read-only projection). |
| `torq trust readiness` | Report production-trust gaps (signing identity, receipt anchor). |

### Workspace dashboard

`torq fleet --run-root DIR --serve` opens Fleet by default. Choose **Workspace** in
the header for a calmer, conversation-first view; the choice is saved locally.
`DIR` must be one individual TORQ run, not its parent collection. If a collection
is selected, Workspace lists safe relative run IDs and shows the exact relaunch
form without choosing a run automatically.

Run discussion is opt-in and remains narrower than a build agent:

```powershell
torq fleet --run-root .\torq-demo-runs\run-0123 --serve `
--chat-provider claude --chat-model MODEL
```

Workspace can discuss verified run history when the configured provider and
session permit it. Discussion does not create or apply a change. Unsent text is stored only in browser `sessionStorage`, scoped to an
opaque identity for the selected root; **Clear draft** removes that scoped text.
Provider keys, attachments, and filesystem paths are never stored there.

### New task

New task is a separate opt-in launch and does not require an existing run directory:

```powershell
torq fleet --serve --task-project app=C:\work\app `
--task-provider claude --task-model MODEL `
--task-claude-bin C:\Users\you\.local\bin\claude.exe
```

TORQ saves the goal and exact relative file scope under an owner-only application
state directory. Start authorizes one tools-off provider request. TORQ writes the
returned UTF-8 contents to a separate candidate, then runs the fixed
`structural-v1` check for Python syntax, strict JSON, and UTF-8 text. The policy
accepts at most 32 files, 64 KiB per file, and 2 MiB total. It does not run unit
tests, execute generated code, or modify the configured project. Candidate
application remains a later governed step.

## Safety model

- Agents never commit, push, or merge. The worktree stays unchanged until an audited, tree-pinned proposal receives explicit approval.
Expand Down
34 changes: 34 additions & 0 deletions docs/plans/2026-09-16-dashboard-browser-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# G1D independent browser verification

Scope: bounded P0/P1 dashboard on implementation branch `feat/dashboard-workspace-pr80`. Local Python Fleet server at 127.0.0.1:8878 with a missing run root, authenticated through its real bootstrap exchange. No provider or live build was invoked. Playwright was used because agent-browser CLI was not installed.

## Baseline

The original page led with operational telemetry, disabled the input, and repeatedly requested unavailable chat SSE. At a 320px viewport the composer began around y=1614px. Screenshots are local working artifacts `tmp/dashboard-before.png` and `tmp/dashboard-before-mobile.png`.

## Checks observed after implementation

- New browser state defaults to Fleet, with the actual legacy composer and transcript still present.
- Workspace opt-in survives reload. Switching views retains the same draft and moves the real composer back to its Fleet slot correctly.
- With a missing run root, input is editable, Send is disabled, metadata explains the missing folder, attachments are unavailable, and execution/start capabilities are false.
- Typed draft survives reload with a truthful restored-for-this-tab status. Clear draft remains cleared after reload.
- No `/api/v1/chat/events` request is made when the configured runtime is unavailable.
- At 320px viewport width, document scroll width is 320px. The first implementation places next-action guidance around y=179 and the composer around y=500; final styling is checked separately below.
- Authenticated workspace metadata contains an opaque workspace identifier, reason/remedy, root kind and capabilities rather than the raw filesystem path.

## Fault-injected UI checks

These use browser-local synthetic metadata/transport responses. They demonstrate frontend behavior, not authenticated provider execution.

- Changed the response identity from root A to root B: B opened with an empty draft. Entered B draft, restored A identity, and A's original text returned. No cross-root carryover.
- Deferred synthetic Send acceptance, delivered a stale no-active-turn snapshot, typed a newer draft, and attempted Send again. Exactly one POST reached the synthetic transport; the newer revision remained after acceptance and input stayed editable.
- Forced browser sessionStorage writes to throw QuotaExceededError. Draft stayed in memory and status changed to Held in this tab only; no false persistent-save claim.
- Returned HTTP 401 for workspace refresh. Draft stayed intact, Send remained disabled, and the UI explained the disconnect. Restoring the response recovered metadata. The injected HTTP failure generated the expected browser network error, not a JavaScript exception.

## Final packaged verification

Final visual refinements and Terra's backend eligibility findings were closed. G2A independently approved the bounded change after 31 targeted tests.

Installed `tmp/dist-dashboard/torq_cli-0.2.0-py3-none-any.whl` without dependencies into `tmp/dashboard-wheel-install` and launched Python with isolated import resolution. The printed module path confirmed the server used that installed package. Authenticated browser smoke at 127.0.0.1:8879 confirmed Workspace and its draft survive reload, the missing-root input remains editable, Send remains disabled, execution capability is false, and the verbose evidence caption is hidden. At 320px, document width equals viewport width. Final packaged screenshots: `tmp/dashboard-wheel-mobile.png` and `tmp/dashboard-wheel-desktop.png`.

Additional source UI checks covered dark theme, reduced motion, and CSS zoom at 200 percent without horizontal overflow. CSS zoom was used, not browser toolbar zoom. The primary setup action opens the setup details. No live provider, file editing, command execution, governed apply, or P2/P3 completion is claimed by these checks.
83 changes: 83 additions & 0 deletions docs/plans/2026-09-16-dashboard-builder-handoff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Dashboard bounded P0/P1 builder handoff

Date: 2026-09-16
Branch: `feat/dashboard-workspace-pr80`
Baseline: `a6716dcf2c585ac3a2e19d4317a56af6ba3ba741`

## Delivered scope

This increment delivers the bounded P0/P1 contract: an opt-in Workspace view for
discussing an existing verified run, truthful authenticated workspace metadata,
safe root and collection classification, provider-driven attachment capability,
fresh submit eligibility checks, and browser-session drafts scoped to an opaque
workspace identity. Fleet remains the initial view and keeps its existing
operational controls.

The CLI now classifies and verifies the selected root before constructing the key
store, chat evidence journal, or provider. The HTTP submit route independently
rechecks root trust, lifecycle writability, chat projection availability, and
active-turn state before forwarding a message. Cancellation remains available
when the session permits it even if sending is unavailable.

The Workspace UI uses the real composer and transcript. It keeps draft editing
available while Send is gated, preserves distinct drafts per workspace for the
current browser tab, avoids unsupported event-stream retries, exposes actionable
setup recovery, and keeps provider/auth/execution claims fail-closed.

## Changed files

- `src/torq_cli/application/workspace.py`: bounded root discovery, link/reparse
rejection, verified-run classification, safe run identifiers, and opaque stable
workspace identity.
- `src/torq_cli/interfaces/cli.py`: root/trust preflight before identity, evidence,
or provider construction while retaining existing model/platform diagnostics.
- `src/torq_cli/interfaces/fleet_http.py`: authenticated `/api/v1/workspace`
metadata and fresh direct-submit eligibility enforcement.
- `src/torq_cli/data/fleet/index.html`, `chat.css`, and `chat.js`: opt-in Workspace,
responsive presentation, capability-driven controls, recovery actions, and
scoped resilient drafts.
- `tests/test_workspace.py`, `tests/test_chat_cli.py`, `tests/test_chat_http.py`,
`tests/test_fleet_ui.py`, and `tests/js/chat_runtime.test.cjs`: root, trust,
mutation-order, HTTP gate, capability, navigation, draft, and in-flight
regressions.
- `README.md` and `docs/plans/2026-09-16-dashboard-ux-plan.md`: launch guidance
and corrected actual phase scope.

## Verification

- `python -m pytest -p no:cacheprovider tests -k "workspace or chat or fleet"`
— **186 passed, 841 deselected in 50.17s**. This run used normal Windows temp
access because the restricted sandbox cannot create pytest temporary folders.
- `python -m ruff check src/torq_cli/application/workspace.py src/torq_cli/interfaces/cli.py src/torq_cli/interfaces/fleet_http.py tests/test_workspace.py tests/test_chat_cli.py tests/test_chat_http.py tests/test_fleet_ui.py`
— **passed**.
- `python -m mypy --cache-dir tmp/mypy-dashboard-review src` — **passed, no
issues in 82 source files** (independent G1D run).
- `node tests\js\chat_runtime.test.cjs src\torq_cli\data\fleet\chat.js` —
**passed**.
- `node --check src\torq_cli\data\fleet\chat.js` and `git diff --check` —
**passed**.
- `uv build --wheel --out-dir tmp\dist-dashboard` — **passed** and produced
`E:\Torq-CLI\tmp\dist-dashboard\torq_cli-0.2.0-py3-none-any.whl`
(274,206 bytes).

G1D independently checked the source UI at desktop, 320 px,
200% CSS zoom, dark theme, storage failure, authentication failure, and workspace
identity changes. A separate desktop/mobile smoke check of the installed wheel returned authenticated workspace metadata,
restored the tab draft, kept Send disabled for a missing root, and included the
final responsive assets. The detailed observations and screenshot paths are in
`docs/plans/2026-09-16-dashboard-browser-verification.md`. G2A independently
approved the frozen implementation after 31 checks.

## Deliberate limits

- Workspace discusses an existing verified run. It cannot start a task, edit
files, run commands, present a governed diff, or accept/apply changes.
- Live dispatch still forbids tools and files, and the governed change
transaction remains design-only. P2 and P3 are not delivered.
- Provider authentication is not probed by metadata. No paid provider was called,
no credential was changed, and no live run was started.
- Draft persistence is limited to the current browser tab. Attachment binaries
are not persisted with drafts.
- A collection root requires the user to relaunch against one selected run; the
server does not silently switch roots.
- Nothing was pushed, merged, deployed, or committed by the builder.
41 changes: 41 additions & 0 deletions docs/plans/2026-09-16-dashboard-g1d-build-contract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# G1D handoff: PR 80 dashboard implementation

Baseline: PR #80 head `a6716dcf2c585ac3a2e19d4317a56af6ba3ba741`; main `65135ec6aa78e5f0022b0dc439b0e867dc4f399e`. PR contains documentation only. Implementation branch: `feat/dashboard-workspace-pr80`.

Roles explicitly requested by the operator: current assistant G1D; GPT-5.6 Sol G1R; GPT Daybreak Blue latest Builder; GPT-5.6 Terra G2A. Gate receipts are local review artifacts, not TORQ production run certificates. No merge, push, release, provider credential changes, or live paid execution is implied by this handoff.

## Review findings to resolve

1. P2 has a missing execution dependency. `LiveStageDispatcher` also forbids tools/file access, and the closed builder schema only accepts a short proposal string. `docs/design/governed-change-transaction.md` explicitly documents the unimplemented application transaction. Existing run creation is not a file-editing engine. P2 needs a separately reviewed execution/workspace/transaction implementation; no new UI may claim it exists.
2. The Working wireframe promises queued follow-up delivery without a queue contract. In this increment follow-ups remain unsent drafts, with explicit manual Send once ready. No silent submission on turn completion.
3. Provider `--no-session-persistence` does not mean TORQ cannot continue discussion: `chat_runtime.py` reconstructs a prompt from signed history. Distinguish discussion continuation from build continuation.
4. Fleet already supports open-action browser notifications. Reuse them; distinguish completion notifications from existing needs-attention alerts.
5. Draft persistence cannot be claimed while using memory-only storage. In this increment use explicitly labelled browser-session drafts, scoped to run/root identity, with Clear draft, quota/storage failure handling, and no automatic evidence insertion. Do not store auth tokens, keys, attachments, or filesystem paths in browser storage.
6. Correct the earlier claim that demo dry runs cannot be verified/certified. An isolated `execute_demo` experiment returned `mode=dry_run`, receipt verification `verified`, and an existing run certificate. Mode, trust, writable-session eligibility, and execution capability are separate axes. A sample-view policy must not be presented as a cryptographic impossibility. The sandbox initially refused multiprocessing pipe creation; the approved no-provider retry succeeded.

## Executable increment

Deliver the friendly entry/workspace and truthful capability foundation (bounded P0/P1), plus a documented lifecycle assessment. Full P2/P3 remain tracked requirements, not delivered by this increment.

- Keep the legacy Fleet view as the initial default. Add an obvious Workspace/Fleet switch; only new Workspace localStorage state is the view preference (retain existing Fleet theme and notification-deduplication keys). Workspace is a polished responsive conversation-first view using existing bundled vanilla HTML/CSS/JS. Keep the original useful Fleet controls and evidence details reachable. No framework migration.
- Add authenticated, read-only workspace metadata (e.g. `GET /api/v1/workspace`) giving root kind (individual run, collection, empty/missing, unavailable), safe run identities, selected identity, actual discussion capabilities, and structured reason/remediation. No raw absolute paths, secrets, receipt bodies, or untrusted HTML in metadata. `can_start_task=false`, execution unsupported, and no decorative Build/Accept buttons pretending otherwise.
- A collection must show a clear choose-run state and safe identifiers. For this slice, give a concrete supported launch instruction with a relative run ID if runtime rebinding is not implemented. Do not switch mutable controllers by changing a projector path; preserve the existing per-run ownership/session invariant. CLI should explicitly diagnose collection roots when chat is requested, rather than mint keys for a parent collection. No arbitrary automatic newest-run selection.
- Root classification and receipt/certificate trust preflight must occur before `FileRunKeyStore.get_or_create_run_keys` or any chat identity/journal creation. Collection, missing, symlink/reparse, and untrusted roots with chat requested must fail or disable chat without key-store mutation. Metadata reads must not create keys or journals.
- Handle empty/missing/demo/untrusted/runtime-disabled/disconnected states with plain-language messages and an actionable Details/setup guidance panel. Do not classify a run as Sample by folder naming alone: use trustworthy run mode or label unknown. Do not classify every nonempty directory as a collection; bounded discovery of immediate `run-*` directories, reject symlink/reparse targets, no recursion.
- Derive attachment support from actual configured provider on the server. Claude: zero attachments; generic/no metadata defaults closed. Other supported adapters retain their existing limits. UI help, accept types, and disabled state match. Server remains authoritative on submission.
- Keep textarea editable while unavailable/working. Submission checks runtime readiness and active turn in handler, not merely disabled button. Draft text entered during an active turn must survive snapshots/completion. Do not queue or auto-send. Support Ctrl/Cmd+Enter; no accidental Enter submit.
- Drafts: browser-session storage, run/root-scoped using an opaque server identifier. Keep local unsent content separate from accepted chat content. Clear only the exact submitted revision after confirmed acceptance, preserving edits typed during request flight. Storage failure must state that the draft is only held in this tab. Preserve draft on error/expired session/reconnect. Empty-root draft cannot silently become a different run's instructions.
- The opaque `workspace_id` must remain stable for the same classified root across reload/reconnect within the browser session and differ across roots. Do not expose the raw path in it. Tests must demonstrate this stability and separation, not simply a random ID per request.
- Workspace should show the task/run title if verified; otherwise a neutral welcome. Suggestion chips insert editable prompts. Progress/usage/status comes from existing evidence; do not invent step counts, file diffs, cost, checks, or success. Raw finding remains available under Details.
- Safe visual hierarchy: project/task header, central conversation or empty state, nearby composer, concise next-action card, collapsible run details. Friendly sentence-case copy, restrained color, responsive at 320px, 200% zoom, visible keyboard focus, reduced motion, polite announcements. Keep legacy mode available.
- Add clear setup/help and README instructions explaining how to launch an individual run and what discussion can/cannot do. The existing untracked personal launcher is not a distributable product artifact: do not overwrite it. If a supported launcher is needed, add it under scripts with no hardcoded machine paths/model and never kill an unrelated port owner.

## Boundaries and tests

Keep certificate verification, exact-origin/session protections, signed transcript semantics, process cancellation semantics, and existing provider tool restrictions unchanged. No secrets or credentials in the browser. No server-controlled innerHTML. New endpoint uses existing authenticated-session checks and no-store headers.

Test root classification (empty, missing, valid individual, collection, symlink, untrusted), metadata auth/redaction/capabilities, no mutation on metadata reads, submit gate, drafts during in-flight acceptance and active turn, draft scoping/storage failure, preference switching, unsupported attachments, and reconnect. Retain chat/Fleet existing tests, adjusting brittle source-string assertions only when behavior is preserved and replacement checks exist.

Run targeted tests, ruff, mypy, packaging if assets change, then affected complete chat/Fleet regression. Verify a real locally served browser flow (fixture evidence allowed and labelled; no provider call), both views, blocked state, draft/edit/persistence, 320px layout and keyboard operation. Capture screenshots and findings. Browser fixtures prove UI behavior only.

G1R must approve this bounded contract before Builder edits implementation. Builder supplies changed files, commands/results, screenshots, limitations. G2A independently reviews final diff and reruns relevant checks. Any gate rejection returns to Builder for corrections; do not equate a partial UI slice with completed build-tool parity.
Loading
Loading