Skip to content

Foundation:explicit Session ownership 与 DSH activity projection #80

Closed

Description

@DoodleBears

What to build

实现 ADR-0035:以 explicit durable Session ownership 替换 cwd → registry.findByWorkspace() 推断,并把 DSH Session facts 投影为 PersonaBot/Assignment Directory 可消费的 activity facts。

cwd仍存在,但只作为显式运行配置:Orchestrator cwd由#115固定为owning PersonaBot的Memory Repository;Assignment cwd由#116的一个有效Workspace Grant选择。两者都不能反向决定ownership。

Scope

  • sessionId → PersonaBot + rootRole(orchestrator|assignment) + provenance;普通DSH Session可unowned。
  • fork与DSH Subagent lineage attribution;Subagent不成为independent Assignment Session。
  • Session/state/read models统一通过ownership interface解析PersonaBot;不得通过cwd、最近Workspace、Memory路径或UI selection猜测。
  • Orchestrator runtime config引用owning PersonaBot的Memory Repository;Assignment runtime config引用一个Workspace Grant及其单一Workspace/cwd。
  • DSH session/event / Projection / cold query → activity/lastRun;不复制第二套Session lifecycle。
  • restart rebuild、unknown/ambiguous ownership fail closed、explicit repair。
  • archive traversal提供owned roots/descendants,供graceful stop使用。

Acceptance criteria

  • shared Workspace中多个PersonaBot不串ownership;多个Assignments复用同一Workspace Grant时仍按sessionId正确归属。
  • no-project-cwd Orchestrator正确归属PersonaBot,且其cwd精确等于#115提供的Memory Repository。
  • explicit ownership precedence;正常runtime永不cwd fallback。
  • Assignment ownership与Workspace Grant是两条独立关系:改变/revoke Grant不改写历史Session ownership。
  • fork/Subagent inheritance、unowned Session、restart/cold query tests。
  • production Host接线驱动现有BotStateTracker,而不是只在测试写状态。
  • interface-level tests覆盖ownership、rootRole、explicit cwd reference与state/session consistency。
  • NFR evidence:projection rebuild上限、fault injection、diagnostic visibility。

Dependencies

Blocks

Activity

  1. added this to the v1.0 milestone on Sep 19, 2026
  2. self-assigned this
    on Sep 21, 2026
  3. added a commit that references this issue on Sep 21, 2026
  4. DoodleBears commented on Sep 21, 2026

    @DoodleBears
    ContributorAuthor

    已交付并合并:PR #169。

    落地内容(ADR-0035)

    • SessionOwnership 深模块(claim / claimWithin / resolve / rootsFor / descendantsOf / repair / list);schema 第 6 代迁移加入 provenance、parent_session_id(lineage)、cwd_reference(显式运行配置,仅作 evidence)。
    • runtime 的 Orchestrator 与每个 Assignment 都经该接口 claim(Assignment 与 Directory 同一事务);bridge sessions() 改为按 sessionId 归属过滤,不再用 cwd / workspace 成员关系。
    • state/dsh-activity.ts:session/event 驱动生产 BotStateTracker;agent/created 按 parentSession/origin:'subagent' 自动归属 fork/Subagent(非 root、不成为 Assignment);agent/disposed 清理;启动冷重建(有界,报告 rebuilt/attributed/unowned)。
    • Archive 遍历原料 rootsFor + descendantsOf 就位。

    证据:session-ownership 7 项(含 generation 5→6 迁移)、dsh-activity 4 项、runtime 2 项(共享 workspace 不串、默认 cwd reference)、bridge 读模型、plugin 接线(live 事件 / 冷重建 / recovery fail-closed),以及 DM turn E2E(真实 adapter + plugin 接线 + fake DSH host:回复落盘、ownership 行、Assignment report、bridge sessions、activity、dispose、跨 turn 复用、重启后冷 resume)。全量 532 passed。

    按票面说明的依赖部分:cwd_reference 目前记录当前运行配置(workspaces[0] 或 runtime workspace root),等 #115(Memory Repository)与 #116(Workspace Grant)替换 resolver 后自动对齐;ownership 接口与两者独立。

  5. moved this from Todo to Done in Roadmapon Sep 21, 2026
  6. added
    V1.0Milestone v1.0; mirrors the GitHub milestone
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

V1.0Milestone v1.0; mirrors the GitHub milestonewayfinder:taskWayfinder task ticket

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions