paseo-room 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +142 -16
  2. package/dist/index.js +483 -72
  3. package/dist/index.js.map +1 -1
  4. package/dist/prompts/contract/lead.md +35 -6
  5. package/dist/prompts/contract/shared-authority.md +2 -2
  6. package/dist/prompts/contract/supervisor.md +17 -0
  7. package/dist/runtime-plugin/client/attention-settings.tsx +173 -0
  8. package/dist/runtime-plugin/client/data.ts +15 -2
  9. package/dist/runtime-plugin/client/effort-settings.tsx +89 -0
  10. package/dist/runtime-plugin/client/forms.tsx +326 -0
  11. package/dist/runtime-plugin/client/host.ts +17 -0
  12. package/dist/runtime-plugin/client/kit.tsx +298 -0
  13. package/dist/runtime-plugin/client/model.ts +113 -0
  14. package/dist/runtime-plugin/client/pills.ts +64 -0
  15. package/dist/runtime-plugin/client/record.tsx +249 -0
  16. package/dist/runtime-plugin/client/role-pills.tsx +96 -0
  17. package/dist/runtime-plugin/client/room.tsx +291 -0
  18. package/dist/runtime-plugin/client/tone.ts +2 -0
  19. package/dist/runtime-plugin/client/views.tsx +163 -150
  20. package/dist/runtime-plugin/index.client.tsx +10 -2
  21. package/dist/runtime-plugin/index.server.ts +54 -3
  22. package/dist/runtime-plugin/server/attention/delivery.ts +218 -0
  23. package/dist/runtime-plugin/server/attention/engine.ts +499 -0
  24. package/dist/runtime-plugin/server/attention/key.ts +44 -0
  25. package/dist/runtime-plugin/server/attention/log.ts +54 -0
  26. package/dist/runtime-plugin/server/attention/mask.ts +50 -0
  27. package/dist/runtime-plugin/server/attention/observer.ts +323 -0
  28. package/dist/runtime-plugin/server/attention/portfolio.ts +77 -0
  29. package/dist/runtime-plugin/server/attention/questions.ts +80 -0
  30. package/dist/runtime-plugin/server/attention/seat-starter.ts +166 -0
  31. package/dist/runtime-plugin/server/attention/sensor.ts +207 -0
  32. package/dist/runtime-plugin/server/attention/signals.ts +240 -0
  33. package/dist/runtime-plugin/server/attention/triage.ts +107 -0
  34. package/dist/runtime-plugin/server/brief.ts +51 -1
  35. package/dist/runtime-plugin/server/context.ts +48 -4
  36. package/dist/runtime-plugin/server/contracts/actions.ts +22 -3
  37. package/dist/runtime-plugin/server/controller.ts +428 -63
  38. package/dist/runtime-plugin/server/correlations.ts +7 -3
  39. package/dist/runtime-plugin/server/domain/acceptance.ts +7 -2
  40. package/dist/runtime-plugin/server/domain/scope.ts +191 -0
  41. package/dist/runtime-plugin/server/domain/state.ts +301 -10
  42. package/dist/runtime-plugin/server/domain/views.ts +162 -10
  43. package/dist/runtime-plugin/server/events/schema.ts +38 -3
  44. package/dist/runtime-plugin/server/git.ts +93 -1
  45. package/dist/runtime-plugin/server/handlers/actions.ts +75 -15
  46. package/dist/runtime-plugin/server/handlers/peer.ts +26 -5
  47. package/dist/runtime-plugin/server/handlers/turns.ts +31 -23
  48. package/dist/runtime-plugin/server/host.ts +26 -0
  49. package/dist/runtime-plugin/server/lifecycle.ts +14 -3
  50. package/dist/runtime-plugin/server/notices.ts +26 -3
  51. package/dist/runtime-plugin/server/ownership.ts +1 -1
  52. package/dist/runtime-plugin/server/paseo-port.ts +294 -13
  53. package/dist/runtime-plugin/server/recovery.ts +124 -7
  54. package/dist/runtime-plugin/server/rpc.ts +222 -9
  55. package/dist/runtime-plugin/server/seats.ts +122 -0
  56. package/dist/runtime-plugin/server/tools.ts +36 -11
  57. package/dist/runtime-plugin/shared/attention.ts +70 -0
  58. package/dist/runtime-plugin/shared/effort.ts +27 -0
  59. package/dist/runtime-plugin/shared/identity.ts +8 -0
  60. package/dist/runtime-plugin/shared/limits.ts +6 -0
  61. package/dist/runtime-plugin/shared/policy.ts +2 -2
  62. package/dist/runtime-plugin/shared/rpc-contracts.ts +118 -1
  63. package/package.json +3 -2
package/README.md CHANGED
@@ -278,8 +278,9 @@ recreate an existing Claude session after setup or an update.
278
278
  have none. Only the contract is dropped, never your own memory, and an earlier generation of it
279
279
  is removed rather than left behind. The choice is recorded in `room.json`, so `verify` compares
280
280
  against it and rejects the flag itself; `setup` without the flag restores the fallback. Keep the
281
- fallback unless you have a reason not to: the plugin hook is verified, but whether a *resumed*
282
- session re-enters it is unproven, and `CLAUDE.md` is what covers that case.
281
+ fallback unless you have a reason not to: the plugin hook is verified, and on Paseo 0.9.1 a
282
+ *resumed* session was observed to keep the room prompt, but that is not proven for every
283
+ supported version or for what the model actually reads, and `CLAUDE.md` is what covers that case.
283
284
 
284
285
  Pi providers use a strict command tail:
285
286
 
@@ -482,7 +483,9 @@ vocabulary for Lead and Peer, and exactly one body per role. TypeScript selects
482
483
  that settles it rather than pre-solving the work; any plan or file list in it is provisional.
483
484
  One moving write scope has exactly one owner, and at most one Peer is writable at a time. It
484
485
  explicitly requests native Paseo completion/error/permission notification for Peer creation and
485
- every background follow-up, then waits for events rather than polling. Room tools: on.
486
+ every background follow-up, then waits for events rather than polling. A question only Human can
487
+ answer goes on its own `NEEDS-HUMAN:` line, and an effect beyond the work's intended scope on an
488
+ `INCIDENT:` line, so neither is lost in a long message. Room tools: on.
486
489
  - **Peer** owns one bounded assignment — writable inside an assigned scope, or read-only
487
490
  against a named candidate, question or area — under exactly one disposition Lead names in the
488
491
  brief (Engineer, Architect, Reviewer or Scout), forms its own technical position from the code
@@ -506,9 +509,12 @@ healthy owner, and closes the duplicate only after a stable handoff. Ambiguous o
506
509
  health, or concurrent writes go back to Human rather than being guessed or merged.
507
510
 
508
511
  Two further limits are deliberately conservative. **One writable Peer per project**, not one
