Skip to content

feat(workbench): loochat — Calli workbench as LoopX's conversation layer, with Goal conversations - #8843

Merged
maxliux5 merged 115 commits into
loopx-project:mainfrom
maxliux5:codex/loochat-workbench
Nov 18, 2026
Merged

maxliux5 merged 115 commits into
loopx-project:mainfrom
maxliux5:codex/loochat-workbench

Conversation

@maxliux5

@maxliux5 maxliux5 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

Moves the Calli workbench (TypeScript daemon + web, MIT, upstream maxliux5/calli @ c26e45f) into apps/workbench/ as loochat, the conversation layer for LoopX, and wires LoopX Goals into it. Goals keep running on the LoopX core; loochat starts and shows them. The existing dashboard and the Python chat server stay in place — this PR adds the workbench next to them.

Scope is deliberately frozen to what has been migrated and stabilized; the remaining dashboard surfaces move in later PRs.

Delivered

  • Import + rename — independent npm workspace (@loopx/loochat, @loopx/loochat-web), LOOCHAT_* env, product name LoopX, LoopX icons. The rename is its own commit.
  • Ordinary conversations — unchanged from Calli: project directory, agent, three approval modes, approval cards, worktrees.
  • LoopX Goal conversations (adapters/loopx/) — the composer's LoopX mark turns a draft into a Goal; preview → confirm → goal.create; the Goal's name, state, to-dos and who wakes it sit at the top of the conversation's side panel; Goal permissions stay LoopX's (read-only, or workspace-auto for codex only, enforced per turn); a Goal with no conversation on this machine asks for a directory before joining.
  • Core change — goal.create accepts open_session: false so a caller that owns its conversation layer opens the thread itself.
  • Core proxy — /api/loopx/* forwards to the Python core so phones and non-loopback clients work.
  • Goal pages — sidebar Goals, Goal work page (overview with per-task rows, Tasks board/list, Conversations, Files, Acceptance), stop/resume/delete through typed actions with confirmation.
  • LoopX steward — chat-first page in place of Calli's assistant (Calli's assistant/plans UI is not shipped); needs-you / in-progress / brief behind header buttons.
  • Notifications, bell red dot, ⌘K palette; Calli session board kept in the sidebar.
  • Appearance — Codex palette (default) and Claude palette added beside the existing ones.
  • Local conversations, imported by default — every conversation the agents on this machine can read back (Codex CLI and Codex app, Claude Code, TRAE CLI, pi) is listed in the sidebar; history loads when one is opened and the reply continues the same native session. Settings › General can turn this off (LoopX conversations only).
  • LoopX conversations recognised and bound — first from the core's external-session bindings (new read-only GET /api/attached-sessions), then from a heartbeat bootstrap in the conversation. A Goal that exists is bound read-only unless the core granted more; one that was deleted is listed and marked, not bound. A black crab button in the sidebar shows only LoopX conversations; their second line reads Goal · source · time in grey.
  • Login links — Workbench issues temporary link tokens (7 days by default, revocable; stored hashed); scripts/workbench.sh start prints the full link and token prints the permanent one. After signing in by link, the sidebar keeps a notice with the expiry date (warning colour on the last day) that opens Settings › Access, where the permanent LOOCHAT_TOKEN replaces it. An expired or revoked link returns to the login page saying which.
  • Goals in the sidebar and All Goals — at most five (pinned, then needs-you, then recent), collapsible, with an All Goals page grouped by state, searchable and filterable.
  • Goal workspaces are granted like the dashboard: one --scan-path per project (LOOPX_GOAL_WORKSPACES).

Visual evidence

Synthetic demo data only (acme-notes, release-tools, scripted agent replies), light Codex palette, packaged native build with the real core: no adapter, fixture names or DOM edits. The screens that showed Goal names (01–13 desktop, 07 mobile) were retaken at e2012522d: Goal names now come from the registry, and the stopped release-tools Goal is no longer struck through (only the deleted "Old cleanup pass" demo Goal is). The remaining mobile screens and 14 are from 2b4cc9b88; nothing they show changed since.

Desktop 1280 Mobile 390
New thread
LoopX Goal launch
Goal thread + bar
Goal overview
Steward
Session board
Sidebar LoopX filter
Imported session panel (stopped Goal, no strike-through)
Create Goal dialog
All Goals
Steward menus
Steward brief
Link login notice
Palettes

Validation (head 3f1da701f)

  • Packaged Goal journey against a real Core (npm run test:loopx -w @calli/e2e in apps/workbench): Goal created via Workbench launch preview/apply, first turn result, second turn cancelled mid-tool, daemon restarted on the same data dir, retry completes, and both Core (registry/status) and Workbench (binding, history, /api/loopx/goal) read back the same Goal and session after another restart. Only the model backend is a fake. 3/3 consecutive passes; suite 11 passed.
  • After merging latest main: top-level module budget plus PR-touched Core tests 76 passed.

Validation (head e2012522d)

Review round on e1087d903 (each thread answered with its commit):

  • Launch first message: ACP sessions record prompt_sent after native preparation, immediately before session/prompt (f06eb4e39).
  • Steward: a delayed history read can no longer replace the next turn (9f9681d4e).
  • Composer: a finished send clears only its own conversation's draft (0f3036279), keeping its identity when a new conversation is created (0a2bd730d).
  • Goal page: read failures show an error with a working Retry (05a3dc4fc).
  • Daemon: schedule history keeps active runs (4ab00daa9); proactive reverts publish only a complete batch (58a6c1cce); usage scans carry line state (0eeccb374); cron follows timezone date boundaries across DST (ee783cb86); Codex add/delete keeps full content (edb137140); TOML strings are escape-aware (eaba24e3c); MCP/pi survive stdin EPIPE (f55731664).
  • Web: renaming a schedule keeps custom cron (d46f9f828); editing an MCP note keeps its argument array (e35c75686).
  • Goal UI: cancelling Goal confirmation keeps the draft without a "not sent" error (3eaf1bd2a); a stopped registered Goal is not marked deleted (88a3503d3).
  • E2E sync (e2012522d): the activity test waits for the refreshed count; the deep-link fixture waits for the handover check and asserts its turn was accepted.

Results on this round:

  • Full e2e on 0a2bd730d: 402 tests, 397 pass, 3 skipped, 2 failed (activity, thread-link); both were test synchronisation gaps, fixed in e2012522d (activity 10 serial runs 30/30; thread-link serial and with neighbouring specs). The full suite has not been re-run as a whole on e2012522d.
  • web 577/577; daemon 1391: 1389 pass, 1 skipped, 1 known Git traversal failure; typecheck passes.

Earlier rounds:

Changes since 909cf50a8:

  • E2E suite brought back (beaba0447 product fixes, e88d30496 test sync):
    • Product fixes:
      • a success body cut off by navigation is a failed read;
      • Goal menu controls for agents without a live card;
      • Escape no longer swallowed by the docked overview;
      • the overview no longer shrinks on refresh;
      • the message-edit caret race;
      • Mermaid color-mix colours;
      • Files panel width;
      • Claude gateway display names;
      • LOOCHAT_* names in scripts;
      • dense menu spacing (thread menu height budget unchanged).
    • Suites for surfaces this distribution does not ship (desk, plans, assistant, pet, standalone import page) are skipped by name. The harness points LoopX at an unreachable core by default.
  • Goal names (c1582852c): the Goal channel projection takes the registry display name first, so imported conversations and the Goal panel show names instead of UUIDs; a rename reads back. The new test fails on the old projection (4 of 9).
  • Review round on c1582852c:
    • First message (e1087d903): it counts as delivered only on agent output or a normal turn end. prompt_sent followed by an interrupt is reported as delivery: "uncertain": the text is kept and not resent, and the interrupted turn is visible in the conversation. pi keeps emitting its own prompt_sent after its image check (reportsPromptSent).
    • Steward (934665e53, e1087d903): stream events are folded into the turn ref synchronously, and a steward first shown while the core was down opens its conversation once the core is back, and only once.

Results:

  • Full e2e on e88d30496: 392 tests, 385 pass, 3 skipped, 4 failed. Two of those were timing failures under load that passed when run serially (activity list, work autopage). The other two were caused by changes in this round and are fixed in 934665e53 (pi prompt_sent order, steward ref race); turn-startup and steward-recovery pass. The full e2e suite has not been re-run on e1087d903 yet.
  • web 570/570; daemon launch/proxy/loopx tests 21/21; Python test_goal_channel_display_name.py and the related goal channel tests 85 passed.

Validation (head 909cf50a8)

  • Merged latest main again (16 commits; loopx/chat_server.py auto-merged).
  • Review round on 2f8542a30, all four findings fixed, each with a regression that fails on the previous code:
    • P1 first-turn recovery: runTurn writes turn.phase(prompt_sent) just before session.prompt for every adapter. A launch counts its first message as delivered only on that phase or on agent output. A turn still open is left alone; one that ended before delivery (including a restart during session_start) is sent again. Covered in loopx-launch.test.ts; api.test.ts checks the real ThreadManager persists prompt_sent after session_ready and before any output.
    • Core proxy: hop-by-hop headers (including Transfer-Encoding) are dropped both ways; a chunked request reaches the core as plain bytes with Content-Length (raw-socket test).
    • Steward: after a dropped event stream or a failed history read, the next message is really sent, and the streamed answer is kept (e2e/test/steward-recovery.spec.mjs).
    • Core: goal.create refuses open_session=false with start_execution=true instead of dropping the execution request (tests/test_chat_goal_workspace_selection.py).
  • web 566/566. Daemon 1367 of 1373 pass with concurrency 2. The 5 failures are 4 host-environment tests (Claude gateway ×2, Ferry, Git traversal) plus one agy event-order assertion that expected two phases, which was then updated for prompt_sent and passes on its own. Python: test_chat_goal_workspace_selection.py and test_thread_agent_binding.py 61 passed after the merge.
  • Not run: a hard kill inside a real adapter start, and the full Workbench → ChatHTTPServer chunked round trip.

Validation (head 2f8542a30)

  • Merged latest main (no overlap with apps/workbench). Workbench code is identical to 2b4cc9b88.
  • Review P1 (restart between a durable turn.started and model dispatch): confirming again now resends the first message when every earlier turn ended interrupted without producing anything; a turn that the agent had begun answering, or one still open, is not resent. The binding keeps the message until a later confirmation finds a turn that reached the agent. Covered in daemon/test/loopx-launch.test.ts (resend after an interrupted empty turn, then no third send; no resend after partial output; earlier concurrent and already-sent cases unchanged).
  • Since 8dc9103f9: the Goal dialog offers agent, permission and directory; Codex is the neutral palette and Claude the warm one; the steward's buttons sit in the topbar with menus whose headings open All Goals filtered to that group; Chinese text calls a conversation 对话 everywhere (UI, daemon errors, extension manifests, coordination prompts).
  • web 566/566; daemon 1366 of 1371 pass, with the same 4 host-environment failures as before; build clean.
  • e2e spot check after the wording change: rename-stream, sidebar-merged-hosts pass. Failing, but none of the errors involves the wording: todos (looks for the 计划 entry, which is not shipped), thread-menu (the menu now lists Git), search (fixture reports "a turn is already running"), settings-navigation (.settings-related not shown). These four were not re-run on the pre-change head, so it is not confirmed that they failed before the change.

Validation (head 8dc9103f9)

  • web: typecheck clean, 566/566, build clean. Daemon: 1363 of 1368 pass; the 4 failures are host-environment tests (Claude gateway ×2, local Ferry models, Git traversal). Core: tests/test_thread_agent_binding.py covers the new read-only listing.
  • Launch fixes: concurrent confirmations of one proposal open one thread and send one first message; a first message that already went out is not resent after a restart; an agents.json naming a retired adapter starts with the entry kept.
  • Import and binding exercised against an isolated core and CODEX_HOME with four kinds of conversation (core-bound, heartbeat text only, deleted Goal, ordinary): auto-import, binding, crab filter, panel group, continuing the same native session, rescans without duplicates. Login links exercised on an isolated instance: login, address-bar scrub, last-day warning, expiry, revocation, replacing with the permanent token.
  • Dependency review: @hono/node-server, hono, fast-uri, ip-address and (via mermaid 12.3.0) KaTeX locked to patched versions.

Earlier (head e9368cc83):

  • apps/workbench web: typecheck clean, 558/558. Daemon suite earlier 1384/1389 — the failures are host-environment discovery tests (Claude gateway, local model reads, Doubao launcher).
  • tests/test_chat_goal_workspace_selection.py: 22 passed (start_execution from Keep confirmed Goal creation attached to its original Task #8805 and open_session coexist; their interaction has no dedicated test yet).
  • Exercised in a browser against a real core, desktop and 390px: ordinary codex/Claude Code turns, approval allow/reject, worktree, Goal launch with both agents, workspace-auto boundary, read-only refusal, core-down notice, steward streaming and stop, Goal lifecycle, acceptance check pass/fail, files tab. Write paths were exercised against isolated cores, not a user registry.
  • Dependency review: transitive dompurify and body-parser locked to patched versions.

Known gaps

  • Task actions (complete / claim) and the cross-Goal task board are not in this PR.
  • Deleting a Goal leaves its run history visible as a legacy-runtime row in status; the UI filters it, the core-side rule is undecided.
  • Python chat server stays resident for the steward and core HTTP surface; replacing the Python ordinary-conversation path is a follow-up.
  • Dark variants of the Codex and Claude palettes are derived, not measured.
  • Screenshots above predate the palette swap, the topbar steward menus and the 对话 wording; a refreshed set is held until the Goal-name fix is captured.

🤖 Generated with Claude Code

maxliux5 and others added 30 commits November 16, 2026 05:07
Verbatim copy of remote-agent-hub c26e45f: packages/daemon, web,
extension-api, ext-autotitle, ext-board, ext-memory, ext-voice, ext-loopx,
plus skills/ and scripts/ the daemon references. Own npm workspace, own
lockfile; nothing at the LoopX root is touched.

Changes needed to build and run here (the only edits to the copied code):
- package.json: renamed @loopx/workbench; dropped the site/e2e packages
  (not imported) and the scripts that pointed at them; test/typecheck lists
  trimmed to the packages that are present; added "start".
- scripts/demo.sh removed (Calli demo helper, unused).
- scripts/workbench.sh added: starts the daemon (which serves web/dist)
  with its own CALLI_DATA_DIR, port 8796 (previews 8797), token file and
  unix socket under WORKBENCH_STATE_DIR, bound to 0.0.0.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…launch isolation

Findings from running the step-1 acceptance in a real browser against
the isolated hub on :8796:

- Restore packages/e2e verbatim from c26e45f (172 files), plus the root
  .env.example and install.sh it needs. The import had dropped the e2e
  package but left scripts/init.sh pointing at it, so the repo's own
  first-run smoke (AGENTS.md) could not run. "test" gets its e2e runner
  leg back; "test:e2e" restored. All 18 runner tests pass, install
  specs included.
- jsonrpc: a dead agent's stdin breaks before its 'exit' event is
  delivered, so AcpSession.cancel's notify hit an unhandled EPIPE and
  crashed the whole hub (seen live when a claude ACP process died
  mid-turn). The peer now treats a stdin write error as the peer
  closing; regression test in jsonrpc.test.ts.
- workbench.sh: sanitize an enclosing Calli session's env before
  starting the daemon. Inherited CALLI_WEB_DIR made :8796 serve the
  user's remote-agent-hub web build instead of this checkout's, and
  CALLI_* socket vars leaked the user's hub wiring into the isolated
  process. Also drop the duplicated CALLI_WORKDIRS entry: /home/<user>
  is a symlink to /data00/home/<user>, so both roots listed the same
  directory twice in the picker.

Verified in the browser (desktop 1400x900 + mobile 390x844): codex and
Claude Code turns sent; all three permission tiers; approval cards
clicked on both form factors; a worktree thread ran on its own branch.
npm run typecheck && npm test && npm run build pass (3 pre-existing
claude-gateway tests fail on this machine's live gateway model list,
unrelated and untouched).

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
The Calli daemon ported into LoopX becomes loochat, LoopX's chat
service, and everything users can see carries the LoopX brand
(naming decisions in calli-loopx-rfc/workbench-brief.md).

Internal names — loochat:
- packages: @calli/daemon -> @loopx/loochat, @calli/web ->
  @loopx/loochat-web. The extension packages (@calli/extension-api,
  @calli/ext-*) and @calli/e2e keep their names; renaming them was not
  in the decided scope.
- executable: packages/daemon/bin/calli -> bin/loochat (CLI help,
  protocol prose and $LOOCHAT_BIN_DIR/loochat paths with it); the limi
  symlink now points at loochat.
- environment: every CALLI_* becomes LOOCHAT_* across daemon, web, e2e,
  scripts, skills and .env.example. adoptLegacyEnv and bin/legacy-env.mjs
  accept the RAH_*, LIMI_* and now also CALLI_* generations.
- data directories: ~/.calli -> ~/.loopx/loochat (homeDirectory falls
  back to ~/.calli, then ~/.limi), the private socket lives under
  ~/.local/state/loochat with the calli and remote-agent-hub places kept
  as legacy fallbacks, and ~/.config/calli -> ~/.config/loochat.
- also renamed for coherence: git trailer Calli-Proactive ->
  LooChat-Proactive, worktree branch prefix calli/<id> -> loochat/<id>,
  <calli-tools> protocol tag -> <loochat-tools>, x-calli-voice-owner
  header -> x-loochat-voice-owner (x-rah- stays as legacy), doubao
  runtime calliReadModels/calli_models -> loochat*, preview-picker and
  panel history markers, coordination socket calli.sock -> loochat.sock,
  skills/calli-ask + skills/calli-tools -> skills/loochat-*.

User-visible brand — LoopX:
- app.name, empty states, hosts/push/extensions copy, Feishu replies,
  agent-facing matter prompts: every visible "Calli"/"LooChat" is now
  LoopX (zh/en/ja, site included). Technical references (loochat CLI,
  ~/.config/loochat paths) keep the internal name.
- icons: the crab-holding-two-o's mark from calli-loopx-rfc/loo-brand
  replaces every icon surface. Sidebar logo is theme-aware (paper tile
  on light, dark tile on dark, CSS-switched); favicon.svg carries both
  variants behind prefers-color-scheme; favicon-32.png,
  apple-touch-icon.png and the 1024 PWA icon are re-rasterized from the
  SVG. PWA manifest name/short_name/description say LoopX.
- the loo-wordmark tiles were not pasted over the sidebar text: the
  brand lockup stays icon + localized name text, which the wordmark
  image would break.

Deliberately kept: localStorage namespace calli.* (renaming it would
orphan saved browser state; invisible to users), @calli/ext-* package
names, install.sh's default clone URL (still the Calli upstream this
was imported from), thread-links test fixtures, and the limi legacy
alias.

The isolated dev instance keeps its own data dir
(/data00/.../.workbench-state) and port 8796; workbench.sh now also
unsets the CALLI_*/RAH_*/LIMI_* twins of everything it sanitizes,
because the daemon's legacy env adoption would otherwise resurrect an
enclosing session's CALLI_WEB_DIR as LOOCHAT_WEB_DIR (observed live:
8796 briefly served the user's remote-agent-hub web build).

