9 Commits

Author SHA1 Message Date
wishforge
b8c3c8e5e9 ✨ Read project code and commit generated pages through the git service
The Copilot needs to look at code, and the Wiki needs to write the pages it
generates. Both go through the git service, which owns the bare repository: the
code view reads the object store (no checkout, no working tree), and a generated
page is committed with the platform as its author.

Paths that hold credentials or operator data are refused in the service, not in
the caller: .env*, *.pem/*.key, kubeconfig, secrets/, local-data/ and .vault-*.
2026-11-09 10:09:39 -08:00
wishforge
147c3e3e18 🔒 Keep the module map out of customer Wiki reads and serve only Markdown pages under wiki/ 2026-11-08 22:46:22 -08:00
wishforge
e1194fbf8b ✨ Serve repository Wiki reads and let a server-held credential answer for the tenant 2026-11-08 22:35:31 -08:00
eust-w
8b77085a5f fix: let Kubernetes sandboxes start, and run on a local development cluster
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>
2026-10-20 00:56:07 +08:00
eust-w
0bcfbc13dd feat(ide): push IDE work to ide/ branches and merge it through a verified wish
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>
2026-10-19 19:17:14 +08:00
eust-w
959f5e2063 fix: make integration pushes, checkpoints and command output work
- 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>
2026-10-19 14:11:38 +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
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