8 Commits

Author SHA1 Message Date
eust-w
b201fd04a9 ✨ Wait for people when commits pushed to the target branch broke it
When a run's change passed its checks but failed one once merged onto
a target branch that moved meanwhile, the agent got a repair round for
it, even when the failure came from commits other people had pushed:
it would change their code, and spend rounds and tokens doing so.

The verifier now runs that check, recording no evidence, on the target
branch alone. If the branch passes, combining the two caused the
failure, and the agent repairs it as before. If the branch fails too
while the commit the run started from passes, the commits pushed since
broke the branch: the run waits on the new reason target_broken, uses
no repair round, and has its own verified change as its checkpoint
again. A run that started from a commit already failing the check may
be its fix, and is repaired as before.

Continuing merges the verified change onto the repaired branch and
checks the merge. An integration that continues reuses the change's own
verification under the same policy instead of repeating the checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 18:14:19 +08:00
eust-w
1d75b03430 feat: register executors in one catalog and add Claude Code (FR-D1)
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>
2026-10-19 20:23:05 +08:00
eust-w
223f497624 feat: give Kubernetes sandboxes an egress proxy for installs and a remote image builder
In Kubernetes mode the per-run network policy allowed only DNS, the API,
Temporal and Git, so dependency installs could not reach a registry and image
builds had no builder.

- WF_RUN_INSTALL_PROXY_URL points both sandboxes at an operator's egress proxy
  (pods labelled egress-proxy); the per-run policy admits it and installation
  commands get HTTP(S)_PROXY, also inside bubblewrap, while checks still have
  no network.
- WF_VERIFIER_DOCKER_HOST with a TLS client certificate points the verifier at
  a remote builder daemon (pods labelled image-builder); a separate policy
  lets only the verifier pod reach it, and release deletes that policy too.
  Builds pass DOCKER_HOST, DOCKER_TLS_VERIFY and DOCKER_CERT_PATH, and refuse
  a Docker context and a remote builder together.
- The control namespace's baseline admits sandbox traffic to both components.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 20:05:30 +08:00
eust-w
15e137ff7f feat: isolate tenants in Temporal with per-tenant namespaces and mutual TLS
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>
2026-10-19 19:59:49 +08:00
eust-w
fb0f60ebe0 feat: let the agent ask clarifying questions before implementing (FR-C4)
A first implementation round may end, without changing any files, with a
QUESTIONS: section of up to five questions. The executor then puts the run in
the clarification wait with the questions in its detail, where the console and
MCP show them; answering already creates a new requirement revision that
starts again from planning. Repair rounds cannot ask: they must fix what the
verifier found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:51:16 +08:00
eust-w
b38db08eeb docs: align documentation with the code and write it in Chinese
Operations, development and architecture docs, the reference pages and the
component READMEs were rewritten against the code: every documented variable
exists, and the settings operators need (runtime image, Git service, listen
addresses, Runner targets, single-tenant gateway and provisioner bindings) are
documented.

Gaps the docs used to present as working are now stated as such: IDE
workspaces do not clone the project yet (FR-H2), and in Kubernetes mode
dependency installs and image builds have no network path until an egress
proxy and builder access exist. The Kubernetes README describes what the
provisioner creates, what the Runner needs in a target namespace, and the
cluster acceptance that is still outstanding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 18:01:39 +08:00
eust-w
86649af4d6 docs: rewrite architecture and restructure documentation
- docs/architecture.md replaces system-design.md: component map,
  run state machine with an explicit waiting-reason catalogue, key
  sequences (dispatch, execute/verify/repair, integrate, release,
  IDE launch, lessons), data model, API surface, identity and trust
  model, isolation modes (host for local development, kata for
  production), deployment topology, ADRs, known limitations and a
  requirement-to-test verification matrix.
- docs/development.md: local setup, one-command start, first wish,
  IDE, MCP and the test matrix (integration toggles are explicit).
- docs/operations.md: production prerequisites, explicit deployment
  mode, component configuration, Kubernetes provisioner, tenants and
  quotas, IDE gateway routing and lifecycle, delivery, monitoring,
  backup/restore, incident handling and known risks. Merges the former
  observability, recovery, billing-entitlements and runbook documents.
- Contract documents move to docs/reference/; evidence narratives that
  pointed at machine-local /private/tmp files are removed and the UI
  reference is rewritten for the target console.
- Delete docs for removed scope: workspace snapshot handoff and private
  application access.
- README rewritten as a concise entry point.

The documents describe the target state that the following
implementation commits realise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 13:29:46 +08:00
eust-w
b47a07e8d2 chore: baseline snapshot of the Codex-delivered code before review
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>
2026-10-19 13:18:04 +08:00