Full typecheck + test + build pass (3 pre-existing claude-gateway tests
still fail on this machine's live gateway model list; they fail
identically before this commit). Smoke-tested end to end in a real
browser: a normal turn ran on the renamed build, desktop and phone,
light and dark.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
… conversation layer

goal.create may now carry open_session:false. The Goal, Agent binding, todos and
outcome are created as before, but no first Session is opened and no first Turn is
sent. The receipt returns managed_agent_id, channel_id and goal_instance_id so the
caller can attach its own thread. Default behaviour is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
/api/loopx/status.json, /api/loopx/healthz and /api/loopx/api/* are forwarded to the
LoopX core (Python chat server, default http://127.0.0.1:8792, LOOCHAT_LOOPX_CORE_URL)
behind loochat's own bearer auth. The hub token is not forwarded; SSE streams through;
a down core answers 502 loopx_core_unavailable. One hook line in http.ts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
A thread bound to a Goal (bindings kept in loopx-threads.json, not in the thread store) runs
under the Goal's own permission: codex gets a read-only or workspace-write sandbox with
approvalPolicy never, other agents are read-only and have any approval refused. Each message
carries a hidden <loochat-loopx> block with the Goal's state read from 'loopx status'.
POST /api/loopx/launch/preview|apply review and create the Goal through the core's typed
action (goal.create, open_session:false) and open the thread; GET /api/loopx/goal/:thread,
/capabilities, /workspaces, /health. Ordinary threads are untouched: hooks in threads.ts
only act on a thread that has a binding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Codex's plain workspace-write leaves /tmp and $TMPDIR writable. A Goal conversation now sends an
explicit workspaceWrite policy (writableRoots=[cwd], excludeSlashTmp, excludeTmpdirEnvVar,
no network). Checked: 'echo x > /tmp/...' fails with Read-only file system, a write in the Goal
directory succeeds, and no approval request is raised.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
A LoopX mark in the composer turns a new conversation into a Goal conversation (not after the
first message): the permission button then offers the Goal's two levels, read only and auto in
workspace (codex only; other agents greyed out with the reason). Sending opens a review card:
the LoopX core checks the Goal (workspace, agent, boundary) and the person confirms before
anything exists. A Goal thread shows a Goal bar above the input (Goal, state, todo counts,
permission, refresh) read through /api/loopx/goal/:thread.

App.tsx changes are small hooks into the draft state, the permission slot, the composer actions
slot, the banner slot and the dialogs; the rest is in components/LoopxGoal.tsx and loopx/.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
… 8792, CLI, registry)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…LoopX steward

Board-port batch A (P0 loopx-project#3 loopx-project#5 loopx-project#7 loopx-project#8) on the web side, per
calli-loopx-rfc/board-port-plan.md:

- Sidebar: a Goals group over the thread list, from the LoopX core
  status read through the loochat proxy (/api/loopx/status.json). The
  tree nests sub-goals, each row carries a status dot, and goals whose
  attention waits on the person get a badge. A row opens #/goals/<id>.
- Goal work page (#/goals/<id>): the overview tab with Vitals (user /
  agent open todos, done, waiting-on), a "since you looked" line
  (since-you-looked.ts ported verbatim from the dashboard with its
  test), the needs-you rows, and the objective. Unknown fields say
  unknown; nothing is guessed.
- LoopX steward (#/steward) in the place Calli's assistant held: the
  brief (needs-you goals, running goals) from the same status read.
  The steward conversation itself is the Python manager's; this batch
  shows the honest "wiring in progress" state for it.
- Calli's assistant surfaces leave the UI: the desk entry and its
  AssistantHome, the matters page (TodosPage) and its sidebar link,
  the pet overlay (portrait, corner bubble, topbar face) and the
  assistant settings entry. #/desk and #/todos addresses now open the
  steward, their successor. The daemon's personal code stays; only
  the entrances are gone.

The status model is deliberately narrow (goal tree + attention queue
with todo-count envelopes); the full dashboard projection stays out
until a shipped page needs more.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ries

The i18n guard (no Chinese outside src/i18n/locales) failed on the lx() helper. Every string is
now a loopx.goal.* key in zh, en and ja; the permission and status wording is resolved at render
so a language switch applies at once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
The proxy answers 502 {error:"loopx_core_unavailable"} when the Python
service behind /api/loopx/* is not running. The status reader keeps
that word and the pages show a dedicated line for it, instead of
"status answered 502".

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
… existing Goal

Body {goalId, agent, permission?, model?, effort?, text?, cwd?}. The core must know the Goal and
have it active (read through the CLI). The workspace is the one an earlier conversation of the
Goal used; a Goal with none yet needs cwd (allowed workdirs only). Permission defaults to the
earlier conversation's, else the agent's default. Answers {threadId, goalId, workspace, permission, turnId?}.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…unked

The core (Python http.server) does not read a chunked request body, so POSTs reached it empty.
The proxy now buffers the (small, JSON) request body and forwards it with its length; responses
still stream, so SSE is unchanged. The proxy test now asserts the upstream sees Content-Length
and no Transfer-Encoding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…per-todo rows

Board-port batch B on the web side, per calli-loopx-rfc/board-port-plan.md
and the lead's assignment, all through the /api/loopx/* proxy:

- Steward conversation (loopx-project#7's remaining half): the Python manager's own
  session on #/steward. History loads with the page; a turn streams over
  SSE (fetch-based: EventSource cannot carry the proxy's bearer token)
  with the core's activity steps as a quiet trail, a streaming answer,
  and a stop button that interrupts the running turn. A turn another
  surface already started (409) is adopted and shown, not failed.
  manager.ts folds events without dropping unknown kinds, so a newer
  core never renders as silence.
- Goal work page tabs: overview + conversations. The conversations tab
  lists this Goal's loochat threads (the daemon's binding on each
  thread view) and opens a new one through the daemon's
  /api/loopx/launch/join (session-design's route).
- Goal lifecycle: stop / resume / delete as typed actions — preview,
  a confirm dialog carrying the core's own summary and evidence, then
  apply. Delete is offered only on a stopped Goal (the core refuses
  otherwise) and says so in the menu. Stopped Goals fold into a
  collapsed 已停止 group in the sidebar.
- Per-todo rows: the scoped status (/api/loopx/status.json?goal_id=…)
  lists the todo items themselves; the overview now shows the rows for
  both the person's and the agent's todos, and says when the core
  listed fewer than it counted.
- Deleted Goals leave "legacy-runtime" run-history ghosts in the
  status projection (registry entries gone, runs remain); the
  workbench lists leave those ghosts out.

Verified live on 8796: a Goal created through the composer hand-over,
joined with a second conversation, stopped, resumed, stopped and
deleted, all in the browser; the steward answered and was interrupted
for real. Screenshots 66-87 in calli-loopx-rfc/workbench-shots/
step3-batchA/ (desktop, mobile 390, light and dark). 534 tests pass,
typecheck and build clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
scripts/workbench.sh core [start|stop|restart|status] starts the LoopX core on 8792 with one
--scan-path per entry of LOOPX_GOAL_WORKSPACES (comma separated; default only
loopx-workbench/loopx), as the dashboard is started. restart-all.sh calls it. The review card's
'directory not granted' message now says how to add one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
In the demo (no hub connected) the composer hid the LoopX mark, so the Goal entry could not be
found. It now shows disabled with the same hint as the other hub-only controls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
State goes to $XDG_STATE_HOME/loochat-workbench, workdirs default to the
checkout, the core uses its packaged chat assets unless LOOPX_CHAT_ASSETS is
set, and the daemon binds 127.0.0.1 unless WORKBENCH_HOST says otherwise.
The adapter test uses a neutral path for the workspace token.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…6gr-qvv4-5v3f, GHSA-mrv2-3pqr-j5jr

dompurify comes in transitively; only the lockfile moves.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ette (loopx-project#12 loopx-project#13 loopx-project#14)

loopx-project#12 Settings → Goal 通知: a browser alert when a Goal newly waits on the person
(first read is only a baseline; needs permission, off by default), and per Goal
the Lark group binding (preview, then confirm) and the two automatic notices,
through /api/loopx/api/chat/goal-channel/*. Status now parses
goal_channel_notification_projection.
loopx-project#13 The sidebar bell gets a red dot when a session asks or a Goal needs the
person; its title counts both.
loopx-project#14 ⌘K / Ctrl+K opens a palette over sessions, Goals (needs-you marked),
settings pages and "new session / steward".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
… longer asks for the assistant

A fresh state dir listed ext-board as built-in but not installed, so the sidebar
had no Board entry. scripts/workbench.sh now installs and enables the extensions
in WORKBENCH_EXTENSIONS (default: board) once per state dir, the way the
Extensions page does; uninstalling it later sticks.

The board manifest drops assistant.ask: the Calli assistant is gone, and without
the permission the host offers no assistant, so the "Ask assistant" button is not
rendered. Drag, stage and done are untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…onger overlap

The dialog surface took focus after the palette's input mounted, so typing went
nowhere; focus is asked for again on the next frame. The notification page reused
the section header's hint class (negative top margin) for inline notes; they get
their own, and the "no targets" line shows once above the list, not per Goal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ect#15)

Reads the core's acceptance as it stands: the retained outcome requirements (the
agent's own review kept apart as self-review), the configured checks with each
criterion's state derived from the last receipt (a receipt for an older contract
revision is stale, a failed or stale oracle overrides a pass), and the read-only
observation (next action, gaps, guards).

Two owner actions, both behind a confirm that says local commands will run:
"Check delivery" (verify) and "Remove check configuration" (clear-checks), written
against the provider revision just read; a lost result is never replayed, the card
re-reads and says the result is unconfirmed. An agent-prepared plan
(goal.acceptance.check) is shown with its commands and applied only on "Adopt and
check". Not ported: JSON import/configure, outcome refinement editing, oracle
evidence detail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ace in the file panel (loopx-project#11)

Reports: the core's goal-results inventory (local result files bound to completed
tasks whose acceptance still holds), markdown or text, each re-verified against
the listed row when opened; an inventory that does not add up, or a report whose
version or acceptance changed, clears the old content instead of showing it.
Workspace: "Browse workspace" opens Calli's FilesPanel on the Goal's own
conversation (it can already browse any thread); a Goal with no conversation says
so and points to the Conversations tab.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…he reader's language

The Goal's seeded task ("推进目标…"), the labels in its objective ("完成条件", "执行边界") and the
review summary were hard-coded Chinese, so an English reader saw Chinese on the Goal
page. They now follow Accept-Language: Chinese for zh, English otherwise. The Goal
masthead also shows the readable status word instead of the raw status code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ebar shortcut

- loopx/tasks.ts reads todos with items[] from the scoped status
  (/api/loopx/status.json?goal_id=) and says how many the core did not list.
- GoalTasks: status lanes, board/list toggle, owner/status filters, search,
  expandable cards, and an empty action slot per card for loopx-project#10.
- Goal page gets a Tasks tab (#/goals/<id>/tasks); each sidebar Goal gets a
  one-click link to it; the Goal header wraps on narrow screens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…ore-down notice

- The Goal header and bar showed raw core status codes (active_state_user_gate,
  state_incomplete, ...); every code the core projects now has a word in zh/en/ja,
  and an unknown one loses its underscores.
- zh 'loopx.coreDown' no longer hardcodes 8792 (en/ja never did); the core URL is
  configurable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Per the board-port plan's in-progress line (管家页改为聊天优先): entering
#/steward is now entering the conversation, the way entering a thread is.
The chat owns the viewport (messages scroll inside it, the composer is
pinned at its bottom on desktop and mobile), replacing the batch-B stack
of a height-capped transcript above a scrolling brief.

- An empty conversation opens on a greeting — the shape Calli's
  new-thread page taught: the brand mark, one question, and three
  one-tap asks that send for real. The hidden transcript pane yields to
  the greeting instead of rendering as an empty box.
- The brief (needs-you rows, running goals) moves behind one header
  button as a popover, badged with the waiting count so needs-you stays
  visible; rows in it jump to the Goal's work page.
- The send path now takes the text it sends (the chips and the composer
  share it); interrupt, 409 adoption and error states are unchanged.

Verified live on 8796: a chip question streamed a real manager turn with
the stop button up. Screenshots 88-93 in calli-loopx-rfc/workbench-shots/
step3-batchA/ (desktop, greeting state, popover, mobile, dark). 558
tests pass, typecheck and build clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5

Copy link
Copy Markdown
Collaborator Author

Re: review at 0623674ee, head now 5a2a358d6

  • [P2] strict-v1 registry fails the real join route: fixed in 953c823 (inline thread answered). Goal roots now come from Core's canonical loopx registry --format json. The real daemon HTTP join regression covers object and strict-v1 encodings on File and SQLite: 4 failures before, 10/10 after.

  • Install suite 10/11 ("LooChat is running"): a product bug, fixed in 296c971. After a successful systemctl restart, install-service.sh ran an optional port diagnostic, ss | grep :8787. On a host with nothing listening on 8787, or without ss, grep exits 1, and set -e/pipefail aborted the script. install.sh then swallowed the failure through run … && STARTED=1 and printed the manual-start hint. Our host happened to have a listener on 8787, so the suite passed here. Now:

    • the diagnostic cannot fail a successful install, and the "port held by another process" warning is kept;
    • real install and restart failures propagate instead of being swallowed;
    • the fixture stubs ss and loginctl for three cases: no listener, unavailable, and occupied.

    Results: 10/11 on the old scripts with an empty ss, reproducing your failure; 11/11 after, both via node --test packages/e2e/test/install.spec.mjs and via run.mjs.

  • Premerge public boundary (52 hits): every hit was classified; none is a real credential, private path or internal business detail. The 52 hits are 48 credential, 1 doc URL and 3 private IPs. By category:

    • 9 synthetic test tokens and 5 example placeholders: renamed to explicit dummy-… / <token> placeholders in 5a2a358 (tests and comments only, no assertion changes). The scan now reports 38 hits, none of them new.
    • 35 false positives remain, all in source code: JSX props passing a runtime variable (token={token}), authorization: req.headers.authorization in test fixtures, userAuthorization: 'high' (a risk-level enum), URL parameter names such as ?token= with no value, and a generic Lark applink URL. Renaming product fields or adding comments to dodge the regex would be the wrong fix; the checker should recognise source references.
    • 3 private IPs are deliberate negative inputs in link-rendering and remote-desktop rejection tests. The checker reports them as advisory.
    • packages/daemon/test/fixtures/sample-video.mp4 is an existing fixture used by the daemon API tests and the video, queue-edit and file-download E2E specs. It is 1.7 KB and 1 s long, with 5 identical solid-colour frames, no audio and no personal metadata. The premerge visual classifier only knows images, so this MP4 is read as UTF-8. There is no media allowlist to register it in, so we kept the fixture and did not add an exemption.

    Proposal for the checker owner: extend the existing visual_review_paths / manual-review hold to recognised video, keep unknown binaries fail-closed, and recognise source-expression references. We did not modify loopx/canary. Full per-line classification available on request.

  • Validation on 5a2a358d6 at low load: typecheck and full build pass; web 579/579; daemon 1393 tests: 1391 pass, 1 skipped, and 1 failure that was already known before this round (Git traversal); LoopX daemon 32/32; test:loopx 10/10; install 11/11. The api.test.ts events wait that timed out in earlier runs passes at low load.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported

REQUEST_CHANGES:旧的 registry 和安装问题均已修复;当前阻塞是必要的完整 Goal 旅程证据,未新增一个未经复现的运行时缺陷。

动机 / Motivation

本地用户想从会话里创建或加入持续推进的 Goal,再看到任务、结果和下一步。 原有 dashboard/Chat 与独立 Agent 会话分开;Workbench 拟让同一会话发现、操作并读回 Goal,减少重新定位任务的成本。 本头已修复合法 v1 registry 的加入和安装成功提示,但完整 Goal 创建与首轮恢复的组合结果仍未获得当前有效验证。 本次是独立可选 Workbench 及 Core 接口配合,不要求在此 PR 替换 dashboard、正式安装 Core、运行付费模型或完成全项目实例激活。

改动思路 / Approach

Core继续拥有Goal事实、授权和动作,Workbench拥有本地会话索引;codec复用正确,但当前完整生产旅程证据仍不足。当前可逆边界是可选 Workbench 的 Goal 任务接入,不要求替换旧界面或实施全项目激活。registeredGoalRoot 现经已有 Core CLI 解码,而不是维护第二个 JSON 读取规则;这是正确的简化。接下来应在原 E2E 组合中贯通真实 Core、ThreadManager、首轮派发与结果读回,不另建配置、状态或验收账本。

具体改动 / Changes

精确头 5a2a358d696adc0fbf5af8ec24f65c1e80b7f6d3,实际PR基线 e11b951dd6447d50fc75a07f4456c25707614888。全PR899文件 +194053/-4;相对上次0623674为21文件 +252/-54。已核对878条既有路径未变;沿用其原证据及限定,未继承批准。新增回归、规范registry读取、可选端口probe与占位样本调整逐项重查。生产452、测试/fixture438、文档8、锁文件1;分类规则公开区分测试工具与生成文件,不以导入行数代替验收。

规范:docs/development/frontend-delivery.md,固定版本 e11b951dd6447d50fc75a07f4456c25707614888,task-first-delivery 第4、5步要求打包产品任务和真实owner读回,并明确复用证据的未变假设。此项目前 not_met:尚未取得当前创建/首轮发送/中断重试链在打包 Workbench 与真实 Core 组合上的结果读回;加入测试在 createThread recorder 结束。 另一个旧标准 docs/architecture/rfcs/goal-instance-identity-and-orphan-recovery-v0.md §5.4 的codec复用已落实,不再保留旧finding,也不要求本PR提前完成未来activation。

关键代码讲解

  • registeredGoalRoot 通过 execFile 调 registry --format json,只消费成功结果;格式及digest检查回到Core owner。
  • LoopxService.join 保留权限上限、注册目录、realpath和允许目录检查,然后建立会话绑定。输入 workspace_auto 不能提升只读Goal。
  • join HTTP harness 确实跑了真实HTTP路由和Core CLI,但 createThread 是recorder;它证明加入和拒绝边界,不能证明原生线程、首轮发送及重启后的任务结果。

对主干的风险 / Risks

[P2] 补齐Goal任务组合资格。 尚未取得当前创建/首轮发送/中断重试链在打包 Workbench 与真实 Core 组合上的结果读回;加入测试在 createThread recorder 结束。 复用可核验的既有组合证据并说明相关源码未变,或补一次隔离真实 Core + 打包 Workbench 的 Goal 创建、首轮结果、一次中断后重试及原 Goal/会话读回;仅模型后端可替身,不要求正式安装或付费模型。 这个范围只核一条代表性Goal任务和相称恢复,不要求重跑所有第三方平台、正式安装或付费模型。原作者较早的真实Core演示与当前示例页面不能自动覆盖之后首轮派发、恢复和目录读取的变动。现有绿测允许这个未知继续存在,因此它是证据阻塞,尚不是“已发现消息丢失”的结论。

本轮PASS:同夹具旧/新构建的 File/SQLite × 对象/v1 真实join,旧v1两组409、当前全部200且保持正确目录/read_only/一个线程;另10项真实authority路由用例验证提权、异目录、范围外根和坏digest拒绝且零线程。安装11、共享Core70、daemon14、web579、完整build/typecheck及假agent smoke通过。首条Python命令拼错测试路径而exit4且未运行测试,纠正后70通过;未将这次命令错误当产品失败。

标准premerge的6项直接检查和18项自动选中检查通过,公共边界子命令失败,仍保留自动门。原默认入口另遇双runtime来源拒绝;使用显式隔离runtime独立重跑得到36条diagnostic:35条经逐项读源码确认是JSX参数/变量、空token、测试标签和公共app-link误报,1条是1694字节视频(已查看缩略图,为纯色)被当作UTF-8。三个图标也逐个查看为相同公开品牌图形。没有发现据此可发布的真实凭据泄漏,不应继续重命名合法JSX参数来迎合正则;检查owner应处理识别/媒体边界或给严格归属证据。未降低扫描范围,未等待或查询远端CI。

语义与 CI 对齐

本轮重用既有codec与权限词汇,没有新增共享闭集。缺口是 task-first-delivery 的产品组合证据;最小返审是上述一条实际任务与失败恢复读回,以及原自动门的准确处置。缺失的不是CI完成,也不是全项目实例激活。

我的整体评价 / Verdict

旧的v1加入和安装成功提示已解决,应当明确结清。当前long_horizon和user_experience仍为not_yet_proven:加入成功不能替代Goal的首轮工作及恢复结果,默认关闭路径也只取得源码/选中回归层面的证据,没有把未验部分标绿。架构的Core/Workbench分工可以保留;本轮已消除最有价值的重复读取规则,剩余主要是组合验收而非继续加机制。

沿用0623674的桌面/390px混合状态与审批恢复观察;渲染组件、样式和示例数据blob未变,当前网页差分只有link-auth注释及测试样本。既有页面中侧栏、消息、工具记录和审批反馈层级可辨;这只是原示例构建的视觉观察,未假称新拍或真实Core。未验证范围:尚未取得当前创建/首轮发送/中断重试链在打包 Workbench 与真实 Core 组合上的结果读回;加入测试在 createThread recorder 结束。 所有第三方渠道、正式安装和真实模型不在本轮资格声明内。可以提供有来源的既有组合证据及未变分析,或补上述有界验证后返审;不要求为此新建跟踪任务。

English verdict: REQUEST_CHANGES — registry and installer fixes are verified; the affected packaged Goal workflow and required validation closeout remain unproven.

maxliux5 and others added 2 commits November 17, 2026 18:39
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Create a Goal through the Workbench launch routes, run the first turn,
cancel a second turn mid-flight, restart the daemon on the same data
dir, retry, and read the Goal and session back from both Core and
Workbench after another restart. Only the model backend is scripted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5

Copy link
Copy Markdown
Collaborator Author

@loopx-agent Re: review 5943631806 [P2] 补齐Goal任务组合资格 — addressed in 3f1da70 (head also merges latest main, b086b08).

New apps/workbench/packages/e2e/test/loopx-goal-journey.{py,mjs}, run by npm run test:loopx -w @calli/e2e from apps/workbench. One isolated run, no recorder; only the model backend is the existing fake Codex:

Step What is real Assertion
Core python -m loopx.cli chat on an isolated LOOPX_HOME/registry/runtime, canonical SQLite creation authority provider marker for the new Goal is sqlite
Workbench built daemon/dist + prebuilt web/dist via the harness (real ThreadManager/Store/LoopxService) GET / equals the packaged index.html
Create /api/loopx/launch/preview → /apply preview is preview_ready and creates nothing; after apply, Core registry has exactly one Goal with the project root and status returns it; thread binding is that Goal, read_only
First turn turn started by apply turn.done read back through /history, first answer appears exactly once, native session id present
Interrupt + retry second turn held by the model, cancelled after a real tool.start; daemon restarted on the same data dir; same request re-sent cancelled turn has no answer; after restart native session id and full binding unchanged; retried turn completes with its answer exactly once
Readback daemon restarted again both answers byte-identical to pre-restart, 3 turn.started / 3 turn.done, unique seqs, no older page; one thread bound to the Goal; /api/loopx/goal/:thread?refresh=1 is fresh for the same Goal; Core status still shows it as registry_member

Results on this head: journey 3/3 consecutive passes (~8 s each); test:loopx 11 passed (10 join + 1 journey). After the main merge: top-level module budget plus the PR-touched Core tests 76 passed.

Boundary: the interruption path is the cancel API plus a graceful daemon restart, not an abrupt SIGKILL crash; no paid model, no formal install.

On the premerge public-boundary residuals (35 checker false positives + 1 media file read as UTF-8): agreed. We are not renaming further identifiers. That needs a fix on the checker owner's side.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max.

REQUEST_CHANGES:原组合验收缺口已有实际补充;本轮新发现是已取消工具仍显示“运行中”,不是消息丢失或后台继续执行的推断。

动机 / Motivation

本地用户想从会话里创建或加入持续推进的 Goal,再看到工作结果和下一步。

原有 dashboard、Chat 和独立 Agent 会话需要分别定位;Workbench 拟在同一会话中创建、查看并继续 Goal,减少入口切换。

本头的真实 Core、线程存储与打包 Workbench 已完成创建、首轮回答、取消、重启和重试读回;已取消工具的活动标签仍不准确。

本次不要求替换旧界面、正式安装、付费模型执行或完成未来的全项目实例激活。

原作者需修复取消后工具仍显示运行中的投影,并保留真实活动、迟到结束与重启读回的区分。

改动思路 / Approach

Core 保留 Goal、授权和动作权威,Workbench 仅承接本地会话与投影;这次应修复既有 timeline 的终态归约,不增加第二份工具执行账本。

当前范围是可选 Workbench 的完整 Goal 会话入口与恢复;不要求替换 dashboard 或提前交付全项目实例激活。

保持现有入口分工比再造 Goal 状态机合理。Core 接收明确的预览/确认,daemon 保存本地会话关系和原消息,并调用原生适配器;网页只读回权威结果。普通会话没有 Goal binding 时不注入 Goal 指令,Core 的 open_session 缺省路径仍建立原有会话。显式 false 与 start_execution=true 的冲突仍拒绝,不能把执行意图丢在一个成功回执后面。

本次不再把“完整 Goal 旅程尚无证据”原样留作 finding:新测试实际贯通 Core、ThreadManager、Store 和打包 Web 的服务端入口,只替换模型后端。另一方面,它目前只断言回执、历史和答案;网页把取消后的历史投影成什么,仍能在这些绿测之外出错。最小修复是已有 timeline 对终态和工具状态的归约,不能为此增加另一个手工同步账本。大规模导入的后续收敛仍按既有迁移边界处理,不以行数或未来完整 dashboard 替换作为新增门槛。

具体改动 / Changes

审查头 3f1da701f0f0a6dabc8b9129854237d1c2fd377c,实际 PR base/merge-base 03e1b482d5a903f1a873b4d1d60360645510540e。全提案 901 路径、+194289/-4:按路径分类,生产/资产 453(+117699/-4)、测试/fixture 437(+69257)、文档 10(+538)、锁文件 1(+6795)。资产和样式行数不是新增 Core 业务规则。

与前次完整评审的 5a2a358d696adc0fbf5af8ec24f65c1e80b7f6d3 / e11b951dd6447d50fc75a07f4456c25707614888 比较,898 个路径的 base、head blob 成对不变。当前仅两份 loopx-goal-journey 脚本和 npm 测试注册不同;同步进来的 main 变动不冒充本 PR 新实现。旧结果保留原版本和边界,没有继承批准;受影响 Core 与组合测试在本头重新执行。

规范依据:docs/development/frontend-delivery.md,spec_revision 为 03e1b482d5a903f1a873b4d1d60360645510540e。task-first-delivery 的 task-first-delivery:2 在 Core owner/规范 registry 复用上 implemented;task-first-delivery:4 的真实创建与恢复部分已有证据,但活动读回仍 not_met。其所链接的设计规则明确:已保存状态不等于当前执行。上述标签映射既有步骤,没有增加全平台或实际模型实验要求。

关键代码讲解

  • LoopxService.applyOnce 核对原 Core proposal、目录和权限,再创建本地线程、保存 binding 与 firstMessage;dispatch 区分在途、交付不明和实际输出,保留恢复责任。
  • registeredGoalRoot 复用规范 registry --format json;对象/v1、坏 digest、目录和提权拒绝属于当前真实 join 验证,不再保留旧格式 finding。
  • closeTurn 将所属 work 结束,并把未完成 compaction 改为 interrupted;工具 step 的 in_progress/pending 却没有相应终态投影。
  • stepStatusLabel 对上述遗留状态直接输出“运行中”,ThreadView 在已停止的外层记录中继续显示它。

对主干的风险 / Risks

[P2] 取消轮次后,不再把未确认的工具显示为仍在运行。 在新加入的真实 Goal journey 中,第二轮已经产生 tool.start(status=in_progress),随后调用 cancel;持久事件读回包含 turn.done(stopReason=cancelled),没有 tool.end。daemon 重启两次,第三轮重试正常结束,线程读回为 idle;当前打包网页仍在“你停止了”的记录下显示旧工具“运行中”,刷新并重开会话后仍成立。独立运行当前 buildTimeline/stepStatusLabel 消费同一真实事件,也得到 running=false 但旧 step 仍 active、标签仍“运行中”。

这会让用户继续等待或排查一个并非当前活动轮次的操作。这里证明的是错误的活动展示,没有证明后台进程仍然运行。请由已有投影 owner 结合所属轮次终态,显示已中断或结束未确认,而不是伪造“已完成”;保留仍活跃工具、迟到 tool.end 和正常完成的语义。将这个断言补到现有组合/历史读回测试即可:当前真实活动对照仍运行,明确完成对照结束,取消后重启/刷新不能再次展示为活动。

当前实际验证:

  • PASS:81 项 Core/Goal 测试、579 项网页测试;含真实 File/SQLite join 格式/拒绝与 canonical SQLite 创建、首轮、工具中断、重启、重试和结果读回。
  • PASS:完整 build、workspace typecheck、隔离假 Agent 启动 smoke、全差分空白检查。
  • PASS:另两项同 daemon 的 scope 反事实:先于 Goal 存在的普通会话、Goal 激活后新建的普通会话,都保持未绑定、没有 Goal 指令,并实际完成回答;canonical Goal 仍只有一个。私有 probe 首次单片段断言失败保留,随后改用完整有序流式答案验证;没有修改产品或作者断言,也未从后一次成功反推首次失败原因。
  • FAIL:上述独立取消状态 oracle,退出 1;实际浏览器和持久事件一致,属于当前 finding。
  • 完整 daemon 观察: macOS 上完整运行记录为 1393 项、1334 PASS / 55 FAIL / 4 SKIP,退出 1;desktop worker 持续约 24 分钟后由评审有界终止。失败含路径规范化差异、终端、桌面及其他场景,归因尚未逐项完成;不能沿用作者 Linux 结果或称全套通过。
  • 标准 premerge: 退出 1:6 项直接检查通过,19 项选中检查全部执行,4 项失败:install-local-smoke 与 codex-cli-packaged-install-smoke 触及原 120 秒预算;premerge-validation-gate-smoke 失败;公共边界扫描失败。未完成同命令 base/head 归属,不把这些失败自动归咎于本 PR,也不记为通过。
  • 额外 Ruff 范围检查:FAIL,4 项 E402,来自两份 Python harness 在插入 fixture 路径后的 import;五个生产 Core 模块未报错。保留这次原始运行,不写成“全量 lint 通过”。

语义与 CI 对齐

当前义务是如实呈现已终止轮次,不是要求一个新状态协议或全项目实例激活。触发点是本 PR 引入的 timeline;现有枚举/合法回执和绿测并不能消除此反例。复用原状态 owner、补上述反向对照,并通过当前本地必需检查后返审。未查询、轮询或等待托管 CI;本地检查的失败与未知没有被改写成远端 CI 成功。

我的整体评价 / Verdict

REQUEST_CHANGES。原 registry、安装及创建/恢复组合问题应按现有证据分别结清,本轮不声称它们仍未修复。原生会话、binding 和完成结果的有界持续性已有正向证据;用户体验仍有具体回归,必须修正停止后的工具活动读回。

桌面和窄屏的会话正文、停止记录与 Goal 概况可辨;同一已取消工具仍显示“运行中”,造成相互矛盾的活动读回。

深色主题、全部第三方 Agent/渠道、正式安装及真实模型任务效果未由本轮资格化;示例页只证明组成,模型回复为脚本输出。

实际观察包含多项目/审批/四 Agent 示例和真实 Core 的 Goal/task 概况、长文本及取消/重试历史;示例、打包浏览器、原生协议与真实模型的边界分别保留。核心权限和指令仍按明确 binding 加载,没有新增全局安装或调度动作;未知的平台和完整成本不从测试数推出。没有合并、提升渠道或正式安装。

English verdict: REQUEST_CHANGES — creation and restart qualification now passes at 3f1da70, but a cancelled tool remains labelled running in persisted history and the packaged UI; fix the terminal-state projection and retain the reported validation limits.

Comment on lines +571 to +574
for (const entry of work.entries) {
if (entry.kind === 'compaction' && entry.status === 'in_progress') entry.status = 'interrupted';
}
if (endedAt) work.endedAt = endedAt;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 取消轮次后终止工具的运行态展示

真实 Core + ThreadManager/Store 的新 Goal journey 中,第二轮已有 tool.start(in_progress),cancel 后持久记录为 turn.done(cancelled),没有 tool.end;两次 daemon 重启和第三轮重试完成后,线程为 idle,但打包网页仍在“你停止了”的记录下显示旧工具“运行中”,刷新重开仍成立。当前 buildTimeline 消费同一实际事件也得到 running=false、stepActive=true。这里证明的是错误的活动读回,没有证明后台进程仍在运行。

closeTurn 只把 compaction 改为 interrupted,stepStatusLabel 仍只看原始工具状态。请让已有投影结合所属轮次终态,显示已中断/结束未确认,并保留真实活动、迟到 tool.end 和正常完成;不要伪造成功完成。扩展现有 journey/timeline 回归,验证取消后重启/刷新不再显示为活动,活动与明确完成对照保持成立。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 981c43e. buildTimeline now projects every still in_progress/pending step inside a closed work block as interrupted (label 已结束) once all events are folded. It does not mark them completed and does not invent an endedAt. The projection runs after the event fold, so:

  • a real or late tool.end (completed/failed) keeps its result and duration;
  • a stale tool.update(in_progress) after close cannot revive the step;
  • the live turn's tools stay 运行中. work.done is only set in closeTurn.

The persisted events are unchanged.

web/test/timeline.test.ts covers:

  • the journey's event shape: tool.start(in_progress|pending) → turn.done(cancelled), with no tool.end. It is replayed alone and again with a later completed turn appended, which is the same rebuild that happens after a restart or reload;
  • the live-turn control;
  • completed/failed tool.end before and after the cancel;
  • every close path: normal done, turn.error, next turn, handover, imported, fromTerminal, and orphan blocks;
  • a partial history without a closing boundary, which stays active.

Without the fix, 2 of these fail. Web suite: 584/584; tsc --noEmit clean.

maxliux5 and others added 2 commits November 18, 2026 00:43
A cancelled or otherwise closed turn left tool steps without a tool.end
in progress, so history kept labelling them as running after restart.
Once all events are folded, project such steps in closed work blocks as
interrupted. A real or late tool.end still keeps its result and
duration, and the live turn's tools stay active.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Both Core-backed harnesses imported the shared authority fixture after
extending sys.path, which Ruff reports as E402. Import it through
importlib instead; the tests themselves are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5

Copy link
Copy Markdown
Collaborator Author

@loopx-agent Re: review 5948732244 (head 3f1da70). Both items are fixed in b5613c8.

  • [P2] cancelled tool still shown as running: fixed in 981c43e. The details and tests are in the inline thread reply: feat(workbench): loochat — Calli workbench as LoopX's conversation layer, with Goal conversations #8843 (comment). Web suite 584/584. Without the fix, the new regressions fail 2 of the timeline tests.
  • Ruff E402 in the two Python harnesses: fixed in b5613c8. The shared authority fixture is now loaded with importlib.import_module after the sys.path entry, and the Core imports moved to the top. There is no noqa and no config change, and the test bodies are unchanged. ruff check apps/workbench/packages/e2e/test/*.py: All checks passed. npm run test:loopx -w @calli/e2e: 11 passed (10 join + 1 journey).

On the local premerge items you could not attribute (install-local-smoke / codex-cli-packaged-install-smoke hitting the 120 s budget, premerge-validation-gate-smoke, the public boundary scan): outside apps/workbench, this PR touches only loopx/chat_action_normalization.py, chat_actions.py, chat_server.py, control_plane/goals/goal_channel_projection.py, thread_agent_binding.py and their three tests. None of those smokes' owners (loopx/canary/*, the release/install scripts) are touched. I have not re-run them on this head, so they are not claimed as passing. The boundary residuals remain the checker false positives agreed earlier.

Hosted CI on this head still shows the main-side Ruff F401 in tests/control_plane/test_contract_health.py (from #8678, not touched here; fix pending in #8946/#8949). I will merge main once it lands.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max. 这是 host 记录的执行来源,不是模型权重证明。

动机 / Motivation

使用可选 Workbench 处理普通对话与 Goal 会话的操作者,需要在取消、重启和重试后继续读到可信的结果。

旧候选版本在工具开始后取消,即使重启两次并成功重试,历史工具仍显示运行中;本头把已结束轮次中未得到结束回报的工具显示为已结束,避免用户继续等待旧工作。

本次已验证同一 Goal、原生会话和两条完成回答跨重启保留,取消工具不再显示运行中,迟到的真实成功或失败结果仍可覆盖中断投影。

本 PR 是独立启动的可选工作台,不承担旧 Dashboard 退役、全面 Core 迁移、正式安装或真实模型效果与完整成本的资格证明。

当前标准 premerge 仍因公共边界扫描失败而未通过;需要完成该检查的可核验修复或独立归因,不能把扫描命中直接当作真实泄密,也不能把失败写成通过。

本次复审覆盖 8843@b5613c8c983eaf8422ab810951df3cc280c5236e 的完整 PR;实际 base 为 03e1b482d5a903f1a873b4d1d60360645510540e。相对上次 3f1da701f0f0a6dabc8b9129854237d1c2fd377c,901 条 base/head 文件对中 897 条完全不变,只有 timeline、其测试及两份 Python journey 脚本变化。复核仍从原有普通对话/Goal 会话交付目标出发,不沿用旧 verdict,也不把取消修复当作整套迁移已经完成。

改动思路 / Approach

Core 继续拥有 Goal、授权和 action receipt,daemon 拥有本地原生会话与事件,timeline 只派生呈现。六行修复复用已存在的 Work.done 和 interrupted,不增加平行执行状态账本;Core 外部会话入口及绑定的原有差异由相同 blob 对与当前真实组合验证覆盖。

可选 Workbench 接入现有 Core Goal/action/registry 与宿主原生会话;本头仅修复终端工具投影和两份测试脚本导入,不扩大 Core 决策或执行权限。

用户的正常路径仍是输入需求,必要时确认一次 Core 的有作用操作,再读取结果;已经授权的继续对话和重试不新增重复表单。保留旧 Dashboard 是当前可选导入的边界,不以全面替换作为本次新门槛。反对直接交付的最强理由是平行宿主维护成本较高,且通过测试并不保证对话可用;这次实际 Core、持久事件和浏览器回读补足了取消修复的直接证据,但不会消除更广平台的资格缺口。

下表说明本头呈现的变化;它是源码说明,执行证据见下文。

输入状态 上个候选版本 当前 head
工具开始、所属轮次仍未结束 显示运行中 保持运行中
所属轮次已结束、没有工具结束回报 仍显示运行中 显示已结束,不编造完成或结束时间
稍后收到真实 tool.end 真实结果 保留真实成功/失败、输出和时间
不完整历史中没有结束边界 保留不完整观察 不凭空推断轮次结束

具体改动 / Changes

  1. LoopxService.applyOnce 延续 Core proposal/apply,再建立宿主会话与绑定。registeredGoalRoot 仍通过 Core registry CLI 取得路径;没有恢复第二套 registry 解码。当前 81 项测试包含 File/SQLite、对象/严格 envelope 编码、权限和目录拒绝、损坏数据拒绝及 Goal 首次创建/结果读回。遗漏或 true 的 Core open_session 维持旧默认,显式 false 走宿主会话;冲突的启动意图仍拒绝。
  2. buildTimeline 在所有事件折叠后处理 Work.done 中的 pending/in_progress step;因此既有 closeTurn 各结束路径共用修复,晚到的 tool.end 先进入真实状态,不会被随后误标中断。原始事件不变、未终结的 Work 不变,结束轮次也不意味着工具已成功。
  3. stepStatusLabel 和 ThreadView 继续消费既有 Step。新投影使已取消工具显示“已结束”;展开还能看到原命令和部分输出,既没有成功徽标,也没有虚构耗时。独立 oracle 对上一轮真实持久事件和本次新事件都通过;把同一 oracle 交给旧 reducer 会在取消活动断言处失败。还独立验证真实活动、迟到成功/失败及原始数据不变的对照。
  4. timeline.test.ts 在原测试套件加入五个回归场景,覆盖多个结束分支和 late update;两份 Python harness 把 fixture 动态载入与 Core 导入顺序整理到 Ruff 可接受的形式。两文件 Ruff 当前通过,原有四个 E402 不再重现;这不是新增状态协议或一套新的测试框架。

规范依据为 docs/development/frontend-delivery.md,不可变 spec_revision=03e1b482d5a903f1a873b4d1d60360645510540e。task-first-delivery:2 要求复用 typed owner 与检查 companion 路径,当前由 Core action/registry 和既有 daemon/timeline 分工实现;task-first-delivery:4 要求使用打包产品完成任务并读回结果,当前通过真实组合、取消恢复及桌面/窄屏查看验证。两项当前行为已实现;不把正式安装、真实模型或将来 Dashboard 退役提升为这两个条目的新义务。

对主干的风险 / Risks

完整 diff 为 901 文件,+194377/-4,主体是带上游来源的可选工作台导入、测试/资源和 lockfile,不是同等规模的新 Core 决策规则。当前相对旧候选只有四个文件 +93/-5;六行生产修复留在现有 projection,规模与该缺陷相称。实际 PR base 和 merge-base 一致;最新获取的 main 中,本 PR 触及的 Core 路径无额外变化。旧整套源码评审和默认关闭对照只在这些已核对假设下保留其原 revision,未冒充本次全部重跑。

本次本地验证:PASS 81 项 Core/Goal、584 项 Web、workspace typecheck、Web build、两份 Python harness 的 Ruff;真实隔离 Core/SQLite/daemon 加打包页面完成两个答案、一处取消、两次重启和成功重试。模型端是 native fake Codex;假工具的文字不是一次真实 npm 命令执行,也没有修改活动 Goal、安装正式服务或调用收费模型。

FAIL / 尚未归因:标准 premerge。对 03e1b482d5a903f1a873b4d1d60360645510540e 的原生命令退出 1:6 项直接检查通过,19 项选中检查全部执行,18 项 smoke 通过,唯一失败是公共边界扫描。它报告 imported auth/code/tests 中的 credential 命中,并把 sample-video.mp4 当 UTF-8 读取失败。当前证据尚未完成真实敏感内容与扫描误报的独立区分;我不据此宣称泄密,也不将失败标为通过。请在相同 base/head 与原有阈值下,给出可复验的边界资格或修复 owning scan/caller;不要仅改变量名、缩窄扫描范围或绕过公共材料规则。

历史失败保持可见:旧 head 的两项安装 120 秒预算超时和 premerge-validation-gate-smoke 失败,在本次原阈值运行中通过,但这不证明旧失败的原因或消除间歇性风险。旧 macOS daemon 广测仍是 1334 PASS/55 FAIL/4 SKIP,desktop worker 曾有界终止,未重新执行或全部归因;未把它写成当前全套成功。其较广终端/桌面资格与本次已有直接证据的 Goal/取消路径分开记录。未查询或等待 GitHub CI。

我的整体评价 / Verdict

本次源码和真实任务证据支持这个可逆、可选的交付切片:取消后“运行中”的 P2 已在本头验证修复;Core 权威和普通对话默认分支仍有来源明确的覆盖。已落实的简化是在现有 timeline 派生活动状态,没有再建账本;更广前端收敛是原有后续边界,不能靠一次恢复成功宣称完整迁移或长程效率收益。

实际查看打包页面的长中文/英文回显、两条完成回答和一条停止轮次:桌面与窄屏都能把停止提示、已结束工具和后续结果区分开;工具展开后保留原命令及部分输出,没有成功标记或伪造耗时。

未验证正式安装、真实模型与真实工具执行、多机、深色模式及较广 macOS 终端/桌面功能;模型回显是合成数据,不能用它证明正式模型的回答质量。

REQUEST_CHANGES:原因是当前必需的公共边界资格仍未通过,未新增声称已经证实的代码缺陷。取消修复、Ruff 修复和其它已通过验证不再作为未解决问题;需先完成上述扫描修复/独立归因,再按未变 exact head 或新 head 的真实范围复核。保留更广平台与正式安装的未知,不凭缺少 merge 授权否定已验证的代码。评审结论、标准 premerge、GitHub 线程/策略及 maintainer merge 授权各自独立。

English verdict: REQUEST_CHANGES — 8843@b5613c8c983eaf8422ab810951df3cc280c5236e. The cancelled-tool projection is verified fixed with real persisted-event replay and packaged recovery. The required local public-boundary validation still fails without sufficient independent attribution; no new confirmed code defect or merge authority is claimed.

@maxliux5

Copy link
Copy Markdown
Collaborator Author

@loopx-agent Re: review 5949724428: independent attribution for the public-boundary step on 8843@b5613c8c9 (base 03e1b482d). The scanner's ranges, thresholds and rules are unchanged, and no identifiers were renamed to satisfy it.

Reproduction

From the repo root at the PR head, run uv run --extra test python boundary_scan.py 03e1b482d5a903f1a873b4d1d60360645510540e. The script is below. It calls premerge's own _public_boundary_changed_files_run and then scan_public_boundary on the same file selection, once per file, so every hit maps back to a repo path and its source line.

boundary_scan.py
import json, subprocess, sys
from pathlib import Path
from loopx.canary.premerge import _public_boundary_changed_files_run, _visual_review_paths
from loopx.contract import scan_public_boundary
root = Path.cwd()
changed = subprocess.run(["git", "diff", "--name-only", f"{sys.argv[1]}...HEAD"], capture_output=True, text=True, check=True).stdout.split()
print(json.dumps({"premerge_ok": _public_boundary_changed_files_run(changed_files=changed, execute=True, timeout_seconds=600, repo_root=root).get("ok")}), file=sys.stderr)
visual = {(root / p).resolve() for p in _visual_review_paths(changed, root)}
paths = [(root / p).resolve() for p in dict.fromkeys(changed) if (root / p).exists() and (root / p).resolve() not in visual]
out = {"blocking": [], "advisory": [], "unreadable": []}
for path in paths:
    b = scan_public_boundary([path], registry={})
    rel = path.relative_to(root).as_posix()
    out["unreadable"] += [rel for _ in b["unreadable_files"]]
    for kind, hits in (("blocking", b["blocking_hits"]), ("advisory", [h for h in b["hits"] if h not in b["blocking_hits"]])):
        for h in hits:
            loc, rule = h.rsplit(": ", 1); ln = int(loc.rsplit(":", 1)[1])
            out[kind].append({"file": rel, "line": ln, "rule": rule, "text": path.read_text().splitlines()[ln - 1].strip()[:200]})
print(json.dumps(out, ensure_ascii=False, indent=1))

Result

897 files scanned, ok=false:

  • 35 blocking hits: 34 credential and 1 private_doc_url;
  • 3 advisory hits (private_ip);
  • 1 unreadable file.

146 further credential matches were already classified by the scanner itself as references. Not one of the 35 blocking hits is a literal secret value. In the table, file paths are relative to apps/workbench/packages/ except the last row (apps/workbench/scripts/workbench.sh).

Group Hits Matched source (verbatim shape) Why it is not a secret
JSX prop passing the runtime session variable 24: web/src/App.tsx 2832, 2841, 2842, 2843, 2856, 2869, 3245, 3277, 3282, 3304, 3324, 3335, 3674; GoalWorkPage.tsx 84, 94, 96, 98, 99, 148; GoalsPage.tsx 99; Hosts.tsx 317 (token={joined.token}); LoopxNotifySettings.tsx 108; StewardPage.tsx 16; web/src/main.tsx 27 <SkillsPage api={api} token={token} …/> identifier reference, no literal; the scanner's reference recogniser handles x = y but not JSX attributes
URL parameter name in parser code, comments, test titles and the empty-value case 6: web/index.html 42; web/src/link-auth.ts 24, 32, 40; web/test/link-auth.test.ts 7, 24 route.startsWith('token='), ?token= (empty) key name only, value absent or empty
Header variable recorded by local test servers 2: daemon/test/fixtures/fake-zcode-quota.mjs 9; model-gateway.mjs 9 authorization: req.headers.authorization property reference
Enum value 1: daemon/test/fixtures/fake-codex.mjs 360 userAuthorization: 'high' risk level, not a credential
Runtime f-string of a freshly issued link 1: apps/workbench/scripts/workbench.sh 90 …/#token={link['token']} expression on the object just returned by the local daemon
Public Lark app-link host (private_doc_url) 1: daemon/test/personal-plan.test.ts 67 app_link: 'https://applink.larkoffice.com/calendar/event' generic app deep link, no tenant, document or meeting id
Advisory private_ip 3: daemon/test/personal-browser.test.ts 133; web/test/markdown-links.test.ts 27, 28 10.0.0.2:5901, 10.0.0.1:8899 synthetic inputs for tests that assert such hosts are refused or not linkified
Unreadable as UTF-8 1: daemon/test/fixtures/sample-video.mp4 1694 bytes, sha256 83ffc7364cd1d95a… binary video fixture used by videos.test.ts, api.test.ts and queue-edit.spec.mjs; _visual_review_paths routes images but not video to visual review; you already inspected the frames (solid colour)

Independent cross-check

I ran a scanner unrelated to this repo, detect-secrets==1.5.0 (uvx --from detect-secrets==1.5.0 detect-secrets scan <changed text files>), over all 901 changed paths, excluding binaries and package-lock.json. It reported 22 candidates, which barely overlap the hits above. I read each line, and all are synthetic:

  • negative-test inputs that assert credential-looking text is rejected: -----BEGIN PRIVATE KEY----- and sk-abcdefghijklmnopqrstuvwxyz123456 in daemon/test/personal*.test.ts;
  • obvious placeholders: user:password@example.com, 'test-key', 'k-1', 'never-copy-this', 'must-not-copy', 'local-fixture-key', 'gateway-test-key', 'rotated-key', 'test-secret', 'test-token-0123456789';
  • marker strings such as SECRET-conversation-text;
  • the split sequential "ghp_" + "1234567890abcdefghijklmnopqrstuvwxyz1234" in tests/test_thread_agent_binding.py:933;
  • the public upstream commit hash in daemon/src/pets.ts:15.

0 real credentials, private documents or internal hosts.

What remains

All three gaps are in the scanner (loopx/contract.py and loopx/canary/premerge.py), not in the PR content:

  • JSX/attribute references are not recognised as references;
  • a URL parameter name with no value still counts as a credential;
  • video files are not routed to visual review.

This PR's scope is the optional Workbench, so I have not changed the checker here. Widening its reference recognition is a change to a shared gate that should get its own owner review, and the PR still does not claim the premerge step passes. If you or a maintainer prefer that fix to land in this PR, say so and I will add it as a separate, independently reviewable commit, with negative cases that keep real literals blocking.

maxliux5 and others added 2 commits November 18, 2026 02:54
The premerge public-boundary step sent video fixtures to the UTF-8 text
scan, which failed closed on them as unreadable. Route .mp4/.mov/.webm
to the existing visual-review hold, like images, but only when the file
carries the container header, so a text file renamed to a video suffix
is still scanned. The hold still blocks merge until reviewed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
The public-boundary scan treated JSX props such as token={token}, empty
query-parameter names such as 'token=', bare object member reads such as
authorization: req.headers.authorization and Python f-string lookups as
credential literals. Recognise these source shapes before quotes are
discarded. Quoted values, concatenations, URLs with a value and Bearer
headers still block, and every match on a line must be a reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5

Copy link
Copy Markdown
Collaborator Author

@loopx-agent Re: review 5949724428, follow-up to the attribution above. The owning scan is now fixed in this PR (00e20a018). These are two separately reviewable commits; the scan ranges, LEAK_RULES, provider shapes, length thresholds and file selection are unchanged.

  • 4e843c361 fix(canary): loopx/canary/premerge.py. .mp4/.mov/.webm now take the existing visual-review hold, like images, but only when the container header is present (ftyp box with a sane size for MP4/MOV, EBML magic for WebM). A text file renamed to a video suffix is still text-scanned and still blocks on a secret. Image routing is unchanged. A media-only change still yields manual_review_required, so this is a hold, not a pass. Without the fix, the 6 new regressions fail.

  • 00e20a018 fix(contract): loopx/contract.py. _credential_match_is_reference now recognises the source shapes it missed:

    • JSX braced reads (token={token}, token={joined.token});
    • a parameter name that ends its string or code span ('token=', an empty ?token= in prose);
    • a bare object member read outside a string (authorization: req.headers.authorization);
    • braced lookups inside a Python f-string (f"…#token={link['token']}").

    It still requires every match on a line to be a reference. These stay blocking and are covered as negatives:

    • quoted JSX values, including a braced string;
    • a URL parameter with a value;
    • Authorization: 'Bearer eyJ…';
    • a plain (non-f) string with a braced token;
    • concatenation;
    • the 12 existing provider samples in 6 contexts.

    Without the fix, the 14 new positive cases fail.

Validation: these 5 files pass, 528 tests in total:

  • tests/test_contract_credential_pattern_precision.py
  • test_contract_public_boundary_prefilter.py
  • control_plane/test_public_boundary_parallel_reads.py
  • canary/test_premerge_public_boundary_run.py
  • capabilities/test_pr_review_result_check.py

The member also ran all 18 credential/boundary test files: 1055 passed, 24 skipped (they need a native Codex binary). Ruff is clean on the 4 touched files.

Same reproduction script and base as above, at the new head: 900 files, unreadable=[], credential blocking hits 34 → 1. The two modified checker files scan clean themselves. Two blocking hits remain, deliberately not exempted:

  1. apps/workbench/packages/daemon/test/fixtures/fake-codex.mjs:360 userAuthorization: 'high'. This is a risk-level field. A field name plus a short word cannot prove the type, so I did not add a field-name or vocabulary allowlist; a negative test pins it as blocking.
  2. apps/workbench/packages/daemon/test/personal-plan.test.ts:67 app_link: 'https://applink.larkoffice.com/calendar/event'. This is a generic Lark app deep link with no tenant, document or meeting id. Whether this host should stay under private_doc_url is a policy call for the rule owner.

For both, the per-line attribution above stands. I am not claiming the premerge step passes.

@songoow songoow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · GPT-6 Astra Pro · OpenAI · self_reported

当前提交复审

REQUEST_CHANGES。本轮审查 8843@00e20a018188ac810281f35f72504b92fe2052ab,实际 PR base / merge-base 为 03e1b48。

相对本人上次 e1087d9 评审,作者已经做了实质修复;本轮不直接沿用旧问题或旧 verdict。本次确认 4 项可公开的 P2,其中前两项是原修复没有覆盖的另一种异步时序。最新 public-boundary 扫描命中已完成独立误报归因;它不再是本轮“尚未解释”的证据缺口,但原检查仍然为 FAIL。

当前 findings

1. [P2] A 发送期间连续切换会话,仍会删除 B 的未发送草稿

Composer.tsx:524–528

A 开始发送、请求或附件上传尚未完成时,先切到保存了正文和注释的 B,再在 A 完成前切到 C。布局 effect 的 cleanup 仍依据整个组件的 sendingRef.current,于是离开 B 时执行 keepDraft(B, null)。A 完成后返回 B,正文为空、注释丢失,localStorage 中的 B 也已被删除。

使用实际 React Composer、真实 drafts owner 与受控发送 Promise 复现:切到 B 时正文/注释还在,切出 B 时持久项变为 null,回到 B 时输入框为空。App 在会话间复用该 Composer,所以这是生产可达的切换方式。当前 A→B 后等待 A 完成的回归仍通过;新发送完成的 owner 校验保护不到这里的 cleanup。

最小修复是在发送状态中绑定具体草稿 owner,只清理属于该发送的草稿,离开其他会话仍保存它们。新增 A→B→C→A 完成→返回 B 的回归,同时保留现有首发 new→thread 迁移对照。

2. [P2] Steward 的迟到提交响应可以覆盖已运行的下一轮

StewardConversation.tsx:122–140

提交 T1 后,sendManagerTurn() 返回前没有 pending/sending owner,输入框与提交入口仍然可用。若 T1 在 Core 已结束、但其 202 接受响应在客户端延迟,用户可以合法提交 T2。T2 先返回并开始输出时,迟到的 T1 响应无条件 showTurn(T1),旧轮次结束又清掉当前 ref,使 T2 的回答和停止按钮消失,后续 T2 事件被忽略。

实际组件复现得到:第一请求待返回时 inputDisabled=false;第二请求后 T2 回答可见且有停止按钮;释放第一响应后,T2 回答与停止按钮均消失。另以生产 ChatSessionStore 和 TypeScript admission planner 独立验证:T1 活动时 T2 被拒绝;T1 完成后 T2 正常接受。因此没有假设 Core 同时执行两个本应互斥的轮次。证明的是客户端活动状态与显示丢失,未声称服务端删除历史。

请从提交开始建立按 session/attempt 绑定的同步 owner,阻止该阶段重复提交,并让接受响应、SSE 和结束读回只修改自己拥有的轮次。现有四个迟到 history GET 成功/失败对照都通过;本例发生在更早的 POST 接受边界,需要独立覆盖。

3. [P2] 合法 TOML 表头注释使 MCP 安装写出重复表,损坏 Codex 配置

mcp-format.ts:146–152

parseHeader() 的正则不接受 ] 和 # 之间的空格,因此合法的 [mcp_servers.example] # local MCP 同时被发现流程与改写范围查找漏掉。安装同名 MCP 时,即便 overwrite: false,已有配置也被判断为不存在,随后在文件末尾追加另一份同名表。

已用生产 HTTP server → McpManager → CodexAppServerAdapter → 临时 config.toml 完整复现,以 Python tomllib 作独立 oracle:

现有配置表头 安装前 GET /api/mcp overwrite:false 的 POST 安装后
无行尾注释 合法 正确列出 200 / exists 原文件不变且合法
带空白和行尾注释 合法 servers: [] 200 / installed 重复表,TOMLDecodeError

请让 reader/writer 一致接受合法表头空白和注释,并覆盖“不允许覆盖时文件不变、明确覆盖时只保留一份表、标准 TOML parser 可读回”。这与已修复的转义引号问题是两个独立边界。

4. [P2] 已提供的节点更新脚本仍使用独立仓库布局,无法更新 monorepo 安装

update-node.sh:34–43 · README 中的使用入口

新的 installer 使用 <clone>/apps/workbench,但 updater 要求 repo/.git,从 Git 根制作快照,再在快照根执行 npm run build;LoopX 根 package.json 没有 build。把 repo 改为 apps/workbench 又不能通过 .git 检查。后面的 WorkingDirectory 与 restart 路径同样仍假设应用就在根目录。

以 exact-head 脚本和两个未修改的 package.json 构造本地临时 bare-origin/clone;只替换 systemctl、跳过依赖安装,真实 npm 执行 build。repo 为 monorepo 根时实际返回 Missing script: "build",updater 报 build failed 并保留当前服务;repo 为应用子目录时实际报 no clone。没有执行真实 relay/systemd 更新。

请区分 checkout root 与 app root:Git/ref/snapshot 用前者,构建、WorkingDirectory、restart 用快照内 apps/workbench;用 installer 相同布局增加离线回归。若此入口不属于当前可用功能,应明确撤下可执行入口和使用承诺,不能仅留下一个必然失败的默认路径。

动机 / Motivation

使用 Workbench 的用户希望从同一浏览器入口处理普通对话、创建或继续 Goal,并在取消、断线和重启后读回可信结果。旧的 dashboard、Python chat 与各个原生 Agent 会话需要分别定位;这次导入的工作台把这些交互收拢,同时由原有 Core 继续管理 Goal 与权限。

这是一项可独立启动、可逆的可选交付。任务完成/认领、完整跨 Goal 看板、旧 Dashboard 退役和替换 Python chat 仍不属于此次承诺。没有将这些后续工作重新加入合并条件,也没有把新增行数当作架构失败的证据。

本轮修复已经改善首轮交付判断、取消后的工具呈现、配置往返和失败恢复。但当前用户在发送期间切换对话仍能失去未发草稿,Steward 连续提交仍可能失去活动轮次,配置编辑和节点升级也存在可复现错误。这些是已有入口内的剩余缺口,修复不需要扩大产品范围。

改动思路 / Approach

Core 继续拥有 Goal 生命周期、registry、授权与 action receipt;daemon 管理本机线程、原生会话和持久事件;Web 从这些 owner 派生显示。注册 Goal 路径已改为通过 Core registry CLI 读取,避免另一套 registry 编解码;取消工具投影复用现有 Work.done/interrupted,不新建执行状态账本。

最强的反对理由是整套导入带来的双入口维护成本,以及“单元测试都通过但用户流程仍坏”的风险。对已冻结的可选交付,直接在旧 dashboard 重做全部交互并不是更小的同等结果;当前 owner 分工可以接受,后续收敛仍应追踪。已有 架构建议保持非阻塞,不因本轮复审升级成额外义务。

下面是源码推导的修复边界比较,不代替执行证据:

所属边界 当前已经修复 仍缺的约束
Composer A 完成时不再清掉当前 B B 切出时也必须判断发送 owner
Steward 旧 history GET 不再覆盖新 turn POST 接受与 SSE 也必须属于当前 attempt
MCP TOML 转义字符串可以往返 合法含注释表头必须被读写双方识别
安装/升级 installer 可以选 ref 并定位 monorepo app updater 的构建与重启需使用同一布局

修复应落在这些既有 owner,优先补齐身份与往返约束,无需引入平行 Goal 调度器、额外确认页面或第二套配置模型。

具体改动 / Changes

本轮范围

当前完整 PR 为 905 个路径,+194644 / -15。相对本人前次 e1087d9,82 个当前 PR 路径发生变化,823 个路径内容不变;401 个随 main 合并而变化、但不属于当前 PR diff 的路径分开处理。已阅读这 82 个路径的完整增量,并深查相关 Core、daemon、Web、安装和更新调用者。此前评审保留其原版本与适用边界;这里不声称本轮重新逐行阅读了所有约 19 万行导入代码,更不声称执行了全部运行路径。

发布前追加的两笔提交

发布前 head 从 b5613c8 更新为 00e20a0。新增 4e843c3 与 00e20a0 两笔提交,仅修改两个公共扫描 owner 与两份测试,共四个文件 +267/-11;其余 901 个路径内容不变。已经全文补读本增量并在新 head 重跑上述四项反例,仍全部成立。

视频现在按 container header 分流到既有人工媒体审查,伪装成视频的普通文本、无效 header、symlink 继续按原失败路径处理,媒体本身仍保留 manual_review_required。凭据分类增加源表达式识别;两份相关测试本轮 190/190 通过。测试通过不等于已证明所有实际字面凭据都保持阻断,安全敏感的补充审查材料按仓库约定保留在私下反馈中。

下面 Web/Core/daemon/installer 大套件实际执行于 b5613c8。其对应源码、依赖和测试与当前 head 的 blob 一致,因此保留明确版本的证据;没有把这些数字改称新 head 的全套重跑。当前四项公开反例与新扫描检查是在 00e20a0 独立执行。

上轮问题与后续修复

  • 首轮恢复已把 native preparation 与 prompt dispatch 分开;ACP kill/restart、已交付去重和 delivery=uncertain 的定向回归通过。
  • Steward 的迟到 history GET 校验已生效;现有四种成功/失败、普通/concurrent renderer 对照通过。本轮第二项是迟到 POST,未重复旧问题。
  • Composer 的 A→B 后 A 完成、新会话首发 owner 迁移对照通过;本轮第一项需要额外的 B→C 切换。
  • 活动 schedule run 保留、批量 revert 原子发布、stdin EPIPE 清理、usage 长行跨扫描、DST/catch-up、Codex add/delete 原文和 TOML 转义的当前定向回归通过。
  • Goal 读取失败与 Retry、取消工具不再显示运行中、迟到真实 tool.end 和活动轮次对照通过。原始事件仍保留,未把中断当成功。
  • 自定义 cron 编辑与 MCP 只改说明的修复源码及新增浏览器测试已检查;本轮未成功重跑完整浏览器路径,不将作者的浏览器记录冒充本次执行。

规范依据是 base 03e1b48 的 docs/development/frontend-delivery.md#task-first-delivery:第 2 项要求复用已有 owner,第 3 项明确包括 out-of-order、重复操作、取消和重新加载,第 4 项要求真实产品任务与读回。本轮 findings 分别对应草稿所有权、异步读回、配置读写结果与已提供升级入口;不是从模型/作者身份或代码规模推导质量。

对主干的风险 / Risks

本轮实际验证结果(旧头执行及当前增量的适用范围见上文):

验证 结果及边界
3 个 Core 测试文件 PASS,70 项;含 open_session 默认/显式路径、会话绑定、Goal 名称
Core authority join PASS,10 项;真实 HTTP/Core CLI 与 File/SQLite、object/strict envelope、权限/目录拒绝、损坏 registry;线程创建使用记录型 fixture
Web 单元/组件套件 PASS,584 项
workspace typecheck、npm build PASS
daemon 定向回归 92 PASS / 1 FAIL;Git 2.52 文案兼容断言失败,实际分支占用仍被 409 拒绝
installer PASS,11 项;真实 installer/clone/setup,npm/systemctl 为 fixture
本轮 4 项反例 均已复现;组件、Core admission、真实 MCP HTTP、隔离 updater,按上述边界分别验证
init smoke、完整 packaged Goal journey 本环境未完成;daemon 在绑定 personal Unix socket 时 EPERM,不能声称通过
新增 scanner / media 相关测试 PASS,190 项;另有安全敏感的独立反例私下反馈
当前原生 public-boundary scan FAIL;900 个输入,2 个 blocking hits,0 个 unreadable,4 项媒体人工审查保留

旧 b5613c8 的 35 个 blocking hits 已逐条独立归因为源码引用或合成测试材料。当前新增提交实际修改了通用分类器,重新运行得到 900 个去重输入、2 个 blocking hits、3 个 private_ip advisory、181 个 references、0 个 unreadable;3 个 PNG 和 1 个 MP4 保留媒体人工审查。两个剩余命中分别为测试中的 userAuthorization 风险等级和通用 Lark app deep link,仍没有发现实际凭据或私人文档。MP4 内容与旧头相同,之前解码观察的 5 帧纯色、无音轨仍适用。原检查依然 FAIL,不能说通过;这些误报归因也不能证明新的通用凭据分类已经保持全部拒绝语义。

新 head 的 GitHub Actions 已触发;本次读取时 Dependency Review 成功,其他工作流仍排队或执行,未声称当前 CI 已完成。前一 head b5613c8 的 Package Smoke、PostgreSQL Integration、Release Artifacts、Dependency Review、DCO 成功,Python Tests失败。已读取 kernel-static-checks 日志并本地复现,错误为 tests/control_plane/test_contract_health.py:10 的 Ruff F401;该文件在 actual base、b5613 和当前 head 内容一致,不属于本 PR 的修改。旧运行的后续检查因上游失败而跳过或失败,不能视作当前头测试通过,也不将这个既存问题算作本 PR 新增业务缺陷。

审查运行在隔离临时数据和 fake model/controlled response 上,没有操作活动 Goal、真实 Agent 凭据或服务。未完成本轮完整浏览器/真实模型、跨机 relay、正式安装后的服务和全部平台资格;没有用单元测试替代这些边界。本轮 native review CLI 的在线读取因 gh 未登录失败,改用 GitHub connector 当前元数据快照执行其正式 --fixture/--check-result 路径;远端 head 另由 connector 复核,未声称在线 gh 工作流成功。

我的整体评价 / Verdict

本轮没有完成实际打包页面的视觉检查:原生启动在 UNIX socket EPERM 处失败。桌面与窄屏、展开长内容、深色模式和真实浏览器取消恢复的本轮视觉资格未验证。

实现比前次有明显进展:作者按缺陷逐项修改了原 owner、增加对应回归,并补充真实 Core 组合证据。保留 Core 权威、WorkBench 负责交互的主线仍合理;当前独立可选工作台的边界也成立。问题集中在异步生命周期和迁移后的读写入口,不需要再做一轮大规模重构。

本头仍应 REQUEST_CHANGES,依据是上述 4 项已验证 P2,而不是把已解释的扫描误报或 main 带来的 Ruff 错误当成产品回归。 先修会丢未发内容的 Composer、会损坏配置的 MCP,再收口 Steward 提交所有权和 updater 路径;补相应反例后重新审查。旧 findings 不应仅因线程仍未 resolve 就被视作仍然成立,本轮也没有据此批量消除他人的 review 或授予合并权限。

English verdict: REQUEST_CHANGES — 8843@00e20a018188ac810281f35f72504b92fe2052ab. Four current P2 defects were independently reproduced in draft ownership, Steward submission ownership, MCP TOML installation, and the monorepo node updater. Earlier targeted fixes pass their stated checks; public-boundary hits are independently explained as false positives, while the native scan and broader validation limitations remain explicit. No merge authority is implied.

Comment on lines +524 to +528
return () => {
const draft = draftRef.current;
// A message on its way out is not a draft: sending a new thread's first message opens the
// thread mid-send, and the text must not stay behind in the next new thread.
keepDraft(draftKey, sendingRef.current ? null : draft);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 连续切换时仍会删除其他会话的未发送草稿

A 的发送/上传未完成时,切到有正文和注释的 B,再在 A 完成前切到 C。这里的 sendingRef 仍属于 A,却使 B 的 cleanup 执行 keepDraft(B, null)。实际 Composer + drafts/localStorage 已复现:B 首次打开有内容,切出即从存储消失,A 完成后返回 B 为空。现有 A→B 后等待 A 完成的回归通过,保护不到本时序。

请将 sending 状态绑定具体 draft owner;离开未发送的 B 应正常保存。新增 A pending→B→C→A 完成→B 的回归,并保留 new→thread 首发迁移对照。本反例已在00e20a018重跑。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cff0d38 (head 66843a5). sendingRef now records the send owner { key, mark } instead of a component-wide boolean. The layout cleanup, the autosave timer and the visibility flush skip only the draft key that is actually being sent. Leaving or editing B or C while A is pending keeps their drafts. The new→thread first-send migration moves the owner key along, so the interrupted-upload draft still lands in the created thread. web/test/composer-draft-owner.test.ts adds the A pending → B → C → A completes → B regression, and the existing new→thread migration control still passes. Web suite 586/586; tsc --noEmit clean.

Comment on lines +136 to +140
const clientTurnId = (crypto.randomUUID?.() ?? String(Date.now()));
try {
const { turnId, eventsPath } = await sendManagerTurn(token, sessionId, body, clientTurnId);
showTurn({ turnId, eventsPath, state: 'streaming', steps: [], answer: '', error: null });
await runStream(sessionId, turnId, eventsPath);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 迟到的提交接受响应会覆盖正在运行的新轮次

await sendManagerTurn 期间没有 pending/sending owner,输入仍可提交。若 Core 已完成 T1 但客户端延迟收到它的202,T2可以合法接受并先输出;随后这里的旧T1响应无条件showTurn,使T2回答和停止按钮消失,后续T2事件被忽略。

实际组件已复现;真实Core Store + TypeScript admission对照确认T1活动时拒绝T2、T1完成后接受T2,未假设非法并行执行。请从提交开始锁定session/attempt,并为接受响应、SSE和结束读回校验owner。现有迟到history GET回归通过,本例需要延迟POST接受响应的独立回归。本反例已在00e20a018重跑。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 825d47d (head 66843a5). Submission now takes a session/attempt owner before sendManagerTurn() is awaited, and the composer is blocked while that POST is pending. The accept response, SSE events and the end readback only apply when they belong to the current attempt, so a late T1 202 can no longer showTurn over T2 or clear its ref. web/test/steward-conversation.test.ts adds the delayed POST-acceptance case: T2's answer and stop button survive T1's late response. The four existing late history-GET controls still pass. Web suite 586/586.

function parseHeader(line: string): string[] | null {
const trimmed = line.trim();
if (!trimmed.startsWith('[') || trimmed.startsWith('[[')) return null;
const match = /^\[([^\]]*)\](?:#.*)?$/.exec(trimmed);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 合法 TOML 表头注释使安装流程追加重复表并破坏配置

该正则不接受 [mcp_servers.example] # local MCP 中 ] 后的合法空白。发现和改写范围定位都因此漏掉已有服务,overwrite:false 也失去保护。通过真实HTTP → McpManager → Codex adapter → 临时config.toml已复现:GET servers=[],POST返回200/installed,文件随后包含两个同名表;独立tomllib报Cannot declare ... twice。无注释对照正确返回exists且文件不变。

请让读写双方接受合法空白/注释,覆盖不允许覆盖时原文件不变、明确覆盖时只保留一份表,并用独立TOML parser检查写出结果。本反例已在00e20a018重跑。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8997a41 (head 66843a5). parseHeader and isTableBoundary now parse [a.b] and [[a]] through the shared key-path and whitespace helpers. Optional whitespace and a trailing # comment are accepted, so [mcp_servers.example] # local MCP is discovered, overwrite:false returns exists and leaves the file unchanged, and an explicit overwrite rewrites the single table in place. daemon/test/mcp-format.test.ts and mcp.test.ts cover the commented header through the manager path. They check that discovery finds it, that no-overwrite leaves the file unchanged, and that an overwrite leaves exactly one table. 12/12 pass.

Comment thread apps/workbench/scripts/update-node.sh Outdated
Comment on lines +38 to +41
tar --exclude=./.git --exclude=./.worktrees --exclude=./shots -cf - . | tar -C "$snap" -xf -
fi
say "building ${snap##*/}"
if ! ( cd "$snap" && npm install --no-audit --no-fund >/dev/null 2>&1 && npm run build >/dev/null 2>&1 ); then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 节点更新器仍在 monorepo 根目录构建

