Skip to content

Restore one-click workflow publishing - #3276

Open
AbigailDeng wants to merge 13 commits into
feat/2026-08-04_workflow-activity-vnextfrom
fix/2026-08-06_one-click-workflow-publish
Open

Restore one-click workflow publishing#3276
AbigailDeng wants to merge 13 commits into
feat/2026-08-04_workflow-activity-vnextfrom
fix/2026-08-06_one-click-workflow-publish

Conversation

@AbigailDeng

@AbigailDeng AbigailDeng commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

问题与方案

Workflow Activity vNext 之前只复用了 Studio 的低层 canvas 组件,未复用完整编辑合同,并另外实现了一套 Publish 路径。这导致边编辑能力缺失,且 vNext Publish 与已经稳定运行的 Team Member Studio 行为不一致。

本 PR 将两条路径收敛到现有 Studio 能力:

  • 新增共享 WorkflowStudioEditorSurface,统一 Canvas、Node library、节点/边选择、连接、删除和布局移动等完整编辑合同。
  • Team Member Workflow Studio 与 Workflow Activity vNext 使用同一个 editor surface。
  • vNext 补齐连接节点、删除节点、删除边、移动节点、选中边、序列化、校验和错误状态。
  • Team Member Studio 的 conditional/switch 连接改为 branch-aware,分支写入 branches,不再错误写入线性 next
  • 编辑器标题只保留一个可编辑 workflow name;Publish 阻塞原因使用紧凑、可聚焦的标准 Tooltip。
  • save、publish 和 validation 的 error/warning 使用 toast;页面只保留 draft run 输出和执行错误。

Publish 与隐藏 authority

后端接口保持不变。用户只感知 Workflow;每个 Workflow 自动拥有一套用户不可见的 system-managed Team 和 Member:

1 Workflow
-> 1 hidden Team
-> 1 hidden Member
-> existing member binding-run Publish
-> publishedServiceId
  • 新 Workflow materialize 后,前端自动创建专属 Team、创建专属 workflow Member,并通过 typed implementationRef.workflowId 建立关联。
  • 不在 UI、路由、query 或用户操作中暴露 Team/Member。
  • 发布前复用既有 Save 逻辑,读取 exact saved document,序列化该版本并生成独立 revisionId
  • 复用 Studio explicit request preview/confirmation,然后调用 bindMemberWorkflow
  • 202 accepted 只表示 dispatch accepted;前端继续读取 exact getMemberBindingRun(scopeId, memberId, bindingRunId)
  • 只有 binding run 为 succeeded 且 revision 匹配时,才从 result.publishedServiceId 显示 Published。
  • 取消确认回到 idle;404/materialization delay 保持非阻塞并允许 Check again,不重复提交 bind。
  • 删除 Workflow 时按 deleteMember -> archiveTeam -> deleteWorkflowDraft 清理其 exact typed authority;各步 404 按已清理处理。

身份边界

teamIdmemberIdworkflowIdpublishedServiceIdrevisionIdbindingRunId 始终是独立身份。

  • 只通过 member.implementationKind === 'workflow'member.implementationRef.implementationKind === 'workflow'member.implementationRef.workflowId === workflowId 解析 backing authority。
  • 不通过字符串前缀、名称、route、相等关系或 service key 推导身份。
  • vNext 生产发布路径不再调用 studioApi.publishWorkflow,也不把 workflow ID 传给 member API。
  • 本 PR 相对 base feat/2026-08-04_workflow-activity-vnext 没有后端代码差异。

影响路径

  • Team Member Workflow Studio 与 Workflow Activity vNext 的共享画布编辑能力。
  • Workflow Activity vNext 的创建、保存、发布、binding-run observation 和删除。
  • conditional/switch branch connection 序列化。
  • Studio workflow API response decoding、标题、toast 和 Publish blocker 提示。
  • 相关页面、hook、shared helper 和 API 的聚焦回归测试。

Local verification

  • Changed/new tests: pnpm exec jest src/pages/workflow-activity-vnext/workflows/workflowBackingAuthority.test.ts src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/pages/workflow-activity-vnext/index.test.tsx src/pages/team-member-workflow-studio/index.test.tsx --runInBand from apps/aevatar-console-web - 5 suites, 230 tests passed.
  • Related tests: pnpm exec jest --findRelatedTests src/pages/team-member-workflow-studio/hooks/useTeamMemberWorkflowStudio.ts src/pages/workflow-activity-vnext/hooks/useWorkflowEditor.ts src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.ts src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.tsx src/pages/workflow-activity-vnext/workflows/WorkflowEditorPage.tsx src/pages/workflow-activity-vnext/workflows/WorkflowsPage.tsx src/shared/studio/workflowBackingAuthority.ts --runInBand from apps/aevatar-console-web - 5 suites, 230 tests passed.
  • Post-format editor regression: pnpm exec jest src/pages/workflow-activity-vnext/index.test.tsx --runInBand from apps/aevatar-console-web - 1 suite, 106 tests passed.
  • Changed-file static checks: pnpm exec biome check <11 task files> from apps/aevatar-console-web - checked 11 files, no fixes required.
  • Test stability: bash tools/ci/test_stability_guards.sh - passed.
  • Whitespace validation: git diff --cached --check - passed.
  • Full frontend suite/typecheck/build: deferred to GitHub CI by personal local workflow policy.

浏览器验证

此前已复用当前登录的 Chrome 会话,对连接远端后端的目标 Workflow Activity vNext 路由完成 authenticated smoke check:

  • 真实 workflow weekly_report_five_nodes 成功加载。
  • 5 个节点和 4 条边正常渲染。
  • 节点 handles 可连接,节点选择可打开 Configure Guard
  • guided config 字段及 Apply/Close 控件正常显示。
  • 没有 authentication wall、空白页、启动失败或 missing-backend 状态。
  • smoke check 未保存任何测试性远端修改。

Design baseline

Design baseline:
  apps/aevatar-console-web/docs/design-baselines/workflow-activity-vnext/
Primary design:
  aevatar-workflow-activity-vnext.excalidraw
Design SHA-256:
  30e74d7b410ae72c4c91432355436679033679c54c10b1702908435b001577de
Contract specification:
  apps/aevatar-console-web/docs/superpowers/specs/
  2026-08-04-workflow-activity-vnext-design.md
User paths:
  apps/aevatar-console-web/docs/superpowers/specs/
  2026-08-04-workflow-activity-vnext-user-paths.md
Authentication and localization:
  Existing Aevatar login, callback, session, returnTo, and Umi locale logic;
  presentation may change, behavior may not.
Production data source:
  Real APIs and API-acknowledged user actions only; no mock fallback.
Baseline integrity:
  python3 apps/aevatar-console-web/docs/design-baselines/
  workflow-activity-vnext/verify-baseline.py

Conflict and CI remediation (2026-08-07)

  • Resolved the six conflicts against latest base be74bab5302b0ec9b5d4b2d6eecb9156dbf829a0; merge commit 9ef206ff3.
  • Preserved backend catalogue search/pagination/capabilities while retaining exact typed hidden-authority provisioning, binding-run publication observation, and authority cleanup.
  • Related tests: pnpm exec jest src/pages/team-member-workflow-studio/index.test.tsx src/pages/teams/workflowOperationalUnits.test.ts src/pages/workflow-activity-vnext/activity/RunDetailPage.test.tsx src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/pages/workflow-activity-vnext/index.test.tsx src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx src/pages/workflow-activity-vnext/workflows/WorkflowPublishDialog.test.tsx src/pages/workflow-activity-vnext/workflows/workflowArchival.test.ts src/pages/workflow-activity-vnext/workflows/workflowBackingAuthority.test.ts src/shared/api/scopesApi.test.ts src/shared/studio/api.test.ts --runInBand - 10 suites / 302 tests passed.
  • CI typecheck reproduction: CODEX_ALLOW_FULL_FRONTEND_VALIDATION=1 pnpm tsc from apps/aevatar-console-web - passed.
  • Changed-file static checks: pnpm exec biome check <31 existing analyzer-selected changed files> - 31 files passed.
  • Test stability guard: bash tools/ci/test_stability_guards.sh - passed.
  • Diff whitespace check: git diff --cached --check - passed.
  • Full frontend suite and production build are delegated to GitHub CI by the personal incremental frontend policy.

