chore: docs, dev scripts and CI catch up with orchestration V2 (#15041)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-02 22:25:00 -07:00
1 parent c5a929e1ac
commit ddcd310282
29 files changed
+303 -415

No files matched your search

@@ -123,7 +123,7 @@ trailing `<terminal_context>` form is parsed only when reading messages sent by
The composer sends `message.text` as canonical prose with reference links and
`message.context.records` built from the draft (`buildMessageContext` in
`apps/web/src/lib/composerContextRecords.ts`). Expired terminal excerpts are dropped from both.
The server projects provider text at turn start (`ProviderCommandReactor`), so the persisted
The server projects provider text at turn start (`projectComposerContextForProvider`), so the persisted
message stays readable and the provider receives markers plus one envelope.
Review comments and preview annotations enter the draft through store mutators. A mounted composer
+1 -1
View File
@@ -60,7 +60,7 @@ a shim directory to the provider's PATH. The CLI installs on the environment
server even when that server cannot run simulators. Hosts start on demand.
That environment is fixed when the provider subprocess spawns, so
[`prepareMcpSession`](../../apps/server/src/provider/Layers/ProviderService.ts)
[`prepareMcpSession`](../../apps/server/src/orchestration-v2/ProviderSessionManager.ts)
starts agent-device only when device support and agent access have both been
enabled, the session has the `device` capability, and the machine can run at
least one platform. Starting it later from `device_open` would leave the
+11 -13
View File
@@ -13,23 +13,21 @@ Terms whose meaning matters across T3 Code. Architecture and lifecycle constrain
| Workspace root | The project's base filesystem directory on the environment. |
| Worktree | A separate Git checkout a thread can use instead of the project's main checkout. |
| Thread | The durable conversation and work history for a project. It survives provider process exits. |
| Turn | One user-to-agent work cycle. Provider work can finish before checkpoint and diff work settles. |
| Turn | One user-to-agent cycle, a V2 run. Provider work can end before checkpoint and diff work settles. |
| Activity | A non-message timeline item, such as a tool action, approval, or failure. |
| T3 home | The base data directory. Runtime state normally lives under its `userdata` directory. |
## Orchestration
| Term | Meaning |
| ----------------------- | -------------------------------------------------------------------------------------------- |
| Command | A request to change domain state. Accepting it does not mean its side effects have finished. |
| Event | A persisted fact produced by a command. |
| Decider | The pure logic that turns a command and current state into events. |
| Projection / read model | A view of current state derived from persisted events. |
| Projector | The logic that applies events to a read model. |
| Reactor | A worker that performs follow-up work in response to recorded intent or runtime signals. |
| Command receipt | A durable record of a command's result, used to make retries idempotent. |
| Runtime receipt | A test-only signal that an asynchronous milestone completed. |
| Quiesced | The relevant follow-up workers have finished, beyond the provider turn merely ending. |
| Term | Meaning |
| ----------------------- | --------------------------------------------------------------------------------------------------------- |
| Command | A request to change domain state. Accepting it does not mean its side effects have finished. |
| Event | A persisted fact produced by a command. |
| Orchestrator | The service that serializes commands and decides their events from current state, without I/O. |
| Projection / read model | A persisted view of current state, committed in the same transaction as the events that change it. |
| Command receipt | A durable record of a command's result, used to make retries idempotent. |
| Outbox effect | Side-effect intent committed with the events, such as starting a provider turn or capturing a checkpoint. |
| Effect worker | The worker that runs outbox effects after commit and feeds their results back as commands. |
## Providers and checkpoints
@@ -51,7 +49,7 @@ Terms whose meaning matters across T3 Code. Architecture and lifecycle constrain
| Term | Meaning |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Pull request link | A persisted thread association identified by host, repository, and number. Links can cross projects within an environment and carry a server-maintained snapshot. |
| Pull request sync | The reactor that refreshes each distinct linked review once per cadence and discovers native stack layers. Explicit refreshes and failed stack reads trigger another read. |
| Pull request sync | The worker that refreshes each distinct linked review once per cadence and discovers native stack layers. Explicit refreshes and failed stack reads trigger another read. |
| Current pull request | The link used by single-review controls and older clients. Open work takes precedence; a completed single chain points at its top layer. Unrelated terminal links use the latest update. |
## Composer context
+17 -10
View File
@@ -3,7 +3,7 @@
Orchestration records intent and state without knowing which provider runs a thread. Provider
protocols, account ownership, permissions, and capabilities belong at the
[adapter boundary](../../apps/server/src/orchestration-v2/ProviderAdapter.ts). Normalize there
instead of spreading provider checks through reactors and clients.
instead of spreading provider checks through orchestration and clients.
A driver kind identifies an integration; an instance identifies one configuration and account
lifecycle. Route work by instance, so two accounts using the same driver do not share mutable
@@ -11,16 +11,23 @@ session or catalog state.
## Process and account isolation
T3-managed OpenCode chat uses one server per thread. Its MCP registrations are directory-scoped, while
T3's MCP connection is thread-scoped. Sharing a chat server between threads in one directory would
let them replace each other's connection. Catalog and text-generation work can share the
[instance-owned helper](../../apps/server/src/provider/OpenCodeServerOwner.ts), which closes
after an idle period. External OpenCode servers remain externally owned and can require an
external restart to pick up configuration changes.
The `opencode` driver probes the installed version and runs the 1.x or 2.x runtime. OpenCode's MCP
registrations are directory-scoped, while T3's MCP connection is thread-scoped, so threads in one
directory must not share one T3 MCP entry.
OpenCode also stores persistent approval grants per directory. Automatic full-access replies use
`once` so they cannot widen a supervised thread's permissions on a shared external server.
See the [adapter](../../apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts).
- **1.x** uses one T3-managed chat server per thread, so threads cannot replace each other's
connection. Catalog and text-generation work can share the
[instance-owned helper](../../apps/server/src/provider/OpenCodeServerOwner.ts), which closes
after an idle period. See the [1.x adapter](../../apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.ts).
- **2.x** serves every directory from one
[server per instance](../../apps/server/src/provider/opencode2/OpenCode2Server.ts). Each thread
registers its own `t3-code-<thread>` MCP entry, and session permission rules deny every other
thread's entry. See the [2.x adapter](../../apps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.ts).
External OpenCode servers remain externally owned and can require an external restart to pick up
configuration changes. OpenCode stores "always" approval grants for the whole project. Automatic
full-access replies use `once` so they cannot widen a supervised thread's permissions on a shared
server. On 2.x, a session-wide approval also replies `once` and becomes T3's own rule on that session.
Pi runs the user's own `pi` install in RPC mode and owns native extension, package, and project
trust discovery. T3 injects only its namespaced MCP bridge, so a Pi session behaves as it does in