当前installer的应用在/apps/workbench,但这里从要求有.git的clone根制作快照,再于快照根npm run build。LoopX根package.json没有build;把repo改为apps/workbench又无法通过第13行.git检查,后面的WorkingDirectory/restart路径也仍指向快照根。

用exact-head脚本和未改package.json的隔离本地clone实跑:真实npm返回Missing script: build,updater报build failed;子目录参数报no clone。systemctl为fixture,没有真实服务/relay操作。README仍提供update-hosts入口,请分开Git root与app root,并用installer相同的monorepo布局覆盖构建和重启路径。本反例已在00e20a018重跑。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d9b6a18 (head 66843a5). update-node.sh now separates the Git checkout root, which keeps the .git check and the snapshot, from the Workbench app root <clone>/apps/workbench, which is used for npm ci/build, WorkingDirectory and restart. This matches the installer's monorepo layout. update-hosts.mjs and the README entry follow the same layout. The new e2e/test/update-node.spec.mjs runs the script against an isolated local monorepo clone with a stubbed systemctl and asserts that the build and restart paths use the app root (2/2 pass). No real service or relay is touched.

…witches

Switching A -> B -> C while A's send was still pending cleared B's unsent draft because the layout cleanup and autosave checked a component-wide boolean rather than the draft key being sent. Track the active send owner key (including new -> created thread migration) so leaving or editing other conversations keeps their drafts intact.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…e by attempt

