Building the web image showed that `next build` failed.
- The console imported runtime values from the contracts entry point.
- Turbopack cannot follow the NodeNext `.js` imports inside that entry,
which also carries zod and every schema into the browser.
- Only `next dev` had ever run before, and the console used to import
types only.
The fix:
- The executor catalog moves to an entry without imports, exported as
@wishforge/contracts/providers. The console takes its values from
there.
- providerBaseUrl moves to its own module.
- A test keeps value imports of the entry point out of the console.
With the console's default budget of 50,000 tokens, every Codex run
stopped after one model request:
- The proxy reserves one token per request byte, and a Codex request is
already about 50 KB.
- The executor then reported a bare 429 as a provider failure.
The fix:
- A request the remaining budget cannot cover now puts the run into the
`budget` wait, with what it needs and what remains.
- The console defaults to 300,000 tokens and explains the reservation.
The run page also marked the stage a successful run ended in as not yet
done; it now shows it as complete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first runs on k3s found these problems; a wish now goes from submission
through the Codex executor, independent verification and integration in
per-run pods.
- Development deployments refused to start because the images set
NODE_ENV=production. The local manifest and the sandbox Jobs now set
NODE_ENV to the deployment mode.
- The model proxy treated x-client-request-id as a per-request idempotency
key. Codex sends its conversation id there, so every second request of a
session failed with 409. Only Idempotency-Key names a single request now.
- Codex's command sandbox (bubblewrap) cannot start in a runc pod. Every
command failed and the agent retried until the budget ran out. The
executor now probes the sandbox before starting Codex. A Kata sandbox that
cannot run it waits as PROVIDER_SANDBOX_UNAVAILABLE. A development (host)
sandbox runs Codex without it, and the timeline records that.
- The prompt asked agents to commit, but Codex keeps .git read-only and the
platform commits the checkpoint itself. Agents now leave their changes
uncommitted, and get the platform's Git identity if they commit anyway. A
resolved merge is recorded even when its tree equals HEAD.
- scripts/k3s-local.mjs:
- excludes the VM and cluster ranges from a host proxy (NO_PROXY);
- uses its own Docker client configuration, so a stale credential
helper does not break builds;
- recovers from an interrupted k3s install;
- reports when Colima switches the current kubectl or Docker context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sandbox Jobs never received WF_DEPLOYMENT_MODE, which every worker requires
before anything else, so each Kubernetes sandbox exited at start. The
provisioner now passes its own mode.
A local development cluster (k3s) has no Kata, no bubblewrap inside runc and no
TLS between services. For it, and only with WF_DEPLOYMENT_MODE=development:
- WF_ALLOW_INSECURE_HTTP=true lets services reach each other over plain HTTP
(Git, the model proxy, the provisioner and IDE gateway targets, the worker's
control-plane client); production refuses the setting outright.
- The provisioner accepts WF_RUN_SANDBOX_MODE=host and WF_KATA_RUNTIME_CLASS=none
and passes the HTTP settings to its sandboxes.
- The development seed is built into the image (dist/api/seed.mjs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model proxy always forwarded to api.openai.com and development runs gave
Codex no base URL or model, so a company model gateway could not be used.
- WF_OPENAI_BASE_URL points the production proxy (and development Codex runs)
at an OpenAI-compatible gateway with the Responses API; WF_ANTHROPIC_BASE_URL
gives Claude Code an Anthropic-compatible one as ANTHROPIC_BASE_URL. Both are
operator settings in the provider catalog, HTTPS without credentials
(loopback HTTP outside production); an invalid gateway disables the proxy.
- Development credentials now carry the run's model, so WF_CODEX_DEFAULT_MODEL
selects a model the gateway serves.
- tests/integration/real-model.test.ts (WF_REAL_MODEL_INTEGRATION=1, key from
WF_TEST_MODEL_API_KEY) runs one wish through the real Codex executor, the
verifier and integration into a local repository.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding an executor touched the contracts, the API's availability check, the
worker and the console separately. Now it is an adapter plus one entry in
@wishforge/contracts' providerCatalog (name, executable variable, whether the
model proxy isolates its credentials) and one in the worker's
providerRegistry; the API, the console's options and MCP's submit_wish read
the catalog, and a test checks every entry is registered with the worker.
The CodeBuddy adapter already parsed Claude-Code-style stream-json, so it is
now a StreamJsonCliAdapter with a dialect per CLI. Claude Code runs headless
with --verbose and --permission-mode bypassPermissions inside the per-run
sandbox and receives only ANTHROPIC_* credentials (WF_CLAUDE_BIN). Like
CodeBuddy it is development-only until the model proxy supports it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Released generations kept their PVCs (and the local backend its run
directories) forever, filling the tenant quota.
- The API's hourly maintenance asks the provisioner to purge the volumes of
every generation of a run once WF_RUN_STORAGE_RETENTION_HOURS (default a
week, 0 keeps them) passed since the release, and records storagePurgedAt.
Checkpoints live in the control plane, so continuing a run never needs them.
- POST /runs/purge deletes the run's PVCs by label (the local backend its
directories) and answers busy while any of the run's pods or processes is
active. The baseline Role gains list and delete on PVCs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sandboxes can reach Temporal, which used to accept any client in one shared
namespace. Now:
- Every Temporal client (API dispatcher, coordinator, deployer, sandboxes) can
present a client certificate (TEMPORAL_TLS_*); production refuses to start
without one.
- TEMPORAL_NAMESPACE_PREFIX gives each tenant its own namespace: the dispatcher
starts and signals a tenant's workflows there, the shared coordinator and
deployer poll every served tenant's namespace with one workflow bundle, and a
sandbox polls only its tenant's. Production refuses to serve several tenants
through one namespace.
- The Kubernetes provisioner mounts the tenant's Temporal client certificate
into executor and verifier pods (WF_RUN_TEMPORAL_TLS_SECRET, required in
production); the local provisioner passes the TLS settings through.
Authorizing certificates per namespace remains Temporal server configuration;
the operations guide describes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People's changes now reach the target branch the same way the agent's do. The
IDE credential carries a ref prefix and the Git service runs a pre-receive hook
on every push that refuses updates outside it, so the IDE can push only
`ide/` branches; the platform's own integration is unaffected.
- A wish may name a source branch. The run starts from that branch's head, the
agent builds on it, and verification, repair rounds, merging onto a moved
target and conflict repair work as before. A missing branch makes the run
wait (git_storage) until it is pushed.
- Release risk is now computed from the target branch before integration, not
from where the run started: a migration committed on the source branch would
otherwise have been missed and could have skipped approval.
- Clones work on `ide/work`; a plain `git push` publishes it.
- The console lists a project's IDE branches with a button to submit a wish
that merges one, and the new-wish form has a starting-point field; MCP
`submit_wish` accepts `sourceBranch`. The Git service lists branches under
a prefix for this (`POST /refs`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While someone has a workspace open, the gateway asks the API for a 15-minute
write token for the project's platform repository on behalf of that person
(membership and role checked each time) and delivers it to the workspace
backend. The backend writes it to a Git config file outside the repository
(a memory volume in Kubernetes) that the clone includes, and on the first
delivery clones the target branch into a folder named after the project. The
workspace cannot mint credentials itself, so access ends with the last
session.
- People commit and push to the target branch like with any Git server; the
platform only accepts fast-forwards, and the next wish starts from that
commit (covered end to end in the local loop test).
- Commits are authored by whoever opened the latest session, from the name and
email in their sign-in; their own git config overrides it.
- Only the gateway can reach the delivery endpoint: it needs Theia's
connection token, and the gateway refuses the path for browsers.
- The provisioner pins the workspace to its repository and lets the pod reach
the Git service; the Kubernetes baseline admits that traffic. External
repositories are not cloned.
- The local shared Theia clones each project into its own folder.
- The Theia image installs Git, and its stage is named theia: the default
build target of that Dockerfile is the gateway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base manifests described a design the code does not have: a Role that only
allowed Jobs, an unused sandbox account, a tool gateway that does not exist and
a deployer bound into the sandbox namespace. They now grant exactly what the
provisioner applies and deletes for runs and IDE workspaces, let sandbox pods
reach the API, Temporal and Git through the control namespace's default deny,
and let the IDE gateway reach workspace pods.
- The API reads the runtime image from WF_RUN_WORKER_IMAGE only, the same name
the provisioner uses; the WF_RUN_IMAGE alias is gone.
- The provisioner takes the public gateway origin from WF_IDE_PUBLIC_URL, which
is what the gateway and API call it, and refuses to start without an explicit
WF_DEPLOYMENT_MODE.
- Environments no longer accept a runnerId that was always rejected.
- The Compose acceptance script uses the current Docker context unless
WF_DOCKER_CONTEXT names one, instead of a hardcoded colima.
- Tests cover waiting reasons and their exits, and the production rejection of
unsandboxed or unstated verification isolation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Runs: a per-file diff of the latest checkpoint, verification evidence with each
command's exit code, duration and output tail (and failed installs), the last
failure that the repair round works on, and the integrated commit when a
project without delivery completes.
- Projects: repository status with a retry for platform repositories, the
project's lessons (list, add a convention, disable, delete) and runs filtered
on the server; IDE texts describe the Git hand-off instead of the removed
save barrier.
- Releases: the approval dialog shows the requirement, project, target
environment (production flagged), verification commands and approval deadline
from a new review endpoint; failed releases say why. Environments locked by a
deployment with an unknown outcome can be unlocked after a confirmation.
- Errors are titled by HTTP status; secondary text and focus rings meet the
contrast requirements; the mobile drawer leaves the tab order when closed and
closes on Esc.
- Sessions: the web BFF refreshes access tokens with the refresh token for up to
12 hours; IDE gateway sessions are renewed while in use (idle timeout 15 min,
at most 12 h) and rechecked by the granted user, so revocation still applies.
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>
Local development had no provisioner, so every wish stopped at "sandbox not
ready", and dev:all started neither the coordinator nor the deployer.
- The provisioner moves from apps/ide to apps/provisioner and gains a backend
switch: `local` starts an executor and a verifier process per run generation
on this host (WF_SANDBOX_MODE=host, own directories and run-scoped tokens,
development mode only) and points workspaces at the local Theia; `kubernetes`
keeps the Kata Jobs, now started with the image entrypoint instead of the npm dev
script and allowed to reach the platform Git service.
- In development the resource grant needs no runtime image digest.
- setup:local is one idempotent script that creates or completes .env.local,
including the deployment mode, provisioner and grant settings.
- dev:all starts Git, API, provisioner, coordinator, deployer and web; dev:ide
starts Theia and the IDE gateway; ide:install and ide:build wrap the separate
Theia package. npm test also runs the provisioner tests.
- Project settings accept the target branch and dependency install commands.
- Web development conveniences require WF_DEPLOYMENT_MODE=development.
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>
- Integration caches are bare clones instead of mirrors. A mirror
remote refuses explicit refspecs, so every push to the target branch
or a GitHub review branch failed. Caches created by earlier versions
are corrected (remote.origin.mirror=false) and the target ref is
force-synchronised from the remote.
- Checkpoints bundle only the commits after their base (base..HEAD)
instead of the full history, so repositories with real history no
longer exceed the inline limit. Restoring clones the project
repository for the base, verifies and applies the bundle, then checks
the tree against the recorded patch. An unchanged workspace produces
no bundle; patches are capped at 4 MiB.
- Git commands get a 10 minute default timeout instead of the generic
120 s, which failed clones and pushes of larger repositories.
- Command output is decoded per stream with StringDecoder, so UTF-8
characters split across chunks are no longer corrupted (this made
executor/verifier patch digests disagree), and output accounting is
incremental instead of quadratic.
- The Git service forwards Content-Encoding to http-backend; gzipped
upload-pack negotiations previously failed with "bad line length".
- API JSON bodies: 16 MB for checkpoint uploads, 2 MB for the model
proxy, 1 MB elsewhere (was 8 MB everywhere, before authentication).
Regression tests push a verified candidate through a fresh and a legacy
mirror cache and restore an incremental checkpoint from its repository.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Security-relevant behaviour (development tokens, loopback HTTP, inline
checkpoints, raw provider keys, optional verification profiles) was
keyed off NODE_ENV === 'production', so any deployment that forgot
NODE_ENV silently ran with development rules.
- @wishforge/contracts exports deploymentMode/isProduction/
requireDeploymentMode. WF_DEPLOYMENT_MODE wins; misspelled values and
development combined with NODE_ENV=production are rejected; NODE_ENV
remains a fallback only for libraries and tests.
- All API, runtime, artifact, Git service and operator-script checks use
isProduction.
- The API, worker, Git service and Runner refuse to start without an
explicit WF_DEPLOYMENT_MODE; the IDE gateway treats anything other
than an explicit development mode as production.
- The development seed loads .env.local before checking the mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The API signed Runner tasks with keys sorted by localeCompare, while the
runner verified with code-unit order; environment keys such as
API_URL/API2 or DB_HOST/DBA sort differently, so valid deployment tasks
were rejected with INVALID_SIGNATURE. A third copy lived in the agent
package.
canonicalJson now lives in @wishforge/contracts (code-unit key order,
undefined properties omitted, non-JSON values rejected) and is used by
the API digest, Runner task signing/verification, the runner's state
digest and agent bundle digests. Binding digests computed by the old
locale-dependent order may differ, so releases requested before this
change must be requested again.
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 IDE carried a second, Theia-internal coordination system: multi-
client save barriers, a hash-chained snapshot store, IndexedDB draft
recovery, transferable debugger-control leases that intercepted
Theia's plugin RPC, Ed25519 actor assertions from the gateway, and an
API gate that blocked every agent integration while any IDE workspace
was open until a human imported a coordinated snapshot. It depended on
Theia internals, made F5 debugging require five environment variables
plus a gateway-signed header, and stalled agent runs. IDE and agents
now hand off through Git commits (docs/architecture.md ADR-7).
- Delete apps/ide/coordination, apps/ide/security, the policy
extension's coordination/draft/DAP-guard/lifecycle-safety modules and
the unused product.json; the policy extension keeps only the managed
extension allow-list and scoped collaboration.
- API: workspace snapshot import/match/check routes are gone. The
project integration lease (one integrating run per project, fenced)
moves to domain/integration-lease.ts and is still enforced on
integrate/build transitions and build evidence.
- Workspace lifecycle: pause/resume no longer requires a save barrier;
automatic sleep needs 30 idle minutes and zero gateway connections,
which the gateway now reports itself. The lifecycle/integration
authorize relays and the gateway's assertion signing are removed;
gateway edit roles match the contract roles.
- Worker: no snapshot matching, workspace-input gate or local lock
file during integration; runtime workspace-snapshot is removed.
- Web: the snapshot import panel is removed from run detail.
- Provisioner workspaces no longer mount coordination state or the
gateway public key; local setup no longer generates gateway keys.
The local Theia build under apps/ide/lib must be rebuilt to pick up the
slimmer policy extension.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Environments defaulted to "private" visibility, which required a
separate per-environment preview gateway, capability tokens, signed
anonymous/authorized probe proofs and API-side proof verification;
without that stack every deployment was blocked. Access control for a
deployed application is now the target environment's responsibility
(docs/requirements.md FR-G6).
- Delete apps/preview-gateway, the API preview controllers/domain
(previews, private-access-verifier) and runtime private-access.
- Environments keep an optional application URL; production releases
still require one plus a fresh access check reported by the Runner.
The URL may never share an origin with the console, API or IDE.
- Release bindings, runner task payloads, deployment evidence and
rollback compatibility no longer carry visibility or private-access
policy digests. PATCH /v1/environments/:id/access becomes
/v1/environments/:id/application-url.
- Web: the delivery launch route is gone; environments configure an
application URL only (the always-rejected "Runner ID" field is
removed); releases and run detail link the live application URL.
- Remove the preview-gateway image target and test:preview script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The invoice/settlement flow produced statements whose every monetary
field was null, behind a review/settle/void ceremony. Model charges are
billed by the provider directly, so the platform only needs to report
measured usage.
- apps/api/src/domain/usage.ts replaces billing.ts: per-month usage
lines, totals, model-measurement coverage and a formula-safe CSV
export. No invoice digest, settlement records or billing entities.
- Routes: GET /v1/usage/lines and /v1/usage/export (owner/admin),
GET /v1/plans; platform-operator actions move to
POST /v1/admin/members and /v1/admin/executions/:id/reconcile.
The operator allow-list is now WF_OPERATOR_SUBJECTS.
- Contracts: UsageLine replaces BillingUsageLine/BillingInvoice; the
billing_event and billing_period entity kinds are removed.
- Web usage page shows limits, occupancy, monthly totals and lines.
- npm script tenant:invite is renamed tenant:create (it provisions a
tenant).
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>