forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
[REQ-084] Alpha 页面通过窄 typed surface 接入路由 #199
Copy link
Copy link
Closed
3 / 33 of 3 issues completedLabels
area:contractsContracts, schemas, or compatibilityContracts, schemas, or compatibilityarea:integrationRepository, API, or external integrationRepository, API, or external integrationarea:productUser-facing product behaviorUser-facing product behaviorbreaking-changeChanges a consumer-facing contract or migration pathChanges a consumer-facing contract or migration pathtype:requirementA product or cross-repository outcomeA product or cross-repository outcome
Description
Activity
Metadata
Metadata
Assignees
Labels
area:contractsContracts, schemas, or compatibilityContracts, schemas, or compatibilityarea:integrationRepository, API, or external integrationRepository, API, or external integrationarea:productUser-facing product behaviorUser-facing product behaviorbreaking-changeChanges a consumer-facing contract or migration pathChanges a consumer-facing contract or migration pathtype:requirementA product or cross-repository outcomeA product or cross-repository outcome
简明目的
给 Alpha 页面一个稳定、很小的接入口,避免继续复制上游内部路由和 Provider,也不再保留旧页面回退开关。
Outcome(专业定义)
@opencode-ai/app暴露最小、版本化的 typed surface seam,使 Alpha 的 Home、Draft 与 Session 叶页面在保持必要 Provider 生命周期的前提下由正式 route composition 挂载;所有深层 upstream context 依赖收敛在 adapter 边界。REQ-084 只定义接缝与结构性存活契约,最终 route manifest 和 alias/redirect 真相由 REQ-089(#204)拥有。Complexity
M — 跨 package 的公开类型、Provider 生命周期与冻结同步守卫需要多处改动,但不引入新的安全域或数据迁移。
Context
窄 typed seam 与路由 helper 已有基础实现,剩余问题主要是行为证据与旧 fallback 清理。现有 #257 仍以“持久化 fatal 后回 legacy”为目标,已与“无既有用户、单一正式路由”原则冲突;#204 才是最终路由真相。
Scope
Non-goals
alpha|legacy|auto-fallback、same-URL legacy reload、双页面预载或旧 Provider tree 热切换。packages/app/src/context/**。Acceptance criteria
AC1. Home、New Session 与 Session 可分别通过窄 typed surface 注入,未被选择的叶页面不会同时挂载或预载。
AC2. typed surface 只暴露 Alpha 所需 props/events,不泄漏 upstream 私有 context 类型。
AC3. server、directory、draft 与 session 的 remount 规则在 Web Router 与桌面 MemoryRouter 中保持确定且一致。
AC4. 生产 route 入口直接调用 seam;Alpha 页面不存在对 upstream 隐藏 DOM、Portal anchor 或私有 context 的旁路依赖。
AC5. 上游前端版本升级(滚动 pin)后,若 Alpha 依赖的页面接缝形状发生变化,本地检查失败,而不是静默通过。 (2026-09-17 按 owner 裁决改写,原文见编辑历史)
AC6. legacy surface flag、fatal 后 legacy reload 与双 composition 路径被移除;失败显示可恢复错误但不切回旧页面。
AC7.
#204 接管 route manifest 后,本 seam 仍只是叶页面挂载接口,不形成第二套路由真相。—— 2026-09-17 删除(owner 裁决):与 REQ-089(alpha-code#204)AC2「不存在第二套路由真相」重复,证据已由该需求的 route-authority-ratchet 承载。Evidence map
packages/ui-mac/src/renderer/route-composition.test.ts:28packages/ui-mac/src/renderer/alpha-ui/surface-seam-contract.test.ts:77、:116packages/ui-mac/src/renderer/surface-remount.test.ts:154-224route-composition.test.ts:56-73(源码文本断言,证据形态弱,owner 2026-09-17 裁决接受)packages/ui-mac/src/shared/route-upstream-shape.test.ts(ADR-034 滚动 pin;PR #638)packages/ui-mac/src/renderer/alpha-ui/surface-boundary.test.ts:18+packages/ui-mac/src/shared/route-authority-ratchet.test.ts:128/:136Acceptance owner
@jinjunnn — 按 AC 逐条验收并手工关闭;PR 不得关闭父需求。
设计要点
潜在问题与风险
过时性与兼容性结论
需求核心有效且已部分交付;旧 legacy fallback、热切换和旧 URL 兼容责任已过时,应删除。保留窄 seam、状态作用域正确性、同步漂移 fail-closed 与未来版本拒绝。
关联与职责边界
Delivery plan / 建议子票
Dependencies