Skip to content

Rename SOP to LOOP across LoopForge - #1286

Merged
Robert0622 merged 30 commits into
mainfrom
codex/rename-sop-to-loop
Nov 26, 2026
Merged

Robert0622 merged 30 commits into
mainfrom
codex/rename-sop-to-loop

Conversation

@Robert0622

@Robert0622 Robert0622 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Use LOOP as the product name for reusable Agent delivery workflows. Update the Chinese and English app copy for the catalog, visual designer, chat references, project setup, requirements, approvals, runs, scheduling, notifications, and reporting.

Update Agent prompts, API and MCP descriptions, the four built-in templates, and the demo project copy. Refresh both READMEs, eight product screenshots, diagrams, and the deployment, API, and Local guides.

Compatibility

Existing routes, tool names, JSON fields, workflow IDs, and persisted execution types still work. The installer applies 043_loop_terminology.sql to update shipped defaults while preserving customized names and descriptions, project copies, and run history. Operators can run the same SQL directly for existing external MySQL deployments.

Validation

  • Chatbot build and 486 tests, 234 Web tests, and 17 targeted Web regression checks.
  • Installer suite with 61 passed and 2 optional checks skipped. MySQL 8.0 upgrade tested against the old catalog, including customized data and an idempotent rerun.
  • Chromium checked both languages and the chat reference picker against the existing reference API. The no-key welcome LOOP produced an artifact, waited for approval, and completed after approval.
  • go vet, public content and secret scans, and LoopForge Local validation and smoke tests passed.
  • The focused HTTP API, Agent intent, Bot, domain, OpenAPI, and Web Go tests passed. The local full Go run reported engine and Runner failures and an HTTP API timeout. Three engine cases were rerun on both the base and this branch. Two passed on both, and the paused child resume test timed out on both.

@crispinhu27 crispinhu27 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.

Code Review — PR #1286 "Rename SOP to LOOP across LoopForge"

Scope: 476-file mechanical rename of "SOP" → "LOOP" in UI copy, documentation, comments, test assertions, migration SQL, installer scripts, and agent prompts. API routes, JSON field names, Go struct/const identifiers, and serialized execution types are unchanged.

Verification performed:

  • Migration SQL (042_loop_terminology.sql): idempotency guards (BINARY equality check on name and payload) are present; transaction is wrapped; installer script correctly appends the new migration file; test-install.py test asserts ordering via sql.index and covers the new migration.
  • Go diffs: all SOP→LOOP changes in .go files are confined to comment text and user-facing notification string literals. No exported type names, struct field names, JSON tags, or const values were renamed.
  • Web/chatbot test assertions updated consistently to match new string literals.
  • CI: browser, e2e (all platforms), first-run, validate, curl-install, secrets, tcmcp, scan all green. core was still running at review time.

One confirmed issue (see inline comment): The Markdown fragment in CHANGELOG.md still points to #updating-existing-public-sops after the matching heading in docs/deployment.md was renamed to ## Updating existing public LOOPs (new anchor: #updating-existing-public-loops). This broken cross-reference was introduced by this PR.

Comment thread CHANGELOG.md Resolved
@cocofhu00

Copy link
Copy Markdown
Contributor

结论:需要修改

GitHub 拒绝了 Pull Request Review 接口(HTTP 403:Tencent 组织启用了 OAuth App access restrictions)。当前账号无法提交正式 Request changes。

CHANGELOG.md 第 40 行的链接仍是 docs/deployment.md#updating-existing-public-sops,但 docs/deployment.md 第 219 行标题已改成 “Updating existing public LOOPs”,对应锚点是 #updating-existing-public-loops。从更新说明点进去到不了这一节。请把片段改成 #updating-existing-public-loops。

完整 diff 超过 300 个文件,没有逐文件看完。已看的迁移 migrations/042_loop_terminology.sql 只按原文精确更新四套内置模板和 welcome 描述;与 #1287 重叠的 Go/前端补丁是文案和注释。CI 已通过,与 main 没有冲突。修掉失效链接后再合。

roberttwang and others added 6 commits November 24, 2026 14:23
Resolve conflicts by keeping main's changes and applying the LOOP
terminology to the conflicting hunks.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Rename the user-visible SOP copy that main added for the enterprise IM
channels, observability dashboard and docs, following the same rules as
the rest of this branch (routes, JSON fields and identifiers unchanged).

Keep accepting the old wording where it can still arrive: notification
cards skip both LOOP and SOP header lines, chat drafts recognise both
(LOOP:…) and (SOP:…) notes, and the clarification command accepts
"保存并启动 LOOP" as well as "保存并启动 SOP".

Point the CHANGELOG link at #updating-existing-public-loops.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Keep main's project role, skill body and workspace changes and apply the
LOOP terminology to the conflicting copy.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…e to main's new copy

main added 042_project_credentials.sql and 042_skill_bodies_to_files.sql,
so the terminology migration becomes 043_loop_terminology.sql; the
installer, its test and the deployment guide follow.

Rename the user-visible SOP copy from #1264, #1294, #1295, #1296 and
#1298 (project roles, join requests, project credentials, workspace
preview messages) with the same rules as the rest of the branch.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…weep

Co-Authored-By: Claude Code <noreply@anthropic.com>
# Conflicts:
#	CHANGELOG.md
#	design.md
#	docs/conversation-workspaces.md
#	e2e/api/35-runner-mode.test.mjs
#	internal/httpapi/project_write_access.go
#	internal/httpapi/runners.go
#	web/app/runners.js
#	webtest/tests/mcp-sops-runners.test.mjs
@Robert0622

Copy link
Copy Markdown
Collaborator Author

