Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.
JavaScript agent-orchestrationagentic-workflowai-agentsai-codingclaude-codecode-reviewcodebuddycodexcoding-agentscursordeveloper-toolshuman-on-the-loopllmmcpmulti-agentsdlcself-hostedsopworkflow-automationworkflow-engine
fix: show LoopForge instead of AgentFlow in user-visible text (#101)
Robert0622dfd6f7e38c54
diff --git a/chatbot/index.html b/chatbot/index.htmlindex 6c61b535..f3ffd549 100644--- a/chatbot/index.html+++ b/chatbot/index.html@@ -4,7 +4,7 @@<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="color-scheme" content="light dark" />- <title>AgentFlow 工作台</title>+ <title>LoopForge 工作台</title></head><body><div id="root"></div>diff --git a/chatbot/src/presentation.js b/chatbot/src/presentation.jsindex c394893a..08fc9d72 100644--- a/chatbot/src/presentation.js+++ b/chatbot/src/presentation.js@@ -19,7 +19,7 @@ export async function createPresentation(source) {const { default: PptxGenJS } = await import("pptxgenjs");const pptx = new PptxGenJS();pptx.layout = "LAYOUT_WIDE";- pptx.author = "AgentFlow";+ pptx.author = "LoopForge";pptx.subject = "会话生成的演示文稿";pptx.title = presentationTitle(source);pptx.lang = "zh-CN";diff --git a/cmd/agentflow-mcp/main.go b/cmd/agentflow-mcp/main.goindex eec116fa..8b700c85 100644--- a/cmd/agentflow-mcp/main.go+++ b/cmd/agentflow-mcp/main.go@@ -21,6 +21,6 @@ func main() {func init() {if os.Getenv("AGENTFLOW_API_URL") == "" {- fmt.Fprintln(os.Stderr, "agentflow-mcp: set AGENTFLOW_API_URL to the running AgentFlow server")+ fmt.Fprintln(os.Stderr, "agentflow-mcp: set AGENTFLOW_API_URL to the running LoopForge server")}}diff --git a/cmd/agentflow-runner/main.go b/cmd/agentflow-runner/main.goindex f008179b..76937d6d 100644--- a/cmd/agentflow-runner/main.go+++ b/cmd/agentflow-runner/main.go@@ -24,7 +24,7 @@ func main() {if runtime.RunMCPCallCLI(os.Args[1:]) {return}- server := flag.String("server", "", "AgentFlow server URL, e.g. https://workflow.example.com (or AGENTFLOW_SERVER_URL)")+ server := flag.String("server", "", "LoopForge server URL, e.g. https://workflow.example.com (or AGENTFLOW_SERVER_URL)")token := flag.String("token", "", "runner bootstrap token (or AGENTFLOW_RUNNER_BOOTSTRAP_TOKEN)")name := flag.String("name", "", "runner display name (default: hostname)")statePath := flag.String("state", "", "state file path (default: ~/.agentflow-runner/state.json)")diff --git a/cmd/agentflow/main.go b/cmd/agentflow/main.goindex d900fd05..fb4a91a3 100644--- a/cmd/agentflow/main.go+++ b/cmd/agentflow/main.go@@ -326,10 +326,10 @@ func main() {}serve := func() error { return srv.Serve(mainLn) }if role != "worker" && *tlsCert != "" && *tlsKey != "" {- log.Printf("AgentFlow %s listening on https://%s", role, displayAddr)+ log.Printf("LoopForge %s listening on https://%s", role, displayAddr)serve = func() error { return srv.ServeTLS(mainLn, *tlsCert, *tlsKey) }} else {- log.Printf("AgentFlow %s listening on http://%s", role, displayAddr)+ log.Printf("LoopForge %s listening on http://%s", role, displayAddr)}signalReady(readyStatus)if err := serve(); err != nil && err != http.ErrServerClosed && !handedOver.Load() {diff --git a/docs/api/README.md b/docs/api/README.mdindex b526c517..1c74878e 100644--- a/docs/api/README.md+++ b/docs/api/README.md@@ -1,4 +1,4 @@-# AgentFlow HTTP API+# LoopForge HTTP API本文档以 `internal/httpapi/server.go`、`dispatch.go`、`schedule.go` 的当前实现为准。接口按领域拆分:diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yamlindex b0c7de20..1f700c6c 100644--- a/docs/api/openapi.yaml+++ b/docs/api/openapi.yaml@@ -1,9 +1,9 @@openapi: 3.1.0info:- title: AgentFlow Platform REST API+ title: LoopForge Platform REST APIversion: 1.0.0description: |- Public control-plane API exposed by AgentFlow Studio. Signed login cookies and+ Public control-plane API exposed by LoopForge. Signed login cookies anduser-owned Bearer tokens authenticate Studio, REST API, and MCP access. Legacydeployment-level Basic authentication remains available. Worker signals,OTLP ingestion, run leases, and sandbox-reclamation endpoints are intentionallydiff --git a/internal/application/operations.go b/internal/application/operations.goindex 3a86dd8e..2b96c001 100644--- a/internal/application/operations.go+++ b/internal/application/operations.go@@ -16,9 +16,9 @@ type Operation struct {// excluded.func PublicOperations() []Operation {return []Operation{- {Name: "health_get", Description: "Check AgentFlow service health", Method: "GET", Path: "/api/health", ReadOnly: true},+ {Name: "health_get", Description: "Check LoopForge service health", Method: "GET", Path: "/api/health", ReadOnly: true},{Name: "capabilities_get", Description: "List public API and MCP operations", Method: "GET", Path: "/api/capabilities", ReadOnly: true},- {Name: "openapi_get", Description: "Read the AgentFlow OpenAPI 3.1 contract", Method: "GET", Path: "/api/openapi.yaml", ReadOnly: true},+ {Name: "openapi_get", Description: "Read the LoopForge OpenAPI 3.1 contract", Method: "GET", Path: "/api/openapi.yaml", ReadOnly: true},{Name: "bootstrap_get", Description: "Get the Studio bootstrap catalog", Method: "GET", Path: "/api/bootstrap", ReadOnly: true},{Name: "business_domains_list", Description: "List managed business domains with the caller's permissions", Method: "GET", Path: "/api/business-domains", ReadOnly: true},{Name: "business_domains_save", Description: "Manage a business domain. Platform admins control lifecycle and managers; domain managers control information and viewers.", Method: "PUT", Path: "/api/business-domains"},@@ -90,7 +90,7 @@ func PublicOperations() []Operation {{Name: "workflows_clone", Description: "Clone an SOP workflow", Method: "POST", Path: "/api/workflows/{id}/clone"},{Name: "workflow_metrics_get", Description: "Get SOP workflow operating metrics", Method: "GET", Path: "/api/workflow-metrics", ReadOnly: true},{Name: "analytics_get", Description: "Get usage and delivery analytics", Method: "GET", Path: "/api/analytics", ReadOnly: true},- {Name: "observability_spec_get", Description: "Get the AgentFlow observability contract", Method: "GET", Path: "/api/observability/spec", ReadOnly: true},+ {Name: "observability_spec_get", Description: "Get the LoopForge observability contract", Method: "GET", Path: "/api/observability/spec", ReadOnly: true},{Name: "runs_list", Description: "List lightweight Run summaries", Method: "GET", Path: "/api/runs", ReadOnly: true},{Name: "runs_control_get", Description: "Read the run mode (sop or workspace), waiting reason, allowed control actions and delivery acceptance. Node execution progress is separate from test results and user acceptance. Read this before changing a run's state.", Method: "GET", Path: "/api/runs/{id}/control", ReadOnly: true},{Name: "runs_start", Description: "Start an SOP Run", Method: "POST", Path: "/api/runs"},diff --git a/internal/engine/assets.go b/internal/engine/assets.goindex ebb0a52c..787f94b8 100644--- a/internal/engine/assets.go+++ b/internal/engine/assets.go@@ -20,9 +20,9 @@ func (e *Engine) platformMCPServer() domain.MCPServerDefinition {e.mu.Unlock()def := domain.MCPServerDefinition{ID: domain.PlatformMCPServerID,- Name: "AgentFlow 平台",+ Name: "LoopForge 平台",Scope: "project",- Description: "AgentFlow 平台侧能力:需求、任务、运行、项目等平台操作以 MCP 工具提供",+ Description: "LoopForge 平台侧能力:需求、任务、运行、项目等平台操作以 MCP 工具提供",Transport: "http",URL: base + "/mcp",TimeoutSec: 60,diff --git a/internal/engine/conversation_push.go b/internal/engine/conversation_push.goindex 27c57406..96904287 100644--- a/internal/engine/conversation_push.go+++ b/internal/engine/conversation_push.go@@ -45,7 +45,7 @@ func (e *Engine) PushConversationWorkspace(ctx context.Context, runID, gitToken,}message = strings.TrimSpace(message)if message == "" {- message = "AgentFlow: " + strings.TrimSpace(run.Input)+ message = "LoopForge: " + strings.TrimSpace(run.Input)}message = truncateCommitMessage(message)sharedTarget = strings.TrimSpace(sharedTarget)diff --git a/internal/engine/integrate.go b/internal/engine/integrate.goindex 0f707a6a..363b2bee 100644--- a/internal/engine/integrate.go+++ b/internal/engine/integrate.go@@ -184,13 +184,13 @@ func integrateMRTitle(r domain.Run, rc domain.RepositoryContext, work, integrateif def == "" {def = work}- return fmt.Sprintf("AgentFlow: 对齐 %s → %s", def, integrate)+ return fmt.Sprintf("LoopForge: 对齐 %s → %s", def, integrate)}label := integrationCommitLabel(r)if label == "" || label == "scheduled SOP work" {- return fmt.Sprintf("AgentFlow: %s → %s", work, integrate)+ return fmt.Sprintf("LoopForge: %s → %s", work, integrate)}- return fmt.Sprintf("AgentFlow: %s → %s", label, integrate)+ return fmt.Sprintf("LoopForge: %s → %s", label, integrate)}func integrateMRDescription(r domain.Run, work, integrate string) string {diff --git a/internal/engine/integrate_test.go b/internal/engine/integrate_test.goindex d32f1b06..488e797a 100644--- a/internal/engine/integrate_test.go+++ b/internal/engine/integrate_test.go@@ -642,7 +642,7 @@ func TestIntegrateMRTitleIncludesIssue(t *testing.T) {ExecutionContext: domain.TelemetryContext{IssueNumber: 30},Repository: domain.RepositoryContext{WorkBranch: "feature/fix-issue-30"},}, domain.RepositoryContext{}, "feature/fix-issue-30", "agentflow/integration")- if got != "AgentFlow: issue #30 timeout spike → agentflow/integration" {+ if got != "LoopForge: issue #30 timeout spike → agentflow/integration" {t.Fatalf("title = %q", got)}}diff --git a/internal/engine/repository_workspace.go b/internal/engine/repository_workspace.goindex f3cc3d92..53c1dee7 100644--- a/internal/engine/repository_workspace.go+++ b/internal/engine/repository_workspace.go@@ -145,7 +145,7 @@ func prepareRepository(ctx context.Context, workspace string, repository domain.if output, err := cmd.CombinedOutput(); err != nil {return fmt.Errorf("copy local source: %w: %s", err, strings.TrimSpace(string(output)))}- for _, args := range [][]string{{"init", "-b", "agentflow-base"}, {"config", "user.email", "agentflow@local"}, {"config", "user.name", "AgentFlow"}, {"add", "-A"}, {"commit", "-m", "AgentFlow baseline", "--quiet"}} {+ for _, args := range [][]string{{"init", "-b", "agentflow-base"}, {"config", "user.email", "loopforge@local"}, {"config", "user.name", "LoopForge"}, {"add", "-A"}, {"commit", "-m", "LoopForge baseline", "--quiet"}} {cmd = exec.CommandContext(ctx, "git", append([]string{"-C", workspace}, args...)...)if output, err := cmd.CombinedOutput(); err != nil {return fmt.Errorf("snapshot local source: %w: %s", err, strings.TrimSpace(string(output)))diff --git a/internal/engine/run_environment.go b/internal/engine/run_environment.goindex a6fe8de7..7ed98b5a 100644--- a/internal/engine/run_environment.go+++ b/internal/engine/run_environment.go@@ -355,7 +355,7 @@ func (e *Engine) LocalRunWorkspace(run domain.Run) (string, string) {return "", "工作区位于远程执行机器,当前版本暂不支持远程浏览"}if e.foreignWorkspaceBind(run) {- return "", "工作区绑定在其他 AgentFlow 实例"+ return "", "工作区绑定在其他 LoopForge 实例"}workspace := e.sandboxes.RunWorkspace(workspaceRunID(run))if strings.TrimSpace(workspace) == "" {diff --git a/internal/gitwork/gitwork_cases_test.go b/internal/gitwork/gitwork_cases_test.goindex a9a204fe..87d62c9f 100644--- a/internal/gitwork/gitwork_cases_test.go+++ b/internal/gitwork/gitwork_cases_test.go@@ -25,7 +25,7 @@ func TestGitIdentityAndStageUntracked(t *testing.T) {_, _ = exec.Command("git", "-C", dir, "config", "user.name", "").CombinedOutput()_, _ = exec.Command("git", "-C", dir, "config", "user.email", "").CombinedOutput()EnsureIdentity(context.Background(), dir)- if out, err := exec.Command("git", "-C", dir, "config", "user.name").Output(); err != nil || strings.TrimSpace(string(out)) != "AgentFlow" {+ if out, err := exec.Command("git", "-C", dir, "config", "user.name").Output(); err != nil || strings.TrimSpace(string(out)) != "LoopForge" {t.Fatalf("name = %q, %v", out, err)}if err := os.WriteFile(filepath.Join(dir, "keep.go"), []byte("package keep"), 0o600); err != nil {diff --git a/internal/gitwork/integrate.go b/internal/gitwork/integrate.goindex 7afa2ecf..d6cbed36 100644--- a/internal/gitwork/integrate.go+++ b/internal/gitwork/integrate.go@@ -9,10 +9,10 @@ import (// EnsureIdentity gives a checkout a committer identity when it has none.func EnsureIdentity(ctx context.Context, workspace string) {if n, _ := C(ctx, workspace, "config", "user.name"); strings.TrimSpace(n) == "" {- _, _ = C(ctx, workspace, "config", "user.name", "AgentFlow")+ _, _ = C(ctx, workspace, "config", "user.name", "LoopForge")}if m, _ := C(ctx, workspace, "config", "user.email"); strings.TrimSpace(m) == "" {- _, _ = C(ctx, workspace, "config", "user.email", "agentflow@local")+ _, _ = C(ctx, workspace, "config", "user.email", "loopforge@local")}}@@ -34,14 +34,14 @@ func MergeLatestIntegration(ctx context.Context, w, work, integrate, label strinif _, err := C(ctx, w, "rev-parse", "--verify", "MERGE_HEAD"); err == nil {_, _ = C(ctx, w, "add", "-A")DropSOPDeliverablesFromIndex(ctx, w)- if err := CommitStaged(ctx, w, labelled("AgentFlow: resolve integration conflicts", label)); err != nil {+ if err := CommitStaged(ctx, w, labelled("LoopForge: resolve integration conflicts", label)); err != nil {return nil, err}}if s, _ := C(ctx, w, "status", "--porcelain"); strings.TrimSpace(s) != "" {_, _ = C(ctx, w, "add", "-A")DropSOPDeliverablesFromIndex(ctx, w)- if err := CommitStaged(ctx, w, labelled("AgentFlow: save scheduled SOP work", label)); err != nil {+ if err := CommitStaged(ctx, w, labelled("LoopForge: save scheduled SOP work", label)); err != nil {return nil, err}}@@ -49,7 +49,7 @@ func MergeLatestIntegration(ctx context.Context, w, work, integrate, label strinif _, err := C(ctx, w, "fetch", "origin", ref); err != nil {return nil, err}- mergeMsg := labelled("AgentFlow: merge latest "+integrate, label)+ mergeMsg := labelled("LoopForge: merge latest "+integrate, label)if _, err := C(ctx, w, "merge", "--no-edit", "-m", mergeMsg, "origin/"+integrate); err != nil {conflicts, finishErr := FinishMergeAfterExcludedConflicts(ctx, w, mergeMsg)if finishErr != nil {@@ -67,7 +67,7 @@ func MergeLatestIntegration(ctx context.Context, w, work, integrate, label strin// Only SOP-report conflicts: merge was completed by FinishMergeAfterExcludedConflicts.}DropSOPDeliverablesFromIndex(ctx, w)- if err := CommitStaged(ctx, w, labelled("AgentFlow: drop SOP deliverables", label)); err != nil {+ if err := CommitStaged(ctx, w, labelled("LoopForge: drop SOP deliverables", label)); err != nil {return nil, err}return nil, nil@@ -92,7 +92,7 @@ func MergeLatestRemoteBranch(ctx context.Context, w, branch string) ([]string, eif _, err := C(ctx, w, "fetch", "origin", ref); err != nil {return nil, err}- mergeMsg := "AgentFlow: merge latest " + branch+ mergeMsg := "LoopForge: merge latest " + branchif _, err := C(ctx, w, "merge", "--no-edit", "-m", mergeMsg, "origin/"+branch); err != nil {conflicts, finishErr := FinishMergeAfterExcludedConflicts(ctx, w, mergeMsg)if finishErr != nil {diff --git a/internal/gitwork/workbranch.go b/internal/gitwork/workbranch.goindex c9d8c5cf..ffbc1ffd 100644--- a/internal/gitwork/workbranch.go+++ b/internal/gitwork/workbranch.go@@ -56,7 +56,7 @@ func pushWorkBranch(ctx context.Context, workspace, branch, message string, requif exec.Command("git", "-C", workspace, "diff", "--cached", "--quiet").Run() != nil {args := []string{"commit", "--no-verify", "-q", "-m", message}if email, _ := C(ctx, workspace, "config", "user.email"); strings.TrimSpace(email) == "" {- args = append([]string{"-c", "user.name=AgentFlow", "-c", "user.email=agentflow@local"}, args...)+ args = append([]string{"-c", "user.name=LoopForge", "-c", "user.email=loopforge@local"}, args...)}if _, err := C(ctx, workspace, args...); err != nil {return "", fmt.Errorf("commit work branch: %w", err)@@ -181,7 +181,7 @@ func pullWorkBranch(ctx context.Context, workspace, branch string, requireExisti}args := []string{"rebase", "-q", "--autostash", trackingRef}if email, _ := C(ctx, workspace, "config", "user.email"); strings.TrimSpace(email) == "" {- args = append([]string{"-c", "user.name=AgentFlow", "-c", "user.email=agentflow@local"}, args...)+ args = append([]string{"-c", "user.name=LoopForge", "-c", "user.email=loopforge@local"}, args...)}if _, err := C(ctx, workspace, args...); err != nil {_, _ = C(ctx, workspace, "rebase", "--abort")diff --git a/internal/httpapi/agent_tool_mcp.go b/internal/httpapi/agent_tool_mcp.goindex dddd169d..8479a107 100644--- a/internal/httpapi/agent_tool_mcp.go+++ b/internal/httpapi/agent_tool_mcp.go@@ -127,7 +127,7 @@ func agentToolInstructions(mode AgentToolMode) string {case AgentToolScheduled:return "使用当前项目和个人已安装的 MCP 以及 agentflow__* 直接读写,写入立即生效。完成后用自然语言汇报。"default:- return "AgentFlow session MCP"+ return "LoopForge session MCP"}}diff --git a/internal/httpapi/assistant_mcp.go b/internal/httpapi/assistant_mcp.goindex 5b2578f3..c3894891 100644--- a/internal/httpapi/assistant_mcp.go+++ b/internal/httpapi/assistant_mcp.go@@ -109,7 +109,7 @@ func (h *assistantHandlers) callAssistantPlatform(ctx context.Context, user domasort.Strings(names)sort.Strings(reads)sort.Strings(writes)- raw, _ := json.Marshal(ginH{"server": "agentflow", "name": "AgentFlow", "tools": names, "readOnly": reads, "write": writes})+ raw, _ := json.Marshal(ginH{"server": "agentflow", "name": "LoopForge", "tools": names, "readOnly": reads, "write": writes})return string(raw), nil}op, ok := assistantPublicOperations[tool]diff --git a/internal/httpapi/clarify_jobs_test.go b/internal/httpapi/clarify_jobs_test.goindex 7456ff84..d7fde6f3 100644--- a/internal/httpapi/clarify_jobs_test.go+++ b/internal/httpapi/clarify_jobs_test.go@@ -320,7 +320,7 @@ func TestPersistClarifyReadyWaitsForUserConfirm(t *testing.T) {if stored.Clarification.WriteBackStatus != "pending" {t.Fatalf("writeBack=%s want pending", stored.Clarification.WriteBackStatus)}- if !strings.Contains(stored.Description, "原 TAPD 描述") || !strings.Contains(stored.Description, "## AgentFlow 澄清结论") || !strings.Contains(stored.Description, "查不到套餐时应返回空数据") {+ if !strings.Contains(stored.Description, "原 TAPD 描述") || !strings.Contains(stored.Description, "## LoopForge 澄清结论") || !strings.Contains(stored.Description, "查不到套餐时应返回空数据") {t.Fatalf("platform description missing conclusion: %q", stored.Description)}again, err := h.persistClarifyOutcome("iss-ready-confirm", map[string]any{@@ -331,7 +331,7 @@ func TestPersistClarifyReadyWaitsForUserConfirm(t *testing.T) {if err != nil {t.Fatal(err)}- if strings.Count(again.Description, "## AgentFlow 澄清结论") != 1 {+ if strings.Count(again.Description, "## LoopForge 澄清结论") != 1 {t.Fatalf("conclusion block should be replaced, not stacked: %q", again.Description)}if !strings.Contains(again.Description, "第二轮结论:返回空数据并记日志") || strings.Contains(again.Description, "查不到套餐时应返回空数据") {diff --git a/internal/httpapi/issues.go b/internal/httpapi/issues.goindex 6ea7d04d..3cc5b31c 100644--- a/internal/httpapi/issues.go+++ b/internal/httpapi/issues.go@@ -578,16 +578,24 @@ func promoteClarifiedIssueTodo(issue *domain.Issue) {}}+const (+ clarificationHeading = "## LoopForge 澄清结论"+ legacyClarificationHeading = "## AgentFlow 澄清结论"+)+func appendClarificationDescription(description, summary string) string {summary = strings.TrimSpace(summary)if summary == "" {return description}- const heading = "## AgentFlow 澄清结论"- block := heading + "\n\n" + summary+ block := clarificationHeading + "\n\n" + summarydesc := strings.TrimRight(description, " \t\n")- if i := strings.Index(desc, heading); i >= 0 {- desc = strings.TrimRight(desc[:i], " \t\n")+ // Descriptions written before the rename still carry the old heading; replace+ // that block too so a re-clarified issue keeps a single conclusion.+ for _, heading := range []string{clarificationHeading, legacyClarificationHeading} {+ if i := strings.Index(desc, heading); i >= 0 {+ desc = strings.TrimRight(desc[:i], " \t\n")+ }}if desc == "" {return block@@ -602,7 +610,7 @@ func clarificationComment(issue domain.Issue, summary string) string {} else if issue.Source == "tapd" {source = "TAPD 需求"}- return fmt.Sprintf("## AgentFlow 澄清结论\n\n%s\n\n---\n来源:%s `%s`,由 AgentFlow 基于当前描述和用户回答生成。", strings.TrimSpace(summary), source, issue.ID)+ return fmt.Sprintf("%s\n\n%s\n\n---\n来源:%s `%s`,由 LoopForge 基于当前描述和用户回答生成。", clarificationHeading, strings.TrimSpace(summary), source, issue.ID)}func assessClarification(policy domain.ClarificationPolicy, answers map[string]string) domain.ClarificationAssessment {diff --git a/internal/httpapi/issues_cases_test.go b/internal/httpapi/issues_cases_test.goindex a34be03e..a0100050 100644--- a/internal/httpapi/issues_cases_test.go+++ b/internal/httpapi/issues_cases_test.go@@ -149,9 +149,16 @@ func TestIssuesMoreDirectHelpers(t *testing.T) {}first := appendClarificationDescription("", "summary")replaced := appendClarificationDescription("prefix\n\n"+first, "replacement")- if strings.Count(replaced, "## AgentFlow 澄清结论") != 1 || !strings.Contains(replaced, "replacement") {+ if strings.Count(replaced, "## LoopForge 澄清结论") != 1 || !strings.Contains(replaced, "replacement") {t.Fatalf("clarification replacement: %q", replaced)}+ legacy := appendClarificationDescription("prefix\n\n## AgentFlow 澄清结论\n\nold summary", "new summary")+ if legacy != "prefix\n\n## LoopForge 澄清结论\n\nnew summary" {+ t.Fatalf("legacy clarification block was not replaced: %q", legacy)+ }+ if comment := clarificationComment(domain.Issue{ID: "T-1", Source: "tapd"}, "结论"); strings.Contains(comment, "AgentFlow") || !strings.HasPrefix(comment, "## LoopForge 澄清结论") {+ t.Fatalf("clarification comment branding: %q", comment)+ }for _, issue := range []domain.Issue{{ID: "local"},{ID: "gf", Source: "gongfeng"},diff --git a/internal/httpapi/issues_test.go b/internal/httpapi/issues_test.goindex ff8b3a68..84462ddc 100644--- a/internal/httpapi/issues_test.go+++ b/internal/httpapi/issues_test.go@@ -1519,7 +1519,7 @@ func TestAppendClarificationDescriptionReplacesPreviousBlock(t *testing.T) {t.Fatalf("got %q", got)}got = appendClarificationDescription(got, "第二轮结论")- if strings.Count(got, "## AgentFlow 澄清结论") != 1 || strings.Contains(got, "第一轮结论") || !strings.Contains(got, "第二轮结论") {+ if strings.Count(got, "## LoopForge 澄清结论") != 1 || strings.Contains(got, "第一轮结论") || !strings.Contains(got, "第二轮结论") {t.Fatalf("replace failed: %q", got)}}diff --git a/internal/httpapi/runs.go b/internal/httpapi/runs.goindex 36fbc48f..b79f9a42 100644--- a/internal/httpapi/runs.go+++ b/internal/httpapi/runs.go@@ -222,7 +222,7 @@ func (h *runsHandlers) run(c *gin.Context) {c.Header("Content-Type", "text/plain; charset=utf-8")c.Header("Content-Disposition", `attachment; filename="`+id+`-worker-logs.txt"`)c.Status(http.StatusOK)- fmt.Fprintf(c.Writer, "# AgentFlow worker logs\n# run=%s\n# nodes=%s\n# count=%d\n\n", id, logDumpNodeLabel(nodeID), len(recs))+ fmt.Fprintf(c.Writer, "# LoopForge worker logs\n# run=%s\n# nodes=%s\n# count=%d\n\n", id, logDumpNodeLabel(nodeID), len(recs))for _, rec := range recs {stamp := rec.Timestamp.Local().Format("15:04:05")node := rec.Context.NodeIDdiff --git a/internal/mcpserver/server.go b/internal/mcpserver/server.goindex 72f7b63b..2a7a8c6c 100644--- a/internal/mcpserver/server.go+++ b/internal/mcpserver/server.go@@ -87,7 +87,7 @@ type LocalInvoker struct {func (i LocalInvoker) Invoke(ctx context.Context, op application.Operation, input ToolInput) (InvokeResult, error) {if i.Handler == nil {- return InvokeResult{}, errors.New("AgentFlow API handler is unavailable")+ return InvokeResult{}, errors.New("LoopForge API handler is unavailable")}path, err := buildPath(op.Path, input)if err != nil {@@ -280,7 +280,7 @@ func (s *Server) handle(ctx context.Context, request rpcRequest) *rpcResponse {"resources": map[string]any{"subscribe": false, "listChanged": false},},"serverInfo": map[string]string{"name": serverName, "version": serverVersion},- "instructions": "AgentFlow business operations. Mutating tools can start agents, change external trackers, or alter saved definitions.",+ "instructions": "LoopForge business operations. Mutating tools can start agents, change external trackers, or alter saved definitions.",}}case "ping":return &rpcResponse{JSONRPC: "2.0", ID: request.ID, Result: map[string]any{}}@@ -447,7 +447,7 @@ func (s *Server) readResource(ctx context.Context, raw json.RawMessage) (map[strreturn nil, err}if result.Status < 200 || result.Status >= 300 {- return nil, fmt.Errorf("AgentFlow API returned %d: %s", result.Status, strings.TrimSpace(string(result.Body)))+ return nil, fmt.Errorf("LoopForge API returned %d: %s", result.Status, strings.TrimSpace(string(result.Body)))}mime := strings.TrimSpace(strings.Split(result.ContentType, ";")[0])if mime == "" {diff --git a/internal/runner/integrate.go b/internal/runner/integrate.goindex 9d97cc07..a7f9c1f1 100644--- a/internal/runner/integrate.go+++ b/internal/runner/integrate.go@@ -66,7 +66,7 @@ func integrateTaskRepositories(ctx context.Context, workspace string, inv *domaireturn append(results, result), nil}if repo.RequireExistingWorkBranch {- if _, err := gitwork.PushExistingWorkBranch(repoCtx, dir, work, "AgentFlow: integration"); err != nil {+ if _, err := gitwork.PushExistingWorkBranch(repoCtx, dir, work, "LoopForge: integration"); err != nil {return results, fmt.Errorf("%s: push existing work branch %s: %w", repo.Name, work, err)}} else if _, err := gitwork.C(repoCtx, dir, "push", "origin", work); err != nil {diff --git a/internal/runtime/gate_mcp.go b/internal/runtime/gate_mcp.goindex 51bdeffe..c78c537d 100644--- a/internal/runtime/gate_mcp.go+++ b/internal/runtime/gate_mcp.go@@ -41,7 +41,7 @@ func materializeGateMCP(workspace, configRoot, binaryRel, resultPath, driver str}return domain.MCPServerDefinition{ID: gateMCPServerID,- Name: "AgentFlow Gate",+ Name: "LoopForge Gate",Transport: "stdio",Command: filepath.ToSlash(binaryRel),Environment: map[string]string{diff --git a/internal/tracker/merge_mr.go b/internal/tracker/merge_mr.goindex 2a15dc6e..8d643342 100644--- a/internal/tracker/merge_mr.go+++ b/internal/tracker/merge_mr.go@@ -56,7 +56,7 @@ func (s *Service) EnsureAndMergeBranchMR(project, sourceBranch, targetBranch, ti}createTitle := strings.TrimSpace(title)if createTitle == "" {- createTitle = fmt.Sprintf("AgentFlow: %s → %s", src, tgt)+ createTitle = fmt.Sprintf("LoopForge: %s → %s", src, tgt)}createDesc := strings.TrimSpace(description)if createDesc == "" {diff --git a/web/app/flows.js b/web/app/flows.jsindex 2006cdc7..6dda9523 100644--- a/web/app/flows.js+++ b/web/app/flows.js@@ -858,7 +858,7 @@ function renderAgentAssetsPanel(a){const d=ensureAgentDraft(a);const generic=catalogGeneric(state.workflow);const col=(title,sub,name,items,selected)=>{const vis=name==='mcpServers'?(generic?(items||[]):visibleMCPAssets(items)):(name==='rules'||name==='skills'?(items||[]).filter(item=>catalogVisible(item.projectId,item.shared)):visibleAssets(items));const picked=vis.filter(item=>name==='mcpServers'&&generic?genericMCPChecked(item.id,selected):(selected||[]).includes(item.id)).length;const empty=name==='mcpServers'?(generic?'通用模板绑定市场别名(如 github),运行时落到当前项目已安装的 MCP':'这个项目或你的个人范围还没有 MCP,先到「MCP 管理」里添加'):name==='rules'?'这个项目还没有可用规则,先到「规则管理」里添加或共享':name==='skills'?'这个项目还没有可用技能,先到「技能管理」里添加或共享':'这个项目还没有此类配置,先到「环境资产」里添加';return `<div class="as-asset-col"><div class="as-asset-col-head"><b>${title}</b><span>${sub}${picked?` · 已选 ${picked}`:''}</span></div><div class="as-asset-search"><span>⌕</span><input type="search" data-asset-filter="${name}" placeholder="搜索名称…"></div><div class="as-asset-list" data-asset-list="${name}">${vis.map(x=>`<label class="as-asset-item"><input type="checkbox" name="${name}" value="${escapeHTML(x.id)}" ${(name==='mcpServers'&&generic?genericMCPChecked(x.id,selected):(selected||[]).includes(x.id))?'checked':''}><div><b>${escapeHTML(x.name)}</b><small>${escapeHTML(x.description||x.id)}${x.shared&&x.projectId!==state.projectFilter?' · 共享':''}</small></div></label>`).join('')||`<div class="as-empty">${empty}</div>`}</div></div>`};- host.innerHTML=`<section class="as-section-block as-platform-mcp-section"><div class="as-section-head"><b>平台能力</b><small>独立开关,不占用 MCP 列表</small></div><label class="as-switch-row"><span><b>接入平台 MCP(AgentFlow)</b><small>开启后,这个角色运行时通过平台 MCP(agentflow-platform)直接调用平台侧功能:需求、任务、运行、项目等平台操作。</small></span><input type="checkbox" name="platformMcp" ${d.platformMcp?'checked':''} role="switch"></label><label class="as-switch-row"><span><b>接入团队知识库</b><small>开启后,这个角色运行时可只读检索团队知识库(agentflow-knowledge),并自动附带「知识库使用规范」规则;产出的 knowledge.md 会进入知识沉淀审核队列。</small></span><input type="checkbox" name="knowledgeBase" ${d.knowledgeBase?'checked':''} role="switch"></label></section><div class="as-assets">${col('必须遵守','规则','rules',state.data.rules,d.rules)}${col('怎么干活','技能','skills',state.data.skills,d.skills)}${col('外部工具','MCP','mcpServers',generic?genericTemplateMCPOptions(d.mcpServers):state.data.mcpServers,d.mcpServers)}</div><section class="as-section-block as-hook-section"><div class="as-section-head"><b>运行时 Hook</b><small>在工具调用前后插一段脚本,比如拦危险命令。一般可以先不配。</small></div><div id="agentHookPanel"></div></section>`;+ host.innerHTML=`<section class="as-section-block as-platform-mcp-section"><div class="as-section-head"><b>平台能力</b><small>独立开关,不占用 MCP 列表</small></div><label class="as-switch-row"><span><b>接入平台 MCP(LoopForge)</b><small>开启后,这个角色运行时通过平台 MCP(agentflow-platform)直接调用平台侧功能:需求、任务、运行、项目等平台操作。</small></span><input type="checkbox" name="platformMcp" ${d.platformMcp?'checked':''} role="switch"></label><label class="as-switch-row"><span><b>接入团队知识库</b><small>开启后,这个角色运行时可只读检索团队知识库(agentflow-knowledge),并自动附带「知识库使用规范」规则;产出的 knowledge.md 会进入知识沉淀审核队列。</small></span><input type="checkbox" name="knowledgeBase" ${d.knowledgeBase?'checked':''} role="switch"></label></section><div class="as-assets">${col('必须遵守','规则','rules',state.data.rules,d.rules)}${col('怎么干活','技能','skills',state.data.skills,d.skills)}${col('外部工具','MCP','mcpServers',generic?genericTemplateMCPOptions(d.mcpServers):state.data.mcpServers,d.mcpServers)}</div><section class="as-section-block as-hook-section"><div class="as-section-head"><b>运行时 Hook</b><small>在工具调用前后插一段脚本,比如拦危险命令。一般可以先不配。</small></div><div id="agentHookPanel"></div></section>`;host.querySelectorAll('[data-asset-filter]').forEach(input=>input.oninput=()=>{const q=input.value.trim().toLowerCase();input.closest('.as-asset-col').querySelectorAll('.as-asset-item').forEach(row=>row.hidden=!!q&&!row.textContent.toLowerCase().includes(q))});host.querySelectorAll('input[type=checkbox]').forEach(el=>el.onchange=()=>{renderAgentSummary();dirty()});const platformToggle=host.querySelector('input[name="platformMcp"]');diff --git a/web/app/issue-drawer.js b/web/app/issue-drawer.jsindex 1bdb83a3..de4f6b22 100644--- a/web/app/issue-drawer.js+++ b/web/app/issue-drawer.js@@ -230,7 +230,7 @@ function renderIssueDetailTab(){}function drawerFact(label,value,title){return `<div class="detail-fact"><span>${label}</span><b title="${escapeHTML(title||value||'')}">${value===''||value==null?'—':value}</b></div>`}function clarificationOverviewCard(issue){- const c=issue.clarification||{},source=issue.source==='gongfeng'?'工蜂':issue.source==='tapd'?'TAPD':'AgentFlow';+ const c=issue.clarification||{},source=issue.source==='gongfeng'?'工蜂':issue.source==='tapd'?'TAPD':'LoopForge';const score=c.score||0;if(issueClarifying(issue.id)||c.status==='analyzing'){return `<div class="clarify-overview"><span>…</span><div><b>澄清正在后台分析</b><small>关闭网页也不会中断,点查看可回到分析过程</small></div><button class="button ghost small" data-start-clarify>查看</button></div>`;@@ -597,7 +597,7 @@ function clarifyHistoryHTML(c){function clarifyPane(issue,project){const c=recoverClarifyView(issue.clarification||{}),source=issue.source==='gongfeng'?'工蜂 Issue':issue.source==='tapd'?'TAPD 需求':'工作项';if(c.status==='ready'&&submittedClarifyDraft?.issueId===issue.id)submittedClarifyDraft=null;- const writeBack=c.writeBackStatus==='succeeded'?`已写回 ${source}`:c.writeBackStatus==='failed'?'写回失败':c.writeBackStatus==='skipped'?'仅保存到 AgentFlow':'';+ const writeBack=c.writeBackStatus==='succeeded'?`已写回 ${source}`:c.writeBackStatus==='failed'?'写回失败':c.writeBackStatus==='skipped'?'仅保存到 LoopForge':'';if(c.status==='ready'&&c.summary){const pending=c.writeBackStatus==='pending'&&(issue.source==='tapd'||issue.source==='gongfeng')&&issue.externalRef;const retry=c.writeBackStatus==='failed'?`<button class="button primary small" data-retry-clarify>重试写回原单</button>`:'';@@ -783,7 +783,7 @@ function conversationRepoCards(issue,data){// 对话需求的阶段卡片:合入为绿、进行中为蓝;没合入就关闭的保持中性,不当成交付成功。function conversationHeadState(issue){const st=issueCurrentStage(issue);- if(issueManuallyClosed(issue))return{tone:'',label:'需求已关闭',hint:'需求已在 AgentFlow 中手动关闭,需要继续时先重新打开'};+ if(issueManuallyClosed(issue))return{tone:'',label:'需求已关闭',hint:'需求已在 LoopForge 中手动关闭,需要继续时先重新打开'};if(issueTrackerClosed(issue)&&!issueMergedDelivery(issue))return{tone:'',label:st.label,hint:'外部工作项已关闭'};if(deliveryLocked(issue)){const merged=issueMergedDelivery(issue);diff --git a/web/app/issue-model.js b/web/app/issue-model.jsindex a06d1441..731cea2d 100644--- a/web/app/issue-model.js+++ b/web/app/issue-model.js@@ -267,7 +267,7 @@ function issueActor(i){}function issueOutcome(i){const health=issueRunHealth(i),stage=issueCurrentStage(i);- if(issueManuallyClosed(i))return{key:'closed',short:'已关闭',title:'需求已关闭',body:'该需求已在 AgentFlow 中手动关闭。如需继续修改或执行,请先重新打开。'};+ if(issueManuallyClosed(i))return{key:'closed',short:'已关闭',title:'需求已关闭',body:'该需求已在 LoopForge 中手动关闭。如需继续修改或执行,请先重新打开。'};if(issueTrackerClosed(i)&&!issueMergedDelivery(i))return{key:'closed',short:'已关闭',title:gongfengIssueClosed(i)?'工蜂已关闭':'外部工作项已关闭',body:'请先在外部系统重新打开工作项,等待状态同步后再执行。'};if(deliveryLocked(i)){const label=deliveryLockedLabel(i);const short=label==='MR 已合入'?'已合入':label==='已合入基线'?'已合入基线':label==='关闭'?'关闭':'已交付';return{key:'closed',short,title:label,body:label==='MR 已合入'?'关联 MR 已合入默认分支。如需继续修改,请用重新触发再开一条 SOP。':label==='已合入基线'?'关联 MR 已合入集成分支,尚未进默认分支。如需继续修改,请用重新触发再开一条 SOP。':label==='关闭'?'需求已关闭。如需继续修改或执行,请用重新触发再开一条 SOP。':'SOP 已全部通过。如需继续修改,请用重新触发再开一条 SOP。'};}if((i.status||'')==='done')return{key:'closed',short:stage.label==='交付闭环'?'已交付':'已完成',title:stage.label==='交付闭环'?'交付闭环':'需求已完成',body:stage.label==='交付闭环'?'SOP 已全部通过。如需继续修改,请先重新打开后再触发新的 SOP。':'需求已完成。'};diff --git a/web/app/observability.js b/web/app/observability.jsindex 032bc931..2aa8be7c 100644--- a/web/app/observability.js+++ b/web/app/observability.js@@ -1520,7 +1520,7 @@ async function exportObsReport(){const scope=obsReportScope();const stamp=new Date().toISOString().slice(0,10);a.href=URL.createObjectURL(blob);- a.download=`AgentFlow用量报告-${scope.project}-${scope.who}-${stamp}.html`;+ a.download=`LoopForge用量报告-${scope.project}-${scope.who}-${stamp}.html`;document.body.appendChild(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(a.href),1500);toast('已导出 HTML 报告','ok');@@ -1578,7 +1578,7 @@ th{text-align:left;color:var(--muted);font-size:11px;padding:8px;border-bottom:1@media print{body{background:#fff}.wrap{padding:0}.kpis article,.block{break-inside:avoid}}@media(max-width:800px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}</style></head><body><div class="wrap">-<header><p class="eyebrow">AgentFlow</p><h1>用量分析报告</h1><p>效果看成功率和一次通过,投入看 Token、成本和执行耗时。交付看 SOP 是否跑完、PR 是否合入。</p>+<header><p class="eyebrow">LoopForge</p><h1>用量分析报告</h1><p>效果看成功率和一次通过,投入看 Token、成本和执行耗时。交付看 SOP 是否跑完、PR 是否合入。</p><div class="meta"><span>项目 ${escapeHTML(scope.project)}</span><span>维度 ${escapeHTML(scope.dim)}</span><span>${obsScope()==='project'?'范围':'责任人'} ${escapeHTML(scope.who)}</span><span>来源 ${escapeHTML(scope.source)}</span><span>生成于 ${escapeHTML(scope.at)}</span></div></header><section class="kpis">${kpis}</section>${obsReportTable('SOP 一览',['SOP','运行','成功率','返工率','Tokens','成本','均执行'],wfRows)}@@ -1590,7 +1590,7 @@ ${obsReportTable('SOP 版本对比',['SOP','版本','运行','成功率','Tokens${obsReportTable(obsGrainCaption()+'趋势',['周期','运行','需求','成功','失败','Tokens','成本','执行耗时'],trendRows)}${projectRows?obsReportTable('各项目用量',['项目','运行','需求','Tokens','成本'],projectRows):''}${obsReportTable('交付明细',['单号','标题','SOP','流程','责任人','Tokens','成本','PR','交付'],deliveryRows)}-<footer>由 AgentFlow 用量分析导出。日志与 Trace 请在运行记录中查看。</footer>+<footer>由 LoopForge 用量分析导出。日志与 Trace 请在运行记录中查看。</footer></div></body></html>`;}diff --git a/web/brand_test.go b/web/brand_test.gonew file mode 100644index 00000000..6e80526a--- /dev/null+++ b/web/brand_test.go@@ -0,0 +1,59 @@+package web++import (+ "io/fs"+ "os"+ "path/filepath"+ "regexp"+ "strings"+ "testing"+)++// The product is LoopForge. "AgentFlow" survives only in internal identifiers+// (AgentFlowHarnessIcons, agentflow-* message types, cookies), never as a word+// a user can read in the console or chat UI.+var visibleOldBrand = regexp.MustCompile(`AgentFlow([^A-Za-z0-9_]|$)`)++func TestUserFacingFrontendSaysLoopForge(t *testing.T) {+ roots := []string{"app", "extensions", "../chatbot/src", "../chatbot/public"}+ files := []string{"../chatbot/index.html", "mcp-setup.txt"}+ for _, pattern := range []string{"*.js", "*.html"} {+ matches, err := filepath.Glob(pattern)+ if err != nil {+ t.Fatal(err)+ }+ files = append(files, matches...)+ }+ for _, root := range roots {+ err := filepath.WalkDir(root, func(path string, entry fs.DirEntry, err error) error {+ if err != nil {+ return err+ }+ if entry.IsDir() && entry.Name() == "node_modules" {+ return filepath.SkipDir+ }+ switch filepath.Ext(path) {+ case ".js", ".jsx", ".html", ".json", ".txt":+ files = append(files, path)+ }+ return nil+ })+ if err != nil {+ t.Fatal(err)+ }+ }+ for _, file := range files {+ if strings.HasSuffix(file, "_test.js") || strings.HasSuffix(file, ".test.js") || strings.HasSuffix(file, ".test.jsx") {+ continue+ }+ data, err := os.ReadFile(file)+ if err != nil {+ t.Fatal(err)+ }+ for number, line := range strings.Split(string(data), "\n") {+ if visibleOldBrand.MatchString(line) {+ t.Errorf("%s:%d still shows the old product name: %s", file, number+1, strings.TrimSpace(line))+ }+ }+ }+}diff --git a/web/extensions/agentflow-workspace/package.json b/web/extensions/agentflow-workspace/package.jsonindex 15b51e68..90fc4ddc 100644--- a/web/extensions/agentflow-workspace/package.json+++ b/web/extensions/agentflow-workspace/package.json@@ -1,6 +1,6 @@{"name": "workspace",- "displayName": "AgentFlow Run Workspace",+ "displayName": "LoopForge Run Workspace","description": "SOP run workspace with explicit human takeover for VS Code for the Web","version": "1.5.0","publisher": "agentflow",diff --git a/web/vscode.js b/web/vscode.jsindex 5ad85555..1ea13f28 100644--- a/web/vscode.js+++ b/web/vscode.js@@ -218,8 +218,8 @@'agentflow.repositories': repositories},productConfiguration: {- nameShort: 'AgentFlow VS Code',- nameLong: 'AgentFlow VS Code',+ nameShort: 'LoopForge VS Code',+ nameLong: 'LoopForge VS Code',applicationName: 'agentflow-vscode',dataFolderName: '.agentflow-vscode',version: '1.91.1',