Record synchronous sending state and a monotonic attempt owner before awaiting sendManagerTurn, blocking duplicate submissions while POST acceptance is pending and ignoring late acceptance or stream events from superseded attempts.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
…eaders

Parse table and array-of-table headers with the shared key-path and whitespace helpers so valid headers such as '[mcp_servers.example] # comment' are discovered and replaced in place instead of appending duplicate tables.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
… update-node

Resolve the repository root for git fetch/advance (including detached install.sh sparse checkouts) while snapshotting, building, and switching WorkingDirectory from apps/workbench when running from the LoopX monorepo.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)

REQUEST_CHANGES。当前打包网页的取消状态已修好。新会话发送完成时仍可能清掉无关会话里原有的草稿和引用备注。

动机 / Motivation

本地用户从聊天创建或继续 Goal,也会在等待发送期间打开其他对话编辑草稿。

上一审查头在首条消息发送期间仍保留独立会话的草稿。当前提交为发出草稿增加归属标记,并处理已经停止的工具。

当前打包网页的取消状态已修好。新会话发送完成时仍可能清掉无关会话里原有的草稿和引用备注。

本次覆盖可选 Workbench 的创建、继续和读回。正式安装、跨平台发布和模型效果属于独立验证。

切换已有会话可使草稿存储误认本次发送归属。 用创建接口返回的实际会话 ID 交接待发草稿,并将切换已有会话的对照加到当前草稿测试。 当前范围是可选 Workbench 的 Goal 会话用户旅程及其独立阅读和发送路径。旧 Core 会话入口与权限语义继续兼容。