main 又前进到 c3dd1b4d(#1304、#1285),已再次合入,head 现为 d03ac060。

  • 8 个冲突文件(CHANGELOG.md、design.md、docs/conversation-workspaces.md、e2e/api/35-runner-mode.test.mjs、internal/httpapi/project_write_access.go、internal/httpapi/runners.go、web/app/runners.js、webtest/tests/mcp-sops-runners.test.mjs)都以 main 为准,再按本 PR 规则把用户可见的 SOP 改成 LOOP。CHANGELOG 里本 PR 自己的条目保留。
  • 另外把 main 新增的 3 处 SOP 注释和测试名改成 LOOP(internal/repo/runner_sharing.go、internal/domain/runner.go、chatbot/tests/execution-machines.test.jsx)。

验证

  • go build ./...、go vet ./internal/... ./web/ 通过。
  • ./web、internal/botinteraction、internal/notification、internal/domain、internal/repo 全过。httpapi 中 Bot、澄清、草稿、通知、分析、项目、凭据、Runner、共享相关用例只有 3 个失败(浏览器/终端),main 上同样失败。
  • webtest 285/285,chatbot vitest 493/493,scripts/test-install.py 通过(跳过 2 个可选项),scripts/check-public.py 通过。
  • 真实 MySQL 8.4.13,用本分支构建的实例:
    • 安装链 seed → 033 → 038 → 043 连跑两次,快照 MD5 相同;4 个内置模板显示「通用…交付 LOOP」。
    • 再跑 main 的两个 042 和 043,都没有报错。

@crispinhu27 crispinhu27 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.

复审 head d03ac060(base main c3dd1b4d),上次 REQUEST_CHANGES 是在 9beb5638 上提的。

历史问题:CHANGELOG 指向 #updating-existing-public-sops 的 [P2] 已复测为 FIXED。CHANGELOG.md 现在指向 docs/deployment.md#updating-existing-public-loops,对应的标题存在;全仓已经没有地方引用旧锚点。用脚本检查了全仓 Markdown 内部锚点,head 和 main 的失效集合相同,本 PR 没有新增失效。

作者自述的其他修复都已核实:迁移改号为 043,不和 main 的两个 042 冲突,installer 按 seed→033→038→043 的顺序追加,test-install.py 通过。在 MariaDB 上 043 跑了两次,两次后的 dump 一致,用户数据没动。cards.go、push_card.go、bot_clarify.go 同时接受 LOOP 和 SOP,测试都有。前端 flows.js 和 workbench.js 也兼容旧值。

新问题(阻塞):chatbot 识别历史提议回执时没有兼容旧文案,详见行内评论 [P2]。

非阻塞:web/rooms.js:372 把 roomIsSOPAuthor 改成了 /^LOOP「.*」$/,但第 376 行的 roomAuthorName 仍然是 slice(4,-1)。这个长度是按 SOP「 写的,LOOP「 多一个字符,结果 LOOP「后端交付」 会解析成 「后端交付,旧的 SOP「…」 作者也不再能被识别。rooms.js 目前没有页面加载,所以不算阻塞,建议顺手改掉。

验证:go build ./...、go vet ./...、scripts/test-install.py、scripts/check-public.py 都通过。webtest 285/285,chatbot vitest 493/493。Go 全量测试里 engine/httpapi/runner/runtime 的失败都是本机没有 user namespace(bwrap)造成的;和 main 对比,失败集合一致,只多了 2 个,单独重跑确认一个是偶发、一个在 main 上同样失败。依赖沙箱的那部分以 CI 的 core 为准。另外在本地 MariaDB 上真实起了 head 和 main 两个平台,用 Chromium 做了对照。

另外:main 已前进到 f3d4f41a(#1284),本 PR 现在和 main 有冲突,涉及 CHANGELOG、docs/conversation-workspaces.md、domain/observability.go、domain/project.go、engine/prompt.go,需要再合一次 main。

Comment thread chatbot/src/api.js Resolved
@cocofhu00

Copy link
Copy Markdown
Contributor

结论:需要修改

GitHub 拒绝了 Pull Request Review 接口(HTTP 403:Tencent 组织启用了 OAuth App 访问限制)。当前账号无法提交正式 Approve / Request changes。以下改为普通评论。

与 main 冲突(mergeable_state=dirty)。本次改了 522 个文件,把产品文案从 SOP 换成 LOOP;检查项均已成功,提交状态虽为 pending,但没有具体失败项,不单独作为修改理由。请变基到当前 main,并保持说明里的兼容约定:路由、工具名、JSON 字段和 workflow id 不变,迁移只更新内置默认文案。变基时请核对与仍打开的 #1287(chatbot/src/App.jsx、chatbot/src/useChat.js)和 #1311(web/app/navigation.css)的重叠,避免把行为改回去。

roberttwang and others added 2 commits November 24, 2026 19:18
Conflicts take main's text with this PR's rule applied: user-facing SOP
wording becomes LOOP. The same rule is applied to the messages, comments,
prompts and tests that #1284 and #1279 added since the previous merge.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Conversations saved before the rename still hold the SOP wording of the
declined and timed-out proposal receipts. The chat matched only the new
LOOP text, so these internal resume turns showed up as user messages.
Accept both wordings.

Rooms also parse LOOP「…」 authors with the correct length and keep
recognizing legacy SOP「…」 authors.

Co-Authored-By: Claude Code <noreply@anthropic.com>

@Robert0622 Robert0622 left a comment

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.

CR + 部署实测:LGTM,可以合入(head 25261b9e)

这一轮看了新提交 25261b9(改名前保存的回执和 SOP「…」作者名的兼容),以及 8afd098 合并 main 7bebfa5 的结果,并对整个改名做了一遍兼容性检查。

代码

  • chatbot/src/api.js:「不走 SOP / SOP 建议超时」两种旧回执和新 LOOP 文案都能识别,而且仍然要求上一条助手回复里有 declined/expired 的 proposal 草稿。普通用户文本即使长得像回执(例如少了句号)也不会被隐藏,测试覆盖了这一点。
  • web/rooms.js:/^(?:LOOP|SOP)「(.*)」$/ 用捕获组取名字,修掉了原来 slice(4,-1) 按 LOOP 长度截取、截错 SOP「…」 名字的问题。
  • 后端:assistantProposalDeclinedText/ExpiredText 只用来生成新回执,判断历史用的是 decision 字段;sopRequested 仍把 sop 当成关键词,用户说「走 SOP」照样能识别;draftChoiceSuffix、通知解析等都同时接受 LOOP: 和 SOP:。路由、工具名、JSON 字段、type: "sop" 都没改。

部署实测(本机原生部署 MySQL 8.4.7)

  • 升级路径:先用 main 建库,装上 main 的种子数据和 033、038 迁移,并把 generic-product-delivery 改名成「我的定制 SOP」,再连跑两次 043_loop_terminology.sql。结果:三个内置模板变成「通用后端/前端/缺陷修复交付 LOOP」,payload 里的 Workflow.name 一起改了,MR 指引里的「和 SOP 阶段文档」变成「和 LOOP 阶段文档」,JSON 仍然有效;定制过名字的模板保持「我的定制 SOP」,没有动;welcome 项目描述也更新了。第二次运行没有任何变化。
  • 用本 PR 的平台在升级后的库上启动,用 Chromium 依次打开 14 个视图(LOOP 列表、需求、运行、审批、角色、项目、指引、协作、执行机器、沙箱、设置、平台、观测、Bot),中文和英文各一遍,扫描页面文本:没有残留的 SOP 字样,LOOP 正常显示。
  • 旧接口 /api/workflows、/api/runs、/api/issues 都返回 200。welcome 的「平台验收 · 脚本与审批」LOOP(换成原生沙箱后)跑完 prepare,进入审批,批准后 succeeded,产物 welcome/decision/completed 都在。
  • 测试:chatbot 495/495、webtest 287/287 通过;go test ./web ./internal/domain ./internal/botinteraction 通过;go vet ./... 干净。./internal/httpapi 全量跑下来只有 TestBrowserStreamPushesFramesAndRunsCommands 和 TestMainBotBrowserStartsAndDrivesRunBrowser 两个失败,main 上是同样两个,原因是本机没有可用的 Chromium,不是本 PR 引入的。
  • CI:当前 head 全部检查通过。

小问题(不阻塞)

  • PR 描述的 Compatibility 一节还写着 042_loop_terminology.sql,实际文件已经改名为 043_loop_terminology.sql(docs、install-schema-extensions.sh 和 test-install.py 都已改成 043),建议把描述也改过来,免得运维照着描述去找文件。

crispinhu27
crispinhu27 previously approved these changes Nov 24, 2026

@crispinhu27 crispinhu27 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.

复审 head 25261b9e(base main 7bebfa50)。上次 REQUEST_CHANGES 6044722369 针对的是 d03ac060。

合并核对:用 git merge-tree 复现了 8afd0981 的 8 个冲突文件(CHANGELOG、docs/conversation-workspaces.md、domain/observability.go、domain/project.go、engine/prompt.go、web/app/issues.js、project-wizard.js、projects.js)。把两边都做 SOP→LOOP 归一化后,c3dd1b4d..7bebfa50 与 d03ac060..8afd0981 的 +/- 行一致,main 的改动没有丢;只有 PR 改、main 没碰的文件合并后无差异。#1284 带进来的用户可见文案都已改成 LOOP,残留的 SOP 只在 Go 标识符、测试 workflow id 和 Type: "sop" 里,符合说明中的兼容约定(路由、工具名、JSON 字段、workflow id 未改)。

历史问题

  • [P2] 升级前保存的「不走 SOP」和「SOP 建议超时」回执不再被识别:FIXED,单元级和真实运行(MariaDB + Chromium)复测,详见原线程。
  • [P2] CHANGELOG 锚点:仍为 FIXED。全仓 Markdown 内部锚点检查,head 与 main 的失效集合相同(只有 vendored 的 vscode-web README 里原有的一条),新加的 #upgrading-existing-project-conversations 能解析。
  • 上次的非阻塞项 web/rooms.js 作者名解析:已改好,新测试在 d03ac060 上失败、在 head 上通过。

验证(隔离环境、最小环境变量、合成数据,与 main 7bebfa50 对照)

  • go build ./...、go vet ./... 通过;scripts/test-install.py(69 OK,跳过 2)、scripts/check-public.py 通过。
  • chatbot vitest 495/495,webtest 287/287。
  • Go 全量测试两边都有本机缺 Docker / 原生沙箱导致的失败;httpapi、runner、runtime 单独重跑失败集合一致。整包跑时 head 多出的几个失败逐个核实为负载下的偶发(单独跑 head、main 各 5 次都通过)或在 main 上同样失败。
  • CI 当前 head 全部通过。

本次没有发现新的阻塞问题。没覆盖的部分:本机没有 Docker,没有实跑 Compose 升级串联 043 迁移,以 CI first-run 和 test-install.py 为准。这个 APPROVE 只针对 25261b9e。

Bring in #1316, #1319 and #1318. Conflicts in orchestration and
workspace docs, run admission, the MCP run tool, the LOOP designer
prompt, catalog and sharing comments, the Web flow, issue and run
views, index.html and the sandbox selection Web test are resolved by
taking main's behaviour and applying this branch's LOOP terminology.

Rename the user-visible SOP copy that #1319 added outside the
conflicts (OpenAPI, run admission errors, the runtime sandbox picker
and its assistant prompt) with the same rules.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

main 前进到 848793b3(#1316、#1319、#1318)后本 PR 有冲突,已合入 main,head 现为 f6e62693。

  • 13 个冲突文件(docs/api/orchestration.md、docs/conversation-workspaces.md、internal/engine/run_start.go、internal/httpapi/assistant_mcp.go、assistant_sop_designer.go、catalog.go、internal/repo/catalog_sharing.go、web/app/flows.js、issues.js、runs.js、sops.js、web/index.html、webtest/tests/sop-sandbox-selection.test.mjs)都以 main 为准,再按本 PR 的规则把用户可见的 SOP 改成 LOOP。合并前逐个比对过:这些冲突块里本 PR 原来只有改名,没有别的改动会丢。
  • main 在冲突之外新加的 SOP 文案也改成了 LOOP:docs/api/openapi.yaml、internal/engine/run_start.go、internal/engine/sop_sandbox.go(及其测试)、internal/httpapi/assistant_sop_sandbox.go。合并后再扫一遍,main 新增的行里已经没有独立的 SOP 词。标识符(SOP_AUTO_SANDBOX、sopSandboxPendingText、autoSelectSandbox 等)、路由、JSON 字段都没动。
  • main 没有新的迁移文件,043_loop_terminology.sql 编号不变。

验证

  • go build ./...、go vet ./internal/... ./web/、scripts/check-public.py、git diff --check 通过。
  • chatbot 495/495、webtest 290/290 通过(含 feat(sop): select the sandbox at runtime #1319 的「由 Agent 选择沙箱」用例,文案已是 LOOP)。
  • engine、httpapi、repo、domain、web、botinteraction、cmd/* 全量跑完,和 main 同环境对比没有新增失败(TestChatClarificationEdgePaths 在 main 上单跑也会偶发 panic,本 head 单跑通过;TestSDNotifySendsReadyAndMainPID 在两边都因本机 socket 路径过长失败)。
  • 本机部署跑 e2e/local.sh 全部 API 场景(MySQL 8.4.7,Docker、bwrap 用测试替身):本 head 160 通过、4 失败、16 跳过,与 main 848793b3 完全一致;4 个失败都是 runner-mode 用例,因为本机 /tmp 不能执行下载的 runner 二进制。
  • CI 16/16 通过。

crispinhu27
crispinhu27 previously approved these changes Nov 25, 2026

@crispinhu27 crispinhu27 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.

复审 head f6e62693(base main 848793b3)。上次 APPROVE 6046872163 针对 25261b9e,后来被新推送 dismiss。这次的增量只有一个合并提交,把 main 的 #1316、#1319、#1318 合了进来。

合并核对

  • 用 git merge-tree 复现了 25261b9e + 848793b3 的 13 个冲突文件。每处冲突都按 main 的逻辑解决,用户可见的文案改成 LOOP。逐个看过 run_start.go、assistant_mcp.go(runs_start 的项目校验沿用 main 新加的 scheduledAssetsFrom 条件)、catalog_sharing.go、sops.js(autoSelectSandbox 分支保留)。
  • 两边都做 SOP/LOOP 归一化后,7bebfa50..848793b3 和 25261b9e..f6e62693 的 +/- 行逐行一致,差异为 0。main 的改动没有丢,合并时也没有夹带别的改动。
  • 合并没有动 migrations/,043_loop_terminology.sql 不变。和当前 main 1cbaa4a6 做 merge-tree,没有冲突。

验证(隔离用户、最小环境变量、合成数据,以 main 848793b3 为对照)

  • go build ./...、go vet ./...、scripts/test-install.py(70 项,跳过 2 项)、scripts/check-public.py 两边都通过。
  • chatbot vitest:head 495/495,main 494/494。webtest:head 290/290,main 289/289。
  • Go 全量测试:两边的失败差异都在 internal/engine,报错都是本机缺少 bwrap。把这 22 个用例在 head 和 main 上单独重跑,失败集合完全一致,不是本 PR 引入的。依赖沙箱的部分以 CI core 为准,core 在当前 head 上已通过(CI 16/16)。
  • 真实运行:在 MariaDB 上起了 head 平台,执行了 seed 和 043,用 Chromium 登录后走了 14 个视图,没有 pageerror,正文中没有残留的 SOP。通过 API 给 welcome LOOP 打开 autoSelectSandbox 后,页面上 sopAutoSandboxLabel() 显示「由 Agent 选择」,资源需求行显示「由 Agent 选择沙箱 | 启动时按项目和任务选择运行沙箱。」,sopSandboxPendingText 显示「正在选择沙箱…」。#1319 合进来的功能在改名后能正常工作。

这次没有发现新的阻塞问题。没覆盖到的部分:本机没有 Docker,没有实跑 Compose 升级;engine 的沙箱用例以 CI 为准。这个 APPROVE 只针对 f6e62693。

roberttwang and others added 2 commits November 25, 2026 08:06
Co-Authored-By: Claude Code <noreply@anthropic.com>
#1300 added a clarification test that expects the bot reply "已启动 SOP" and a comment that says "a SOP started". This branch already renders "已启动 LOOP", so the test failed after merging main.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

Re-review of f6e62693 (merge of main 848793b3): the 13-file resolution is correct, but this head has a semantic conflict with current main 1cbaa4a4 (#1300). Please merge main again before merging this PR.

Conflict resolution (git show --remerge-diff f6e62693)

Verification

  • Ran this head against a fresh MySQL 8.4.7 database and opened the LOOP create wizard's sandbox step in Chromium. The page has 0 "SOP" and 3 "LOOP". The sandbox list, including "由 Agent 选择" ("chosen by the Agent") from feat(sop): select the sandbox at runtime #1319, renders.
  • go vet ./internal/engine ./internal/httpapi ./internal/repo: clean.
  • go test ./internal/engine -run 'Sandbox|RunStart|Admission|Parent' and go test ./internal/httpapi -run 'Sandbox|SOP|Loop|WorkspaceFallback|ResumeRecovery|Designer|Clarif': pass.
  • webtest: 290/290 (including sop-sandbox-selection 10/10).
  • CI: 16/16 at this head, but CI runs against 848793b3, so it doesn't include feat(im): 把聊天发起人记入需求操作日志,并在平台管理里配置外部访问地址 #1300.

P2 – semantic conflict with main 1cbaa4a4

git merge origin/main applies cleanly, but afterwards go test ./internal/httpapi -run TestChatClarificationStartAttributesTheSavingMember fails in both the text and card subtests:

bot_clarify_test.go:309: save and start = "澄清结果已保存到需求 LOOP-7「登录优化」(bot-owner)。\n已启动 LOOP(运行 run-…),失败、等待处理和完成时会发在这里。"

#1300 added the assertion strings.Contains(reply, "已启动 SOP") ("SOP started") at internal/httpapi/bot_clarify_test.go:308. This PR changed the message at bot_clarify.go:887 to 已启动 LOOP ("LOOP started"). Fix: merge main again, change line 308 to 已启动 LOOP, and also update the comment "a SOP started right after a clarification" that #1300 added. I've already handed this to the fix session, and it will push a new head.

Conclusion: the resolution in this head is fine, but it shouldn't be merged until main is merged again with the test above fixed. This token is the PR author's account, so this is a comment, not a formal review state.

roberttwang and others added 2 commits November 25, 2026 08:48
Resolve conflicts with #1327 (idle LOOP workspace reclaim) and #1323 (privileged Docker sandboxes) by keeping main's logic, then apply LOOP terminology to the copy they added: runner run-limit tip, queued-run callout, run-list concurrency note, child resume errors and activity, deployment docs, comments and test messages. The stored legacy activity "切回 SOP,等待继续" is still matched unchanged.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The child-resume marker merged from #1327 now reads "等待继续子 LOOP". A parent paused on a build that stored "等待继续子 SOP" still resumes its child after admission.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

Re-review of 6a35c49b: the #1300 semantic conflict is fixed. However, main has moved again to cb78a499 (#1327, #1323), and this head now has text conflicts. Please merge main once more before merging.

Fix for my previous comment ✅

  • 4dbdc4e6 merges main 1cbaa4a4. 6a35c49b changes the following to LOOP:
    • bot_clarify_test.go:308 (已启动 LOOP)
    • the comments in bot_chat_actor.go / bot_clarify_test.go
    • the 保存并启动 command test, which now covers LOOP, loop and the legacy SOP alias
  • bot_clarify.go:67 still accepts 保存并启动SOP/sop as a backward-compatible alias. That's reasonable.
  • go vet ./internal/engine ./internal/httpapi ./internal/repo: clean.
  • TestChatClarificationStartAttributesTheSavingMember and the rest of the Clarify/Bot/PublicURL/Sandbox/LOOP/WorkspaceFallback tests pass. The only failure, TestMainBotBrowserStartsAndDrivesRunBrowser (no Chromium sandbox here), fails the same way on main 1cbaa4a4.
  • engine/repo tests: pass.
  • webtest: 293/293.
  • Ran this head on a fresh MySQL 8.4.7 database and opened the LOOP create wizard in Chromium: 0 "SOP", 3 "LOOP".

Blocking: conflicts with main cb78a499

git merge origin/main conflicts in 9 files:

  • internal/engine/conversation_workspace.go, run_environment.go, run_ops.go
  • internal/httpapi/workspace_restore.go, internal/repo/run_admission.go
  • web/app/runners.js, web/app/runs.js, web/index.html
  • webtest/tests/mcp-sops-runners.test.mjs

#1327 also adds user-visible SOP text that should become LOOP in that merge:

  • run_ops.go:680 resumePausedChildActivity = "等待继续子 SOP" ("waiting to resume child SOP")
  • the two 继续子 SOP %s:%w errors ("resume child SOP %s: %w")
  • the quota tooltip in runners.js ("按顶层 SOP 计数…", "counted per top-level SOP"; "…待确认的 SOP 空闲 1 小时后…", "SOPs awaiting confirmation, after 1 hour idle")
  • the queue callout in runs.js ("子 SOP 共享父…", "a child SOP shares its parent's…")
  • the concurrency note in index.html ("最多同时运行 10 条 SOP", "at most 10 SOPs at a time")

I've handed this to the fix session.

The token is the PR author's account, so this is a comment, not a formal review state.

@Robert0622

Copy link
Copy Markdown
Collaborator Author

main 前进到 cb78a499(#1327 空闲 LOOP 工作区回收、#1323 Docker 特权沙箱),本 PR 又有冲突,并且和 #1300 有一处语义冲突。已处理,head 现为 dfac0810。

改动

验证(本机,Go 1.26.11;没有对本仓库做实测)

crispinhu27
crispinhu27 previously approved these changes Nov 25, 2026

@crispinhu27 crispinhu27 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.

Re-review of dfac0810 (base main cb78a499). My earlier approvals on f6e62693 were dismissed by the pushes. The two new commits are a merge of main and a compatibility fix; I verified both and found nothing blocking.

b06d138 merge of main cb78a499 (#1327, #1323): faithful.

  • Every symbol main added is present with main's file counts: sharesWorkspace 8/8, sopWorkspaceTreeIdle 2/2, ShouldDeferRestoreUntilAdmitted 2/2, resumeChildrenAfterAdmission 1/1, RunWouldQueueOnAdmission 3/3, appendAdmissionRunEvent 2/2, IdleReclaimableSOPRuns 3/3, ReleaseCleanedRunAdmission 5/5, ReleaseIdleBorrowedSOPAdmission 2/2.
  • The four hunks that were at risk last round now carry main's idle-reclaim copy with LOOP wording: web/app/runners.js, web/app/runs.js, web/index.html, webtest/tests/mcp-sops-runners.test.mjs.
  • The 489 files main never touched are byte-identical to 6a35c49b. Every main file matches after LOOP→SOP normalisation except one comment in conversation_workspace.go and the new marker block. Nothing from #1327/#1323 was dropped, and nothing unrelated came in.
  • run_environment.go:194 keeps sharesWorkspace(current), and run_admission.go keeps main's parent.WorkspaceCleaned != nil || parent.AdmissionState == "released" clause.

dfac0810 "Resume paused children marked before the LOOP rename": fixes a real stall, not a cosmetic rename.

  • internal/engine/sop_node.go:108 now uses isResumePausedChildActivity(), which accepts both 等待继续子 SOP and 等待继续子 LOOP; the == there is the only reader of that marker.
  • Reproduced in an integration test: parent queued behind an idle reclaim with a paused child whose activity still holds the legacy 等待继续子 SOP. With the helper the run completes; reverting line 108 to the strict comparison leaves the parent parked in running indefinitely. The negative control fails with the old code, so the fix is load-bearing.
  • Adversarial cases all rejected correctly: empty, whitespace only, 等待继续子, 等待继续子 lop, trailing or leading spaces, Sops. A second resume is not re-entered because the activity is rewritten to 正在执行子 LOOP …, and sop_node.go:60 only picks the child when prev.WorkflowID matches, so a stale marker cannot hijack a re-pointed node.

Verification (Go 1.26.11, webtest, chatbot vitest; head dfac0810 vs main cb78a499, separate worktrees, synthetic data only):

  • go build ./..., go vet ./..., scripts/check-public.py: pass on both.
  • webtest: 293/293 on head, 292/292 on main (the extra one is a subtest in a renamed file). chatbot vitest: 59 files, 495 tests pass.
  • go test ./...: 133 failing cases in 5 packages on both, 26 ok packages on both. Comparing the failing-case sets, nothing fails only on head or only on main; the causes are this environment (no bwrap, no Chromium, host git identity in a commit-shape assertion).
  • Merge: git merge-tree against cb78a499 and against current main 11e7521 is clean. The conflict reported last round is gone.

Non-blocking: internal/engine/run_ops.go:738,801 still match the unrenamed 切回 SOP,等待继续, and web/app/approvals.js:231 matches it too. That is consistent on both sides and correct as is, but anyone renaming that literal later has to change all three.

Not covered: no Docker here, so the Compose/first-run path relies on CI. core and platform-required are green on this head. This approval is for dfac0810 only.

Four user-visible errors that arrived with main (#1342 work branch naming,
#1343/#1348 runner auto-assign, #1301 child artifacts) still said SOP.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

修复 P3:50b5c89f(合 main 后带进来的 SOP 报错)

CR 提的两条之外,我扫了全部非测试的 Go / JS / HTML 字符串字面量(带中文且含 SOP 的),和上次 LGTM 的 74dfee49 比,这次合 main 新带进来的一共 4 条,都改成了 LOOP:

剩下带 SOP 的字面量和 74dfee49 时完全一样,都是兼容旧数据的标记。测试、e2e、前端里没有按这几条旧文案匹配的地方。

验证(本机 Go 1.26.11 + MySQL 8.4.7 全新库,用 50b5c89f 构建的平台;没有对 Tencent/LoopForge 做任何部署实测操作)

  • go build / go vet / chatbot 单测 / webtest / check-public 都通过。engine、httpapi、runner、runtime、cmd 的 go test 有 19 个失败,全是 docker、Chromium、git 身份这类本机环境问题,main 上同样失败,没有新增失败。
  • 部署实测 feat(sop): configure repository work branch naming #1342 的 AI 工作分支命名(仓库设为 AI 命名,执行器 Cursor、模型 grok-4.7):
    场景 结果
    负责人没有 Cursor 凭据时派发需求 返回 400:仓库 "bn-…" 的工作分支生成失败:请配置 LOOP 负责人的模型凭据或执行机器登录 ✅
    配好 Cursor key 后再派发(真实 grok-4.7 high) 32 秒内生成分支 feature/login-remember-me,节点在这个分支上执行,run 成功 ✅
  • CI:50b5c89f 上 16 项全部通过。

合并顺序提醒:本 PR 单独和 main 不冲突,但和 #1332、#1223 叠在一起有 6 个文件冲突(App.jsx、ArtifactPanel.jsx、SopRunPanel.jsx、conversation_workspace.go、sop_idle_reclaim_test.go、runs.js)。建议放在最后合,合之前再合一次 main。

crispinhu27
crispinhu27 previously approved these changes Nov 25, 2026

@crispinhu27 crispinhu27 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.

复审 50b5c89f(base main 832e2bef):APPROVE

上一次在 74dfee49 上的 APPROVE 因后续推送被撤销。本次审查范围是 74dfee49..50b5c89f:三个合并提交(1fec8644 合 main 78cdab43、7c6a20a8 合 merge-audit/release-current-main、1be1d8a2 合 main 832e2bef)和 50b5c89f(把从 main 合进来的 4 条报错文案改成 LOOP)。

审查

  • git show --remerge-diff 看了三个合并提交的冲突解法:run_start.go 注释、assistant_sop_sandbox.go 选沙箱提示词采用了 main 的新内容并保留 LOOP 术语;web/i18n-en.js 合并后 LOOP 写法的 key 都在。
  • 50b5c89f 改的 4 条文案(runner_auto_assign.go:175、sop_node.go:266、sop_work_branch.go:146、assistant_sop_sandbox.go:95):代码、测试、web、chatbot、e2e 里都没有按旧文案匹配的地方,改字面量不影响调用方。
  • 和当前 main f7b066d8(新合入 #1345、#1351)合并无冲突,这两个 PR 没有带进新的 SOP 文案。

验证(隔离工作区,未接触任何凭据)

  • 运行时探针:在 head 上实际调用 generateSOPWorkBranch(未配置分支命名器)和读取 errSOPHelperCredentials,返回 AI 分支命名不可用,请检查 LOOP 执行器、请配置 LOOP 负责人的模型凭据或执行机器登录;同一探针在 1be1d8a2 上返回 SOP 写法,断言失败。
  • go build ./...、go vet ./... 通过;go test ./... head 与 1be1d8a2 失败的测试名单完全一致(138 个,都是容器里缺 bwrap / Docker / Chromium 这类环境原因),本次没有新增失败。
  • chatbot:62 个文件 534 个测试通过,前端构建成功;webtest:309 个测试全部通过。
  • CI 16/16 通过。

历史问题复测(6058911645 提出,22:30 轮在 74dfee49 上已确认修复)

  • [P2] 英文界面 LOOP 运行评测标题、回写失败提示显示中文:FIXED。web/i18n-en.js 合并后仍有 LOOP 运行评测、打开 LOOP、回写失败提示三条 key,旧 SOP 写法 0 条;webtest English mode translates the LOOP evaluation and writeback action 在 head 上通过。
  • [P3] LOOP/SOP 混用:FIXED。runner_auto_assign.go 的报错里已没有 SOP;web/index.html 去掉 script/style 后可见文字里 SOP 为 0。

不阻塞的备注:从 main 合进来的文档里还有 4 处用 SOP 指流程,不在本 PR diff 里,可以顺手改:design.md:343、design.md:344(#1348)、docs/api/collaboration.md:72(#1342)、docs/deployment.md:245(#1301)。

本轮没有重新在浏览器里部署实测界面(本次增量只改了 4 条后端报错文案,界面相关的验证靠 webtest 和 CI 的 e2e-browser)。以上是对当前 head 的审查结论,不代表代码没有任何缺陷。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

CR + 部署实测:50b5c89f,LGTM,上一轮留的 P3 已修

范围 1be1d8a2..50b5c89f 只有一个提交,4 个文件各改 1 行字符串,把合并 main 带进来的 4 条用户可见报错从 SOP 改成 LOOP:

  • internal/engine/runner_auto_assign.go:175:没有在线执行机器可运行此 LOOP:%w
  • internal/engine/sop_node.go:266:读取子 LOOP %s 的产物失败
  • internal/engine/sop_work_branch.go:146:AI 分支命名不可用,请检查 LOOP 执行器
  • internal/httpapi/assistant_sop_sandbox.go:95:请配置 LOOP 负责人的模型凭据或执行机器登录

核查:

  • 这 4 条文案没有被任何测试或前后端代码按原文匹配(全库 grep),%w 包装和错误类型都没动,行为不变。
  • 又扫了一遍用户可见的 SOP 残留:只剩 internal/engine/run_ops.go 的 切回 SOP,等待继续(只读兼容旧记录,web/app/approvals.js 也按旧文案识别,新写入已经是 LOOP)和 internal/botinteraction/cards.go 解析旧输入的「SOP:」前缀,两处都是有意的兼容,不算漏改。

部署实测(本机 MariaDB 11.8 全新库,用本 PR head 构建的平台;没有对 Tencent/LoopForge 做任何部署操作):

项目 结果
go build ./...、go vet ./internal/engine ./internal/httpapi 通过 ✅
平台启动、建项目/角色、建 LOOP 并发布、起 run 正常 ✅
真实触发分支命名路径(仓库设成 AI 分支命名 + 需求派发) 返回 仓库 "repo-review" 的工作分支生成失败:请配置 LOOP 负责人的模型凭据或执行机器登录,新文案生效 ✅
构建产物文案检查 4 条 LOOP 文案都在,4 条旧 SOP 文案都不在 ✅
go test ./internal/engine ./internal/httpapi 3 个用例失败,都是 bwrap: No permissions to create a new namespace(本机容器不允许 user namespace,docker 也不可用),与本次改动无关 ⚠️
CI 16/16 通过 ✅

说明:这台机器没有 docker,内核也不允许 user namespace,所以沙箱内跑真实节点这一步做不了,run 会停在 docker inspect workspace: docker: executable file not found;runner_auto_assign.go:175 和 sop_node.go:266 两条只在有兼容执行机器/子 LOOP 时才会出现,本轮按代码路径核对,未在部署里复现。

结论:改动只有文案,无逻辑变化,P3 已闭环。token 是作者本人的账号,所以只评论、不点 Approve。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

与最新 main f7b066d8 试合并 + 部署实测:50b5c89f 无需修改,可直接合入

本 PR 的 base 是 832e2bef,之后 main 又合入了 #1345(只有测试)和 #1351(MCP 审批等待期间用 SSE 保活)。两边都改过的 5 个文件(agent_tool_mcp.go、bot_clarify_test.go、3 个 e2e)都自动合并,没有冲突。main 新增的代码和测试里没有 SOP 字样,也没有用到本 PR 改名的路由,所以不用再改文案。为了不让现有 Approve 失效,合并提交没有推上来,结果只写在这条评论里。

检查 结果
build-chatbot / go build ./... / go vet ./... 全过
go test ./... 全量(同一环境) 失败集合与 main f7b066d8 完全相同,都是 19 个本机环境类用例(Docker、真实 Chromium、bwrap 隔离),PR 没有新增失败
API e2e(MariaDB 部署,AGENTFLOW_E2E_MODEL=0) 169 通过,0 失败,16 跳过(需要真实模型)
UI e2e 25 通过,1 失败:03-workbench-settings:21 改名,是 MariaDB 上的老问题,与本 PR 无关
路由覆盖率 357/416 = 85.8%(门槛 85%)
中英文 13 个页面巡检 没有出现 SOP 字样,没有页面报错

真实模型实测(#1351 的审批保活和本 PR 改名后的 agent_tool_mcp.go 叠在一起):本地起一个 HTTP MCP 收据服务,注册成项目 MCP,审批模式设为「确认」,会话用 native 沙箱。

执行器 / 模型 场景 结果
DeepSeek Harness deepseek-flash 审批挂 330 秒后批准 每 30 秒检查一次,审批一直 pending,没有提前执行;批准后写入 1 条收据,回复 RCPT-7781 ✅
DeepSeek Harness deepseek-flash 20 秒后拒绝 写入 0 条,模型如实说明被拒绝,没有重试 ✅
Cursor CLI grok-4.7(high) 20 秒后批准 写入 1 条,回复 RCPT-7781 ✅
CodeBuddy deepseek-v4.1-flash(IOA) 20 秒后批准 写入 1 条,回复 RCPT-7781 ✅
浏览器(dsh) 审批 pending 时关掉页面,333 秒后重开 审批卡片还在,显示「已等待 332 秒」;在页面上点批准后写入 1 条 ✅

结论:与当前 main 合并没有冲突,也没有语义问题,不用改。按之前约定,本 PR 最后合;如果先合 #1332 或 #1223,合之前要再合一次 main 解冲突。

@crispinhu27 crispinhu27 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.

复审:a744e027,REQUEST_CHANGES(1 个 P3,修一行即可)

审查范围:50b5c89f..a744e027(migrations/043_loop_terminology.sql)。同时与当前 main 2e5176f1 试合并,没有冲突。

043 的增量改动验证通过(隔离的非特权用户、合成数据,MySQL 8.4.13 和 MariaDB 10.11.20):

  • 全新库:按 install-schema-extensions.sh 的顺序执行 001、seed、033、038、043,在 MySQL 上全部成功。MariaDB 10.11 能正确解析和执行 JSON_TABLE 列定义里的 CHARACTER SET utf8mb4、FOR ORDINALITY,以及多表 UPDATE 里引用被更新表的写法,043 连续执行两次都成功(MariaDB 上 033 的 CAST AS JSON 报错是 main 上原有的情况,与本 PR 无关)。
  • 6 个哈希都从仓库历史实际算过,分别对应 033 原版和 HEAD 版、033+038 之后的版本,以及历次 seed 出厂的 3 个 MR prompt,没有遗漏的出厂版本。
  • 升级场景:分别构造了 033 原文、038 原文、管理员改过的 MR prompt、只改了其他字段(deliver prompt 里也带有「和 SOP 阶段文档」)四种情况。出厂原文都被改名,管理员改过的 MR prompt 和其他字段保持不变,把 MR agent 移到下标 0 也能正确定位;第二次执行影响 0 行。同样的数据用 50b5c89f 的旧版 043 跑,会把管理员改过的内容一起改掉,这正是本次提交要修的问题,确认已修好。
  • 合并树上 go build ./... 和 go vet ./... 都通过;go test ./internal/repo/(MySQL DSN)的失败集合与 main 相同(6 项,都是环境原因),没有新增失败;scripts/test-install.py 70 个用例全部通过;CI 16/16 通过。

需要修改:见行内评论。本 PR 的 install-schema-extensions.sh 新依赖 043,但 test-install-live.sh 的 fixture 没有拷贝这个文件,文档里的实机安装验收在第一次安装时就会失败(用桩模拟的 fixture 已复现,main 上正常)。这个问题从 9beb5638 起就存在,不是本次提交引入的,之前几轮复审都漏看了,抱歉。

未完成的验证:没有 Docker,没有完整跑完 test-install-live.sh 端到端。

Comment thread scripts/install-schema-extensions.sh Resolved
install-schema-extensions.sh now replays migrations/043_loop_terminology.sql,
but test-install-live.sh only copied 001/033/038/042 into its trimmed
fixture, so every live install identity stopped at the first install with
'cat: migrations/043_loop_terminology.sql: No such file or directory'.

Copy 043 as well, and add a test-install.py check that every migration the
installer replays is in the live fixture's copy list, so CI catches the
next one.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

CR + 部署实测:a744e027,043 的改动没问题;crispinhu27 提的 test-install-live.sh P3 我这边也复现了,修完那一行就可以合

范围 50b5c89f..a744e027,只改了 migrations/043_loop_terminology.sql:MR prompt 的改名从「整份 payload 全文替换」改成「用 JSON_TABLE 找到 <模板 id>-mr 这个 agent,只有 prompt 的 SHA-256 等于出厂版本时才替换」。

部署实测(本机 MySQL 8.4.7):先用 main 起平台建库,再按 install-schema-extensions.sh 的顺序灌 main 的 seed、033、038,模拟老版本安装;然后构造两种管理员改动:

  • generic-frontend-delivery:管理员在 MR prompt 末尾加了一句带「和 SOP 阶段文档」的定制文字;
  • issue-fix-production:MR prompt 没动,但 deliver 节点的 prompt 里被加了「代码和 SOP 阶段文档一致」。
检查 旧 043(50b5c89f) 新 043(a744e027)
没改过的 generic-backend-delivery MR prompt 改成 LOOP 改成 LOOP,只差这一个短语,其余字节不变
管理员改过的 frontend MR prompt 被改掉(定制内容被动) 原样保留
issue-fix 的 deliver prompt(非 MR 字段) 被改掉 原样保留;它的 MR prompt 照常改成 LOOP
模板 UPDATE 影响行数:第 1 次 / 第 2 次 — 2 / 0(可重复执行)
其余字段(去掉 MR prompt 和 Workflow.name 后比较) — 4 个模板都和升级前一致

之后用 PR head 的平台起在这份升级后的库上,模板列表显示「通用后端交付 LOOP」等 4 个新名字;分别 clone 后端、前端模板到项目里:后端 clone 出来的 MR 角色是 LOOP 文案,前端 clone 出来的 MR 角色保留了管理员的定制文字。

需要修改(P3,和 crispinhu27 行内评论同一个问题):按 scripts/test-install-live.sh 第 22–28 行原样建 fixture(docker_access 换成吞掉 stdin 的桩、install-observability-schema.sh 换成 exit 0)后执行 bash scripts/install-schema-extensions.sh:

  • a744e027:cat: migrations/043_loop_terminology.sql: No such file or directory,exit 1
  • main:exit 0

在 test-install-live.sh 的 cp 列表里补上 migrations/043_loop_terminology.sql 即可,生产安装用的是完整仓库,不受影响。

其他:CI 16/16 通过,与 main 2e5176f1 没有冲突。#1411(需求可以不使用 SOP)新加了几条带「SOP」的用户可见文案,如果它先合,本 PR 下次合 main 时要一起改成 LOOP。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

修复 crispinhu27 的 P3(live 安装验收 fixture 没拷 043),新 head 318d927b

改动只有测试脚本,产品代码没动:

  • scripts/test-install-live.sh:fixture 的迁移拷贝列表补上 migrations/043_loop_terminology.sql。
  • scripts/test-install.py:新增 test_live_install_fixture_copies_every_replayed_migration,从 install-schema-extensions.sh、install-observability-schema.sh 里取出安装器要重放的迁移,检查 live 脚本的拷贝列表都包含它们。修复前这个测试失败(缺 043_loop_terminology.sql),修复后通过。之前 CI 发现不了这个问题,现在能发现。

实测(本机没有 Docker,docker 换成把 compose exec -T mysql sh -c ... 转给本机 MySQL 8.4.7 的替身,fixture 是直接执行 live 脚本里建 fixture 的那几行生成的,不是手抄的)

数据库先用 main 2e5176f1 的平台建表、灌 main 的 seed,模拟升级前的状态(4 个模板名是「… SOP」,欢迎项目说明写「选择 SOP」)。

a744e027(修复前) 318d927b(修复后)
fixture 里的迁移 001、033、038、042 001、033、038、042、043
install-schema-extensions.sh exit 1,cat: migrations/043_loop_terminology.sql: No such file or directory exit 0
4 个模板名和 $.Workflow.name 仍是「… SOP」 都改成「… LOOP」
3 个 MR prompt 的「和 SOP 阶段文档」 未改 改成「和 LOOP 阶段文档」;产品方案模板本来没有 MR 节点,不变
欢迎项目说明 「选择 SOP」 「选择 LOOP」
再执行一次 — exit 0,数据库结果和第一次逐字节相同

升级后用本 PR 的平台起在这个库上,/api/workflows 返回的 4 个模板名都是 LOOP,欢迎项目说明也是 LOOP。

测试

  • python3 scripts/test-install.py -v:在本机跑,a744e027 和 318d927b 的失败集合完全相同(76 个,都是本机容器里 install.sh 超过 15 秒超时、没有 Docker 这类环境原因),新测试通过。CI 结果以 GitHub 为准。
  • bash -n scripts/test-install-live.sh 通过。
  • 没有完整跑 test-install-live.sh 端到端,原因是本机没有 Docker。

合并提醒:#1411(sopMode 契约)和本 PR 有 5 个文件文本冲突。按之前定的顺序本 PR 最后合;#1411 先合的话,本 PR 合之前要再合一次 main,把 #1411 新加的「不使用 SOP」「尚未触发」等文案改成 LOOP。

脚本和结果:loopforge-pr-fix-robert0622-1126-0400/(scripts/live-fixture.sh、results/1286-*)。token 是作者本人的账号,所以只评论、不点 Approve,需要 crispinhu27 重新审一下撤掉 REQUEST_CHANGES。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

复测 318d927b:P3 已修,LGTM

  • 范围 a744e027..318d927b:scripts/test-install-live.sh 的 fixture cp 列表补上 migrations/043_loop_terminology.sql,scripts/test-install.py 新增回归测试 test_live_install_fixture_copies_every_replayed_migration;迁移文件本身没有改动,上一条评论里 043 的升级实测结论仍然有效。
  • 用和上次相同的 fixture 复现步骤(docker_access 换成吞掉 stdin 的桩,install-observability-schema.sh 换成 exit 0)执行 install-schema-extensions.sh:318d927b exit 0(a744e027 是 exit 1)。
  • 新增的回归测试:在 318d927b 上通过。把 test-install-live.sh 换回 a744e027 版本后失败,报 Items in the first set but not the second,说明这个测试能拦住同类遗漏。
  • 本机没有 Docker,test-install.py 全量跑不完,以 CI 为准。写这条评论时 CI 14 项通过、1 项进行中。

crispinhu27
crispinhu27 previously approved these changes Nov 25, 2026

@crispinhu27 crispinhu27 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.

复审 #1286 head 318d927b(base 832e2bef,当前 main 2e5176f1)。

本次增量 a744e027..318d927b 只改了 scripts/test-install-live.sh(fixture 拷贝列表补上 043)和 scripts/test-install.py(新增回归测试)。产品代码和迁移文件与上一轮审过的 a744e027 相同;那一轮已在 MySQL 8.4.13 和 MariaDB 10.11.20 上用合成数据验证过 043 迁移。

历史问题:

  • [P3] live 安装验收 fixture 漏拷 043_loop_terminology.sql(discussion_r4700154000):FIXED。在 318d927b 上用脚本自己的拷贝命令建 fixture,以非特权用户运行 install-schema-extensions.sh,exit 0;在 a744e027 上做对照,exit 1(cat: migrations/043_loop_terminology.sql: No such file or directory)。新增测试在 head 上通过,放到旧脚本上运行会失败。

验证:python3 scripts/test-install.py 71 个测试通过、2 个跳过;CI 16/16 通过。

未覆盖:没有用 Docker 镜像真正跑一遍 test-install-live.sh(容器里没有 Docker),这部分以 fixture 复现和 CI 的结果为准。

roberttwang and others added 2 commits November 26, 2026 02:48
The merge of main kept the product copy for requirements without a LOOP,
but comments, test fixtures and failure messages around #1411's sopMode
still said SOP. Use the LOOP terminology there too; protocol values such as
sopMode none/sop and Go identifiers keep their names.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

合入最新 main 并把 #1411 的「不使用 SOP」统一改成 LOOP,新 head 4d8ce406

按约定 #1286 放在 #1411 之后最后合,合之前再合一次 main。这次推送是 fast-forward,没有强推,远端原有提交都保留了:

#1411 文案的处理方式(和 #1286 其余改名同一规则)

  • 用户能看到的文案都改成 LOOP:聊天确认卡片的 LOOP 字段(「不使用 LOOP」、默认的「通用后端交付 LOOP」),机器人草稿摘要「(LOOP:不使用 LOOP)」,需求详情的「关联 LOOP / 不使用 LOOP」,未开始状态的说明「这条需求不使用 LOOP…」「触发后由 LOOP 节点 Agent 接手」「按 LOOP 执行」,issues_save 在 openapi 里 workflowId、sopMode 两个字段的描述,以及英文翻译("uses no LOOP"、"LOOP triggers / auto-dispatch" 等,web/i18n-en.js 里已经没有 SOP)。
  • 协议和标识符保持不变:sopMode 字段和它的 none / sop 取值、IssueSOPNone、WithoutSOP()、botDraftWithoutSOP、issueWithoutSOP 等名字都没改,旧客户端照常能用。
  • 全仓 grep:和 318d927b 比,没有新出现的 SOP 文案,剩下的都是上面这些标识符。

验证

  • go build ./...、go vet ./... 通过。chatbot 535/535,webtest 315/315。
  • 受影响的 9 个 Go 包(domain/engine/httpapi/mcpserver/repo/runner/runtime/tracker/web)在本 PR 和 main 080e91b0 上各跑一遍做对比。本 PR 只多出 TestChatClarificationEdgePaths 一项失败,原因是高负载下超时,单独重跑 5 次都通过。其余失败和 main 完全一样,都是本机缺 bwrap/docker 导致的。最终 head 的 domain/httpapi/mcpserver/web 又跑了一遍,失败项是 main 失败集合的子集。
  • 本机部署:MySQL 8.4 + 平台,用私有测试库 Robert0622/lf-cr1286-fb979e,用无头 Chromium 验证:
    • 需求、LOOP、运行、审批、项目、对话 6 个页面,中英文界面都没有 SOP 字样。
    • 新建需求向导里,交付方式显示「按 LOOP 交付 / 不使用 LOOP」(英文是 Deliver with a LOOP / No LOOP)。选「不使用 LOOP」后 LOOP 流程选择框会隐藏,提示「已创建需求(不使用 LOOP)」,接口返回 sopMode=none、workflowId 为空、automationState=ignored。详情抽屉显示「关联 LOOP:不使用 LOOP」,英文显示 "Linked LOOP: No LOOP / This requirement uses no LOOP…"。
    • AI 助手(CodeBuddy deepseek-v4.1-flash):完全权限模式下直接建出 sopMode=none 的需求,旧 head 和新 head 各测一次。确认模式下卡片显示「LOOP:不使用 LOOP」,点「确认保存需求」后建出的需求同样是 sopMode=none,没有绑定 LOOP。

CI:4d8ce406 的 16 项检查全部通过。分支保护在新推送后撤掉了之前的批准,现在显示 REVIEW_REQUIRED,需要维护者重新批准后才能合并。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

独立 CR + 部署实测 4d8ce406:合 main 的解法正确,LGTM,可合入

本轮有三个新提交:e523d8cf 合入 main 080e91b0,bd3fb432 把合进来的注释和测试文案改成 LOOP,4d8ce406 合入 main 68ed15f3(#1432)。我单独审了一遍,并部署实测。没有发现问题,没有改代码。token 身份是 PR 作者本人,所以只评论,不点 Approve。

代码审查

  • 用 git show --remerge-diff 逐个看了冲突文件:chatbot/src/operations.js、internal/httpapi/bot_drafts.go、web/app/issue-drawer.js、web/app/issue-model.js、web/i18n-en.js、docs/api/openapi.yaml。fix(issues): let agents create requirements without an SOP #1411 / fix(catalog,runs): 平台角色仅管理员可改、拒绝不可路由 id,并修复审批/产物/SOP 模板的回归 #1413 的新逻辑都保留了,包括 sopMode: none 判断和 issueTriggerLabel 等;用户可见文案统一改成 LOOP,例如「不使用 LOOP」「关联 LOOP」「通用后端交付 LOOP(默认)」,openapi 描述也改了。sopMode、workflowId 这类协议字段名没有动,和本 PR 之前的做法一致。
  • bd3fb432 只改了注释和测试文案(issue_sop_mode_test.go、assistant_proposals*.go、repo/issues.go 的注释等),不影响行为。
  • 4d8ce406 合 fix(catalog): keep the sandbox description #1432 没有冲突。
  • 英文词表比对:main 的 4881 个 key 在 PR 里一个不少(把 key 里的 SOP 换成 LOOP 后逐一对照),PR 的英文译文里也已经没有 SOP。在 web、chatbot、internal 的非测试代码里搜残留的中文「SOP」文案,只剩 bot_clarify.go 里「保存并启动SOP」这个兼容旧说法的别名,属于有意保留。
  • 与 main 68ed15f3 无冲突,CI 16/16 通过。

部署实测(PR 构建,全新 MySQL 库,Chromium)

场景 结果
中英文各打开需求、LOOP、运行、审批、项目、协作、设置 7 个页面,扫描页面文字里的 SOP 都是 0 处
新建需求向导,交付方式选「不使用 LOOP」/ No LOOP → 创建 LOOP 选择框隐藏;提示「已创建需求(不使用 LOOP)」/「Requirement created (no LOOP)」;接口返回 sopMode=none、workflowId 为空、automationState=ignored
打开这条需求的详情抽屉 「关联 LOOP:不使用 LOOP」/「LINKED LOOP: No LOOP」;触发方式「对话处理」/「Handled in chat」(#1413 的 issueTriggerLabel 生效)
AI 助手 CodeBuddy deepseek-v4.1-flash:「新建一条不使用 LOOP 的需求」 completed,27 秒;模型通过 MCP 建单,库里这条需求是 sopMode=none、automationState=ignored,回复里也写的是 LOOP
AI 助手 Cursor grok-4.7 high:问「不使用 LOOP」会怎样处理 completed,48 秒,回答正确,说明不绑 LOOP、定时 LOOP 不会领取
页面 JS 报错 / 5xx 无

中文向导,选「不使用 LOOP」:
zh wizard
中文详情抽屉:
zh drawer
英文向导 / 详情抽屉:
en wizard
en drawer

(英文抽屉里「平台新建」「统计关联 TAPD」「继续开发分支」还没翻译,main 上也是这样,和本 PR 无关。)

测试

  • go vet ./... 通过。
  • go test ./internal/httpapi、./internal/runtime ./internal/repo ./internal/engine ./internal/mcpserver ./internal/domain:本 PR 和 main 68ed15f3 在同一台机器上跑,本 PR 没有比 main 多出来的失败。失败的都是本机缺 Docker、bwrap、Chromium 沙箱这类环境问题,两边一样。
  • webtest 315/315 通过,chatbot vitest 535/535 通过。

@crispinhu27 crispinhu27 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.

复审 4d8ce406(上一版 318d927b 的 APPROVE 因新推送被撤销):LGTM

本次增量:e523d8cf 合入 main 080e91b0(#1345/#1351/#1410/#1412/#1231/#1411/#1429/#1413)、bd3fb432 把合进来的注释和测试文案改成 LOOP、4d8ce406 合入 main 68ed15f3(#1432)。

历史问题

  • [P3] live 安装验收 fixture 没拷 043(REQUEST_CHANGES 6064098095):FIXED。318d927b 之后 scripts/、migrations/ 没有改动;按 test-install-live.sh 的 cp 列表搭 fixture(docker 部分打桩),fixture 里有 043_loop_terminology.sql,install-schema-extensions.sh exit 0;python3 scripts/test-install.py 71 过 2 跳过。

审查

  • git show --remerge-diff e523d8cf:3 个文本冲突(chatbot/src/operations.js、internal/httpapi/bot_drafts.go、bot_drafts_test.go)都保留了 #1411 的新逻辑(sopMode=none、botDraftWithoutSOP),只改了文案;另有 6 个文件在合并中顺带改名。把 main 改过的 68 个文件两边统一 SOP→LOOP 后逐个比对,剩余差异都是本 PR 合并前已有的改动,没有丢掉任何一方的逻辑。
  • main 新带进来、在 head 上仍写 SOP 的只有标识符(sopMode、WithoutSOP 等)、JSON 字段和测试数据,在 PR 声明保留的兼容范围内。
  • bd3fb432 只改注释、测试夹具名和断言消息;4d8ce406 是无冲突合并(remerge-diff 为空)。
  • migration:043 编号唯一;MariaDB 11.8 上全新库和「用户改过模板名」的升级库各跑两遍 043,内置模板改成 LOOP、用户自定义名不动、两遍结果逐字节相同。

验证(隔离环境、合成数据、运行 PR 代码的进程不带任何凭据)

  • 4d8ce406:go build ./...、go vet ./... 通过;webtest 315/315;go test ./... -count=1 失败集合是 e523d8cf/main 68ed15f3 失败集合的子集,没有新增失败(剩余都是本机缺 bwrap / Docker / 浏览器沙箱的环境问题,main 上一样)。e523d8cf 上另跑了 chatbot vitest 535/535(main 534/534)。
  • 真实服务:4d8ce406 构建的 agentflow + MariaDB,注册合成管理员、建项目和一条 sopMode:none 需求,无头 Chromium 中英文各打开 15 个页面(issues、sops、runs、approvals、projects、agents、runners、settings、platform 等):可见文字里 SOP 0 处、无 JS 报错、无 4xx/5xx;#1411 的需求详情中文显示「不使用 LOOP」「这条需求不使用 LOOP,在对话里澄清需求、直接改代码…」,英文显示「No LOOP」「Handled in chat」。main 对照组仍显示「不使用 SOP」。
  • CI 16/16 成功,合并无冲突。

非阻塞(不是本次合并引入,可顺手改):design.md:343-344、docs/api/collaboration.md:69/72、docs/deployment.md:245、docs/api/openapi.yaml:5088("newly created SOP work branches")仍是 SOP。

未覆盖:没有 Docker,未端到端跑 test-install-live.sh;本轮未在 MySQL 8 上跑迁移(043 自 318d927b 起未改,之前已在 MySQL 8.4 验证)。

@Robert0622
Robert0622 merged commit f1c80ce into main Nov 26, 2026
16 checks passed
@Robert0622
Robert0622 deleted the codex/rename-sop-to-loop branch November 26, 2026 03:56
Robert0622 pushed a commit that referenced this pull request Nov 26, 2026
Resolve conflicts with the SOP→LOOP rename (#1286) by keeping this
branch's restructured run panel, artifact rows and run detail header,
and rename the user-visible SOP copy this branch adds to LOOP.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Robert0622 pushed a commit to Robert0622/LoopForge that referenced this pull request Nov 26, 2026
After dispatching from the issue editor the button text was reset to
'启动 SOP', reverting the Tencent#1286 rename while index.html labels it
'启动 LOOP'. Restore the LOOP wording and assert it in issues_list_test.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

4 participants