8 Commits

Author SHA1 Message Date
eust-w
bf3313620e ✨ Let each wish stay frontend-only, and optimize wishes into short goals with choices
- Each wish says whether it may change backend code. A frontend-only wish is told
  which paths it must leave alone; a change to them goes back before any check runs,
  the platform puts those files back before the repair round, and the control plane
  never integrates them. A wish that may change backend code integrates directly for
  people with backend permission and waits for a code review otherwise.
- Owners and admins grant backend permission per person on the members page as well
  as per project in the project settings.
- AI optimization has its own button for the wish and for the criteria. It writes a
  wish of at most three lines (goal, scope, limits), keeps the details in checkable
  criteria, and asks only what the person must decide, as choices whose answers join
  the wish; suggested criteria are taken one by one.
- Lists, run titles, Feishu cards and pull request titles show a wish's first line;
  the run details show the rest.
- Changed paths no longer follow renames, so moving backend code into a frontend
  directory counts at both places for code review and for the frontend-only scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:37:30 +08:00
eust-w
b5b5c49ec3 🐛 Checkpoint a merge candidate again: its worktree is no agent workspace
Since the Git config of an agent workspace is reduced to an allowlist
before each checkpoint, every checkpoint read `<workspace>/.git/config`.
A merge candidate is a worktree of the integration cache, whose `.git`
is a file, so the read failed with ENOTDIR: whenever the target branch
moved while a run was working, its integration stopped on an
infrastructure wait, and continuing failed the same way. No test merged
onto a moved target without a conflict.

A GitWorkspace now remembers the worktrees it added from a repository
WishForge owns and leaves their config alone; no agent can reach it. A
workspace whose `.git` someone else turned into a pointer file is still
refused rather than followed. Tests merge onto a target that moved
meanwhile, end to end and at the Git contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 18:03:43 +08:00
eust-w
d4ea7c7626 🔒 Reduce an agent workspace's Git config to a safe allowlist before trusted Git commands
The agent's file tools are confined to its workspace, and the
workspace holds .git. It could plant .git/config and .gitattributes
there, and the executor then ran trusted git add, diff, bundle and
merge in that workspace to export the checkpoint and start a repair
round. Git honours repo-local configuration for every command and no
environment variable disables it, so a planted clean or smudge filter,
diff or merge driver, core.fsmonitor or sshCommand, an include, or a
url.insteadOf transport rewrite would run as the worker: in the
development host mode, as the operator, outside any sandbox. The
driver names are the agent's to choose, so -c overrides cannot reach
them.

Before the checkpoint and before mergeTarget, .git/config is now
reduced to core basics, remote, branch and extensions, which is what a
clone needs to fetch, merge and bundle; everything else, the planted
drivers and includes among it, is dropped. It is redone each time,
since a paused run's agent could plant again before it resumes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:08:02 +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
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
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
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