Adopt codex-flows 0.3.5 surfaces
Some checks failed
check / check (push) Failing after 3s

This commit is contained in:
matamune 2026-05-18 00:07:15 +00:00
parent e7a85c5bcf
commit 81ea91e387
Signed by: matamune
GPG key ID: 3BB8E7D3B968A324
22 changed files with 197 additions and 170 deletions

View file

@ -38,13 +38,25 @@ to identify the upstream update. The receiving workspace still reads Git and
forge state to discover the maintained branch, patch commits, candidate refs,
and current checks.
## Workspace Backends
## Flow Execution Surfaces
When `PATCH_WORKSPACE_BACKEND_URL` is unset, patch.moi uses local flow
execution from the process working directory. When it is set to an HTTP or
WebSocket URL, patch.moi dispatches to that Codex workspace backend. In both
cases patch.moi writes its own dispatch and maintenance-attempt records under
`DATA_DIR`.
patch.moi supports the codex-flows flow surfaces without requiring any one of
them to be running on this checkout:
| Surface | How patch.moi selects it | Run state |
| --- | --- | --- |
| synchronous local | no backend URL and no Actions mode | in-process local client state |
| Actions/local | `CODEX_WORKSPACE_MODE=actions` or `GITHUB_ACTIONS=true` and no backend URL | `.codex/workspace/actions/flow-client` |
| workspace HTTP | `PATCH_WORKSPACE_BACKEND_URL`, `PATCH_FLOW_BACKEND_URL`, or `PATCH_FLOW_DISPATCH_URL` is an HTTP URL | backend-owned |
| workspace WebSocket | configured workspace URL starts with `ws://` or `wss://` | backend-owned |
The Actions/local surface is the no-running-backend path for semi-autonomous
fork maintenance in CI. A persistent workspace backend remains optional: use it
when a host, service, or gateway needs durable run inspection, app-server
pass-through, or remote dispatch/replay control.
In every case patch.moi writes its own dispatch and maintenance-attempt records
under `DATA_DIR`.
Workspace backend run state is useful for inspection and sync. It is not the
authoritative patch.moi product state.
@ -66,8 +78,8 @@ local harness path. The repository also includes an explicit manual
bun run workspace:run:harness-flow
```
That flow task requires a running workspace backend URL. In
`@peezy.tech/codex-flows@0.3.4`, workspace-owned flow tasks synthesize unique
That flow task requires a running workspace backend URL for the repo-native
workspace automation command. In codex-flows, workspace-owned flow tasks synthesize unique
`id`, `occurredAt`, and `receivedAt` fields for every run. Those ids are useful
for workspace automation, but patch.moi must not use workspace-generated ids
for feed-owned maintenance attempts.

View file

@ -53,8 +53,15 @@ Verify Codex release flow matching without executing release work:
bun run patch.moi -- run codex-release --tag rust-v0.130.0 --dry-run
```
Dispatching the Codex release task requires a configured workspace backend by
default:
Dispatching the Codex release task requires an explicit execution surface. Use
Actions/local mode when no workspace backend is running:
```bash
CODEX_WORKSPACE_MODE=actions \
bun run patch.moi -- run codex-release --tag rust-v0.130.0
```
Or point at a workspace backend:
```bash
PATCH_WORKSPACE_BACKEND_URL=ws://127.0.0.1:3586 \
@ -63,7 +70,7 @@ bun run patch.moi -- run codex-release --tag rust-v0.130.0
Use `--allow-local` only when you intentionally want the local Patch process to
execute matching Codex release flows. The Code Mode step still requires its own
`CODEX_FLOWS_ENABLE_CODE_MODE=1` gate.
`CODEX_FLOWS_MODE=code-mode` gate.
## Status

View file

@ -18,7 +18,10 @@ description: Runtime environment variables used by patch.moi.
| `PATCH_FLOW_DISPATCH_URL` | unset | Legacy or explicit flow dispatch URL fallback. |
| `PATCH_FLOW_DISPATCH_SECRET` | unset | Legacy HMAC secret fallback. |
| `PEEZY_CODEX_REPO` | `../codex` | Optional Codex checkout path for `patch.moi setup codex`. |
| `CODEX_FLOWS_ENABLE_CODE_MODE` | unset | Required by Code Mode flow steps before local Code Mode execution. |
| `CODEX_WORKSPACE_MODE` | unset | Set to `actions` to use codex-flows Actions/local flow state when no workspace backend URL is configured. |
| `GITHUB_ACTIONS` | unset | When `true`, also selects the Actions/local no-backend flow surface. |
| `CODEX_FLOWS_MODE` | unset | Set to `code-mode` when Code Mode flow steps should run. |
| `CODEX_FLOWS_ENABLE_CODE_MODE` | unset | Legacy narrow gate accepted by Code Mode flow steps. |
| `CODEX_APP_SERVER_CODEX_COMMAND` | unset | Passed to local code-mode flow execution. |
| `CODEX_HOME` | unset | Passed to local code-mode flow execution. |
@ -30,4 +33,4 @@ Git topology is intentionally not represented here. Local mode should read
upstream, fork, branch, and tag state from Git. Service mode should read remote
repository, branch, workflow, and review state from the forge. Environment
variables should stay limited to runtime concerns such as workspace backend
URLs, data directories, and Codex execution settings.
URLs, data directories, workspace mode, and Codex execution settings.

View file

@ -35,10 +35,13 @@ bun run docs:build
## Root Workspace
The repository root owns shared scripts and dev dependencies. It installs
`@peezy.tech/codex-flows` so repo-native workspace commands are available:
The repository root owns shared scripts and dev dependencies. It installs the
current `@peezy.tech/codex-flows` package surface so repo-native workspace,
flow, app-server, and backend commands are available:
```bash
bun run flow:list
bun run workspace:backend
bun run workspace:doctor
bun run workspace:tick
bun run workspace:run:harness
@ -62,17 +65,15 @@ codex-flows pack doctor --json
not patch.moi product state. patch.moi still records feed-owned flow events,
workspace dispatches, and maintenance attempts under `DATA_DIR`.
## Related Runtime Packages
## Related Runtime Package
These published packages define the current patch.moi integration baseline:
patch.moi uses the consolidated codex-flows package surface:
| Package | Published version | patch.moi use |
| --- | --- | --- |
| `@peezy.tech/codex-flows` | `0.3.4` | repo-native workspace commands and CLI automation |
| `@peezy.tech/flow-runtime` | `0.4.0` | local flow discovery, matching, execution, and Bun flow helpers |
| `@peezy.tech/flow-backend-convex` | `0.4.0` | optional generic durable flow backend for future service experiments |
| `@peezy.tech/codex-flows` | `^0.3.5` | flow runtime, Bun flow helpers, workspace backend protocol/client, Actions/local flow state, CLI automation, and backend bins |
patch.moi product state still belongs in the Patch service JSONL store by
default. `flow-backend-convex` should be considered only when patch.moi needs a
generic durable flow event/run backend; it is not the default home for feed
signals, workspace dispatch records, or maintenance attempts.
default. Generic flow backend state is execution/run state. It is useful for
inspection and sync, but it is not the default home for feed signals, workspace
dispatch records, or maintenance attempts.