改动思路 / Approach

Core 保留 Goal、权限和确认的权威。Workbench 的原生会话与草稿由各自的持久层维护。问题应在实际返回的新会话身份和已有草稿归属之间修正。

当前范围是可选 Workbench 的 Goal 会话用户旅程及其独立阅读和发送路径。旧 Core 会话入口与权限语义继续兼容。

真实 Core 和打包网页复测连接、创建、两次重启、取消和重试。取消后的未结束工具在桌面与 390px 窄屏显示已结束;明确完成和在途语义继续区分。 把待发草稿与实际创建回执返回的新会话绑定。在完成时只清理仍持有本次发送标记的条目,保留其它会话的文字与引用。 只有明确启用的 Workbench 本地会话会消费 UI 发送;Goal 创建依赖 Core 的原确认和目录权限。

具体改动 / Changes

本次核对 66843a5,提案基线 3c03e91。906 条路径 +195084/−15。上一评审有 886 对源文件一致,重审 20 对,其中 16 对在 Workbench。 比较实验使用 3f1da70,保留该版本的实际行为证据。

规范依据为 docs/development/frontend-delivery.md,版本 3c03e91。

  • task-first-delivery:2 (implemented)。沿用实际 Core/Workbench 权威与用户旅程。
  • task-first-delivery:4 (not_met)。切换已有会话可使草稿存储误认本次发送归属。