509
- per moving scope: the room gives you no writer isolation, so separate scopes are not evidence
510
- of separate working trees, and no workspace protocol relaxes the limit. Concurrent writable
511
- Peers in isolated worktrees are a deferred decision, not an oversight. And a seat's **model and
512
+ per moving scope: separate scopes are not evidence of separate working trees, and no workspace
513
+ protocol relaxes the limit. The contract makes one exception — Peers the runtime dispatches into
514
+ its own worktrees with non-overlapping declared scopes (runtime Phase 2,
515
+ [runtime-coordination-phase2.md](docs/design/runtime-coordination-phase2.md); see
516
+ [Isolated writers](#isolated-writers-runtime-phase-2) below). Every other Peer, and every writer in
517
+ Lead's own workspace, is inside the limit. And a seat's **model and
512
518
  reasoning effort are not one knob**: the model stays the profile's default unless a repository
513
519
  protocol explicitly supplies model routing, while the thinking effort is Lead's
514
520
  per-brief choice on task risk, uncertainty, context size and verification burden — lowest that
@@ -616,10 +622,24 @@ npx paseo-room verify
616
622
  points, so a daemon outside that range is refused for runtime while the baseline room keeps
617
623
  working.
618
624
  - **Lead** gains room tools such as `assignment_create`, `assignment_dispatch`, `assignment_answer`,
619
- `assignment_accept` and `gate_run`. **Supervisor** gains `room_status`, `runtime_findings` and
620
- `message_lead`, and cannot change an assignment.
621
- - **A runtime-dispatched Peer** gets exactly two tools, `ask` and `handoff`, for its own assignment,
622
- and still no Paseo room tools. A report exists only once one of those calls is accepted; its
625
+ `assignment_accept`, `gate_run`, and for isolated writers `workspace_close` and `lease_reclaim`.
626
+ `assignment_create` refuses a base that is not a commit of the repository (`base_unknown`).
627
+ **Supervisor** gains `room_status`, `runtime_findings`, `message_lead` (with a `project` for a
628
+ Supervisor of several projects) and `attention_feedback`, and cannot change an assignment. Its
629
+ status and findings cover only its portfolio and the project it stands in; `room_status` lists
630
+ the assignments still open or still to close, and only counts settled ones.
631
+ - **Peer thinking.** A runtime-dispatched Peer launches on its room profile's model and thinking
632
+ option. In **Settings › Room seats › Thinking Lead may choose** you can allow other thinking
633
+ options per Peer provider, from the ones Paseo lists for its model. Lead may then pass `thinking`
634
+ (with a `thinkingReason`) to `assignment_dispatch`, as the Lead contract directs. The runtime
635
+ refuses anything outside what you allowed or what the model offers, and always refuses `ultra` and
636
+ `ultracode`, which start agents on their own. It records the choice, shows it with the reason to
637
+ Supervisor and in the panel, and keeps it for a reclaimed Peer while you still allow it. The model
638
+ itself is never Lead's to change.
639
+ - **A runtime-dispatched Peer** is titled `<Disposition> · <outcome gist> · <assignment id>` (for
640
+ example `Reviewer · Review the Docker Compose dev env… · asg_…`), and the runtime's notices to Lead
641
+ name the assignment the same way. It gets exactly two tools, `ask` and `handoff`, for its own
642
+ assignment, and still no Paseo room tools. A report exists only once one of those calls is accepted; its
623
643
  final message is never read as a report. Claude asks for permission before a Peer's first call
624
644
  to `mcp__paseo_room__ask` or `mcp__paseo_room__handoff`: approve it in Paseo, since the runtime
625
645
  never answers a permission for a seat. Codex and Pi Peers do not ask.
@@ -629,13 +649,116 @@ npx paseo-room verify
629
649
  immutable commit. The runtime reads the commit and changed paths itself, never merges, resets,
630
650
  cleans or stashes, and releases a writer only after Paseo proves the Peer archived.
631
651
  - **State** lives under `~/.paseo-room/runtime/v1` as append-only event files. Setup never edits it.
632
- The **Room runtime** sidebar item and workspace panel show projects, assignments, writer
633
- ownership and findings, each labelled with how it is known (enforced, detected, procedural,
634
- unverifiable).
652
+ - **The Room runtime panel** (sidebar item, and a workspace panel that opens on its own project)
653
+ puts what needs you first. Below that come your projects, ordered by status, then your
654
+ Supervisors.
655
+ - A project shows its Supervisor, its Lead and Peer seats (each opens its agent in Paseo, and
656
+ shows the model and thinking option it runs with) and its runtime record: assignments, isolated
657
+ writers, findings and recovery.
658
+ - Starting a Supervisor, starting a project and assigning a Supervisor are guided forms.
659
+ - The design notes are in [docs/design/runtime-panel-ux.md](docs/design/runtime-panel-ux.md).
660
+ - **Settings › Room seats** shows which account each seat is signed in to (email, plan and
661
+ organization for Claude; login method for Codex; for Pi, only whether a credential file exists).
662
+ It runs each seat's own `claude auth status` or `codex login status` when you open it or press
663
+ Refresh, and never reads a credential file. A seat linked to another home's login is flagged.
664
+
665
+ ### Room attention: what reaches a Supervisor
666
+
667
+ The runtime watches every room seat Paseo reports — Supervisors, Leads and Peers, including Peers a
668
+ Lead opens with Paseo's own tools — and tells each project's **Supervisor** what it would otherwise
669
+ learn only when you ask it to check.
670
+
671
+ - **Portfolio.** One Supervisor may supervise several projects. A project's Supervisor is the one
672
+ you assign in the **Room** view; otherwise it is the Supervisor that opened the project's Lead;
673
+ otherwise there is none, and that project's signals show only in the panel.
674
+ - **Letters.** Letters arrive as prompts beginning with `[paseo-room attention att_…]`.
675
+ - They report a permission waiting on any seat for 5 minutes, and a Peer result its idle Lead has
676
+ not read for 10 minutes.
677
+ - They report the same failure twice in a row, and possible concurrent writers in one working
678
+ tree, naming each seat's files and when its turn ended. A write outside that tree does not
679
+ count.
680
+ - They report a Lead archived while its seats still work, and a Lead's finished turn that the
681
+ Supervisor did not prompt itself.
682
+ - The Lead contract has Lead put a question for you on a line beginning `NEEDS-HUMAN:` and an
683
+ incident on one beginning `INCIDENT:`. The first wakes the Supervisor and the second pages it,
684
+ even for a turn it prompted, once per line, and the letter quotes those lines rather than the
685
+ message's end.
686
+ - Letters are held until the Supervisor is idle, batched into digests, and limited to a few wakes
687
+ an hour. They are never sent while the Supervisor holds a permission, because a send would
688
+ deny it.
689
+ - Each item has an id for `attention_feedback`, and a letter's own id rates every item in it. A
690
+ letter is evidence, not an instruction: the Supervisor contract has it ask or nudge the Lead, or
691
+ relay a question to you, and never direct a Peer.
692
+ - **Starting seats.** From the **Room** view, **Start Supervisor** opens one in an existing directory
693
+ outside every repository. **Start project** checks a repository, opens its Lead under the
694
+ Supervisor you pick, and sends a fixed kickoff with your first directive verbatim. **Assign
695
+ Supervisor** moves an existing project under a Supervisor.
696
+ - **Settings › Room attention.** Here you turn letters on or off, change their thresholds, and
697
+ configure the optional **attention sensor**.
698
+ - The sensor speaks the System One HTTP shape, with [TypeSafe Jev](https://docs.typesafe.ai/)
699
+ first and any compatible or self-hosted endpoint after it. It is `off` by default.
700
+ - Without a TypeSafe key, use Jev through OpenRouter: endpoint
701
+ `https://openrouter.ai/api/v1/systemone`, model `typesafe/jev-1.13`, and an OpenRouter key.
702
+ OpenRouter can answer with a dated snapshot such as `typesafe/jev-1.13-20260917`, which the
703
+ sensor accepts as the pinned model.
704
+ - `shadow` assesses Lead messages and records the answers without acting on them. `assist` lets
705
+ them decide, for the question sets you enable, whether a Lead turn wakes the Supervisor, waits
706
+ for a digest, or is only recorded.
707
+ - Nothing leaves the machine until you acknowledge the endpoint's host, and only masked, bounded
708
+ excerpts of Lead messages are sent.
709
+ - The key is write-only: it is stored owner-only under `~/.paseo-room/runtime/v1/secrets` and never
710
+ shown again.
711
+ - **Evaluation.** `npm run attention:eval` (in this repository) reads your Claude Lead transcripts
712
+ read-only and prints what an evaluation would send. `-- --send` runs it against the endpoint, as
713
+ your consent for that run.
714
+
715
+ ### Isolated writers (runtime Phase 2)
716
+
717
+ By default a writable assignment runs in Lead's workspace and excludes every other writer. With
718
+ `isolation: "worktree"` on `assignment_dispatch`, the runtime instead asks Paseo for a new worktree
719
+ cut from the assignment's exact base commit, proves it with Git (its repository, its exact `HEAD`, a
720
+ clean tree, not Lead's directory), and places the Peer there with Lead as its parent. Up to three
721
+ such writers may run at once in one project.
722
+
723
+ The runtime refuses an isolated dispatch before recording anything or asking Paseo for anything,
724
+ and the refusal is final for that dispatch — narrow or sequence the work:
725
+
726
+ | Code | Why |
727
+ |---|---|
728
+ | `worktree_unqualified` | the daemon's version has not passed live qualification for worktree dispatch |
729
+ | `worktree_setup_unobservable` | `paseo.json` at the base declares `worktree.setup`, which Paseo runs where the runtime cannot see it finish |
730
+ | `scope_not_canonical` | a `writeScope` or `serialOnly` item is not a repository-relative path or `*`/`?`/`**` glob |
731
+ | `writer_exclusive` | a writer is still active in Lead's workspace (or, the other way round, isolated writers are active) |
732
+ | `writer_uncertain` | another isolated writer's state is uncertain |
733
+ | `lease_cap` | three isolated writers are already active |
734
+ | `scope_overlap` | the new scope may share a path with an active writer's scope |
735
+ | `serial_path` | both the new scope and an active writer reach a path Lead declared `serialOnly` |
736
+
737
+ Write scopes prevent collisions between isolated writers; **they do not contain a Peer**, which can
738
+ still write anywhere its user can. At handoff the runtime records any changed path outside the
739
+ scope as `scope.exceeded`, and accepting that candidate needs an override. Lead still integrates
740
+ each candidate by hand, in its own workspace, one at a time; the runtime never merges, rebases or
741
+ pushes.
742
+
743
+ When the writer is released, the runtime closes a worktree that is clean at the handed-back
744
+ candidate or the unchanged base. Anything else is kept and Lead is told: `workspace_close` with
745
+ `discardUncommitted` and a reason destroys that work. Closing removes the directory and keeps the
746
+ branch. If a Peer dies, `lease_reclaim` — once Paseo shows it archived — dispatches a new Peer into
747
+ the same worktree at the next lease epoch; the old Peer's late reports are refused. The panel offers
748
+ the Human form of both, only where the runtime would accept it, and asks twice before discarding
749
+ work.
750
+
751
+ Worktree dispatch is enabled per daemon version, only after the live qualification in the Phase 2
752
+ delta §9 passes on that version; `0.9.1` is qualified. On any other version the runtime refuses
753
+ `worktree_unqualified` and dispatch without isolation still works.
635
754
 
636
755
  To stop using it, finish, close or abandon the recorded work, then run setup **without**
637
- `--runtime`. Setup refuses while anything is still active or uncertain, and keeps the recorded
638
- state once it proceeds. `npx paseo-room export --apply` copies that state out; the export omits gate
756
+ `--runtime`. Setup refuses while anything is still active or uncertain — including an isolated
757
+ writer's lease or an unconfirmed worktree create or close — and keeps the recorded state once it
758
+ proceeds. Retained worktrees belong to Paseo, and directories a failed teardown left behind are
759
+ yours: setup and `remove` count both and delete neither. Close a retained worktree from the panel
760
+ before deselecting (or archive it in Paseo afterwards); remove a left-behind directory by hand, and
761
+ its finding clears. `npx paseo-room export --apply` copies that state out; the export omits gate
639
762
  output unless you add `--include-gate-output`, and briefs or commands written by a seat cannot be
640
763
  proven secret-free. `remove --apply` warns about runtime history and then deletes it with the rest
641
764
  of the room.
@@ -651,7 +774,10 @@ of the room.
651
774
  - [docs/product/runtime-coordination-prd.md](docs/product/runtime-coordination-prd.md),
652
775
  [docs/design/runtime-coordination.md](docs/design/runtime-coordination.md) and
653
776
  [docs/plans/runtime-coordination-phase1-implementation-plan.md](docs/plans/runtime-coordination-phase1-implementation-plan.md)
654
- — the runtime coordination preview: requirements, technical design and Phase 1 plan.
777
+ — the runtime coordination preview: requirements, technical design and Phase 1 plan;
778
+ [docs/design/runtime-coordination-phase2.md](docs/design/runtime-coordination-phase2.md) and
779
+ [docs/plans/runtime-coordination-phase2-implementation-plan.md](docs/plans/runtime-coordination-phase2-implementation-plan.md)
780
+ — worktree concurrency (Phase 2).
655
781
  - [docs/product/paseo-room-prd.md](docs/product/paseo-room-prd.md) — the original PRD, kept
656
782
  for history; the transactional-installer requirements in it were deliberately dropped.
657
783