View file

@ -48,15 +48,15 @@ codex-flows pack doctor --json
```
The current local install pins `openai-codex-bindings` and `peezy-codex-fork`
in `.codex/pack-lock.json`. `@peezy.tech/flow-runtime@0.4.0` discovers
installed `.codex/flows/*` before source-owned `flows/*`, so the installed
Codex capabilities are visible to patch.moi while the harness remains a
source-owned repo flow.
in `.codex/pack-lock.json`. The codex-flows runtime discovers installed
`.codex/flows/*` before source-owned `flows/*`, so the installed Codex
capabilities are visible to patch.moi while the harness remains a source-owned
repo flow.
Safe local verification stops at event matching and runner gating. The test
suite confirms that a stored `upstream.release` event for `openai/codex`
selects both installed Codex release steps, and that the Code Mode step still
requires `CODEX_FLOWS_ENABLE_CODE_MODE=1`. Do not fabricate a full
requires `CODEX_FLOWS_MODE=code-mode`. Do not fabricate a full
`openai/codex` release lifecycle just to exercise the flow.
You can run the same safe match check through the CLI:
@ -65,7 +65,23 @@ You can run the same safe match check through the CLI:
bun run patch.moi -- run codex-release --tag rust-v0.130.0 --dry-run
```
## 3. Point Patch at a workspace backend
## 3. Pick an execution surface
Patch does not require a Codex workspace backend to be running in this checkout.
For CI-style no-backend maintenance, select the codex-flows Actions/local
surface:
```bash
CODEX_WORKSPACE_MODE=actions \
DATA_DIR=./data \
bun run patch.moi -- run codex-release --tag rust-v0.130.0
```
That writes flow run state under `.codex/workspace/actions/flow-client` and
patch.moi product state under `DATA_DIR`.
For a service or host-owned execution surface, point Patch at a workspace
backend:
```bash
PATCH_WORKSPACE_BACKEND_URL=http://127.0.0.1:3586 \
@ -81,7 +97,7 @@ workspace flow capability. `PATCH_FLOW_BACKEND_URL` and
`PATCH_FLOW_DISPATCH_URL` remain accepted for older feed targets.
Leave `PATCH_WORKSPACE_BACKEND_URL` unset only when you intentionally want local
flow execution from the Patch process working directory.
or Actions/local flow execution from the Patch process working directory.
## 4. Inspect the stored event