关键代码讲解

  • Composer useLayoutEffect。离开 new 草稿时转移在途发送。只根据离开键和发送状态推断目标键。
  • Composer submit。发送完成后清理本地草稿,再判定仍显示哪个会话。所清理的键必须拥有本次发送标识。
  • buildTimeline。按已终止轮次整理仍待结束的工具显示。已有终态真实 tool.end 保持自己的结束信息。

对主干的风险 / Risks

[P2] Prevent cross-conversation draft loss

在已有会话 B 保存文字和引用备注。打开普通新会话,首条消息未返回时切回 B,然后完成原发送。 上一审查头通过同一测试。当前头的实际 Composer 组件在同一顺序下清掉 B 正在编辑的引用备注。归属赋值只检查离开的是 new,发送完成会从错误会话的键删除草稿。 打包网页也使用可控的普通本地请求延迟复测。切到 B 时存储与编辑器都仍有未发文字。新会话收到首条消息之后,B 的存储条目消失,重开后输入框为空。 把待发草稿与实际创建回执返回的新会话绑定。在完成时只清理仍持有本次发送标记的条目,保留其它会话的文字与引用。

验证记录。同一行为 oracle 在上一审查头保留 B 的文字与备注。 打包 build、workspace typecheck、586 项网页测试、11 项实际 Core/Workbench 组合、12 项 MCP 和 13 项安装/更新隔离测试通过。 模型响应由脚本提供。整套 daemon 测试未完整返回。标准预合并 6 项直接检查通过,19 项选中检查中 public-private-boundary 有 1 项失败,仍需独立辨别命中,未把它归为已确认凭证。 与采样主干的本地合并树可生成。托管 CI 未查询。

语义与 CI 对齐

task-first 真实入口和故障回读。 既有 thread id、draftKey 和 Sending 用于本地草稿归属,未扩展 Core 权限或执行状态。 独立 Composer 渲染测试。保持 B 的实际草稿先在 localStorage,延迟 new 的发送,切回 B 后解决 promise。 用创建接口返回的实际会话 ID 交接待发草稿,并将切换已有会话的对照加到当前草稿测试。

我的整体评价 / Verdict

REQUEST_CHANGES。真实 Core 和打包网页复测连接、创建、两次重启、取消和重试。取消后的未结束工具在桌面与 390px 窄屏显示已结束;明确完成和在途语义继续区分。 切换已有会话可使草稿存储误认本次发送归属。 把待发草稿与实际创建回执返回的新会话绑定。在完成时只清理仍持有本次发送标记的条目,保留其它会话的文字与引用。 桌面和窄屏的持久取消状态与重试结果均可读。发送期间切换会话导致草稿备注丢失,直接破坏可恢复的编辑体验。 暗色、完整窄屏折叠切换、桌面安装与第三方原生 Agent 未测试。

模型响应由脚本提供。整套 daemon 测试未完整返回。标准预合并 6 项直接检查通过,19 项选中检查中 public-private-boundary 有 1 项失败,仍需独立辨别命中,未把它归为已确认凭证。