@AbigailDeng

Copy link
Copy Markdown
Contributor Author

Local verification: single workflow editor title

  • Related tests: pnpm exec jest src/pages/workflow-activity-vnext/index.test.tsx --runInBand - 97 passed
  • Regression test: pnpm --dir apps/aevatar-console-web jest --runInBand src/pages/workflow-activity-vnext/index.test.tsx -t "keeps the editor header focused on one inline workflow name" - passed after a verified RED failure before implementation
  • Changed-file static checks: pnpm exec biome check src/pages/workflow-activity-vnext/WorkflowActivityVNextShell.tsx src/pages/workflow-activity-vnext/index.test.tsx src/pages/workflow-activity-vnext/styles.ts src/pages/workflow-activity-vnext/workflows/WorkflowEditorPage.tsx - passed
  • Stability guard: bash tools/ci/test_stability_guards.sh - passed
  • Browser smoke check: desktop 1440x900 and mobile 390x844 - one inline editable title, no title/action overlap, and the long mobile title remains visible without horizontal overflow
  • Full frontend suite, typecheck, and production build: delegated to GitHub CI per the repository-local frontend validation policy

Commit: 9598d869e (Use one workflow editor title)

@AbigailDeng

Copy link
Copy Markdown
Contributor Author

Local verification

  • Related tests: pnpm exec jest src/pages/team-member-workflow-studio/index.test.tsx src/pages/workflow-activity-vnext/activity/RunDetailPage.test.tsx src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/pages/workflow-activity-vnext/index.test.tsx src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx src/shared/studio/api.test.ts --runInBand — 6 suites, 272 tests passed
  • Post-resolution duplicate-key regression tests: pnpm exec jest src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/shared/studio/api.test.ts --runInBand — 2 suites, 74 tests passed
  • Changed-file static checks: pnpm exec biome lint src/locales/workflowActivityVNextMessages.en-US.ts src/locales/workflowActivityVNextMessages.zh-CN.ts src/pages/team-member-workflow-studio/components/WorkflowStudioEditorSurface.tsx src/pages/team-member-workflow-studio/hooks/useTeamMemberWorkflowStudio.ts src/pages/team-member-workflow-studio/index.test.tsx src/pages/team-member-workflow-studio/index.tsx src/pages/workflow-activity-vnext/WorkflowActivityVNextShell.tsx src/pages/workflow-activity-vnext/activity/RunDetailPage.test.tsx src/pages/workflow-activity-vnext/activity/RunDetailPage.tsx src/pages/workflow-activity-vnext/hooks/useWorkflowEditor.ts src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.ts src/pages/workflow-activity-vnext/index.test.tsx src/pages/workflow-activity-vnext/settings/SettingsPage.tsx src/pages/workflow-activity-vnext/styles.ts src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.tsx src/pages/workflow-activity-vnext/workflows/WorkflowEditorPage.tsx src/pages/workflow-activity-vnext/workflows/WorkflowNodeInspector.tsx src/shared/studio/api.test.ts src/shared/studio/api.ts src/shared/studio/models.ts — 22 files passed
  • Test stability guard: bash tools/ci/test_stability_guards.sh — passed
  • Full frontend suite/typecheck/build: deferred to GitHub CI by personal local workflow policy

