63 Commits

Author SHA1 Message Date
eust-w
13ceca5c8f 🔀 Merge review/overhaul into feat/wiki-copilot-diagnostics
Some checks failed
CI / Format, types and tests (pull_request) Has been cancelled
CI / PostgreSQL migrations and integration tests (pull_request) Has been cancelled
Brings the branch up to the current base (executor settings, project
skills, Chinese run messages, cloud IDE removal, wish attachments) and
resolves the ten conflicted files, keeping both sides:

- wish-refiner: the tenant's executor settings pick the models first,
  then the Copilot model setting; the tenant credential still goes
  before the operator's login
- worker providers: executor settings apply, and a run with its own
  credential still gets an empty home
- main.ts: Copilot screenshot uploads and wish attachments each keep
  their own body limit
- contracts, http, web types: default budget and skill auto-activation,
  Copilot and attachment entity kinds, ./text and ./attachments exports
- globals.css: Copilot styles and attachment styles, one after the other
- tests: the canceled-release reason is Chinese; the refiner's default
  models have no [1m] suffix, as this branch names them

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 00:39:05 +08:00
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
wishforge
22e7eb4ad7 🔧 Pass local auth settings to the production web build and ignore AGENTS.md
Running the local console with WF_WEB_SERVE_MODE=production starts Next.js with NODE_ENV=production, which previously disabled development sign-in even when WF_DEPLOYMENT_MODE=development was explicitly set. Keep the deployment-mode gate explicit, forward the console's auth and API variables from scripts/dev.mjs, narrow the Temporal worker grace-time literal for TypeScript, and ignore local AGENTS.md instructions.
2026-11-11 07:59:03 -08:00
wishforge
c75f429716 🐛 Read the line breaks a model escapes inside its tool call
An answer travels in a submit_answer tool call, and the model writes its
line breaks there as the two characters \n. The console draws exactly what
it is given, so a customer read \n\n where a paragraph break belonged.

The layout escapes are now unfolded once, where model text enters: the
answer, the Wish draft, the quick replies and the excerpts all pass one
door. Answers stored before this change are unfolded as they are drawn, so
the history reads correctly without touching the database.
2026-11-09 20:12:01 -08:00
wishforge
c959b96f54 ✨ Rebuild the Copilot panel as a chat box a customer can use
The panel was a form that submitted a question and printed an answer. It is now
a conversation: a bubble per message, a picture strip, a folded reasoning line,
a progress sentence in the customer's words, and cards that ask for confirmation
instead of repeating the answer.

The input box is the part that was missing. A paperclip opens the file picker,
the whole box accepts a dropped file, and a pasted screenshot becomes an
attachment too; each one shows as a thumbnail with a remove button, and the send
button waits until nothing is still uploading. Enter sends, Shift+Enter breaks
the line, and the box grows to five lines.

The panel also has a page of its own at /copilot, and the docked panel steps
aside there so the same conversation is never rendered twice.

Colour, spacing and radii follow one small set of tokens (teal #0f766e, 12px
cards and bubbles, 8px buttons) so the panel reads as part of the console.
2026-11-09 19:07:55 -08:00
wishforge
5dd2daee35 🐛 Show the answer once, and keep the wish card from repeating it
Two copies of the same words could appear on screen, and both came from the
panel rather than from the model.

The card that asks the customer to confirm a drafted wish fell back to the
answer text whenever the Copilot wrote no separate goal, then printed it under
「要做的改动」 — the answer above the card already said it. The card now shows
that section only when the goal really is a different sentence.

The streamed answer also stayed on screen after it ended, next to the stored
message it had just become. It is now dropped as soon as the transcript holds
the same text, and the stored session is read back before the stream is cleared.
2026-11-09 19:06:16 -08:00
wishforge
3f879c37d3 ✅ Red-team the Copilot, prepare screenshot acceptance, and tidy two names
Ten ways a customer, a page or a log line may try to make the Copilot hand over
what it must not: a key, the connection string, the system prompt, a kubeconfig.
Where a mock model leaks, the platform still refuses; where it obeys an
injected instruction, the prompt already says a document is data, not a command.
The tool layer is tested separately: an environment file is refused even when
the model names it, and logs outside the project's namespaces are refused.

Screenshot acceptance is prepared, not faked: the fixtures directory explains
what to put there, and the test runs only when an operator does, against the
real gateway.

Model names stored with a context suffix are rewritten by a dry-run-by-default
script (the local database currently has no projects), and the console calls
/providers what it is: 模型连接.
2026-11-09 10:09:59 -08:00
wishforge
ec0978acfd ✨ Show the Copilot's answer as it arrives, and confirm a wish on one card
The drawer reads a stream instead of polling every 1.5 s. A thinking block folds
away, a short progress sentence says what is being looked at in the customer's
words, the answer types itself with a cursor, and stopping is a button rather
than closing the drawer.

The wish draft becomes one card: what will change, how it will be checked,
confirm. The two text areas and the eight-character minimum are gone; the card
already holds the Copilot's phrasing, and the customer's job is to say yes.

The drawer is wider (520px) and the composer grows with what is typed: Enter
sends, Shift+Enter breaks the line.
2026-11-09 10:09:53 -08:00
wishforge
aa4915b214 🔧 Offer gateway model names without the [1m] suffix in the project model catalog 2026-11-09 01:23:38 -08:00
wishforge
6c054bcab0 ✨ Optimize every Copilot draft, honor a project budget, and record Wiki gaps 2026-11-08 23:35:21 -08:00
wishforge
0157b2a5ec ⏱️ Fit Copilot model attempts inside one 270 s budget and keep the Wish key stable 2026-11-08 23:27:24 -08:00
wishforge
34e221d880 🔒 Require verbatim Wiki citations and keep code paths out of customer answers 2026-11-08 23:00:20 -08:00
wishforge
4118e30872 ✨ Add the Copilot sidebar, Wiki source page, and browser acceptance script 2026-11-08 22:36:27 -08:00
eust-w
3a2296e9d7 ✨ Support image and file attachments on wishes
Wishes can now carry screenshots, designs, logs and documents: upload,
drag-and-drop, or paste into the goal/criteria boxes. The files are stored
as attachment records, written into the executor's workspace under a
Git-ignored directory, and pointed out to the agent in its prompt. People
fetch them back one at a time (images inline, everything else downloads)
with nosniff and a sandbox CSP.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-09 14:28:07 +08:00
wishforge
bf721b84a7 🎨 Format source files and ignore local acceptance artifacts 2026-11-08 22:23:01 -08:00
eust-w
4e0ac6bdfd 🔀 Merge Chinese run messages
Resolved against the IDE removal and the lessons-to-skills merge; the
pitfall skills, their events and repair notes are written in Chinese too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-04 12:50:03 +08:00
eust-w
3217982f32 🔀 Merge project knowledge
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	apps/web/src/features/projects.tsx
#	apps/web/src/lib/types.ts
#	docs/architecture.md
#	docs/reference/ui.md
#	docs/requirements.md
#	docs/user-manual.md
#	tests/local-loop.test.ts
2026-11-04 12:45:22 +08:00
eust-w
302635254a 🔀 Merge executor settings
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	docs/architecture.md
2026-11-04 12:43:44 +08:00
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
91ab5f91e6 🌐 Write run events, waiting details and agent replies in Chinese
The run page mixed English stage events and agent summaries into the
Chinese console. Messages are now written in Simplified Chinese at their
source (control plane, dispatcher, worker, POC build), keeping commands,
SHAs, branches and error codes verbatim; raw runtime errors get a Chinese
prefix. The agent prompt asks for the plan, summary and questions in
Chinese. File-change parsing accepts old and new messages, and the event
label table covers every event kind written.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-04 12:42:04 +08:00
eust-w
c6d37e3cc3 ✨ Add the 知识库 page for managing project skills across projects
Top-level console entry listing skills of every visible project with
project, status and category filters and search; confirm, edit, enable,
disable, delete, import SKILL.md / zip, copy to another project and
export. The project page shows a summary linking there; project settings
gain the auto-activation switch; docs describe the unified skills.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-04 12:37:36 +08:00
eust-w
4e9e5fb874 ✨ Let tenant admins configure each executor: gateway, models and time limit
A per-tenant, per-executor settings record (GET /executor-settings,
GET/PUT /executor-settings/:provider, owner/admin, idempotent replace) with
baseUrl, defaultModel, smallFastModel, fallbackModel, timeoutMinutes, askModel
and askFallbackModel. Unset fields keep the operator's configuration.