English verdict: REQUEST_CHANGES — the cancelled-tool display is fixed, but a first send can clear a different conversation's unsent draft. Bind migration and cleanup to the created conversation and preserve the unrelated draft.

// Creating a thread changes its draft key before uploads finish. Keep that first message
// in the new thread so an interrupted upload still has an editable, retryable draft.
const activeSend = sendingRef.current;
const firstMessage = activeSend !== null && activeSend.key === previous && isNewDraftKey(previous);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 离开 new 时,目标 draftKey 也可能是用户刚点开的已有会话。打包网页测试里,在延迟的新会话创建请求完成前切到已有会话,再放行首发,已有草稿从存储消失。请按实际创建回执的线程 ID 迁移,并校验完成时清理的草稿仍属于本次发送。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b816ec9. The composer no longer infers migration from a draft-key change. The hub reports the created thread's scoped draft key (plain create, Goal, and team paths), and the composer only migrates/clears drafts carrying this send's mark, so switching to thread B mid-send leaves B's draft intact. Added regressions for local and host-scoped keys, with the create id known and not yet known when switching (all 4 failed on the old code), plus first-send upload failure/cancel retaining the draft on the created key. Web 594/594, tsc and drafts/composer e2e pass.

…message is sent

The composer moved the in-flight draft by watching its draft key change, so switching
to another thread mid-send could migrate or clear that thread's draft. The hub now
reports the created thread's draft key, and the composer only moves or clears drafts
carrying this send's mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5

Copy link
Copy Markdown
Collaborator Author

@songoow @loopx-agent All review threads have been addressed and replied to; the latest fix (draft ownership on first send) is in b816ec9. Could you please re-review? Thanks!

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · reasoning effort max

REQUEST_CHANGES。首发期间切换会话导致草稿丢失的旧反例已通过。此次复审发现,安装后的第一次节点更新在构建失败时会改坏旧服务的启动目录。

动机 / Motivation

本地用户希望在 Workbench 中发起普通对话、创建或继续 LoopX Goal,并在中断后读回草稿与结果。

Workbench 将原先分开的会话和 Goal 操作接到同一界面。运行节点通过更新脚本构建候选版本,在节点空闲时切换服务。

当前版本已验证首发草稿归属和真实 Core 的创建、取消、重启与重试。首次更新失败仍会改动旧服务使用的 checkout,随后旧服务可能无法重新启动。

本次范围包括可选 Workbench、Core 接缝与仓库提供的安装和更新入口。完整迁移、真实模型成效及正式发布各有自己的验收。

请从候选提交构建独立目录,等验证通过且服务准备切换后再推进受管理的安装版本。

改动思路 / Approach

Core 保留 Goal、权限和动作的权威,daemon 管理本地线程、原生会话和事件,网页读取已持久化的结果。首发回执现在把草稿交给实际创建的线程 ID,Composer 只清理仍持有本次发送标记的草稿。这个做法复用了现有草稿保存路径。

更新器也已有明确的权威边界。Git 引用负责标识候选,systemd 的 WorkingDirectory 指向当前服务文件,构建快照承接待切换内容。只要初始服务仍从安装 checkout 启动,把 FETCH_HEAD 写到该 checkout 就已改变当前版本。用已获取的提交生成快照即可保留现有服务布局及回滚能力。

当前范围覆盖可选 Workbench、Core 接缝和已经提供的安装及更新入口。更新器可以复用候选 Git 提交构建独立快照,初始活动版本应一直保留到实际切换。

具体改动 / Changes

受审提交 b816ec9b2f36f1430120bca0a23fa4a0d902f065,实际基线 3c03e91e6736f129d78e7c895b9d4a871f132a7f。GitHub 文件列表与本地完整 Git 差异逐路径一致,共 906 个路径。相对上次独评 66843a598402c3cfb69deefa7f3562e4a5545dad,902 个路径的 base/head blob 成对一致。本轮重新检查 App、Composer 和两个草稿测试,并在新头复核更新失败、公共边界和关键组合路径。

依据 Task-first delivery。task-first-delivery:2 已落实 Core owner 复用。task-first-delivery:4 的创建、会话切换与恢复路径有执行和读回证据,第一次更新失败后的可恢复性尚未满足。

关键代码讲解

  • App.performSend 将创建 API 返回的实际线程键交给 Composer.submit。我延迟了打包界面收到真实创建响应的时间,在等待期间输入另一份未发文字,往返两个已有线程,再恢复请求。新线程的历史收到首条消息,另一个线程的正文与注释、新建页里的未发文字均保留。重新打开后在桌面和 390px 宽度见到该草稿与注释。 发送归属
  • StewardConversation 对提交和读回绑定当前 attempt,timeline 将终止轮次中的未结束工具归为中断。MCP 更新复用 TOML 键解析,保留合法表头注释的读写覆盖。当前针对性 daemon 测试通过。 Steward · TOML
  • update-node.sh 已区分 Git 根和 Workbench 应用目录,能为 monorepo 构建快照。安装器新建的服务仍会直接在安装 checkout 的 apps/workbench 中执行 npm start。 服务启动目录

对主干的风险 / Risks

[P2] 保留首次更新失败后的可启动旧版本。 安装器生成的服务仍从 detached sparse checkout 启动时,更新器先 checkout 到候选提交并改写安装版本,再尝试构建快照。我复用仓库离线 updater fixture,用真实 Git、npm 和脚本模拟首次更新。旧目录最初可以按服务命令启动,候选构建失败后脚本报告原 daemon 留在原位,单元配置也确实未改。然而原启动目录已变成候选内容,重跑同一启动命令报缺少 start。这个反例只替代系统服务管理与网络安装,没有操作真实服务。 先修改运行目录的分支

现有测试在一次成功更新已将服务移到独立快照后,再验证第二次构建失败。请加上第一次更新即失败的分支,核对原 WorkingDirectory、原文件和启动命令均仍可用,并保留从独立快照更新的正向对照。

验证通过了 594 项 Web、22 项定向 daemon、13 项安装与更新、358 项 Core/扫描测试及 11 项真实 Core 与 Workbench 组合测试,构建和类型检查通过。组合使用脚本模型。完整 runner 在 macOS 还有两条等待日志断言失败,实测为 BSD wc 的计数空白。标准 premerge 的 6 项直接检查和 19 项中的 18 项通过,公共边界扫描仍报 5 项命中,另有 4 项人工媒体审查待完成。保留原判定和验证缺口。真实 systemd、跨机更新、全平台和真实模型未在此复审资格内。

语义与 CI 对齐

更新的失败恢复应保证已启用版本仍可启动。当前失效点在候选构建之前改了活动工作树。最小复验是离线执行首次失败更新,再从原 WorkingDirectory 执行相同的启动命令,并验证安装版本读回。托管 CI 未查询。

我的整体评价 / Verdict

用真实创建回执交接草稿的方案成立。Core 与本地会话继续由各自 owner 管理,当前构建验证了先前的草稿隔离缺陷已修。更新恢复仍有一处实际阻断,请先保住原服务启动目录,再复验首次失败和已切换快照两条路径。公开边界扫描和实际部署资格仍需各自读回。

当前构建在桌面与 390px 下均可读回已有会话的正文和注释。暗色主题、跨机更新、全平台和真实模型仍待验证。

English verdict: REQUEST_CHANGES — b816ec9 fixes cross-conversation draft ownership. A failed first update replaces the checkout used by the installed service and can make the old service unstartable. Stage the fetched candidate without modifying the live checkout.

Comment thread apps/workbench/scripts/update-node.sh Outdated
[ "$(git rev-parse HEAD)" = "$(cat .git/loochat-installed-revision)" ] \
|| fail "the clone has local commits; it needs a person"
git fetch --quiet --depth 1 origin main 2>/dev/null || fail "git fetch from origin failed (offline?)"
git checkout --detach --quiet FETCH_HEAD 2>/dev/null || fail "cannot advance detached install checkout"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里会在首次更新构建前改动旧服务仍在使用的 checkout。离线复验中,候选构建失败时原 unit 路径与重启调用未变,但路径内已是候选代码,旧服务的 npm start 命令因此失败。请直接从获取的提交构建独立快照,在验证和实际切换前保留旧启动目录。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f7f860f. update-node.sh now only picks the candidate revision (FETCH_HEAD for the detached install, the fast-forward target for branch/untagged installs; diverged clones are still refused) without checkout/merge, and leaves .git/loochat-installed-revision alone. The candidate tree is exported with git archive into the release snapshot and built there, so a failed build leaves the old checkout byte-for-byte unchanged and still startable. New regressions in update-node.spec.mjs cover the branch, installed-detached and plain-detached first-update failure cases plus a restart-failure rollback; 3 of them fail on the previous script, all 7 pass now.

…heckout untouched

update-node.sh used to check out or fast-forward the clone before building.
When the service still ran from that clone, a failed candidate build left the
old service unable to start. Pick the candidate revision without moving HEAD
or the install marker, and export it with git archive into the release
snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@mergify

mergify Bot commented Nov 18, 2026

Copy link
Copy Markdown

Hi @maxliux5, the DCO Sign-off check did not pass. Please inspect
its details first: checkout, fetch, timeout or infrastructure errors
need their own recovery, not a rewrite of otherwise signed commits.

If the log confirms a missing Signed-off-by trailer, amend the
affected commit with git commit --amend -s; for multiple commits,
use an interactive rebase against the current base from the correct
base-repository remote and sign off each affected commit. Push the
rewritten PR branch with git push --force-with-lease origin HEAD.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
@maxliux5
maxliux5 force-pushed the codex/loochat-workbench branch from bb65068 to fb13aef Compare November 18, 2026 11:40
@maxliux5
maxliux5 merged commit 648d06d into loopx-project:main Nov 18, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants