Repository navigation
Closed
Labels
V1.0Milestone v1.0; mirrors the GitHub milestoneMilestone v1.0; mirrors the GitHub milestonewayfinder:taskWayfinder task ticketWayfinder task ticket
Milestone
Description
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
- Foundation:operational database owner / writer lease / schema generation #79 operational database foundation(已完成)。
- Spike:验证 BotWork 所需 DSH Agent / SessionPersistence / Subagent seams #77 DSH runtime seam validation(已完成)。
- Architecture foundation:架构地基:显式 Session 归属与 deep modules(GrokBot-on-DSH 对齐) #71;current Memory/Workspace direction:Wayfinder: Memory Repository / Workspace Grant / Assignment cwd #114。
Blocks
- [Retired] Orchestrator: V1.0 PersonaBot Activity、Presence 与 Output Events #119/Bot activity: shared snapshot and live DM presence #120/Bot activity: Orchestrator and Assignment aggregation #123 PersonaBot Activity/Presence 与 Orchestrator/Assignment presentation。
- 费用归属语义:explicit Session ownership → PersonaBot / Assignment / Subagent #38 usage attribution semantics。
- Foundation:Assignment Runtime / Assignment Directory / Orchestrator tools #81 Assignment Runtime。
Metadata
Metadata
Assignees
Labels
V1.0Milestone v1.0; mirrors the GitHub milestoneMilestone v1.0; mirrors the GitHub milestonewayfinder:taskWayfinder task ticketWayfinder task ticket
Type
Projects
- StatusShow more project fieldsDone
- StatusShow more project fieldsDone
Activity
Merge pull request #169 from BotHarness/feat/80-session-ownership
DoodleBears commentedon Sep 21, 2026
已交付并合并:PR #169。
落地内容(ADR-0035)
SessionOwnership深模块(claim / claimWithin / resolve / rootsFor / descendantsOf / repair / list);schema 第 6 代迁移加入provenance、parent_session_id(lineage)、cwd_reference(显式运行配置,仅作 evidence)。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)。rootsFor+descendantsOf就位。证据:
session-ownership7 项(含 generation 5→6 迁移)、dsh-activity4 项、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 接口与两者独立。