Plan 0 Paseo probe report and plan 1 Foundation draft (Astra)
Both written by Astra (codex) from the committed briefs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+651
−0
docs/superpowers/plans/2026-11-01-equipo-plan-1-foundation.md+273 −0docs/superpowers/specs/2026-11-01-paseo-probe.md+378 −0
No CI script — run details
diff --git a/docs/superpowers/plans/2026-11-01-equipo-plan-1-foundation.md b/docs/superpowers/plans/2026-11-01-equipo-plan-1-foundation.md| new file mode 100644 |
| index 00000000..2adbe7ca |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-11-01-equipo-plan-1-foundation.md |
| @@ -0,0 +1,273 @@ |
| +# Equipo Foundation Implementation Plan |
| + |
| +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. This names the future execution method; writing this plan does not authorize implementation or agent dispatch. |
| + |
| +**Goal:** Paul can sign in to a lone Equipo instance on CARLOS, add projects, and use the rail and account-grouped Projects overview, with no agents running. |
| + |
| +**Architecture:** A Rastrillo app owns the team roster and project metadata in its activation database. The copied prototype remains a separately tested execution library, with a roster-backed Authority and team/project budget contracts; Foundation does not open its execution store or dispatch work in production. Use the framework's sidebar shell and server-rendered forms. |
| + |
| +**Tech Stack:** Go 1.25.0 or later; `amadan.net/oficina/equipo`; `amadan.net/rastrillo/rastrillo v0.28.0`; chi v5, GORM, cgo-free `modernc.org/sqlite`; embedded HTML and Rastrillo's `day` assets. |
| + |
| +**Spec:** `docs/superpowers/specs/2026-11-01-equipo-design.md`, revision 2; Foundation row of `docs/superpowers/plans/2026-11-01-equipo-roadmap.md`; scope clarified by `docs/superpowers/plans/CODEX-BRIEF-plan-1-foundation.md`. |
| + |
| +## Global Constraints |
| + |
| +- “An Equipo instance belongs to one team. Its members are the team's roster.” Use lone-instance identity and membership together (doctrine rulings 1 and 5). |
| +- “Everyone on the team shares projects and work; each person has their own coordinator.” Foundation implements shared records; coordinators are plan 3. |
| +- “Equipo is its own Go module, `amadan.net/oficina/equipo`.” It “does not import `oficina/suite` in the first milestone”. |
| +- “Product, Design, Copy, Engineering, Review”; categories with icons, never initials. Store settings only. |
| +- “Connections belong to people, not the team.” Do not create team-owned provider accounts or put credentials into project or specialist records. |
| +- “No split screen”; phone navigation is “drill-down index screens with a back link to the parent”. Default phone landing is the conversation. |
| +- “Before (1) and (2) exist, ‘connecting a CARLOS account’ in the first milestone means naming it and binding its apps to repositories by hand; it grants Equipo nothing.” No CARLOS signals or CLI-credential shortcut. |
| +- “Equipo never merges and never pushes the default branch.” No runner, model call, repository fetch, publishing, merge or deployment endpoint in Foundation. |
| +- “Copy for every user-facing string goes through copy review before it ships.” Mockup copy is unapproved. Put app copy in one file and review before insertion into runtime artifacts. |
| +- Estilo's ruling is `day`, identical to the framework theme. Use attribute grammar, vendored assets, and scriptless forms/navigation. |
| +- Browser writes name the authenticated person (doctrine ruling 9). Never accept an actor, role or team identity from submitted form fields. |
| +- Keep Go caches at their defaults. Scratch goes under on-disk `$TMPDIR`; stop processes and remove scratch at the end. Local servers bind explicitly to `127.0.0.1`. |
| +- Only the human deployment task below publishes the app. This planning session creates only this file, with no commits, pushes, other repository changes or agents. |
| + |
| +## Review Focus |
| + |
| +1. A removed member or demoted owner with an existing cookie loses access immediately; roster lookup failures fail closed. Task 3: `TestRosterChangesAffectExistingSession`. |
| +2. A crafted repository binding or submitted decision owner cannot redirect future work outside the saved project or assign authority to an outsider. Tasks 4 and 6: `TestProjectRejectsUnsafeBinding`, `TestAuthorityRejectsMismatchedTarget`. |
| +3. Concurrent reservations, a period boundary and an uncertain stopped attempt cannot make project/team usage disappear or admit overspend. Task 5: `TestPeriodBudgetReservations` and `TestTimeChargeWaitsForContainment`. |
| +4. Repeated boot, duplicate form submission and stale edits preserve records and settings without silently overwriting another person's changes. Tasks 3, 4 and 7: bootstrap, idempotency and revision tests. |
| +5. A narrow screen, long project name or disabled JavaScript still permits navigation and project creation; a failed count never becomes a confident zero. Tasks 8 and 9: overview error and browser tests. |
| + |
| +--- |
| + |
| +## Grounding and scope decisions |
| + |
| +Sources were read at Equipo HEAD `5042a9e` on branch `design`, memoria `617eb2a`, Rastrillo checkout `9c1e14ef` and its `v0.28.0` tag. Prototype checkout HEAD is `cb280f7`; `git diff ceee7a67 -- internal/team internal/teamcontract` is empty. Use the pinned commit for the copy, not a moving checkout. |
| + |
| +| Source | Reuse and correction | |
| +|---|---| |
| +| Rastrillo `cmd/rastrillo/new.go` at `v0.28.0` | `new --theme day --shell sidebar equipo`; the generator refuses an existing directory. Generate under scratch, then select files for this repository. This tag has no `--auth` flag; HEAD does. Do not mix their recipes. | |
| +| Rastrillo `ui/ui.go`, `ui/funcs.go`, `ui/layouts/sidebar.html` at the tag | `ui.Layout("sidebar")`, `ui.ThemeCSS("day")`, `ui.VendoredAssets("day")`, `ui.Funcs(ui.WithIcons(...))`, `ui.Templates()`. Use `view`, `up`, `brand`, `nav`, `account` blocks and `aria-current`. No new rail framework. | |
| +| Rastrillo `DESIGN.md`, Navigation | Its generic disclosure description is older than the sidebar's implemented phone index. The verified sidebar and Equipo spec agree on index/page navigation below 800px. | |
| +| Rastrillo `cmd/rastrillo/migration.go:appPackage` | Requires exactly one immediate app directory under `internal/` excluding names ending in `test`. Put the core in `internal/equipo/team` and its contracts in `internal/equipo/teamcontract`, not alongside `internal/equipo`. | |
| +| memoria `cmd/memoria/main.go`, `internal/memoria/{app,auth,config,migrations,render}.go` | Reuse Resolve → `db.Open` → app → Serve, one `auth.Auth`, admission callback, fail-closed routes, SMTP refusal, and separate app `Schema` / merged `BootSchema`. Translate old `github.com/carlosframework/rastrillo` imports to the pinned `amadan.net/rastrillo/rastrillo` module. | |
| +| memoria `Makefile`, `.amadan/ci`, `.amadan/ci.d/` | One `make ci` definition and executable step wrappers; stamped release; flags before deploy binary. Keep the new scaffold's additional checks rather than weakening them to memoria's smaller gate. | |
| +| memoria `tools/drive/main.go`, README, `/home/paulca/memoriadrive/run.sh` | Separate local drive; explicit loopback; persistent local config; production binary retains auth. Read the external script without copying its secrets or addresses. README's “never deployed” paragraph contradicts its Live section; Makefile's release path is authoritative. | |
| +| Prototype `internal/team` and `internal/teamcontract` at `ceee7a67` | Production imports are standard library, `modernc.org/sqlite`, and `golang.org/x/sys/{unix,windows}`. Only the two contract tests import `github.com/carlosframework/platform/internal/team`; rewrite those to the nested Equipo package. No console or other platform-internal implementation must be extracted. | |
| +| estilo README; suite doctrine rulings 1, 5, 9 and §8 | `day`; lone roster; actual actor; no provider egress in this plan. The Equipo provider-egress amendment remains separate suite work. | |
| + |
| +**Boundary:** no task form, runner protocol, connections discovery, live counters, product ranking, coordinator, preference learning, evidence extensions or plan editor. Preserve prototype evidence, fencing and recovery tests. Add owner-only quarantine release in plan 2 before opening the execution store for live jobs; append/cancel-unstarted-step operations and plan revision events belong to plan 3. Neither is required for metadata-only Foundation. Removing the source packages from platform is separate work. |
| + |
| +The spec's full phone landing preference belongs with personal settings in plan 3. Foundation opens `/conversation` by default and provides `/work` explicitly. The brief pulls the basic phone shell forward from roadmap row 4; it does not pull forward the whole phone product. |
| + |
| +## File structure and contracts |
| + |
| +All paths below are relative to this repository unless absolute. Existing files are only the README, spec, roadmap, briefs and mockups. All application names/signatures below are **new planned interfaces**, not claims that they already exist. |
| + |
| +- `cmd/equipo/main.go`: configuration, activation, database lifetime, serving; no execution-store startup. |
| +- `internal/equipo/{app,config,auth,render,models,migrations}.go`: composition, sign-in, embedded templates/assets, app schema. |
| +- `internal/equipo/{roster,projects,specialists,authority,budgets}.go`: focused metadata services and prototype adapters. `store.go` holds shared transaction/error helpers. |
| +- `internal/equipo/team/*.go`, `internal/equipo/teamcontract/*_test.go`: copied core and external contracts; the core keeps its own SQLite migrations, witness and lock protocol. They do not enter app `Models` or `BootSchema`. |
| +- `internal/equipo/templates/{layout,signin,index,empty,projects,project,project_form,team,specialist}.html`, `internal/equipo/static/equipo.css`, `internal/equipo/icons/icons.go`: shell, forms and icons; scaffold static assets stay byte-identical to the library. |
| +- `internal/equipo/copy.go`: sole app-owned runtime copy source, with stable keys and copy-review status. Scaffold boilerplate, accessible names, errors and email text count too; framework-owned strings stay framework-owned. |
| +- `internal/equipo/migrations/0001_init.sql`, subsequent additive migrations and `schema.sql`; `Models []any` describes app tables only. |
| +- `internal/equipotest/`: HTTP, migration, asset, gate and browser tests. Core tests remain beside their packages. |
| +- `Makefile`, `.amadan/ci`, `.amadan/ci.d/`, `.rastrillo/budgets.txt`, `.gitignore`, `go.mod`, `go.sum`, `AGENTS.md`, `CLAUDE.md`, `manifest/README.md`: scaffold conventions and gates. Preserve existing `docs/`. |
| +- `run.sh`, `tools/drive/main.go`, `README.md`: local operation and reviewed human deployment instructions. |
| + |
| +Shared app types: `Role string` with only `owner` and `member`; `Actor{Address string}` derived from a verified session; `Member{Address string; Role Role; Revision int64; Active bool}`. Normalize lone-instance addresses with trim/lowercase, as memoria and doctrine specify. `Team{ID string; Name string; RosterEpoch int64}` has one persisted random ID, independent of CARLOS labels. App sentinel errors are `ErrForbidden`, `ErrNotFound`, `ErrConflict`, `ErrInvalid`, `ErrUnavailable`. |
| + |
| +`Store` wraps `*db.DB`; `NewStore(d *db.DB) *Store`. Mutators authorize the supplied trusted `Actor` against current roster rows inside their write transaction. Each mutation appends `AuditEvent{ID int64; Actor, Kind, RecordID string; At time.Time}` in that transaction; never audit credentials. `NewStore` itself grants nothing. HTTP middleware obtains the actor, and handlers never bind requests onto GORM models. |
| + |
| +## Task 1: Create the Rastrillo app and its gate |
| + |
| +**Files:** Create the scaffold files listed above, `internal/equipotest/foundation_test.go`; modify `README.md` only with reviewed setup prose. Reserve `copy.go` for reviewed strings; keep unapproved scaffold copy out of shipping artifacts. |
| + |
| +**Interfaces:** Consume the pinned Rastrillo APIs. Produce `App(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logger) (*http.ServeMux, error)`, `Config{Origin, InstanceKey string; Owners []string; AllowLoggedMail bool}`, `LoadConfig(getenv func(string) string) (Config, error)`, `Schema`, `BootSchema`, `Models`, and the `Store` contract above. Keep the scaffold decomposition with `Router(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logger) (chi.Router, error)`, `Mux(r http.Handler) *http.ServeMux` and `Configure(opts *rastrillo.Options, mux *http.ServeMux, started time.Time)`; update the generated HTTP/browser/performance harness callers together. Until Task 3, private routes return service unavailable rather than an unauthenticated scaffold page. |
| + |
| +- [ ] **Step 1: Write failing boot/gate tests.** `TestFoundationFailsClosed` requires an unauthenticated private request to fail, an empty key/owners or incomplete SMTP config to reject boot, and an invalid origin to reject boot. `TestFoundationMigratesTwice` applies `BootSchema` twice without losing a row. `TestCIGateSteps` checks executable CI wrappers call the same Make targets. Assertion examples: |
| + |
| + ```go |
| + // TestFoundationFailsClosed |
| + if err == nil { t.Fatal("missing production configuration accepted") } |
| + if response.Code == http.StatusOK { t.Fatal("private page served before auth") } |
| + // TestFoundationMigratesTwice |
| + if second.Applied != 0 { t.Fatal("migration repeated on second boot") } |
| + ``` |
| + |
| +- [ ] **Step 2: Establish the red result.** Run `go test ./internal/equipotest -run 'TestFoundation|TestCIGateSteps' -count=1`; before scaffold creation the missing module/package is the expected failure. Once a compileable scaffold exists, also observe the behavioral auth refusal fail before adding the guard. |
| +- [ ] **Step 3: Generate and adapt the scaffold.** In a fresh directory made by `mktemp -d "$TMPDIR/equipo-scaffold.XXXXXX"`, run `go run amadan.net/rastrillo/rastrillo/cmd/rastrillo@v0.28.0 new --theme day --shell sidebar equipo`. Select its files into this existing checkout, preserving design documents; rewrite scaffold `equipo/internal/...` imports and module declaration to `amadan.net/oficina/equipo`. Set the Go floor to `1.25.0`, retain the pinned CLI tool dependency and run `go mod tidy`. Do not commit a local `replace`. Remove the example Note model before the first app migration ships. Before adding any new app-owned copy in this or later tasks, use the copy-review gate described in Task 8; its placement there does not postpone approval of earlier strings. |
| +- [ ] **Step 4: Wire configuration and gates.** Use `rastrillo.Resolve(rastrillo.Options{DBPath: "equipo.db", Logger: logger})`, `db.Open(opts.DBPath, logger)`, app construction, then `rastrillo.Serve(opts)` with `opts.DBPath = ""` after the app opens it. Require `EQUIPO_ORIGIN`, `EQUIPO_INSTANCE_KEY`, `EQUIPO_OWNERS`, plus both `CARLOS_SMTP_HOST` and `CARLOS_SMTP_FROM`, or explicit local-only `EQUIPO_ALLOW_LOGGED_MAIL=1`. Reject logged mail on a public production origin. This pinned release predates `carlos.InstanceKey`; do not call that HEAD-only function. Use `mail.FromEnv("CARLOS", logger)`. Keep `Schema = migrate.MustFromFS(migrationFS, "equipo")` and `BootSchema = migrate.Merge(sessions.Schema, auth.Schema, Schema)`; apply with `migrate.Apply`. CI includes build, vet, formatting, tests and `go run amadan.net/rastrillo/rastrillo/cmd/rastrillo migration check`, plus the scaffold's static/security checks. Update AGENTS to shared-team data, copy review, `make ci`, and no autonomous merge/deploy; remove its generic per-user `scope.Owned` instruction. |
| +- [ ] **Step 5: Verify.** Run the targeted tests, `make migration-check`, and `make build`; expect PASS, no schema drift, and cgo-free compilation. Remove scaffold scratch. Prove a removed CI target fails `TestCIGateSteps`, then restore it. |
| +- [ ] **Step 6: Commit during implementation.** Stage only Task 1 files; `git commit -m "feat: scaffold Equipo foundation"`. |
| + |
| +## Task 2: Move the prototype and preserve its contracts |
| + |
| +**Files:** Create every tracked source/test file from the two prototype directories under `internal/equipo/team/` and `internal/equipo/teamcontract/`; update `go.mod`, `go.sum`; create `internal/equipotest/core_imports_test.go`, `internal/equipo/team/main_test.go`, `internal/equipo/teamcontract/main_test.go`; modify `.rastrillo/budgets.txt`. |
| + |
| +**Interfaces:** Preserve `team.Open(ctx context.Context, path string, o team.Options) (*team.Store, error)`, `team.Authority.Introspect(context.Context, team.AdmissionRequest) (team.Admission, error)`, `Store.Resume`, `Store.Close`, and all existing record APIs. Preserve behavior; changes beyond imports are test-budget instrumentation and its narrowly scoped exception. |
| + |
| +- [ ] **Step 1: Write the import boundary test.** `TestCoreHasNoPlatformDependency` parses copied Go imports, rejects any platform or suite import, and requires both contract test files to import `amadan.net/oficina/equipo/internal/equipo/team`. |
| +- [ ] **Step 2: Observe failure.** Copy the tracked bytes from `git show ceee7a67:<path>` in the source repository, including tests and OS build tags, then run `go test ./internal/equipo/team ./internal/equipo/teamcontract -count=1`. Expect the contract package's forbidden platform-internal import to fail before rewriting it. |
| +- [ ] **Step 3: Fix module boundaries only.** Rewrite the two contract imports; resolve `modernc.org/sqlite` and `golang.org/x/sys` through the app module. Preserve fixture evaluators, fake adapters, clock injection, conservative unknown usage, locks and witness files. No production fixture runner and no unrelated core rewrite. Add `TestMain(m *testing.M)` calling `os.Exit(budget.Main(m))` in both copied test packages, using `amadan.net/rastrillo/rastrillo/budget`, as the scaffold gate requires. The copied core has 5,243 source lines, already over the 5,000 default; record a specific `size internal/equipo/team 6500 -` exception with a reason naming the preserved transactional core and this budget extension. Keep the 8,000 test-line default and all other package limits; do not split a proven store just to satisfy the initial copy gate. |
| +- [ ] **Step 4: Verify.** Run the two core packages and `go test ./internal/equipotest -run TestCoreHasNoPlatformDependency -count=1`; all original tests must pass. Run `make migration-check` to prove nested core directories do not confuse app discovery. Run `make budget` and the normal instrumented `make test` gate as well. No test run against the external repository is required. |
| +- [ ] **Step 5: Commit with provenance.** Stage copied packages and module/import test changes. Use subject `feat: move the team prototype into Equipo`; body `Copied internal/team and internal/teamcontract from carlos/platform ceee7a67. Platform removal is separate work.` Supply the body as a separate `git commit -m` argument, producing a real blank line. |
| + |
| +## Task 3: Persist the roster and wire keymail sign-in |
| + |
| +**Files:** Create `internal/equipo/{store,roster,auth}.go`, `internal/equipo/templates/signin.html`, `internal/equipotest/{auth,roster}_test.go`; modify app configuration, models, migrations and composition. |
| + |
| +**Interfaces:** Produce `(*Store).Bootstrap(ctx context.Context, owners []string) error`, `Member(ctx context.Context, address string) (Member, error)`, `SetMember(ctx context.Context, actor Actor, address string, role Role, active bool, revision int64) error`; `NewAuth(d *db.DB, cfg Config, mailer mail.Sender, store *Store, logger *slog.Logger) (*auth.Auth, error)`; middleware `requireMember(next http.Handler) http.Handler` on the app. |
| + |
| +- [ ] **Step 1: Write tests.** `TestRosterBootstrapOnce`: two boots yield one team and one normalized owner per unique address; subsequent boot does not resurrect a removed seed member. `TestRosterProtectsLastOwner`: last active owner cannot be removed/demoted, and a member cannot promote themselves. `TestRosterChangesAffectExistingSession`: real session remains a framework session after demotion but owner writes fail; removal denies every private page; a failed lookup yields 503 rather than admission. `TestSigninAdmission`: approved owner/member can complete sign-in; an outsider cannot; missing/invalid cookie is denied. `TestSigninCSRF`: foreign-origin POSTs to sign-in, signout and roster mutations fail. Assert: |
| + |
| + ```go |
| + if !errors.Is(err, equipo.ErrForbidden) { t.Fatal("member changed roster") } |
| + if response.Code != http.StatusServiceUnavailable { t.Fatal("roster failure hidden") } |
| + if teamCount != 1 || memberCount != 2 { t.Fatal("bootstrap duplicated records") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipotest -run 'TestRoster|TestSignin' -count=1`; expect missing interfaces or failed assertions before wiring admission. |
| +- [ ] **Step 3: Implement the roster.** Bootstrap in one transaction only when the team row is absent; persist monotonically increasing `RosterEpoch` on changes. Seed owners from the configured list, then use the DB as authority. Attribute the initial seed audit to `bootstrap`, not to a person who has not signed in. Roster changes use revision checks, preserve at least one owner, and refuse removal of a person still assigned a project decision until reassigned. Missing rows are `ErrNotFound`; DB errors remain `ErrUnavailable`. |
| +- [ ] **Step 4: Wire existing auth.** Create one `auth.New(auth.Config{...})` for the process, with non-nil `Authorize` checking current active membership, `SubjectFor` returning the normalized address, `KeymailServers: []string{"keymail.dev"}`, and the supplied mailer/key/origin. Preserve the framework's keymail flow, email fallback, rate limiting and session cookies. Mount `Begin` at POST `/auth/begin`, `Callback` at GET `/auth/callback`, `Verify` at GET and POST `/auth/verify`, and `Signout` at POST `/signout`; reuse the pinned sign-in behavior rather than constructing tokens. Protect all mutating routes with `csrf.Protect(cfg.Origin)`. Private routes use `Auth.RequireSession`, then `auth.From(r)` and a live roster lookup; `Authorize` alone does not recheck old sessions. Use the framework fake-keymail test pattern from `auth/keymailfake_test.go` to verify the keymail callback, and a capturing `mail.Sender` for email tests. Never log a link in production. |
| +- [ ] **Step 5: Verify.** Run the targeted tests plus `make migration-check`; exercise both red and green cases for removal and nil-auth startup. A nil auth handle must never grant access. |
| +- [ ] **Step 6: Commit.** Stage Task 3 files; `git commit -m "feat: add lone-instance membership and sign-in"`. |
| + |
| +## Task 4: Store CARLOS labels, projects and decision owners |
| + |
| +**Files:** Create `internal/equipo/projects.go`, `internal/equipotest/projects_test.go`; modify models and additive migrations. |
| + |
| +**Interfaces:** Produce `Account{ID int64; Label string; Revision int64}` and `Project{ID, AccountID int64; Name, Repository, AppName string; Revision int64}`, with unique team-wide repository binding. `DecisionOwner{ProjectID int64; Decision, Address string}` stores decision keys `work`, `merge`, `copy`, `design`, `product`. Produce `SaveAccount(ctx context.Context, actor Actor, account Account) (Account, error)`, `SaveProject(ctx context.Context, actor Actor, project Project, owners []DecisionOwner, requestID string) (Project, error)`, `Projects(ctx context.Context) ([]ProjectGroup, error)`, and `Project(ctx context.Context, id int64) (ProjectDetail, error)` on `Store`. `ProjectGroup{Account Account; Projects []ProjectDetail}`; `ProjectDetail{Project Project; Owners []DecisionOwner}`. ID zero creates; existing IDs require exact revisions. |
| + |
| +- [ ] **Step 1: Write tests.** `TestProjectsSharedAndGrouped` creates two account labels and three projects, one without an app; both members read all three in stable label/name order. `TestProjectRejectsUnsafeBinding` rejects non-Amadan hosts, userinfo, query/fragment, missing owner/repo, path traversal and encoded separators. `TestProjectOwnersAreMembers` rejects inactive/unknown addresses and duplicate decision keys; every project requires `work` and `merge` owners. `TestProjectRetryAndRevision` replays an identical request ID without duplication; different content under that ID conflicts; stale update preserves the saved record and owners. Test hostile HTML as a valid display name, not executable markup. |
| + |
| + ```go |
| + if len(groups) != 2 { t.Fatal("account groups lost") } |
| + if !errors.Is(err, equipo.ErrInvalid) { t.Fatal("unsafe binding accepted") } |
| + if before.ID != retried.ID { t.Fatal("retry created a second project") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipotest -run 'TestProjects|TestProject' -count=1`. |
| +- [ ] **Step 3: Implement metadata transactions.** Only team owners configure account labels, repository/app bindings and decision owners; all active members can read. Accept `amadan.net/<owner>/<repo>` or its HTTPS spelling, canonicalize to an HTTPS URL with exactly those two non-empty path segments, and store no credential. Blank `AppName` is valid. Do not probe repositories or CARLOS. Validate owners within the same transaction as the project write, use allowlisted form DTOs later, and audit the actual person. Store idempotency keys with the actor, operation and input hash. A CARLOS label is display metadata, never a `team.AccountID` or authority boundary. |
| +- [ ] **Step 4: Verify.** Run the targeted tests and `make migration-check`; close/reopen the app DB and verify the same grouping and owner assignments. New form IDs are unique per rendered form; duplicate submit has one effect. |
| +- [ ] **Step 5: Commit.** Stage Task 4 files; `git commit -m "feat: add projects and decision ownership"`. |
| + |
| +## Task 5: Define and test team/project limits |
| + |
| +**Files:** Create `internal/equipo/budgets.go`, `internal/equipo/team/periodbudget.go`, `internal/equipo/team/periodbudget_test.go`, `internal/equipotest/budgets_test.go`; modify app models/migrations and core `model.go`, `jobs.go`, `budget.go`, `scheduler.go`, `store.go`. |
| + |
| +**Interfaces:** New core `ProjectID int64`; `PeriodLimits{Calls, InputTokens, OutputTokens, Seconds int64}`; `BudgetSet{Revision int64; Team PeriodLimits; Projects map[ProjectID]PeriodLimits}`; `PeriodUsage{Reserved, Spent PeriodLimits}`. Add `Project ProjectID` to `JobSpec`/`Job` and `ConfigureBudgets(ctx context.Context, account AccountID, expectedRevision int64, budgets BudgetSet) error`, `PeriodUsage(ctx context.Context, account AccountID, project ProjectID, at time.Time) (PeriodUsage, error)` to `team.Store`; project zero requests team totals. App `BudgetConfig{Revision int64; Team team.PeriodLimits; Projects map[team.ProjectID]team.PeriodLimits}` is persisted in the app DB; `(*Store).SaveBudgets(ctx context.Context, actor Actor, config BudgetConfig) error` and `Budgets(ctx context.Context) (BudgetConfig, error)` manage it. |
| + |
| +- [ ] **Step 1: Write budget tests.** `TestBudgetConfiguration` pins owner-only changes, positive explicit limits, project limits no larger than team limits, unknown project rejection, overflow refusal and revision conflict. `TestPeriodBudgetReservations` uses the fake clock: project A permits 2 calls, B permits 2, team permits 3; three one-call reservations succeed, fourth fails even across projects. Independently exhaust input tokens, output tokens and seconds. Concurrent last-slot requests yield exactly one success. `TestTimeChargeWaitsForContainment` reserves a 1,200-second attempt under a 1,500-second project ceiling: a second attempt is rejected; cancellation/lease expiry alone does not refund it; confirmed containment at 300 seconds settles 300, releasing 900 exactly once. `TestBudgetPeriodBoundary` advances from November to December UTC: settled November usage leaves December, unresolved usage remains charged, and a late receipt is counted once. `TestProjectBudgetMigration` opens a pre-extension DB and preserves existing jobs/ledger/witness behavior. |
| + |
| + ```go |
| + if !errors.Is(err, team.ErrBudget) { t.Fatal("team ceiling bypassed") } |
| + if successes != 1 { t.Fatal("last budget slot was not atomic") } |
| + if usage.Spent.Seconds != 300 { t.Fatal("contained time settled incorrectly") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipo/team -run 'TestPeriodBudget|TestTimeCharge|TestBudgetPeriod|TestProjectBudget' -count=1` and `go test ./internal/equipotest -run TestBudgetConfiguration -count=1`. |
| +- [ ] **Step 3: Implement metadata limits.** Use calendar months in UTC as the explicit Foundation period choice; spec leaves period length to the builder. Start with no configured budget, represented as unavailable/unset, never unlimited or fictitious spend. The owner must supply team limits before project limits, and project limits before any future job. Persist no invented numeric production defaults. Account roll-ups sum their projects using checked integer arithmetic. |
| +- [ ] **Step 4: Extend the existing ledger, keeping its safeguards.** Map the prototype's `AccountID` to the stable Equipo team ID and its account ceiling to the team ceiling. In configured mode, require a known nonzero project on new jobs and prohibit parent/child project changes. Atomically check project and team period totals inside the existing `reserve`/`checkBudget` transaction. In configured mode these replace the lifetime account aggregate check, so a new month is not still blocked by a lifetime ceiling; preserve legacy account checks only in unconfigured fixture mode. Keep job/ancestor and per-call checks. Reserve `AttemptSeconds` at `Claim`; settle trusted elapsed time only in `Contain`, using the injected clock and attempt creation time. `Complete` and `Release` leave containment pending in this prototype and must not refund time. Unknown work stays reserved. Count every open reservation against the current period, regardless of creation month, and settled usage by its original reservation period; do not erase history at rollover. Time over the reserved maximum remains charged and blocks subsequent work. Update all finish/recovery paths consistently, using existing clock/fence/lock machinery and checked arithmetic. Increment the core schema version with additive migration steps; do not replace its witness protocol with GORM. `ConfigureBudgets` requires a matching revision and never permits lowering below current charged usage. With no configured hierarchy, retain legacy prototype fixture behavior; the later production adapter must always configure it before job creation. |
| +- [ ] **Step 5: Verify.** Run targeted tests, then both full core packages once after this core change. Verify unchanged evidence, cancellation, unknown-outcome and restore tests. App migrations still pass. The original positive `CostMicros` policy remains intact; subscription policy/currency relaxation is plan 2, not a fake currency value in this UI. |
| +- [ ] **Step 6: Commit.** Stage Task 5 files; `git commit -m "feat: add team and project period limits"`. |
| + |
| +## Task 6: Implement Authority from roster and project ownership |
| + |
| +**Files:** Create `internal/equipo/authority.go`, `internal/equipotest/authority_test.go`; consume roster/project schemas without introducing a console grant table. |
| + |
| +**Interfaces:** `NewAuthority(store *Store, clock team.Clock) *RosterAuthority`; `(*RosterAuthority).Introspect(ctx context.Context, req team.AdmissionRequest) (team.Admission, error)`; `GrantRef(projectID int64, address string) string`. Grant refs use versioned JSON encoded with raw URL-safe base64, containing only project ID and canonical address; they are references, not credentials. `team.AccountID` must match persisted `Team.ID`. `Admission.Version` is the project's revision; `Admission.Epoch` is `RosterEpoch`; admissions last exactly five seconds. |
| + |
| +- [ ] **Step 1: Write tests.** `TestAuthorityUsesLiveRoster` admits a current `work` decision owner and a team owner, then rejects a removed member or reassigned work owner. `TestAuthorityRejectsMismatchedTarget` rejects unknown/malformed grants, wrong team, wrong repository, business targets, unknown operations and publishing to the default ref. `TestAuthorityFailureIsNotRevocation` injects a failed DB read and requires `team.ErrAuthorityUnavailable`, distinct from `team.ErrGrantRevoked`. `TestAuthoritySnapshotChanges` requires project revision/roster epoch changes and `ExpiresAt.Sub(IssuedAt) == 5*time.Second`. |
| + |
| + ```go |
| + if !errors.Is(err, team.ErrGrantRevoked) { t.Fatal("wrong repository admitted") } |
| + if !errors.Is(err, team.ErrAuthorityUnavailable) { t.Fatal("outage treated as revocation") } |
| + if admission.ExpiresAt.Sub(admission.IssuedAt) != 5*time.Second { t.Fatal("bad admission TTL") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipotest -run TestAuthority -count=1`. |
| +- [ ] **Step 3: Implement a read-only Authority.** Resolve grant identity and current project/roster in one DB read transaction. Allow `OpJobContinue`, `OpAttemptContinue`, `OpProviderCall` and `OpForgePublish` only for a current team owner or the project's `work` owner. For `OpForgePublish`, additionally require a nonempty review ref different from `DefaultRef`; this grants review-branch publication, never merge. Reject `OpTrackerPublish` until its product contract exists. Other decision owners are routing records, not implicit execution permission. Return prototype errors with `errors.Is` compatibility. The later trusted job-creation adapter must derive `GrantRef` and requester from the authenticated person; possession of a ref never authorizes an HTTP request. No runner-facing endpoint is added here. |
| +- [ ] **Step 4: Verify integration.** In tests only, open `team.Open` with this Authority and fake adapters; call `Resume`, create a job, change ownership, and prove the next admission is stale or revoked. Run authority tests and the core contracts. Production `cmd/equipo` still opens only the app DB; execution-store persistence/replication and restore release must be resolved in plan 2 before enabling runners. |
| +- [ ] **Step 5: Commit.** Stage Task 6 files; `git commit -m "feat: authorize core work from the instance roster"`. |
| + |
| +## Task 7: Seed specialist records and their settings |
| + |
| +**Files:** Create `internal/equipo/specialists.go`, `internal/equipotest/specialists_test.go`; modify models and migrations. |
| + |
| +**Interfaces:** `Specialist{Key, ModelSelection, Provider, ModelFamily, Model, StandingInstructions string; MaxConcurrent int; Revision int64}`; `(*Store).Specialists(ctx context.Context) ([]Specialist, error)`; `SaveSpecialist(ctx context.Context, actor Actor, specialist Specialist) error`. Stable keys in order: `product`, `design`, `copy`, `engineering`, `review`. |
| + |
| +- [ ] **Step 1: Write tests.** `TestSpecialistsSeedOnce` requires exactly the five keys in order after two boots; edited instructions survive. `TestSpecialistSettings` permits owner writes, denies member writes, rejects unknown keys/modes, nonpositive concurrency and stale revisions. Records default to `ModelSelection="best_fit"`, concurrency 1, blank provider/family/model/instructions. These are builder-chosen inactive settings, not allocated accounts. `TestSpecialistsHaveNoRuntime` proves startup/settings edits do not create a core job or make a provider call. |
| + |
| + ```go |
| + if strings.Join(keys, ",") != "product,design,copy,engineering,review" { t.Fatal("wrong specialists") } |
| + if saved.StandingInstructions != instructions { t.Fatal("boot overwrote settings") } |
| + if jobs != 0 || calls != 0 { t.Fatal("settings started work") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipotest -run TestSpecialist -count=1`. |
| +- [ ] **Step 3: Implement seed and settings.** Seed missing keys transactionally during bootstrap, without overwriting existing rows. Accept model selection modes `best_fit` and `fixed`; fixed requires provider/family/model fields, but does not connect or validate a remote account. UI leaves these unset until configured. Do not hard-code current model names. Preserve the spec's different-family Review rule as a plan 2 assignment constraint; two stored defaults cannot prove that a future builder/reviewer pair is independent. |
| +- [ ] **Step 4: Verify.** Run tests and `make migration-check`; close/reopen and compare settings. All five categories remain visible when unconfigured. |
| +- [ ] **Step 5: Commit.** Stage Task 7 files; `git commit -m "feat: seed specialist settings without execution"`. |
| + |
| +## Task 8: Build the rail, empty screens and Projects overview |
| + |
| +**Files:** Create the planned templates, `internal/equipo/{navigation,handlers}.go`, `internal/equipo/static/equipo.css`, `internal/equipotest/pages_test.go`; modify `render.go`, `copy.go`, `app.go`, icons. |
| + |
| +**Interfaces:** Produce `NavItem{Key, Href, CopyKey, Icon string}` and `Navigation() []NavItem`; each handler has signature `(w http.ResponseWriter, r *http.Request)`. Use the Store interfaces from Tasks 3–7. `render(w http.ResponseWriter, name string, data any)` follows the pinned scaffold's buffered execution, not HEAD's newer `ui.Pages` API. |
| + |
| +- [ ] **Step 1: Write route tests.** `TestRailRoutes` verifies the team link, all 11 destinations (four work pages, five specialists, Connections, Preferences), exactly one `aria-current` on each destination page (the `/work` index has no selected child), icon plus name, and no console Apps/Billing entries. `TestProjectsOverview` checks grouping, repository/app/decision owners, an add-project form, zero activity only after successful reads, and an unavailable CARLOS signal state. `TestOverviewFailureIsNotZero` forces a DB error and expects 503. `TestProjectForms` submits create/edit as owner, reads as member, rejects member writes, CSRF and tampered actor fields; HTML names are escaped. `TestEmptyScreensDoNotStartWork` requires no enabled composer/run/connect-provider action. |
| + |
| + ```go |
| + if response.Code != http.StatusServiceUnavailable { t.Fatal("failed count rendered as empty") } |
| + if strings.Contains(body, "<script>alert(1)</script>") { t.Fatal("stored HTML executed") } |
| + if currentCount != 1 { t.Fatal("ambiguous navigation position") } |
| + ``` |
| + |
| +- [ ] **Step 2: Run red tests.** `go test ./internal/equipotest -run 'TestRail|TestProjectsOverview|TestOverviewFailure|TestProjectForms|TestEmptyScreens' -count=1`. |
| +- [ ] **Step 3: Review copy before inserting it.** No existing runtime copy convention exists at this HEAD; establish `internal/equipo/copy.go` as that single source. Follow the copy-review skill during implementation: index every app-owned string with context, including validation, empty states, email subject/body, titles, labels and accessible names; apply Paul's edits verbatim. Required navigation names come from the spec. Other keys include `projects.empty`, `projects.add`, `signals.unconnected`, `form.invalid`, `form.conflict`, `service.unavailable`, `conversation.empty` and specialist empty states. Keep draft wording short; mark the inventory `COPY REVIEW REQUIRED` until approved. Do not copy mockup sample activity or invent final prose in this plan. Add reviewed README copy through the same gate. |
| +- [ ] **Step 4: Implement the shell and routes.** Use the pinned sidebar template/attributes; customize its blocks, not its mechanics. `/` redirects to `/conversation`; `/work` is the phone index (`view=index`); content pages have parent links back to `/work#nav-<key>`. Routes: GET `/conversation`, `/needs-you`, `/journey`, `/projects`, `/connections`, `/preferences`, `/specialists/{key}`, `/team`, `/projects/new`, `/projects/{id}`, `/projects/{id}/edit`. POST `/accounts`, `/projects`, `/projects/{id}`, `/team/members`, `/team/budgets`, `/specialists/{key}` use the corresponding store mutators and redirect 303 after success. Render unknown IDs/keys as 404; invalid form as 422; stale revisions as 409; owner-only denial as 403. A single team appears at the rail top; its link opens the roster, with no nonfunctional team switcher. |
| +- [ ] **Step 5: Implement grouped cards and settings forms.** Projects overview uses account headings and project cards from `projects.html`; show saved metadata and actual project counts. With no jobs, activity areas have reviewed empty states, not sample work or percentages. Show configured limits and zero usage separately; missing limits are unset, not zero. Each project page is a metadata/settings detail, not the later product view. Team page exposes roster, label and budget forms; specialist pages expose their stored settings plus empty working/queued/finished sections. Connections/Preferences remain honest empty destinations. Use `html/template` escaping, icons from the vendored icon set, and only theme tokens in app CSS. |
| +- [ ] **Step 6: Verify.** Run page tests and `go test ./internal/equipotest -run TestVendoredAssetsMatchTheLibrary -count=1`; confirm `theme.css` and `shell.css` are linked and copied library bytes match `v0.28.0`. Navigation and every form work without scripts. |
| +- [ ] **Step 7: Commit.** Stage Task 8 files and approved copy; `git commit -m "feat: add the rail and grouped projects overview"`. |
| + |
| +## Task 9: Exercise the finished app in a browser and provide local startup |
| + |
| +**Files:** Create `run.sh`, `tools/drive/main.go`; modify `internal/equipotest/browser_test.go`, `README.md`, `.gitignore`; add `internal/equipotest/startup_test.go`. |
| + |
| +**Interfaces:** Keep production `App` from Task 1. The drive uses that app with a capturing mailer and a real framework session minted through its sign-in flow, not an auth-bypass flag. New drive flags: `-addr` (default `127.0.0.1:8824`), `-db` (required scratch DB path). `run.sh` consumes a local ignored environment file and executes the built binary with explicit `--db` and `--addr` flags, following memoria's script shape. |
| + |
| +- [ ] **Step 1: Add browser/startup assertions.** `TestFoundationBrowserWalk` uses Rastrillo `harness.New`, `rig.Run` and `rig.Screen` with `chromedp` as the pinned scaffold does: sign in, add account, create two projects, reopen, edit, sign out. At widths 1280 and 390, and with JavaScript disabled, assert no horizontal overflow; all rail/index destinations reachable; specialist back link returns to its index row; long project names wrap; project creation succeeds. `TestProductionDoesNotUseDriveAuth` starts the production handler with missing/invalid auth configuration and requires refusal. Browser screenshots are inspection evidence, not a substitute for assertions. |
| +- [ ] **Step 2: Run the browser test before fixes.** `go test -tags browser ./internal/equipotest -run TestFoundationBrowserWalk -count=1`; observe the missing flow or rendering assertion fail. A skipped browser is not a pass; use an installed Chromium or `RASTRILLO_CHROME` as the scaffold supports. |
| +- [ ] **Step 3: Implement local tooling and fix browser failures.** `run.sh` requires explicit owners, origin and persistent instance key, opts into logged mail only for loopback development, uses `exec`, and never contains production secrets. The drive creates synthetic account/project data through real store/HTTP interfaces, opens no inbound address except loopback, and removes its own scratch on shutdown. Do not copy memoria's auth bypass into production or its hard-coded home directory. Review setup prose before writing it. |
| +- [ ] **Step 4: Verify the complete slice.** Run `make ci`, then the browser command, once with script enhancements and once without. Inspect desktop and phone pages, keyboard focus, parent navigation and empty states. Run `go test -race ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipotest` once for the changed transactional core/auth boundaries. Check no test uses an external provider or CARLOS credential. Stop drive/review servers and remove only session-owned scratch. |
| +- [ ] **Step 5: Commit.** Stage Task 9 files; `git commit -m "test: verify the foundation sign-in and project flow"`. |
| + |
| +## Task 10: Prepare the release and have a human deploy it |
| + |
| +**Files:** Modify `Makefile`, reviewed `README.md`; create `internal/equipotest/release_test.go`. Human deployment changes no source file. |
| + |
| +**Interfaces:** `make release` produces `releases/equipo-linux-arm64`; `RELEASE_GOARCH=amd64` is an explicit alternative. Stamp `amadan.net/rastrillo/rastrillo.BuildVersion` with `git rev-parse --short HEAD`. The human supplies `CARLOS_ACCOUNT`; there is no inferred default. |
| + |
| +- [ ] **Step 1: Write a failing release check.** `TestReleaseStampContract` tests the Make recipe using a fake `go` executable to capture arguments: require `CGO_ENABLED=0`, Linux/arm64 defaults, correct output path and `-X amadan.net/rastrillo/rastrillo.BuildVersion=<commit>`. A dirty tracked file must make the recipe fail before building even with a supplied `VERSION`, and a supplied unrelated `VERSION` must not change the commit stamp. The recipe must include `-trimpath` and print `carlos deploy`, not the scaffold's `carlos ship`. Mutate the stamp/path deliberately, see failure, then restore it. No deploy command runs in this test or in CI. |
| +- [ ] **Step 2: Run red check.** `go test ./internal/equipotest -run TestReleaseStampContract -count=1`; the unadapted scaffold permits a `VERSION` override and prints `carlos ship`; expect those assertions to fail. Its existing stamping and output path are not missing features. |
| +- [ ] **Step 3: Implement the memoria release pattern.** Use `-trimpath` and `-ldflags "-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$(git rev-parse --short HEAD)"` in the actual shell recipe, with Make's doubled dollar escaping. Reject dirty tracked files independently of the stamp variable, remove the arbitrary `VERSION` override, and replace the scaffold's printed ship command with the human deploy instruction. Document required origin, owners, stable instance key and platform SMTP configuration without secret values; provider credentials are not needed. Do not invent CARLOS configuration CLI flags: the human uses the supported account/app configuration surface, confirms the real HTTPS origin, and provisions these settings before startup. |
| +- [ ] **Step 4: Verify and commit the release preparation.** Run the release test, `make ci`, and commit Task 10 files with `git commit -m "build: prepare the human-run CARLOS release"`. Then `make release`; expect the stamped Linux/arm64 artifact. This commit is an implementation step, not permission to merge or deploy. |
| +- [ ] **Step 5: Human deploys after choosing the account.** This step is performed by Paul or a human operator, never by the implementing agent. From the clean, reviewed revision, set the chosen account and run the verified memoria command shape: |
| + |
| + ```sh |
| + : "${CARLOS_ACCOUNT:?Set the Equipo deployment account}" |
| + carlos deploy --app equipo --account "$CARLOS_ACCOUNT" --channel edge --timeout 5m ./releases/equipo-linux-arm64 |
| + ``` |
| + |
| + Flags precede the binary. Confirm the target's architecture before choosing the release override. Poll GET `/api/version` on the actual deployed origin until the process reports the stamped commit; the router's `X-Carlos-Version` is insufficient. |
| +- [ ] **Step 6: Human acceptance.** Sign in as a configured owner, add a second roster member, create an account label and two projects (one repo-only), refresh/restart and verify persistence. Sign in as the member and verify shared visibility and denied owner edits. Open every empty destination and the phone Work index. Confirm no runner is enrolled, no execution job exists, and no provider/CARLOS credential was requested. Record acceptance in the normal review record; do not claim deployment from a successful local build. |
| + |
| +## Questions for Paul |
| + |
| +1. Which CARLOS account should host the Equipo instance? Memoria uses `bds`, while mockups show `tito` and Personal project groups; neither establishes Equipo's deployment account. This blocks only Task 10's human deployment. |
| + |
| +## Self-review results |
| + |
| +1. **Spec coverage:** §§2, 3.2, 3.3, 4.1, 4.5, 5.1, 6.7 and 8 map to Tasks 1–10. Roster/sign-in: 3; projects/owners: 4; team/project limits: 5; Authority: 6; specialists: 7; rail/overview/phone shell: 8–9; human deployment: 10. Coordinator/runtime/evidence extensions, provider connections, product ranking and routing are excluded according to the roadmap. Plan-edit operations are plan 3; quarantine release and execution-store deployment are plan 2 prerequisites. No Foundation requirement is silently delegated to a future UI. |
| +2. **Step scan:** Tasks name files, interfaces, assertions and red/green commands; no function bodies or invented final product copy. New APIs are explicitly planned interfaces. Future commits are described but none is made by this planning session. All proposed subjects are under 80 characters. |
| +3. **Type/source consistency:** Framework references use verified `v0.28.0` APIs and its `amadan.net` module path, not memoria's old path or newer HEAD-only auth/scaffold APIs. Nested core placement avoids the migration CLI's single-app scan. `team.AccountID` always means the Equipo team; CARLOS labels never scope execution. Project revisions and roster epochs invalidate admissions. App and core migration ownership remain separate. |
| +4. **Review Focus:** All five failure classes have named tests in their owning tasks. Bootstrap and seeding preserve edits; session revocation is checked on requests; malformed bindings never become network requests; time and uncertain reservations remain charged; browser/layout and DB-failure tests prevent plausible empty results. |
| +5. **Proportion and validation:** Ten reviewable tasks cover Foundation. At about 6,400 words against the 4,270-word whole spec, the plan is longer because it includes source-grounded integration and red/green steps, but is not several times the spec; assertion blocks are a small minority. Tests and signatures specify decisions without implementing the application. The planning pass checked source files, tag-specific APIs, imports, the prototype diff and command definitions; it did not run application tests, build, deploy or claim future tests passed. |
| +6. **Conflicts found:** The mockup says the phone opens on Work, while spec §4.1 defaults to Conversation and later permits a personal choice; the spec wins. The mockup's console Apps/Billing hierarchy is superseded by the standalone Equipo rail. Roadmap row 4 mentions phone layout, but the Foundation brief explicitly requires its basic shell now. Spec §9's provider egress conflicts with the unamended suite §8; Foundation has no provider egress, and the separate amendment remains needed before later live use. Spec §§6.8/9 acknowledge subscriptions cannot enforce token/currency caps while also requiring token limits; this plan preserves recorded ceilings and the core's metered policy, leaving the runner plan to distinguish admission/reservation limits from what an unmodified subscription CLI can actually enforce. The prototype's distinct-provider review is stricter than the spec's distinct-family rule; preserve it here and resolve assignment behavior in plan 2. Memoria's deployment prose and Rastrillo's generic navigation prose are stale in the ways recorded above. |
diff --git a/docs/superpowers/specs/2026-11-01-paseo-probe.md b/docs/superpowers/specs/2026-11-01-paseo-probe.md| new file mode 100644 |
| index 00000000..f78d6e42 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-01-paseo-probe.md |
| @@ -0,0 +1,378 @@ |
| +# Paseo probe for Equipo plan 0 |
| + |
| +Tested on docs-t1 on 2026-11-01 against CLI and daemon 0.14.0. Read section 6.9 of the Equipo design first. Build the runner around the structured client API; the CLI alone does not supply a JSON event stream. Cancellation needs more than `stop`. |
| + |
| +Evidence below distinguishes live tests from documentation and source inspection. JSON excerpts omit unrelated fields. Two Haiku 4.5 agents ran five prompted turns altogether: file write, question, rejected sleep command, background/foreground cancellation, and an MCP call. No helper agents or reviewers ran. No daemon configuration, sign-ins, or host registrations were changed. No commits or pushes were made in equipo-design; the disposable repository received one empty seed commit so the worktree could start from a real hash. |
| + |
| +Commands use these abbreviations for the exact paths and IDs tested: |
| + |
| +```sh |
| +P=/home/paulca/.cache/tmp/equipo-paseo-probe-vnpbwsk1 |
| +W=/home/paulca/.paseo/worktrees/3ts4lj9g/equipo-probe-vnpbwsk1 |
| +WS=wks_ed152d6e0762a1fb |
| +A=920363b1-2c8a-471e-819f-5be735981e5b |
| +B=93d551b6-37a0-48c3-b503-b3987d3dc021 |
| +CLI=/home/paulca/.local/lib/node_modules/@getpaseo/cli |
| +Z=/home/paulca/.paseo/plugins/zerosub/62e3ee9e-87c0-4453-9a09-3e59cd91b60a/node_modules/@kapybara/zerosub |
| +``` |
| + |
| +```text |
| +$ paseo --version |
| +0.14.0 |
| +$ paseo daemon status --json |
| +{"home":"/home/paulca/.paseo","listen":"127.0.0.1:6767", |
| + "serverId":"srv_ZwrHnYLkipmz","hostname":"DOCS-T1", |
| + "daemonVersion":"0.14.0","desktopManaged":false,"connectedDaemon":"reachable"} |
| +$ paseo provider models claude --json |
| +... {"model":"Haiku 4.5","id":"claude-haiku-4-5","thinkingOptions":"none"} ... |
| +``` |
| + |
| +## 1. Create and follow an agent |
| + |
| +**Verdict: yes.** A program can create a workspace from an exact commit, start an agent there, and retain its ID. Keep the workspace ID from creation: `run` and `inspect` omit it in their CLI output, although the client snapshot contains it. The CLI inherited this session's parent-agent identity; a standalone runner must choose its own parentage deliberately. |
| + |
| +```sh |
| +# In the disposable repository under $TMPDIR: |
| +git init -b main |
| +git -c user.name=Probe -c user.email=probe@localhost commit --allow-empty -m 'Probe base' |
| +git rev-parse HEAD |
| +# 3704b320b9ec292458d41ce9cdb2c56a40f49fb3 |
| +paseo workspace create --isolation worktree --path "$P/repo" \ |
| + --mode branch-off --new-branch equipo-probe \ |
| + --base 3704b320b9ec292458d41ce9cdb2c56a40f49fb3 \ |
| + --worktree-slug equipo-probe-vnpbwsk1 --title 'Equipo disposable probe' --json |
| +``` |
| + |
| +```json |
| +{"workspaceId":"wks_ed152d6e0762a1fb","project":"repo", |
| + "name":"Equipo disposable probe","isolation":"worktree", |
| + "cwd":"/home/paulca/.paseo/worktrees/3ts4lj9g/equipo-probe-vnpbwsk1","background":false} |
| +``` |
| + |
| +```text |
| +$ git -C "$W" rev-parse HEAD |
| +3704b320b9ec292458d41ce9cdb2c56a40f49fb3 |
| +$ git -C "$W" branch --show-current |
| +equipo-probe |
| +$ paseo run --workspace "$WS" --provider claude/claude-haiku-4-5 \ |
| + --mode default --title 'Equipo probe approval' --no-wait --json \ |
| + 'Create hello.txt containing hi using Write. Do not read any other files or use other tools.' |
| +Using workspace wks_ed152d6e0762a1fb |
| +{"agentId":"920363b1-2c8a-471e-819f-5be735981e5b","status":"running", |
| + "provider":"claude","cwd":"/home/paulca/.paseo/worktrees/3ts4lj9g/equipo-probe-vnpbwsk1", |
| + "title":"Equipo probe approval"} |
| +``` |
| + |
| +Capture stdout and stderr separately; the tool transcript above merges them. Do not parse the combined transcript as JSON. After approving the write, `paseo wait "$A" --timeout 30s --json` returned `status: "idle"` and the agent reported creating `hello.txt` with `hi`. Without `--no-wait`, `run` waits by default; its help also supplies `--wait-timeout`. |
| + |
| +Paseo placed the managed worktree under its own home, while the source repository and probe scripts were under `$TMPDIR`. Both were removed at cleanup. For an already-existing branch, help exposes `workspace create --mode checkout-branch --branch NAME`; that path was not separately exercised. |
| + |
| +## 2. Timeline and usage |
| + |
| +**Verdict: partly.** `inspect` and `ls` return JSON, including provider/model, and `inspect` exposes last usage. `logs`, `logs --follow`, and `attach` accept `--json` but still print human-readable text. The installed client supplies structured live events, including completed-turn usage. That API is usable by a long-lived program. |
| + |
| +```text |
| +$ paseo inspect "$A" --json |
| +{"Id":"920363b1-2c8a-471e-819f-5be735981e5b","Provider":"claude", |
| + "Model":"claude-haiku-4-5","Status":"idle","Mode":"default", |
| + "LastUsage":{"InputTokens":18,"OutputTokens":404,"CachedTokens":29591,"CostUsd":0.0673131}, |
| + "PendingPermissions":[],"Worktree":null} |
| +$ paseo logs "$A" --json |
| +[Write] /home/paulca/.paseo/worktrees/3ts4lj9g/equipo-probe-vnpbwsk1/hello.txt |
| +Done. Created hello.txt with content "hi". |
| +$ timeout -s INT 2 paseo logs "$A" --follow --json |
| +... human-readable history ... |
| +--- Following logs (last 10 entries; Ctrl+C to stop) --- |
| +$ timeout -s INT 2 paseo attach "$A" --json |
| +Fetching history for agent 920363b... |
| +(Press Ctrl+C to detach) |
| +[Tool: Write] completed |
| +Done. Created hello.txt with content "hi". |
| +Attached to agent 920363b. |
| +``` |
| + |
| +The two `timeout` commands exited 124 as intended. `paseo ls --global --json`, filtered to our two IDs, returned JSON rows with `id`, `provider: "claude/claude-haiku-4-5"`, `status`, and `cwd`, but no usage. Reading `$CLI/dist/commands/agent/logs.js` and `attach.js` confirmed that these commands format transcripts instead of selecting a JSON renderer. |
| + |
| +For the live test, `observe.mjs` contained the following code. It uses the CLI's installed connection helper to obtain the same authenticated local connection, without printing credentials. This internal import is a probe convenience, not a supported production dependency. |
| + |
| +```js |
| +import {connectToDaemon} from '/home/paulca/.local/lib/node_modules/@getpaseo/cli/dist/utils/client.js'; |
| +const client = await connectToDaemon({target:{kind:'instance',home:'/home/paulca/.paseo'}}); |
| +const id = process.argv[2]; |
| +console.log(JSON.stringify({snapshot:(await client.fetchAgent({agentId:id})).agent})); |
| +const off = client.subscribeAgentTimeline(id, m => console.log(JSON.stringify(m))); |
| +await off.ready; |
| +console.log(JSON.stringify({ready:true})); |
| +await new Promise(r => setTimeout(r,50000)); |
| +off(); |
| +await client.close(); |
| +``` |
| + |
| +```text |
| +$ node "$P/observe.mjs" "$A" > "$P/events.jsonl" |
| +$ rg 'usage|turn_completed' "$P/events.jsonl" |
| +{"type":"agent_stream","payload":{"agentId":"920363b1-2c8a-471e-819f-5be735981e5b", |
| + "event":{"type":"turn_completed","provider":"claude","turnId":"foreground-turn-1", |
| + "usage":{"inputTokens":18,"cachedInputTokens":29591,"outputTokens":404, |
| + "totalCostUsd":0.0673131,"contextWindowMaxTokens":200000,"contextWindowUsedTokens":31239}}, |
| + "timestamp":"2026-11-01T21:10:14.667Z"}} |
| +``` |
| + |
| +Timeline item events also carried `seq`, `epoch`, and `subscriptionId`. Control events did not all carry sequence numbers. The next question turn reported `totalCostUsd: 0.07589280000000001`; do not assume every usage field is a per-turn increment. `LastUsage` was zero during a later turn and after cancellation. Capture completion events durably instead of treating a later snapshot as a lifetime ledger. Billing accuracy and provider-independent usage semantics were not established. |
| + |
| +The current SDK documents `agent.timeline.refetch()` with cursors and `agent.timeline.subscribe()`. Subscriptions are live-only; reconnect requires explicitly fetching missed history, and replacement invalidates the previous epoch. We observed live delivery, not reconnect/restart recovery. Source: [https://paseo.sh/docs/sdk/reference.md](https://paseo.sh/docs/sdk/reference.md). |
| + |
| +**Request to Paseo:** Make `logs --json --follow` emit newline-delimited structured events and make one-shot `logs --json` return structured history. Preserve IDs, cursor/epoch information, permission events, cancellation, and usage. Document which usage counters are cumulative, which are per-turn, and how to recover missed completion events after reconnection, so runners can account for work without parsing prose or double-counting cost. |
| + |
| +## 3. Questions and permissions |
| + |
| +**Verdict: yes for the tested Claude tools.** In `default` (Always Ask) mode, the write remained pending until a program approved its request ID. `AskUserQuestion` arrived as a structured `permission_requested` event with `kind: "question"`. Answer it through the permission response, not an ordinary chat message. |
| + |
| +```text |
| +$ paseo inspect "$A" --json |
| +... "Status":"running", "Mode":"default", |
| +"PendingPermissions":[{"id":"permission-023626f4-428c-4f24-b777-e8187cce0b94","tool":"Write"}] |
| +$ paseo permit ls --json |
| +... {"id":"permission-023626f4-428c-4f24-b777-e8187cce0b94", |
| + "agentId":"920363b1-2c8a-471e-819f-5be735981e5b","name":"Write","description":"-"} ... |
| +$ paseo permit allow "$A" permission-023626f4-428c-4f24-b777-e8187cce0b94 --json |
| +[{"requestId":"permission-023626f4-428c-4f24-b777-e8187cce0b94", "result":"allowed", ...}] |
| +``` |
| + |
| +The raw client snapshot included the proposed file path and content under `pendingPermissions[].input`; CLI `inspect` reduced this to an ID and tool name. A runner should fetch the full request before deciding. The observer received `permission_resolved` with `resolution.behavior: "allow"`, then tool completion and turn completion. |
| + |
| +```sh |
| +paseo send "$A" --no-wait --json \ |
| + 'Use AskUserQuestion to ask which word to write next, with choices hi and bye. Do nothing else.' |
| +``` |
| + |
| +```json |
| +{"agentId":"920363b1-2c8a-471e-819f-5be735981e5b","status":"queued", |
| + "message":"Message queued for delivery after two quiet seconds"} |
| +``` |
| + |
| +Trimmed observer event: |
| + |
| +```json |
| +{"type":"permission_requested","provider":"claude","request":{ |
| + "id":"permission-6d5670a3-5c2c-47d3-9b5c-629b1cf8b5eb","name":"AskUserQuestion", |
| + "kind":"question","title":"Which word should we write next?","description":"hi / bye", |
| + "input":{"questions":[{"question":"Which word should we write next?","header":"Next word", |
| + "options":[{"label":"hi","description":"Write hi"},{"label":"bye","description":"Write bye"}], |
| + "multiSelect":false,"allowOther":true}]}}} |
| +``` |
| + |
| +```text |
| +$ paseo permit allow "$A" permission-6d5670a3-5c2c-47d3-9b5c-629b1cf8b5eb \ |
| + --input '{"answers":{"Which word should we write next?":"hi"}}' --json |
| +[{..., "name":"AskUserQuestion","result":"allowed"}] |
| +$ paseo wait "$A" --timeout 20s --json |
| +{"agentId":"920363b1-2c8a-471e-819f-5be735981e5b","status":"idle", |
| + "message":"... User selected \"hi\"."} |
| +``` |
| + |
| +`send` was tested for follow-up prompts. Its queued receipt was not proof of turn completion. Plain conversational questions can be answered by `send`, but their classification as questions was not tested. Codex permission/question formats were not tested. |
| + |
| +## 4. Stop and clean up |
| + |
| +**Verdict: partly.** Stop is observable and interrupts the active foreground command. It did not kill a previously launched background child. Archiving the agent did remove that child in this test. Do not equate a stop receipt with proof that all effects have ceased. |
| + |
| +The first command (`sleep 180 & echo $! > child.pid; wait`) was rejected by the provider harness, so it supplied no process-cleanup evidence. The successful retry used the supported background mode: |
| + |
| +```sh |
| +paseo agent mode "$A" bypassPermissions --json |
| +paseo send "$A" --no-wait --json 'Use Bash with run_in_background:true to execute: python3 -c '\''import os,time; open("child.pid","w").write(str(os.getpid())); time.sleep(180)'\''. Then immediately run another Bash command with timeout 200000: python3 -c '\''import time; time.sleep(180)'\''. Do nothing else.' |
| +node "$P/observe.mjs" "$A" > "$P/stop-events.jsonl" |
| +``` |
| + |
| +The observer was running before cancellation. `child.pid` contained namespace PID `3`; host `ps` identified the processes by their exact commands. Do not send signals to a namespace PID on the host. |
| + |
| +```text |
| +$ ps -eo pid,ppid,args | rg 'python3 -c import (os,time|time; time.sleep)' |
| +777780 777779 python3 -c import os,time; open("child.pid","w").write(str(os.getpid())); time.sleep(180) |
| +777828 777827 python3 -c import time; time.sleep(180) |
| +$ paseo stop "$A" --json |
| +{"stoppedCount":1,"agentIds":["920363b1-2c8a-471e-819f-5be735981e5b"]} |
| +$ ps -eo pid,ppid,args | rg 'python3 -c import (os,time|time; time.sleep)' |
| +777780 777779 python3 -c import os,time; open("child.pid","w").write(str(os.getpid())); time.sleep(180) |
| +$ paseo inspect "$A" --json |
| +... "Status":"idle" ... |
| +$ tail -3 "$P/stop-events.jsonl" |
| +... {"type":"turn_canceled","provider":"claude","turnId":"foreground-turn-4","reason":"Interrupted"} ... |
| +``` |
| + |
| +Cleanup was then executed in order: |
| + |
| +```text |
| +$ paseo archive "$A" --json |
| +{"agentId":"920363b1-2c8a-471e-819f-5be735981e5b","status":"archived",...} |
| +$ ps -p 777780 -o pid,ppid,args |
| +PID PPID COMMAND |
| +$ paseo delete "$A" --json |
| +{"deletedCount":1,"agentIds":["920363b1-2c8a-471e-819f-5be735981e5b"]} |
| +$ paseo delete "$B" --json |
| +{"deletedCount":1,"agentIds":["93d551b6-37a0-48c3-b503-b3987d3dc021"]} |
| +$ paseo workspace archive "$WS" --json |
| +{"workspaceId":"wks_ed152d6e0762a1fb","status":"archived",...} |
| +$ paseo project delete prj_f0721b61d3557b28 --json |
| +{"projectId":"prj_f0721b61d3557b28","removedWorkspaceIds":[]} |
| +$ test -e "$W" && echo worktree-present || echo worktree-removed |
| +worktree-removed |
| +$ ps -p 777780,777828 -o pid,ppid,args |
| +PID PPID COMMAND |
| +``` |
| + |
| +The project ID belonged to the throwaway repository, automatically registered during workspace creation. Only that project, workspace, and the two probe agents were mutated. Observers exited after 50 seconds; bounded CLI followers detached. The custom MCP process also disappeared after agent deletion. The scratch directory was removed after preserving this evidence. Workspace archive was tested after agent deletion; its handling of an independently running terminal was not tested. |
| + |
| +**Request to Paseo:** Offer a cancellation operation with a documented process-tree guarantee across providers, including background tool jobs and workspace-owned processes. Return an acknowledgement only after termination is complete, or report remaining jobs explicitly. Preserve the cancellation event and cleanup result for reconnecting clients. `stop` currently leaves the runner unable to claim that all agent work has stopped. |
| + |
| +## 5. Tools per agent |
| + |
| +**Verdict: yes through the client API.** No direct MCP configuration flag appears in `paseo run --help`, but `createAgent` accepted a session-scoped `mcpServers` map. The agent called that server successfully without a configuration-file edit or plugin installation. |
| + |
| +The scratch `mcp.py` was a line-oriented JSON-RPC server. It answered `initialize` with protocol `2024-11-05` and tool capability, advertised one no-argument tool `probe_ping` via `tools/list`, and returned text `equipo-mcp-ok` from `tools/call`. It ignored notifications. Its full implementation was: |
| + |
| +```python |
| +import sys,json,os |
| +for line in sys.stdin: |
| + m=json.loads(line); method=m.get('method'); result={} |
| + if 'id' not in m: continue |
| + if method=='initialize': |
| + result={'protocolVersion':'2024-11-05','capabilities':{'tools':{}}, |
| + 'serverInfo':{'name':'equipo-probe','version':'1'}} |
| + elif method=='tools/list': |
| + result={'tools':[{'name':'probe_ping','description':'Return probe marker', |
| + 'inputSchema':{'type':'object','properties':{}}}]} |
| + elif method=='tools/call': |
| + result={'content':[{'type':'text','text':'equipo-mcp-ok'}]} |
| + print(json.dumps({'jsonrpc':'2.0','id':m['id'],'result':result}),flush=True) |
| +``` |
| + |
| +The working `mcp-run.mjs` used the same `connectToDaemon` import as the observer: |
| + |
| +```js |
| +const c = await connectToDaemon({target:{kind:'instance',home:'/home/paulca/.paseo'}}); |
| +try { |
| + const a = await c.createAgent({ |
| + workspaceId:'wks_ed152d6e0762a1fb', |
| + cwd:'/home/paulca/.paseo/worktrees/3ts4lj9g/equipo-probe-vnpbwsk1', |
| + title:'Equipo MCP probe', provider:'claude', model:'claude-haiku-4-5', |
| + modeId:'bypassPermissions', |
| + mcpServers:{equipo_probe:{type:'stdio',command:'python3', |
| + args:['/home/paulca/.cache/tmp/equipo-paseo-probe-vnpbwsk1/mcp.py']}}, |
| + initialPrompt:'Call equipo_probe probe_ping once and report its result. Do nothing else.' |
| + }); |
| + console.log(JSON.stringify({agentId:a.id,workspaceId:a.workspaceId})); |
| +} finally { await c.close(); } |
| +``` |
| + |
| +```text |
| +$ node "$P/mcp-run.mjs" |
| +{"agentId":"93d551b6-37a0-48c3-b503-b3987d3dc021","workspaceId":"wks_ed152d6e0762a1fb"} |
| +$ paseo logs "$B" --tail 4 |
| +[User] Call equipo_probe probe_ping once and report its result. Do nothing else. |
| +[Toolsearch] |
| +[mcp__equipo_probe__probe_ping] {} |
| +Result: `equipo-mcp-ok` |
| +``` |
| + |
| +Two setup attempts failed before creating any agent: the low-level connection object has no `workspaces.ref`, and its `createAgent` requires `cwd` even with `workspaceId`. The corrected call above is the one tested. The public SDK has a different, higher-level interface; pin and test the chosen client version. |
| + |
| +The current public SDK documents `config.mcpServers`, `config.toolPolicy`, provider-native `options`, and runtime settings. Local plugin instructions and the installed ZeroSub plugin use `before("agent.session_open")` for launch-time tools/environment/MCP configuration and `agent.create` for saved configuration. Current online documentation instead names `server.addHook("agent.open.before", ...)` and `agent.create.before`. This is a concrete documentation/runtime compatibility concern, not evidence that the installed hook failed. Sources: [https://paseo.sh/docs/sdk/reference.md](https://paseo.sh/docs/sdk/reference.md) and [https://paseo.sh/docs/plugins/hooks.md](https://paseo.sh/docs/plugins/hooks.md). |
| + |
| +## 6. Accounts |
| + |
| +**Verdict: yes by configuration and installed-plugin inspection; no new login or two-account execution test.** Multiple Claude credential homes already exist on this machine. ZeroSub selects a home per agent at session open. Separate daemon homes are therefore not required for this setup. `--home` selects a daemon; it does not, by itself, prove that Claude credentials are isolated. |
| + |
| +```text |
| +$ rg -n 'CLAUDE_CONFIG_DIR|session_open|homes' "$Z/README.md" "$Z/index.server.ts" |
| +README.md:91:Each added account gets its own credential home under `$PASEO_HOME/zerosub/homes/`: |
| +README.md:93:- Claude uses it as `CLAUDE_CONFIG_DIR`; Codex uses it as `CODEX_HOME`. |
| +index.server.ts:35: server.before("agent.session_open", async ({ request }, context) => { |
| +``` |
| + |
| +Only non-secret counts were extracted from the registry: |
| + |
| +```sh |
| +python3 - <<'PY' |
| +import json,os |
| +s=json.load(open(os.path.expanduser('~/.paseo/zerosub/state.json'))) |
| +a=[x for x in s['accounts'] if x['family']=='claude'] |
| +print(json.dumps({'claudeAccounts':len(a), |
| + 'signedIn':sum(x.get('signedIn',True) for x in a), |
| + 'separateManagedHomes':len({x['home'] for x in a if x.get('home')})})) |
| +PY |
| +``` |
| + |
| +```json |
| +{"claudeAccounts":6,"signedIn":6,"separateManagedHomes":5} |
| +``` |
| + |
| +These are saved registry flags, not a fresh authentication or quota check. Inspection of `server/state.ts` found per-agent `bindings` and live `sessions` keyed to `accountId`; `server/claude.ts` sets `CLAUDE_CONFIG_DIR` and `CLAUDE_SECURESTORAGE_CONFIG_DIR` for a managed home. The README says Linux credentials stay in each home's `.credentials.json`, while non-account settings and project history are shared by symlinks. |
| + |
| +For Equipo, select an existing account through the supported account-routing interface and record which account actually opened the session. Verify whether automatic failover may move it before treating a connection as person-bound. A new account would require a separate official CLI sign-in in its own credential home; no credentials should be copied between accounts. None was added here. |
| + |
| +Core provider profiles also support different credentials via `agents.providers` entries extending `claude`; the online example uses distinct API keys. That example alone does not establish two subscription logins. The installed Claude provider source resolves `env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude")`, so separate Paseo homes need explicit provider-home routing to guarantee account separation. Sources: installed ZeroSub README and [https://paseo.sh/docs/custom-providers.md](https://paseo.sh/docs/custom-providers.md), fetched with `curl -fsSL`. |
| + |
| +## 7. Remote and hosts |
| + |
| +**Verdict: partly.** Cross-host routing is documented, but no destination is registered on this daemon and execution on tito-studio was not established. No remote agents were started. |
| + |
| +```text |
| +$ paseo host ls --json |
| +[] |
| +$ paseo host add --help |
| +Usage: paseo host add [options] <connection> |
| +Options: --label <name>, --meta <key=value>, --json, --host <host>, --home <path> |
| +$ timeout 12 ssh -o BatchMode=yes -o ConnectTimeout=8 100.76.110.54 \ |
| + 'command -v paseo; paseo daemon status --json' |
| +Host key verification failed. |
| +``` |
| + |
| +The SSH command exited 255. Host verification was not disabled and `known_hosts` was not changed. This proves only that this particular Tailscale-IP SSH route was not ready for unattended use, not that tito-studio lacks Paseo or that another existing connection cannot work. |
| + |
| +The local Paseo skill supports `serverId` on remote workspace creation, agent creation, sending, status/activity, and listing. The public SDK documents `client.hosts.client(serverId)` for one-hop routing through the selected daemon. Both ends need connected-host support, a running destination daemon, authenticated transport, and access to the repository and providers on the destination. Paths and workspace IDs belong to that host. A runner must retain `{serverId, agentId}`, not an agent ID alone. Source: [https://paseo.sh/docs/sdk/reference.md](https://paseo.sh/docs/sdk/reference.md), fetched with `curl -fsSL` and inspected at its connected-host section. |
| + |
| +For this machine's rules, use Tailscale directly or SSH over Tailscale with verified host keys. Registration would use `paseo host add CONNECTION --label tito-studio`; this is a future setup instruction, not a command run during the probe. A runner on each host avoids needing this route for ordinary local execution. |
| + |
| +**Request to Paseo:** Provide a read-only runner preflight that reports remote transport authentication, expected server identity, supported routing operations, and provider availability together. Include an example that creates a workspace, streams events, answers permissions, cancels, and archives through a remote scope. We could verify discovery here but could not establish the tito-studio route without separate host setup. |
| + |
| +## 8. Runner as a Paseo plugin |
| + |
| +**Verdict: yes by documentation and installed-plugin evidence; a runner plugin was not installed or executed.** Server plugins run trusted Node code in a daemon subprocess. They can make outbound HTTP requests, maintain timers and subscriptions, register RPC handlers, and call Paseo APIs. Lifecycle hooks can alter creation and session-open requests. That is enough machinery for a runner, provided it persists work and resumes after plugin or daemon restarts. |
| + |
| +Commands used to retrieve and inspect current documentation: |
| + |
| +```sh |
| +curl -fsSL https://paseo.sh/llms.txt |
| +curl -fsSL https://paseo.sh/docs/plugins/reference.md -o "$P/plugin.md" |
| +curl -fsSL https://paseo.sh/docs/plugins/hooks.md -o "$P/hooks.md" |
| +sed -n '608,638p' "$P/plugin.md" |
| +rg -n 'agent.create|agent.open|permission' "$P/hooks.md" |
| +``` |
| + |
| +Trimmed evidence: |
| + |
| +```text |
| +reference: Cleanup can be async. Release timers, watchers, sockets, and other resources created by the plugin. |
| +reference: Backend code can use Node APIs and dependencies installed in the plugin directory. |
| +hooks: agent.create.before | yes | ... | Saved config except cwd; env |
| +hooks: agent.open.before | yes | ... | Launch-only env, tools, mcpServers |
| +hooks: agent.permission.before | no | { agent, request } |
| +hooks: agent.permission.after | no | { agent, requestId, resolution } |
| +``` |
| + |
| +The local skill documents `server.handle(contract, handler)` for validated RPCs and a handler context containing `paseo`. Installed ZeroSub demonstrates session-open hooks in this daemon. The public reference says reload, disable, and removal dispose the installation and stop the server subprocess. Outbound HTTP is an inference from the documented unrestricted Node/network access; no external HTTP request was made from a newly installed plugin. Sources: [https://paseo.sh/docs/plugins/reference.md](https://paseo.sh/docs/plugins/reference.md) and [https://paseo.sh/docs/plugins/hooks.md](https://paseo.sh/docs/plugins/hooks.md). |
| + |
| +Recommend a **separate runner process**, preserving section 6.9's service ownership and outbound connection. It can keep leases, credentials, accounting, and recovery state across a Paseo plugin reload or daemon outage. MCP injection already works through agent creation, so it does not force a plugin. A small Node adapter using the supported TypeScript client is a practical option for a Go runner; a native Go wire client needs an explicit versioned protocol contract. Do not build production code around the probe's absolute CLI-internal imports. A plugin can later add account selection or UI integration if needed. The hook-name difference between installed instructions and current docs is another reason to pin and integration-test that boundary. |
| + |
| +## What the runner should rely on |
| + |
| +- Explicit workspace creation from a commit hash; retain host, workspace, agent, and provider-session identities separately. |
| +- A version-pinned structured client connection for timeline events, full permissions, and usage; CLI JSON for bounded commands only after checking their actual output. |
| +- Subscription readiness before dispatch, durable event storage, cursor-based recovery, and explicit handling of timeline replacement. Validate recovery and usage semantics before claiming reliable billing. |
| +- Permission-ID responses for structured questions and approvals; `send` for conversational follow-ups. A queued receipt is not completion. |
| +- Per-agent MCP configuration at creation. Give each coordinator its own scoped Equipo tool capability. |
| +- Explicit account routing through the existing credential-home mechanism, with observed account identity and failover rules. |
| +- Stop, archive, and workspace cleanup as separate steps. Verify remaining processes before acknowledging cancellation; `stop` alone is insufficient. |
| +- A local runner on each enrolled machine. Treat remote routing and plugin hooks as optional, version-tested integrations. |