6 Commits

Author SHA1 Message Date
eust-w
da1cfcea13 🔥 Remove the cloud IDE
The cluster never ran Theia or the IDE gateway, so every workspace stayed
"未配置" forever. The feature is gone instead of half-present:

- API: workspace, launch and lifecycle endpoints, the gateway identity and
  its internal routes, the dispatcher's workspace provisioning and the
  lifecycle worker. Migration 003 deletes stored workspaces and settles
  their pending outbox items.
- Provisioner: workspace provisioning and lifecycle for both backends.
- Web: the 云 IDE panel, the launch route, the start-branch picker that
  listed IDE branches, and the workspace count on usage.
- apps/ide, infra/oct, dev:ide and the CI job; IDE parts of local k3s,
  network policies, RBAC, docs and the architecture diagram.

A wish can still start from a pushed branch through the API (sourceBranch).
Plan files and stored entitlements may still carry maxWorkspaces; it is
accepted and ignored.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-04 12:43:02 +08:00
eust-w
71cc6de5e2 fix: keep the local cluster from filling the Mac's disk
Repeated builds grew the VM's disk to 63 GB, until the Mac's disk was
full. Writes inside the VM then failed and its file systems broke.

- The service image installed dependencies after copying every source
  file, so each source change rebuilt a 750 MB layer, five images at a
  time. It now installs from the workspace manifests first, and a test
  keeps every workspace listed.
- The VM's disk defaults to 40 GiB instead of 80.
- `up` refuses to create the VM when the Mac has less free space than
  that, and `build` refuses below 15 GiB free.
- After building, superseded images are pruned and the build cache is
  capped at 10 GB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 08:03:41 +08:00
eust-w
e89f11b396 feat: run the cloud IDE on the local k3s cluster
The local cluster deploys the IDE gateway, and the provisioner creates a
Theia workspace with an OCT sidecar per project in the tenant namespace.
`build` adds the ide, ide-gateway and oct-workspace images; `web`
forwards the workbench (3100) and the gateway (3101).

- On a local development cluster (WF_ALLOW_INSECURE_HTTP), the
  provisioner accepts the in-cluster HTTP platform Git and the localhost
  gateway for workspaces.
- Builds use a proxy from the host environment, at the address the VM
  sees the host at.
- `web` refuses ports already taken on the host, where kubectl would
  otherwise listen on ::1 only. Its defaults stay clear of the local
  development stack (3000, 4400).
- Pods reading the settings or secrets carry a digest of them, so a
  redeploy with changed settings rolls them.
- The IDE build context leaves out every local node_modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 23:24:04 +08:00
eust-w
1beee7e593 feat: deploy the web workbench on the local k3s cluster
The local cluster runs the workbench next to the API. It is a development
build of the web, from the image's new WEB_BUILD=development argument:
- Next.js inlines NODE_ENV into production builds.
- Development sign-in therefore exists only in development builds, and
  production images never carry it.

`node scripts/k3s-local.mjs web` forwards it to http://localhost:3000. The
web refuses changes from any origin but its WF_PUBLIC_URL, so that address
is set at deploy time (WF_K3S_WEB_PORT). `build` now also takes the images
to rebuild, for example `build web`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:20:27 +08:00
eust-w
27b6e19d6b fix: run a wish end to end on the local k3s cluster
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>
2026-10-20 01:47:33 +08:00
eust-w
975b880ae7 feat: run the whole platform on a local k3s cluster
infra/k8s/local describes a development cluster in a Colima VM: PostgreSQL,
Temporal, the platform Git service, the API (migrating and seeding in init
containers), the coordinator and deployer workers, and the Kubernetes
provisioner with a service-account kubeconfig, a Role in the tenant namespace
and a default-deny policy there. Wishes run in per-run pods under the
provisioner's network policies, and models are reached through the API's
run-scoped proxy and the configured gateway.

scripts/k3s-local.mjs starts the VM and a local registry, builds and pushes the
images by digest, renders the manifest with generated secrets kept in
.wishforge/k3s, stores the gateway key over stdin, and runs a smoke wish. Every
command names the colima-wishforge context, never the current one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 01:00:41 +08:00