You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 854ca6d
Browse filesBrowse the repository at this point in the historyBrowse files
F: run plan suggestions through lane D in planning's own worker (#117, part 2) (#120)
* wip: parameterize leftover ledger by worker naming
* wip: AgentWorker hosts Ask or planning jobs
* F: run plan suggestions through lane D in planning's own worker (#117, part 2)
- AgentWorker (was QuestionWorker) and question-worker.ts serve one feature
each; LeftoverLedger, worker roots, locks and recovery wording take a
WorkerNaming. Ask's names and messages are unchanged (ASK_NAMING).
- Planning gets its own worker, TMPDIR root, ledger, lock and per-database
owner token (planning_owner), so its recovery never touches Ask's or the
runner's agents.
- PlanningAgent (runner/planning.ts) runs each request at the snapshot head of
the review repository, with the Settings vendor; Codex is refused (#93).
- E3's suggestion timer and the request share one ten-minute budget.
- The server awaits PlanningDeps.describe before a start; web/planning.ts
reads the issue from GitHub with a bound and is on for any non-demo review
with a github block.
- Real-Docker planning test in the agent-isolation workflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* F: address independent review on planning wiring (#117)
- A suggestion start replays its recorded outcome before reading GitHub, and
reads nothing for a start that would be refused (no planning, shutdown,
stale revision or snapshot). A GitHub failure is a 502, not recorded; a
shutdown during the read is a 503.
- Shutdown gives planning requests Ask's 20 s grace after E3 aborts them,
then closes planning's worker, which abandons one stuck in lane D's setup.
- Docs: a crashed process's container runs until Claude exits or the next
planning request's recovery removes it (no host-side deadline is left).
- Tests: E3 budget wiring, deadline lower bound, replay without GitHub, 502,
503, shutdown bound, reverse isolation, worker-side refusal of another
feature's job, and a leak check in the real-Docker planning test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ Dependencies point downward only. `core/` imports nothing that does input or out
160
160
| Part | Main files | Owns | State |
161
161
|---|---|---|---|
162
162
| Command line |`web/cli.ts`| Parses `--demo` or `--config`, takes the single-runner lock, starts the server, releases the lock on Ctrl+C. | In use |
163
-
| HTTP server |`web/server.ts`| Binds `127.0.0.1` only. Checks the token, Host and Origin. Bounded JSON bodies. Routes `/api/review`, `/api/action`, `/api/questions`, `/api/merge`, `/api/issues`, `/api/settings`, plus `/api/runner` and `/api/plan/*` when a runner or planning provider is supplied. Ordered shutdown. | In use; `/api/runner` and `/api/plan/*` not connected|
163
+
| HTTP server |`web/server.ts`| Binds `127.0.0.1` only. Checks the token, Host and Origin. Bounded JSON bodies. Routes `/api/review`, `/api/action`, `/api/questions`, `/api/merge`, `/api/issues`, `/api/settings`, plus `/api/runner` and `/api/plan/*` when a runner or planning provider is supplied. Ordered shutdown. | In use; `/api/plan/suggestions` runs Claude through lane D for a review with a `github` block (#117)|
164
164
| Browser screen |`web/public/*`| Review screen and Issues screen. Plain JavaScript with IBM Plex fonts served locally. Sends item and segment IDs and a state token, never fingerprints or ownership. | Yes |
165
165
| Review service |`runner/review.ts`| Builds the review view: reads history, links it to the plan, computes approval states and merge blockers. Applies review commands through the store. | Yes |
166
166
| Ask |`runner/questions.ts`, `runner/question-*.ts`| Answers a question about one plan item with a read-only agent. Runs lane D's synchronous setup in a worker thread so the server stays responsive. Tracks leftover containers. | Yes |
|`GET /api/plan/suggestions/:id`|`Store.getSuggestions`| reads only the request row |
357
-
| `POST /api/plan/suggestions/:id/cancel` | `pending`: `handle.cancel(reason)` on the `SuggestionHandle` that `SuggestionCoordinator.start()` returned. E3's coordinator has no cancel-by-ID method, so F keeps a map from request ID to handle, adds each handle when it starts the request, and removes it only after the handle's outcome settles. If the request is `pending` but F holds no handle (for example after a restart), F calls `Store.cancelSuggestions`. It is safe to do so because startup recovery has already stopped the crashed process's provider. A live planning provider runs only through D (G4 after D5), in a container labelled with this database's runner owner, and D's `recoverLeftovers` (startup step 2) stops it before admission opens. Until D5 there is no live planning provider at all ("Planning agent not available yet"). If a planning provider ever runs outside D, this endpoint must refuse such a request instead, until startup has reconciled it. `ready`: `Store.cancelSuggestions` (dismiss), because no invocation is running. | request is `pending` or `ready`, as `Store.cancelSuggestions` already allows |
357
+
| `POST /api/plan/suggestions/:id/cancel` | `pending`: `handle.cancel(reason)` on the `SuggestionHandle` that `SuggestionCoordinator.start()` returned. E3's coordinator has no cancel-by-ID method, so F keeps a map from request ID to handle, adds each handle when it starts the request, and removes it only after the handle's outcome settles. If the request is `pending` but F holds no handle (for example after a restart), F calls `Store.cancelSuggestions`. It is safe to do so because a crashed process's planning container has no route back to the Store: its output went to that process's worker, which ended with it. A live planning provider runs only through D (#117), in planning's own worker, in containers labelled with this database's planning owner (not the runner's or Ask's). Like Ask's, those containers are removed by D's `recoverLeftovers` for that owner before the first planning request of the next process, not at startup; until then a stray container can keep running read-only (its deadline is enforced from the host, which is gone) until Claude exits or that recovery removes it, and its output is discarded. If a planning provider ever runs outside D, or could report into the Store from another process, this endpoint must refuse such a request instead, until it has been reconciled. `ready`: `Store.cancelSuggestions` (dismiss), because no invocation is running. | request is `pending` or `ready`, as `Store.cancelSuggestions` already allows |
358
358
|`POST /api/plan/suggestions/:id/apply`|`Store.applySuggestion`| request `ready` and bound to the current revision and snapshot |
359
359
360
-
Live planning invocation waits for D5. Until then, the server returns "Planning agent not available yet" instead of using a fake provider.
360
+
Live planning runs for a non-demo review with a `github` block (#117): `web/planning.ts` reads the issue from GitHub before each start, and `runner/planning.ts` runs the request in planning's worker. E3's suggestion timer and the request share one ten-minute budget (`PLANNING_BUDGET_MS`). At shutdown E3 aborts every request; one that has not settled within 20 seconds (`PLANNING_SHUTDOWN_GRACE_MS`, as Ask) is ended by abandoning planning's worker. A start replays its recorded outcome before reading GitHub; a GitHub failure is a 502 and is not recorded. Without a `github` block, or in a demo, the server returns "Planning agent not available yet".
0 commit comments