Skip to content

T05 — Make Playground the Pi chat home

Base dependencies: T02, T04. T05b/T05c additionally require verified T03. Status: planned.

Read ../README.md and ../PLAN.md first. Paths are discovery anchors, not permission to skip caller analysis.

Likely files

  • anvil_serving/observability/dashboard/static/views/playground.js
  • anvil_serving/observability/dashboard/static/views/pi_chat.js
  • anvil_serving/observability/dashboard/static/views/settings.js
  • anvil_serving/workbench_app/service.py
  • anvil_serving/workbench_app/pi_sessions.py
  • tests/workbench/test_pi_chat_behavior.py

Implementation steps

Run one slice per agent turn, in order; use the shared receipt rules. T05a intentionally uses existing host-session controls without waiting for new multi-root task support. New T03 project controls remain unavailable until verified; the host tab can ship independently with its owner-access label intact.

Slice Owned change Checkpoint before continuing
T05a Host Pi tab mounting and retained Model test view Pinned transport, authentication, existing session resume and reconnect pass inside Playground
T05b Host project/thread navigation, T03 files/worktrees and settings Host column of the capability table below passes; native histories/authority unchanged; settings read back
T05c Managed-task view entry, capability presentation and cross-mode navigation Managed-task column passes; unsupported controls visibly unavailable; no host authority or transcript crossing; packet-wide acceptance
  1. Implement the selected T02 integration as the default Pi tab, opening existing host Pi conversations first. Preserve Pi Web's familiar visual and interaction model; let the shell own navigation/context, not duplicate chat controls. Retain the current direct-model view under Model test with its history/routes intact.
  2. Provide project-filtered thread list/search, new/reopen/rename/archive, source/running indicators and stable thread URLs. Preserve native session IDs and histories; use correlation references rather than importing transcripts.
  3. Surface explorer, file preview/mentions, staged/working diffs and worktree visibility/selection from T03; prevent rebinding an active writer. Add explicit managed worktree creation only using an existing safe owner path.
  4. Provide the capabilities below, separately verified for each owner. Reuse Pi Web controls and existing pi_chat.js for task-bound runners; do not infer task-mode support from host UI or upstream RPC documentation.
  5. Expose settings with explicit thread/project/global scopes and application times. Disable unavailable controls with reasons; preserve declared model/provider and authoritative catalog limits. Maintain pending request identity across reconnects.

Acceptance

  • [ ] Existing authorized host sessions are visible (unassigned/owner-only until explicitly associated) and reopen without spawning duplicate processes; foreign sessions remain unavailable. Association cannot change cwd, authority or adopt a task lease.
  • [ ] One user can switch between project threads without losing drafts or redirecting tool writes to another root.
  • [ ] Every required host/task capability below passes against a deterministic fake backend and the selected pinned UI; unavailable managed follow-up/attachments have explicit negative-command tests and visible reasons. Host success does not count as task-mode evidence.
  • [ ] A lost send response/reconnect produces one accepted turn, with visible recovery when ownership is uncertain.
  • [ ] Settings affect only the declared scope, survive expected restart boundaries, and expose no secret. In-Playground chat works; a link-only implementation fails.
  • [ ] Compare retained-session resume, send/stream/stop, supported command/shortcut use, extension response and file/diff navigation side by side with the pinned Pi Web baseline. Familiar controls remain reachable, embedding does not steal composer focus/keys, and every material difference is recorded for review. A generic replacement chat layout does not meet the experience target.

Capability and scope contract

This roadmap makes the existing host Pi experience the full chat home. It preserves the managed task runner's narrower supported contract. T02 must record exact installed support; an unsupported required host feature is a named gap to resolve, not a silent disabled-control substitute for acceptance.

Capability Host Pi Web (T05b) Managed Anvil task Pi (T05c)
Prompt, streaming/tools, stop, steer, resume Required through pinned owner Required through current dispatcher/retained runner
Queued follow-up Required; prove pinned owner's queue semantics Deferred: no follow_up command in current PiSessionService.command; show unavailable
Attachments Required for formats supported by the pin; test limits and rejection Deferred: current adapter submits text prompts only; no client-side upload workaround
Branch Required through supported host operation Required through existing stop-and-new-bound-conversation path; inline fork/clone commands are rejected
Model/thinking Owner-authorized catalog and scope Current allowlist; provider change needs a new isolated conversation
Extension select/confirm/input/editor Required where installed extension protocol supports it Existing extension_response; test correlation/expiry and unsupported widget states
Rename/archive Supported owner operation or reversible view-only metadata View-only metadata if owner has no operation; never imply native deletion or lease changes
Files/worktrees T03 context controls with operator-access label Frozen task workspace and enforced T03 scope

Managed queued follow-up and attachments require a separately scoped extension to pi_rpc.py, pi_sessions.py, service payload validation and binding/storage tests before enabling those controls. They are explicitly outside this initial task-mode delivery, not evidence of full parity. File mentions in task mode remain references to already authorized roots, not uploads or permission grants.

Focused checks

Use the existing checkout Python environment and repository test wrapper. These are planned checks, not test results.

python scripts/run_tests.py tests/workbench/test_pi_chat_behavior.py tests/workbench/test_pi_sessions.py tests/workbench/test_pi_rpc.py tests/workbench/test_playground.py tests/workbench/test_service.py -x -q

Add behavioral regression coverage in the existing suite for new contracts; source-string assertions alone are insufficient. Run browser checks described above. Run broader checks only for changed shared seams or failures.

Stop boundary

No second session authority, blind replay, forced provider switch or wholesale Pi UI reimplementation without a recorded T02 decision.

Completion receipt

Record commit/files, actual commands and results, browser observations, unresolved items, schema decisions and next eligible packet. Raw deployment evidence stays private. Do not change acceptance boxes without measured proof.

Engineering references

Read the implementation guide section and verified source map for this packet. tasks.json selects the relevant code/data examples and primary external references. Current APIs and proposed contracts are labeled separately; examples grant no live authority.