@AbigailDeng
AbigailDeng force-pushed the fix/2026-08-06_one-click-workflow-publish branch from 417cbe8 to 12c4207 Compare August 7, 2026 07:52
…y-vnext' into HEAD

# Conflicts:
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/index.test.tsx
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.tsx
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/workflows/WorkflowsPage.tsx
#	apps/aevatar-console-web/src/pages/workflow-activity-vnext/workflows/workflowArchival.test.ts
@AbigailDeng

Copy link
Copy Markdown
Contributor Author

Local verification after resolving the target-branch merge and test-contract conflicts:

Local verification

  • Related tests: pnpm exec jest src/pages/workflow-activity-vnext/index.test.tsx src/pages/workflow-activity-vnext/workflows/workflowBackingAuthority.test.ts --runInBand — 2 suites, 106 tests passed.
  • Related tests: pnpm exec jest src/pages/team-member-workflow-studio/index.test.tsx src/pages/workflow-activity-vnext/activity/RunDetailPage.test.tsx src/pages/workflow-activity-vnext/hooks/useWorkflowPublication.test.ts src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx src/shared/studio/api.test.ts --runInBand — 5 suites, 184 tests passed.
  • Changed-file static checks: pnpm exec biome check <26 affected frontend files> — 26 files checked, no fixes required.
  • Test stability: bash tools/ci/test_stability_guards.sh — passed.
  • Full frontend suite/build: delegated to GitHub CI by personal local workflow policy. GitHub type-check is already passing; the full console-web test step is currently running.

@AbigailDeng

Copy link
Copy Markdown
Contributor Author

CI remediation follow-up (2026-08-07)

Fixed the two deterministic console-web locale-audit failures from run 31170068896:

  • localized the system-managed Workflow authority description
  • added the missing workflowActivityVNext.editor.canvasUpdateFailed English and Chinese catalogue entries

Focused verification:

  • pnpm exec jest src/locales/hardcodedCopyAudit.test.ts src/pages/workflow-activity-vnext/workflows/workflowBackingAuthority.test.ts src/pages/workflow-activity-vnext/workflows/NewWorkflowPage.test.tsx --runInBand (3 suites / 29 tests passed)
  • pnpm exec biome check src/locales/workflowActivityVNextMessages.en-US.ts src/locales/workflowActivityVNextMessages.zh-CN.ts src/shared/studio/workflowBackingAuthority.ts (passed)
  • CODEX_ALLOW_FULL_FRONTEND_VALIDATION=1 pnpm tsc (passed; full CI failure reproduction explicitly requested)
  • bash tools/ci/test_stability_guards.sh (passed)
  • git diff --cached --check (passed)

The local production build was intentionally not run; full frontend suite/build verification remains delegated to GitHub CI.

@AbigailDeng

Copy link
Copy Markdown
Contributor Author

Local verification

  • Regression test (RED before fix, PASS after fix): pnpm exec jest src/pages/team-member-workflow-studio/index.test.tsx --runInBand -t "deletes the connection requested by the canvas"
  • Related Workflow Studio tests: pnpm exec jest --findRelatedTests src/pages/team-member-workflow-studio/hooks/useTeamMemberWorkflowStudio.ts src/pages/team-member-workflow-studio/index.tsx --runInBand (87 passed)
  • Shared canvas tests: pnpm exec jest src/shared/graphs/GraphCanvas.test.tsx --runInBand (7 passed)
  • Changed-file static checks: pnpm exec biome check src/pages/team-member-workflow-studio/hooks/useTeamMemberWorkflowStudio.ts src/pages/team-member-workflow-studio/index.test.tsx src/pages/team-member-workflow-studio/index.tsx (passed)
  • Test stability guard: bash tools/ci/test_stability_guards.sh (passed)
  • Diff validation: git diff --check (passed)
  • Full frontend suite/build: deferred to GitHub CI by personal local workflow policy

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.

1 participant