oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Agent setup controller report
2
3Round 2 adds automatic coordinator binding, setup and failure notes, and chat
4focus/transition fixes. The round 2 evidence and handoff follow the original
5R1–R5 report below.
6
7The coordinator can propose a repository project in the conversation. The
8project is created only when its person taps **Set up**. **Not now** closes
9the card without creating a project. This branch was rebased onto `main`
10`96920a2` after the chat UI merge. Commit only; the controller pushes.
11
12## Delivered
13
14- R1: each normal heartbeat sends the sorted repository keys from the dedicated
15 forge credential file. Legacy string values and separate API/Git values both
16 work. No credential values enter the report. The instance replaces the list
17 per authenticated runner and resolves the person through the current runner
18 and roster. Failed local discovery withdraws old names. Revoked runners are
19 excluded immediately. Rotation-only heartbeats leave discovery unchanged.
20- R2: `propose_project({repository, why})` is in the coordinator-only tool list.
21 Repository names must match a current report from this person's runners.
22 Proposals are private, audited, replayable and deduplicated while pending.
23 Confirmation checks the person, binding generation, current owner role,
24 repository report and card revision inside the write transaction. It uses the
25 existing project validator. Account, project, decision owners, audit, card
26 update and follow-up message commit together. Replay creates nothing twice.
27- R3: the prompt tells the coordinator to propose setup for a new repository or
28 app and to recommend a repository when the team has no projects. Context
29 contains reported names and eligible existing project metadata. Existing
30 project restrictions still apply to the selected model connection. Empty
31 conversations explain that people can say what they want fixed.
32- R4: the optional new-project form requires only a repository. A datalist offers
33 reported names and still accepts typed names. More options is collapsed.
34 Existing project edits keep the previous validation path.
35- R5: only coordinator policy inventories changed. Its obsolete live certificate
36 was removed from the active manifest. Both specialist certificates, their
37 isolation tuples and all specialist inventory hashes are unchanged. Historical
38 evidence files are unchanged. The coordinator remains uncertified.
39
40Defaults: the last repository segment supplies the name; its namespace supplies
41an account label, created if needed; kind is Repository; branch is `main`; the
42confirming person owns work and merge decisions. No project playbook or approval
43override is written. The existing team/kind playbook resolution and approval
44default apply. Tests verify an installed team playbook is inherited. Model
45connection consent and execution gates retain their existing behavior.
46
47Migration `0034_agent_setup.sql` adds `runner_repositories` and
48`project_proposals`; Models and the schema snapshot match. Form parsing lives in
49`setup`, and the new integration tests have their own package. Size budgets were
50not raised. The historical reference inventory received only the changed model
51line's hash.
52
53## Policy identities
54
55These are portable constructor inventory hashes, not new live certificates.
56
57| Provider/action | Before | After |
58|---|---|---|
59| Claude/coordinate | `a671f7b2fe5b2d9864684d2260400f278041f35f0b33afbe7e2569551aba9e7f` | `ed4d28bda3454a731a0265a46f25d7b567ad05606ef288751100eb4b31e7f6f2` |
60| Codex/coordinate | `d6815e9d94c8c96ae63e40505011be6c7ec226db1e2479454eee83ca6b8f4c6e` | `26a6d7dbb36a6787f651a22ae9785ac827e02bb8de8b89f93a0b403108577a86` |
61
62The retired Claude coordinator live policy hash is
63`7390776107a4ae309ed3182e2c6079dd08e7f4fdcaee0cb64287eb2bf0671529`.
64The controller must rerun the starter gate for the new coordinator policies.
65Offline tests grant no production certification.
66
67## Verification
68
69Before implementation:
70
71- `CGO_ENABLED=0 go test ./internal/coordinator -run '^TestProposeProjectSchema' -count=1`
72 failed with `runner.invalid` for the new tool.
73- `CGO_ENABLED=0 go test ./internal/plan3test -run '^TestAgentSetup' -count=1`
74 failed to compile because the reporting and proposal-answer APIs did not exist.
75 These tests were later moved to `internal/agentsetuptest` to keep the existing
76 package within its size budget.
77- `CGO_ENABLED=0 go test ./internal/agentsetuptest -run '^TestAgentSetupContextScope$' -count=1`
78 failed with `setup context disclosed a project denied to this connection`.
79 Applying the existing project-access check restored it.
80
81Passing targeted commands:
82
83```sh
84CGO_ENABLED=0 go test ./internal/agentsetuptest -count=1
85CGO_ENABLED=0 go test ./internal/coordinator ./internal/equipo ./internal/release ./internal/runner/transporttest -run 'TestProposeProjectSchema|TestCoordinatorToolAllowlist|TestMigrationModels|TestConversationMigrationSnapshot|TestPlanWorkflowReleasePolicyInventory|TestRunnerHeartbeatWireReports' -count=1
86CGO_ENABLED=0 go test ./internal/runner/forge ./internal/runner/heartbeat -run 'TestRepositoryNames|TestForgeCredential' -count=1
87CGO_ENABLED=0 go test ./internal/plan3test ./internal/runner/provider/claude ./internal/runner/provider/codex -run 'TestCoordinatorAuthorityProjectContext|TestCoordinatorContext|TestCoordinatorSessionContinuity' -count=1
88```
89
90The fake CLI is a local Python subprocess that reads the actual coordinator
91prompt and emits `propose_project`. Its call crosses the real tool broker,
92runner journal, loopback HTTP protocol and instance transaction. Repository
93URL, app name and no-project cases each reach a card, then an authenticated
94HTML form tap, then one persisted project. Provider event transport and
95containment are simulated; no live provider account is used.
96
97### Guard mutations
98
99Each mutation was applied alone and restored. Each command below exited 1
100with an assertion failure, rather than a compilation failure. The restored
101suite passes. The card-state test removes a queue replay record to check the
102state guard independently of queue idempotency. An initial weaker test was
103strengthened after that separate guard concealed the mutation.
104
105Use `CGO_ENABLED=0 go test <package> -run '<filter>' -count=1`:
106
107| Guard deliberately broken | Package | Filter | Observed failure |
108|---|---|---|---|
109| repository allowlist | `./internal/agentsetuptest` | `^TestAgentSetupGuards/unreported$` | unreachable repository accepted |
110| tap rechecks discovery | `./internal/agentsetuptest` | `^TestAgentSetupGuards/withdrawn$` | guard accepted withdrawn |
111| current owner | `./internal/agentsetuptest` | `^TestAgentSetupGuards/role$` | guard accepted role |
112| binding generation | `./internal/agentsetuptest` | `^TestAgentSetupGuards/generation$` | guard accepted generation |
113| card revision | `./internal/agentsetuptest` | `^TestAgentSetupGuards/stale$` | guard accepted stale |
114| card terminal state | `./internal/agentsetuptest` | `^TestAgentSetupDuplicateAndDecline$` | declined card reused |
115| person isolation | `./internal/agentsetuptest` | `^TestAgentSetupTap$` | another person accepted |
116| pending deduplication | `./internal/agentsetuptest` | `^TestAgentSetupDuplicateAndDecline$` | duplicate pending card |
117| existing project | `./internal/agentsetuptest` | `^TestAgentSetupDuplicateAndDecline$` | existing project proposed |
118| audit atomicity | `./internal/agentsetuptest` | `^TestAgentSetupGuards/audit$` | guard accepted audit |
119| decline consent | `./internal/agentsetuptest` | `^TestAgentSetupGuards/decline$` | refused proposal created a project |
120| coordinator instructions | `./internal/agentsetuptest` | `^TestAgentSetupFakeCLI/Fix_new-app$` | Fake CLI instruction assertion failed |
121| heartbeat names | `./internal/runner/heartbeat` | `^TestRepositoryNames$` | names missing from serialized heartbeat |
122| runner revocation | `./internal/agentsetuptest` | `^TestAgentSetupHeartbeat$` | revoked runner repository retained |
123
124### Full gate
125
126Two complete `make -k ci` runs were made. The first exited 2. It exposed
127context visibility regressions, expected certification-count changes, the
128missing copy-inventory rows, one stale reference hash and one lint finding.
129Targeted reruns of every failing group passed after correction.
130
131The single full rerun exited 0: 34 test packages ran uncached with zero
132failures. Build, vet, formatting, static analysis, vulnerability and secret
133scans, reference inventory, size budgets, adapter checks, namespace checks,
134migration comparison and performance checks passed. The conversation's median
135response was 20.587 ms against 150 ms; cold boot was 111 ms against 500 ms.
136
137The local run printed timing warnings for existing packages. These are
138informational locally but are enforced in CI; no time limits were raised:
139
140| Package | Measured | Limit |
141|---|---:|---:|
142| `internal/runner` | 5m56.061s | 5m30s |
143| `internal/runner/provider` | 21.532s | 15s |
144| `internal/runner/provider/claude` | 47.184s | 45s |
145| `internal/runner/provider/codex` | 39.056s | 35s |
146
147The new integration package passed within its unchanged 10-second default.
148Its independent guard and fake-CLI cases run in parallel.
149
150### Browser evidence
151
152Both widths passed browser checks for one confirmation card, live creation and
153completion, no horizontal overflow, a repository datalist and one required
154field. The scriptless variant also submitted the real confirmation form.
155
156```sh
157EQUIPO_BROWSER_ARTIFACTS="$PWD/docs/mockups/built/2026-11-06" CGO_ENABLED=0 go test -tags browser ./internal/agentsetuptest -run '^TestAgentSetupBrowser' -count=1
158EQUIPO_BROWSER_NO_JS=1 CGO_ENABLED=0 go test -tags browser ./internal/agentsetuptest -run '^TestAgentSetupBrowser' -count=1
159```
160
161Screenshots are in `docs/mockups/built/2026-11-06/`:
162`agent-setup-card-1280.png`, `agent-setup-card-390.png`,
163`agent-setup-empty-1280.png`, `agent-setup-empty-390.png`.
164
165## Copy and handoff
166
167No copy-review server was started. Eleven new strings and the revised
168`conversation.empty` are individually marked `COPY REVIEW PENDING` in
169`internal/equipo/copy.go`. The existing complete copy inventory in
170`CONTROLLER-REPORT-plan-3.md` contains the same text and marks it for review.
171README prose was left unchanged.
172
173The controller's remaining work is to review copy, rerun the live starter gate,
174and push this commit. No merge, push or deployment was performed here.
175All servers and browser processes started for the checks have stopped. Scratch
176files created for this task were removed; default Go caches were retained.
177The supplied worktree remains in place for the controller.
178
179## Round 2: automatic coordinator binding (2026-11-06)
180
181Merged local `main` first as `449715a`. The only conflict was in `copy.go`:
182kept the previous agent-setup empty state pending and retained main's approvals
183for unchanged chat strings. No fetch or push was attempted.
184
185A1: sending a main-conversation message now binds an unconfigured coordinator
186to the first eligible connection by ID. Candidates belong to the current
187person and an active runner in this instance. The release must certify the
188provider's coordinate action; reported provider, launcher, bubblewrap and
189policy versions must match. Existing freshness, availability, routing and
190isolation checks apply. The binding records current member and connection
191revisions. Message, binding, human-attributed audit, queued turn and system
192note commit together. A replay adds no note, binding or turn. Existing bindings
193are retained, including explicit project selection and the existing poll path.
194
195A2: missing runners, connections, certification or usable online connections
196produce a plain system note with the next action. Existing offline or changed
197bindings also explain the problem when sending. Interrupted, fenced, waiting
198connection and budget states are visible in the conversation. Lease and attempt
199deadlines produce a timeout note, with live refresh scheduled for both. Retry
200controls for uncertain turns remain hidden until containment is confirmed.
201Reads do not rewrite turn state or authorize a new attempt.
202
203A3: an app-owned script skips cross-document transitions when the source and
204destination have the same origin, path and query. Composer and answer forms
205restore focus to the composer after POST + 303; ordinary page navigation keeps
206its transition. Browser tests exercise actual composer and project-answer
207submissions at 1280 and 390. Vendored Rastrillo files remain byte-identical.
208
209Selection logic moved into the conversation package to stay within the existing
210source budget. No budget, migration, schema, policy constructor, policy inventory
211or certification file changed in round 2. The prior coordinator hashes above
212still apply. Its live certification is still required; the fake release injected
213by tests cannot authorize a real runner's policy or executable checks.
214
215### Round 2 verification
216
217Initial failing tests:
218
219- `CGO_ENABLED=0 go test ./internal/agentsetuptest -run 'TestCoordinatorMissingSetupNote|TestCoordinatorFailureVisible' -count=1`
220 failed with a missing setup note and silent uncertain, fenced, waiting
221 connection and budget states.
222- `CGO_ENABLED=0 go test ./internal/agentsetuptest -run '^TestCoordinatorExistingOfflineNote$' -count=1`
223 failed because an existing offline binding produced no note.
224
225The fake Python CLI now receives an authenticated first HTML message with no
226binding, runs through automatic binding and the real runner protocol, posts a
227reply with `post_message`, and reaches delivered state. A separate subprocess
228failure reaches an uncertain turn with a visible recovery action after
229containment. Existing project-proposal flows still pass. No live provider is
230used; containment and provider event transport are simulated.
231
232Eleven guard mutations each exited 1 with a test assertion, then were restored.
233Commands use `CGO_ENABLED=0 go test ./internal/agentsetuptest -run '<filter>' -count=1`:
234
235| Broken guard | Filter | Observed failure |
236|---|---|---|
237| coordinate certification | `^TestCoordinatorAutoBind/uncertified$` | ineligible binding accepted |
238| online freshness | `^TestCoordinatorAutoBind/offline$` | offline binding accepted |
239| certified provider version | `^TestCoordinatorAutoBind/wrong-version$` | wrong version accepted |
240| candidate person filter | `^TestCoordinatorAutoBind/eligible$` | eligible binding missing |
241| connection revocation | `^TestCoordinatorAutoBind/connection-revoked$` | revoked connection bound |
242| deterministic order | `^TestCoordinatorAutoBind/deterministic$` | wrong binding selected |
243| audit atomicity | `^TestCoordinatorAutoBind/audit$` | audit failure ignored |
244| setup replay | `^TestCoordinatorMissingSetupNote$` | replay attempted duplicate setup write |
245| failure visibility | `^TestCoordinatorFailureVisible/uncertain$` | silent turn |
246| timeout visibility | `^TestCoordinatorTimeoutVisible$` | timeout note missing |
247| same-page transition skip | `^TestAgentSetupBrowser/390$` with `-tags browser` | transition was not skipped |
248
249The certification and version fixtures were strengthened after independent
250version and isolation checks initially concealed those mutations. Restored
251checks cover current membership, foreign ownership, revoked runners and
252connections, unavailable reports, lookup/decode errors and audit rollback.
253Timeout tests also verify that live refresh is scheduled. Historical conversation
254and migration assertions now include the setup note beside the person's message.
255
256Eight new copy entries and the revised `coordinator.uncertain` and
257`coordinator.waiting_connection` are individually marked `COPY REVIEW PENDING`.
258The consolidated Plan 3 copy inventory contains their exact text. The controller
259applies Paul's acceptance before release. No copy-review server was started;
260README prose is unchanged.
261
262Targeted checks passed:
263
264```sh
265CGO_ENABLED=0 go test ./internal/agentsetuptest -count=1
266CGO_ENABLED=0 go test -tags browser ./internal/agentsetuptest -run '^TestAgentSetupBrowser' -count=1
267CGO_ENABLED=0 go test ./internal/agentsetuptest ./internal/plan3test -run 'TestCoordinatorAutoBind|TestCoordinatorExistingOfflineNote|TestPlan3ReleaseBoundaries/inventory' -count=1
268```
269
270The first full `make -k ci` exited 2 with one failing package:
271`internal/tryequipo`, test `TestAutomaticAnswerProcessChain`. Its captured
272terminal output showed the provider check passing and the shell printing
273`exit`; the Python driver then failed its one-shot, nonblocking child-exit
274check. A process-reaping race is the likely cause, not a proven diagnosis.
275`CGO_ENABLED=0 go test ./internal/tryequipo -run '^TestAutomaticAnswerProcessChain$' -count=3 -v`
276passed all three isolated runs. That unrelated fixture is unchanged.
277
278Every other gate passed on the first full run. Conversation median response was
27919.594 ms against 150 ms; cold boot was 110 ms against 500 ms. Existing local-only
280timing warnings: runner 5m54.874s/5m30s, provider 22.456s/15s, Claude
28153.751s/45s, Codex 43.872s/35s. No time limits were raised.
282
283The single full rerun exited 0. All 34 test packages ran uncached with zero
284failures. Reference scan, build, vet, formatting, static analysis, vulnerability
285and secret scans, size budgets, adapter and namespace checks, migration
286comparison and performance passed. Conversation median response was 20.991 ms;
287cold boot was 115 ms. The four local timing warnings remained: runner
2885m54.195s/5m30s, provider 21.528s/15s, Claude 47.469s/45s and Codex 39.94s/35s.
289Timing limits are enforced in CI environments; these existing warnings were not
290waived or changed. Two full runs total, one rerun; no third run.
291
292Controller: apply copy acceptance, rerun live coordinator certification and push
293the local commits. No push or deployment was performed. Test servers and browser
294processes have stopped, and task scratch was removed. Default Go caches and the
295controller-provided worktree remain in place.
296