A release's risk only counted what the target branch gained when the
run integrated. Commits people pushed to the branch directly, and
integrations that were never deployed, went out with the next release
without being classified: an environment preauthorized for automatic
release took a migration or a Dockerfile change pushed straight to the
branch without approval. The POC chose what to rebuild from the same
narrow diff, so worker and coordinator kept running old code; on the
local POC, WishForge had in fact only ever rebuilt the api.
The control plane now gives the verifier the commit of the release the
environment runs, and the classification covers everything between it
and the release, as well as what the integration brought. On the POC,
each deployment records the commit and the image a release put there.
The build plans from that snapshot, the one the release is checked
against: worker and coordinator keep their images only while what they
run differs from the source in web files alone. A component of unknown
source (never deployed by a release, restored by a rollback, or set by
hand, which leaves the annotations stale) is rebuilt, and the release
is marked partial: it needs approval and does not roll back on its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- verifyRun returned deliver() unawaited inside try/finally, so the
session closed and deleted the workspace while the build still used
it: a build continued after an infrastructure failure always failed.
The failure handlers there were unawaited too.
- The resumed build classified the release risk from the checkpoint's
base, not the target branch it integrated onto, and replaced the
earlier classification: a migration brought by an IDE branch no
longer counted. Integration evidence now records the target commit
it integrated onto, the resumed build classifies from it, and a
commit's classification only ever widens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pausing revoked the executor at once: the agent was killed and the work
of the current attempt stayed only in the executor's local workspace,
so continuing started that attempt over.
A pause of a run whose executor holds the lease now drains it first:
- The run keeps `running` with pauseRequestedAt (the console shows
pausing). Its agent gets no model credential and no new model
request; continuing is refused until the pause completes; cancelling
still stops it at once.
- The executor learns of it from its heartbeat, stops the agent, saves
a checkpoint with its live lease and completes the pause through
/internal/runs/:id/pause. Continuing restores that checkpoint.
- The workflow is stopped only after the pause completes; stopping it
earlier would abort the save. A model request interrupted by the
stop no longer expires the pausing run's lease.
- If the executor does not complete it within two minutes, or stopped,
the heartbeat, the next lease, the coordinator's wait or the
background sweep pause the run anyway.
Runs no executor is working on still pause at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connector tokens (MCP and other agent clients) held by an owner or admin
could replace or revoke the tenant's provider key through
/v1/provider-connections. Creating and revoking now require a human, as
creating environments and registering runners already do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entity carried `[key: string]: unknown`, so a misspelt field compiled and most
records were read as untyped bags. Every stored kind now has an interface in
contracts (workspace, runner task and registration, provider connection,
checkpoint record, resource allocation, integration lease, delivery config) and
the project, run, release and evidence types list all their fields. Entity writes
are generic over the record type, and the project delivery settings no longer
accept a stray target branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Storage: read-only queries use a read-only transaction without the tenant
lock, so event streams and dashboards no longer queue behind writers; lists
filter on indexed project, run and status fields and the run list pages with
limit/before. Dispatchers claim outbox items with SKIP LOCKED and a claim
deadline; delivered items and old idempotency records are pruned hourly.
- Migrations are versioned files recorded with checksums in schema_migrations;
002 adds the claim column and run index and migrates preview-stage runs and
free-text waiting reasons. Run events and usage are append-only for the app.
- Identities: static service tokens reach only their routes (coordinator: state,
wait, repair; deployer: lease, transition, releases); the static verifier
identity is gone; Git credentials go only to the lease holder; internal bodies
are validated; framework and body-parser errors use the API error envelope.
- Quotas: only queued or running runs (or ones with an unsettled model request)
hold token reservations; continuing a run reserves its remaining budget again.
- Recovery: owners can list and reconcile model requests with an unknown outcome,
and requests whose proxy died are marked unknown; definite deployment failures
free the environment, admins can unlock an environment after checking the
target, approvals expire with their release, and production approvals need a
second person. The builder's Docker context is operator configuration.
- MCP: list_projects, absolute console links, request_release resolves the run's
evidence and default environment, and tool changes are audited as the user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verification ran git inside the tree under test, kept no command output and
treated every infrastructure fault as a test failure; repairs went through an
executor lease the coordinator should not hold; and a project without delivery
could never succeed. This reworks the worker execution path and the control-plane
contracts it depends on.
- Verification exports the exact commit to a directory without .git, installs
dependencies (network allowed) and runs the protected commands under
bubblewrap in kata mode or directly in host mode; evidence records exit code,
duration, digest, a redacted output tail and the isolation used. Production
rejects host evidence. A failed installation waits as infrastructure.
- Waiting reasons are an enum with a redacted detail; dispatcher, GitHub and
model-proxy states map onto it, and the console explains each one with a way out.
- Repairs are requested by the coordinator through /internal/runs/:id/repair;
the control plane derives the failure summary from the verifier's evidence and
enforces the repair budget. Continuing after the budget is spent grants one more
round; a new requirement revision starts a fresh budget.
- Execution identities may only move a run within their own stages and only to
running or waiting; success comes from integration evidence (no delivery
configured) or deployment acceptance. The unused preview stage is gone.
- Integration fast-forwards when the target has not moved, merges and re-verifies
otherwise, retries when a push finds the target moved, and turns merge conflicts
into a repair round that merges the current target for the agent to resolve.
- Successful runs that needed a repair leave a project lesson; active lessons are
injected into later prompts, and admins can list, add, disable and delete them.
- Executor progress (messages, commands, file changes, plan updates) is stored as
normalized events; previously agent messages were recorded as the literal word
"output". Provider failures keep the work as a checkpoint and wait as
provider_error instead of failing the run.
- Workers declare WF_SANDBOX_MODE=host|kata (host refused in production),
heartbeat with retries until the lease could have expired, and retry safe
control-plane reads with backoff.
- tests/local-loop.test.ts runs the loop end to end with real Git, the in-process
control plane behind its internal routes and a scripted agent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop the WorkBuddy Cloud executor stub: it always reported
"unverified" and could never run. WorkBuddy remains an MCP client for
submitting wishes. Providers are now codex and codebuddy; an unknown
provider waits with an explicit reason instead of a fake adapter.
- Remove internal routes nobody calls (/internal/releases/:id/begin,
/accept, /failure and /internal/workspaces/:id/provisioned) with
their domain methods, the never-consumed release.ready and
release.rollback outbox events, an unreachable idempotency branch,
dead helpers in runtime/deploy.ts and an unused RunnerBroker
dependency.
- Enable noUnusedLocals in the base and web TypeScript configs; the
runtime package now extends the base config.
- Add tests/tsconfig.json and include it in `npm run typecheck`. This
surfaced tests still calling the deleted begin/accept path (now
exercised through the Runner protocol) and five latent type errors.
- Web: provider capability labels match the API's keys and the wish
form disables unavailable providers.
- Delete the invalid example Runner Job manifest; stop tracking the
generated apps/web/next-env.d.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The meta-evolution machinery (failure clustering meta-tasks, signed
offline evaluation, shadow/canary stages, external release receipts,
evaluator identity and its UI) could never take effect: promotions were
written to the system tenant only, the benchmark/runner/observer it
depended on did not exist, and its statistical gates were effectively
unreachable. It is removed as agreed in docs/requirements.md section 3.
What remains is the part every run actually uses, now explicit:
- packages/evolution becomes packages/agent and keeps only the bundle
schema, content digest and prompt assembly; consumers import it as the
@wishforge/agent workspace package instead of by relative path.
- apps/api/src/domain/agent-bundles.ts: immutable, content-addressed
agent configurations per tenant, with create, activate and rollback
restricted to human owners/admins. A run pins the active version at
submission; later activations never change it.
- /v1/agent-bundles routes replace /v1/evolution*; all /internal
evolution routes, the evaluator service token and the rsi:rollout
script are gone.
- Web: the experiment page becomes an "Agent 配置" page.
- Tests for the deleted modules are removed; control-plane tests cover
version pinning, rollback and authorization.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds prettier 3.9.8 (exact) with a shared config (single quotes,
120 columns, trailing commas), .prettierignore, .editorconfig and the
`format` / `format:check` scripts, then formats all TypeScript,
JavaScript, CSS, JSON and YAML sources.
Purely mechanical: no behaviour change. Typecheck passes, the vitest
suite and the 74 IDE node tests produce the same results as before
(socket-binding tests still cannot run inside this sandbox).
Previously the longest source line was ~3000 characters; reviewing the
following semantic changes now produces readable diffs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Imports the previously untracked working tree as-is so that the review
changes that follow (requirements -> design -> implementation) can be
reviewed as diffs and reverted if needed. No content changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>