- defaultModel is pinned at submission below the wish and bundle models.
- smallFastModel, fallbackModel and timeoutMinutes travel in the run context
  to the worker; Claude Code gets ANTHROPIC_SMALL_FAST_MODEL /
  ANTHROPIC_DEFAULT_HAIKU_MODEL and --fallback-model, CodeBuddy the limit.
- baseUrl goes only with the tenant's own key, over HTTPS (plain HTTP only
  where plainHttpAllowed), never in production, behind the model proxy or
  with the deployment's native Claude account.
- The wish refiner tries the tenant's ask models first.
- The 执行器 page gets an 执行器设置 dialog, also in native-account mode;
  model fields (and the agent page's) accept gateway names like
  deepseek-flash@latest[1m].

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-04 12:19:02 +08:00
eust-w
ee340d6a8b ✨ Raise default run token limit to 100M and max cap to 500M
Claude Code runs with cache reads count toward token budget and easily
exceeded the former 1M default and 10M cap. The default is now 100M
tokens and the maximum allowed cap is 500M.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-11-03 14:30:23 +08:00
eust-w
59243ac85a 🐛 Give wish optimization more time, and a fallback model
Flash gets 180 s to finish the structured JSON. If it times out or the
JSON does not parse, the same request is tried again with deepseek-pro.
The console proxy waits long enough for both attempts.

Co-Authored-By: Claude Haiku 4.5 (1M context) <noreply@anthropic.com>
2026-11-02 15:30:20 +08:00
eust-w
b672d16277 ✨ Let project settings fetch the gateway's models
The available-models checklist has a "get models" button. The control
plane asks the gateway's /v1/models with its own key and returns names
only, to owners and admins.

Co-Authored-By: Claude Haiku 4.5 (1M context) <noreply@anthropic.com>
2026-11-02 14:28:16 +08:00
eust-w
97ee4467a3 🐛 Let the console import the model catalog without the contracts entry
The settings checklist pulled values from the contracts barrel, which
Turbopack cannot follow. The catalog now lives in its own entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-11-02 12:21:26 +08:00
eust-w
b1f94302d7 ✨ Offer project models as a checklist, and default wishes to flash
Owners pick from deepseek-flash and deepseek-pro instead of typing names.
A wish uses flash when the project offers it, even if pro was listed first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-11-02 12:10:38 +08:00
eust-w
4cffd71be8 ✨ Learn project skills from runs, and export a wish's report
- Skills: per-project know-how the platform proposes from each succeeded
  run (in the background, or on request from a run), people confirm,
  edit, disable, delete or write; active ones enter later prompts
- Export one skill as SKILL.md, or all as a zip with a directory per
  skill, as .claude/skills/ expects
- A wish's report: every run, its stage timeline, the agent's plan,
  replies, commands, changed files and model usage, the change, the
  checks, failures, reviews and releases, and the full event log, as
  Markdown, or laid out for printing to PDF

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 03:57:24 +08:00
eust-w
6d615c0ffd ⚖️ Count cache reads a tenth toward budgets, and allow runs up to 10M tokens
- countedTokens: input, output and cache creation in full, cache reads a
  tenth, as they cost; the worker meters Claude CLI usage with it and the
  usage event says how much counted
- A run's token budget may be raised to 10,000,000

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 03:26:27 +08:00
eust-w
72085cf752 ✨ Let a project offer models and a wish choose one
- Projects list the models their wishes may run with, the first by
  default; owners and admins set them in the project settings
- A wish may choose one of its project's models; the choice is checked
  and pinned to the run, which shows it, and the executor starts the
  agent with it (--model), else with the agent configuration's
- Model names may be spelled as the model gateway does
  (deepseek-pro@latest[1m]), in projects and agent configurations alike

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 03:08:35 +08:00
eust-w
aa151d16f9 ✨ Deliver to Fanyu's cluster from the dev branch beside the POC
- Profiles pin each environment: POC (branch poc) and Fanyu (branch dev,
  180.76.138.88, droboticflow-fanyu), with their Deployments by UID
- Releases expect every Deployment of their profile; Fanyu's api image
  also runs its annotation processor and validator, each rolled back to
  its own image
- Bindings may list several projects; each Runner has its own settings
- fanyu-access: least-privilege identity and build-Pod admission policy in
  Fanyu's cluster, its token only in the executor and Fanyu's Runner
- projects --replace: delete every project with all it holds, then create
  the POC and Fanyu projects, their environments and Runners
- Ship the Runner's public keys in the ConfigMap, not a Mac path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:47:47 +08:00
eust-w
c5a6c6160d 🚀 Deploy WishForge to the POC cluster, with check Pods and daily backups
- cluster-poc.mjs: image (in-cluster Kaniko), bootstrap, secrets, apply,
  migrate --rehearsal|--final, public HTTPS entry, backup and restore
- One restricted Pod (platform, executor, Runner, PostgreSQL, Temporal,
  MinIO, Caddy, backup) listening only on loopback except Caddy
- Protected checks run in per-workspace check Pods; cancellation during
  start-up now always removes them
- Daily snapshots on the node (consistent dump with row counts, Temporal
  online backup), copied to the Mac by launchd with SHA-256 checks and a
  notification on failure; restore verified on the rehearsal copy
- Downloads and uploads survive the Mac's lossy link to the cluster
- Local public entry, evidence isolation labels, acceptance records

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:27:07 +08:00
eust-w
addf330b10 ✨ Add account types and enforce per-user wish permissions
- Provide six account types and custom combinations of wish, code review,
  release and management permissions, applied on each authenticated request.
- Enforce frontend-only accounts when submitting, answering, widening and
  reverting wishes; require every contributor to have full access before
  skipping backend code review.
- Gate code review and release decisions by their specific permissions.
- Rework member management to create and edit account types, permissions and
  project access, and reflect those permissions throughout the console.
- Update the manual and architecture docs with permission tests and
  end-to-end coverage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-10-28 12:07:08 +08:00
eust-w
17553e2f8f ✨ Let a person widen a frontend-only wish to backend code
When the agent of a frontend-only wish asks to change backend code, or keeps
changing it until the repair rounds run out, the run details offer "改为前端和
后端并继续". It answers the wish with allowBackend: the run may change backend
code from the new requirement revision on, the agent reads that the scope
changed, and the timeline records who widened it. Whether a backend change needs
a review still depends on the submitter's backend permission. Only an answer to
a frontend-only wish accepts the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:19:08 +08:00
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
a4eaefc69f ✨ Hold reviewed paths, take back runs, optimize wishes and notify in Feishu
What the pilot asked for, from its meeting:

- Code review: a project names the paths changes to which a person reviews
  before they reach the target branch (globs, with exceptions). After the
  checks pass, the verifier asks the control plane, and the run waits at
  integration until an owner or admin approves the exact commit; approving
  integrates it without repeating the checks, rejecting hands the comment to
  the agent as a new requirement. Continuing cannot get around it: the
  verifier asks again before every integration.
- Undo: "take back this change" starts a run that reverses what a run
  integrated on the current target branch, three-way, keeping later commits;
  only lines later commits changed too go to the agent. It then verifies,
  integrates and delivers like any run. Releases get a rollback button for the
  version live in their environment.
- Wish optimization: the local Claude account rewrites a draft wish and its
  acceptance criteria by built-in and project rules, with no tools at all;
  the person compares and decides, nothing is submitted for them.
- Release confirmation: an environment can make every release wait for a
  person, not only those the risk rules flag.
- Feishu notifications: a group bot is told of releases awaiting approval and
  changes awaiting review (mentioning the decision makers), runs that need a
  person, finished runs and failed releases; each once, signed when a secret
  is set, with text from runs never acting as card markup.
- Reviewers see the agent's change summary and who submitted the wish, and
  whether the checks ran in the macOS sandbox; the wish form offers only the
  executors this deployment can run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:08:27 +08:00
eust-w
e8f99f4b24 👥 Let each person sign in with an account of their own
Everyone used the one local administrator, so the system could not tell who
asked for a change, and anyone could approve anything. Owners and admins now
create accounts on a members page: a login name, a display name and a role,
with a password shown once. The control plane keeps only its scrypt hash, and
account creation is deliberately not replayable by idempotency key, so the
password is stored nowhere a replay could return it.

The console checks a password through a control plane route its proxy never
forwards from a browser, then calls the control plane with its local
credential plus the person's account and password version; those headers
count only together with that credential. Disabling an account stops it at
once, and resetting a password ends its existing sessions. A session that is
neither the administrator nor a valid account gets no credential at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:08:14 +08:00
eust-w
40a20f5dfb 🌐 Name timeline events in Chinese
The run timeline showed raw event kinds such as provider.file_change. Each
kind now has a Chinese label, with the raw kind kept in its tooltip; a kind
the console does not know is shown as it came.

The executor event kinds move to the import-free providers entry, so the
console's test can check that every kind has a label without pulling the
contracts entry into the browser bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:07:20 +08:00
eust-w
862a133f36 🌐 Name the reasons a release waits for approval in Chinese
The release page listed why a release needs approval as the control
plane wrote it, in English, while everything around it is Chinese, and
approving is the one decision there that a person has to make.

The reasons now live in the contracts package, in a module that imports
nothing, as the provider list does: the control plane gives them and the
console names each in Chinese, a protected change with its path. A
reason the console has no name for fails its type check; one it does
not know at all is shown as it came.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:32:08 +08:00
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
d0402589f4 🔒 Close DNS rebinding into the local web console and Theia
- In development sign-in the web proxy attached the development token
  to every request, and reads carry no Origin check: a page that
  rebinds its own domain to 127.0.0.1 could read the API as the
  development user. The token now goes only to requests whose Host is
  this machine or the configured public URL.
- Without THEIA_HOSTS, Theia only checks that a WebSocket's Origin
  matches its Host, which such a page satisfies, terminals included.
  The local IDE now allows only the address the gateway uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 22:22:11 +08:00
eust-w
87e01adb36 🔒 Space out local sign-in checks instead of locking out, and keep the dev server off the LAN
- Eight wrong passwords from anywhere on the network locked the only
  local administrator out for fifteen minutes, again and again. The
  password is 256 random bits, so the limit only has to bound the
  scrypt work: after eight failures, checks are spaced two seconds
  apart, globally, and a burst cannot run them at once.
- The launcher let the Next.js development server listen on the LAN,
  handing every visitor its source maps and hot-reload channel. Only
  the production build may now listen beyond loopback. A listener
  bound to one address is also checked for readiness there, and the
  banner shows the configured port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:33:30 +08:00
eust-w
30369c1430 ✨ Save the agent's work before a run pauses
Pausing revoked the executor at once: the agent was killed and the work
of the current attempt stayed only in the executor's local workspace,
so continuing started that attempt over.

A pause of a run whose executor holds the lease now drains it first:

- The run keeps `running` with pauseRequestedAt (the console shows
  pausing). Its agent gets no model credential and no new model
  request; continuing is refused until the pause completes; cancelling
  still stops it at once.
- The executor learns of it from its heartbeat, stops the agent, saves
  a checkpoint with its live lease and completes the pause through
  /internal/runs/:id/pause. Continuing restores that checkpoint.
- The workflow is stopped only after the pause completes; stopping it
  earlier would abort the save. A model request interrupted by the
  stop no longer expires the pausing run's lease.
- If the executor does not complete it within two minutes, or stopped,
  the heartbeat, the next lease, the coordinator's wait or the
  background sweep pause the run anyway.

Runs no executor is working on still pause at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:38:06 +08:00
eust-w
9b2c8f14a9 🐛 Repair installations the agent's manifest changes broke instead of waiting
Every failed installation waited as an infrastructure fault. When the
agent's own change broke it (a misspelled package, say), continuing
installed the same manifests before the agent ran, failed again, and
the agent never got a turn: the run could not move without a new
requirement revision.

- The verifier attributes a failed installation to the checkpoint when
  it changed dependency manifests (package.json, go.mod, lockfiles and
  the like) and the output is not a network or registry failure. The
  evidence lists those manifests, and the control plane records an
  `install` failure that the next repair round fixes.
- A repair round for an `install` failure starts the agent even when
  the installation fails again, with that output in the prompt.
- Prompts, lessons and the run page name the failed installation.

Any other failed installation still waits for the environment, without
spending a repair round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:32:16 +08:00
eust-w
24c8b8b6b8 🐛 Wait for local services to stop before rebuilding
Reproduce and fix the launchd SIGTERMed shutdown race; wait for owned processes to exit and report timeouts. Describe local task workspaces without claiming OS isolation.
2026-10-25 03:33:47 +08:00
eust-w
6fc7eaf00c ✨ Improve local WishForge reliability and LAN access
Detect actual service and Runner readiness, restore LAN access after network changes, protect production web builds with rollback, honor cancellation during executor startup, and show truthful cached-data and credential states.
2026-10-25 03:29:51 +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
ed20bf640e fix: keep IDE collaboration sign-in alive, and label branch-run diffs
- OCT holds each login poll open for 30 seconds before answering. The
  gateway gave every upstream 30 seconds of silence, so creating a
  collaboration session failed with "Workspace upstream unavailable" once
  sign-in took that long, and raced at best.
- Collaboration requests now get at least 65 seconds; other upstreams
  keep 30 (upstreamTimeoutMs).
- A run that starts from a branch shows its checkpoint relative to that
  branch, so the branch's own commits, which merge too, are not in the
  diff. The run page now says so instead of "relative to the target
  branch".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 23:24:04 +08:00
eust-w
b4ece6057c fix: let the console build, and stop runs that cannot afford the next model request
Building the web image showed that `next build` failed.
- The console imported runtime values from the contracts entry point.
- Turbopack cannot follow the NodeNext `.js` imports inside that entry,
  which also carries zod and every schema into the browser.
- Only `next dev` had ever run before, and the console used to import
  types only.

The fix:
- The executor catalog moves to an entry without imports, exported as
  @wishforge/contracts/providers. The console takes its values from
  there.
- providerBaseUrl moves to its own module.
- A test keeps value imports of the entry point out of the console.

With the console's default budget of 50,000 tokens, every Codex run
stopped after one model request:
- The proxy reserves one token per request byte, and a Codex request is
  already about 50 KB.
- The executor then reported a bare 429 as a provider failure.

The fix:
- A request the remaining budget cannot cover now puts the run into the
  `budget` wait, with what it needs and what remains.
- The console defaults to 300,000 tokens and explains the reservation.

The run page also marked the stage a successful run ended in as not yet
done; it now shows it as complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:20:27 +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