boardx / boardx/workspacex

core-loop.spec.ts 步骤 8c 改用真实创建的 agenda segment,不再依赖种子脚本预置

Open
#646 0 comments 0 reactions 0 assignees View on GitHub
backlog enhancement
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
1h 7m
Merged PRs (30d)
969

Description

## 背景

#627(PR [#645](https://github.com/boardx/workspacex/pull/645))补上了 `createAgendaSegment` 的 controller——工作坊现在有真实的 HTTP 路径能造出一条环节。但 `core-loop.spec.ts` 步骤 8c(`canvas-template-apply`,#493)绑定模板时用的 segment 仍然来自 `seed-fullstack-smoke.ts` 的直连数据库 `INSERT`(`apps/api/scripts/seed-fullstack-smoke.ts:329-334`),不是走 #645 新加的真实端点。

## 为什么不能简单地把种子脚本改成调用新端点

`seed-fullstack-smoke.ts` 在 `apps/web/playwright.fullstack-smoke.config.ts` 的 `webServer` 启动链里**先于 API 进程本身启动**(见该 config 文件的 `webServer` 数组顺序)——种子脚本运行时,API 服务器还没起来,结构上不可能对它发 HTTP 请求。

## 要求

1. 改为让 `core-loop.spec.ts` 步骤 8c 自身(测试运行时,API 已经起来了)用已认证请求真实调用 `POST /workshops/:workshopId/agenda-segments` 现造一条环节,不再依赖种子脚本预置的 `FULLSTACK_E2E.agendaSegmentId`。参考同文件里其它需要真实数据的步骤如何在 spec 内部发起认证请求(如 PR #643 描述的 `POST /auth/bootstrap` → `POST /auth/login` 那套直接 HTTP 调用模式)。
2. 确认前端 `segment-binding.tsx`(或其容器组件)当前是如何拿到要绑定的 `segmentId` 的——如果它依赖某种"列出本工作坊全部环节"的机制,可能还需要先补 `listAgendaSegments` 的 controller(同样零挂载,契约已存在,`packages/contracts/src/project.ts:529`)。
3. 确认后再动手:`/workshops/*` 整个前缀目前在 `.harness/state/rewrite-coverage-allowlist.json` 的棘轮名单里,前端即使调用这条端点也可能因为 Next rewrite 缺失而 404——这个问题不是本 issue 引入的(`advance` 端点早就有),但如果要让浏览器(而不是纯 API 测试)真正走通这条链路,可能需要一并处理。

## 范围提醒

这会改动 `core-loop.spec.ts`——人类交付验收的核心闭环脚本本身,请按对待该文件一贯的谨慎程度处理(不许用 `test.skip`,未实现的步骤要显式红着)。

Refs #627, #645

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with core-loop.spec.ts step 8c, then read apps/api/scripts/seed-fullstack-smoke.ts, apps/web/playwright.fullstack-smoke.config.ts, and segment-binding.tsx. Trace the authenticated POST flow and how segmentId reaches the binding UI, checking packages/contracts/src/project.ts:529 and the rewrite allowlist when needed. Done means the browser flow creates and binds a runtime segment without FULLSTACK_E2E.agendaSegmentId, with no skipped steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, playwright, typescript
Domain
backend-api-design, testing-qa, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.