10 Commits

Author SHA1 Message Date
wishforge
5855d5a43c ✨ Render diagnosis cards, tool steps, safe Markdown, and editable Wish drafts
Some checks failed
CI / Format, types and tests (pull_request) Has been cancelled
CI / PostgreSQL migrations and integration tests (pull_request) Has been cancelled
CI / IDE gateway, collaboration and policy tests (pull_request) Has been cancelled
Display structured Copilot diagnoses with verdict badges, server-stamped evidence chips, confidence-tagged hypotheses, missing-evidence callouts, and an explicit handoff path when evidence is insufficient.

Add progressive start/end tool step rows, path-scrubbed Markdown rendering via react-markdown and remark-gfm, typed stream error banners, sticky-threshold auto-scroll, copy actions, Grill-me choice previews, editable Wish drafts, and the accompanying design and operations docs.
2026-11-11 07:59:03 -08:00
eust-w
4e5ab1719c ✨ Enable local Claude delivery to Gitea and POC
Add authenticated LAN access, native Claude execution, checkpoint and budget recovery, and signed POC build/deploy/rollback contracts. Include local service management, regression coverage, and evidence from the completed POC delivery.
2026-10-22 16:21:33 +08:00
eust-w
d7d2cb705d feat: run images from built services instead of transpiling at start-up (FR-K5)
scripts/build-services.mjs compiles the API, its migration runner, the worker,
the Runner and the platform Git service into single ESM files under dist/.
Workspace packages are compiled in, everything else loads from node_modules,
and esbuild applies the transform tsx applied before, so behaviour does not
change. The Temporal workflow bundle is built at the same time and the worker
uses it when present instead of bundling at start-up.

The runtime image builds the services and runs dist/*/main.mjs; the
Kubernetes provisioner starts sandboxes with dist/worker/main.mjs, and
migrations run as node dist/api/migrate.mjs. esbuild is now a declared dev
dependency. A test builds everything and checks that each entry point loads
all its imports and reaches its own configuration checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 20:15:42 +08:00
eust-w
a9411f586b feat: run the whole loop locally with a local provisioner
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>
2026-10-19 15:36:12 +08:00
eust-w
cce214f8fb feat: close the main loop from wish to integrated commit
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>
2026-10-19 15:15:54 +08:00
eust-w
78ed117763 feat: make the deployment mode explicit and fail closed
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>
2026-10-19 14:07:02 +08:00
eust-w
82d35a3708 fix: use one canonical JSON implementation for digests and signatures
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>
2026-10-19 14:04:36 +08:00
eust-w
ba5fe56e88 refactor: replace platform meta-evolution with versioned agent configuration
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>
2026-10-19 13:38:53 +08:00
eust-w
0ef99b1e6d style: add Prettier and EditorConfig, format the codebase
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>
2026-10-19 13:32:43 +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