Repository navigation
Description
2026-09-30 closeout
The Git working-tree tracer, Channel Memory browsing/history, and external-change Inbox delivery were delivered in earlier slices (#297, #259, #473). PR #519 completed the final two gates:
- Human Memory commands use the Host-owned
local-humanidentity already used by Channel membership. DSH authenticates access to the Host but does not distinguish people sharing one browser credential. - ADR-0097 records trustworthy observation/command context and explicit, confirmed recovery across reset, merge, branch movement, and dirty working trees.
Focused integration tests, typecheck, lint, build, full CI, CodeRabbit review, a real isolated DSH/LLM reply, browser E2E, and Human visual QA passed. PR #519 is merged; #115 is closed.
Part of #114. Target milestone: v1.0.
Decision (2026-09-25)
The checked-out Git working tree is the PersonaBot's current Memory. Ordinary files, including code and binary files, are available as soon as the worktree changes. Native Git may fetch, merge, reset, and switch branches. Neither the Bot nor the Human must call an extra "accept" action. BotHarness's recorded HEAD/actor/cause is an audit and recovery checkpoint, not an admission gate. See ADR-0068.
The Orchestrator uses native file, search, Shell, and Git capabilities in its Memory Repository. It decides whether an external repository should be merged, replace current history, or be cloned elsewhere from the Human's task; when ambiguous, it asks the Human through native DSH Ask Question. Initial PersonaBot creation may import a Git URL through #298; an existing Bot still uses native Git for repository integration. There is no model-facing Memory CRUD replacement tool.
Git working-tree tracer (file and UI path delivered; audit pending)
- Create a PersonaBot with a real Git Memory Repository and fixed Orchestrator cwd.
- Use native Git to fetch an unrelated repository with code, binary files, branches, and a merge commit.
- Show the checked-out files immediately in Channel Memory, with bounded text preview and a binary-file indicator; Git graph shows all local branches and reachable commits.
- In the same Orchestrator Session, switch to a local branch and read its actual files. Git decides whether working changes permit the switch; conflicts are reported without discarding work.
- After restart, show the same branch, files, and graph. Record a HEAD observation without staging or committing; comprehensive operation audit and recovery remain below.
- Run a real DSH/LLM interaction and stop for step-by-step Human QA before expanding sibling cases.
Boundaries
- Memory Service owns repository identity/lifecycle, trusted Session ownership, UI queries, and audit/recovery checkpoints. Git and its current worktree own files, branch topology, and history.
- File queries refuse .git control paths and escapes through symlinks. Text preview has a bound; binary content is retained by Git and available to native tools, but is not edited as text in Channel.
- Human text saves use an expected HEAD and an explicit Git commit. Legacy structured Markdown writing keeps its own narrower contract.
- There is no automatic git add -A/commit of dirty files during observation, no per-branch admission gate, and no required repair for a normal uncommitted edit.
- Session-frozen Persona text is unchanged within the same Session after a branch switch (ADR-0060).
Acceptance criteria
- PersonaBot creation/retry/restart provisions and reopens a real Git repository; Orchestrator cwd is that repository (earlier Foundation: Git working tree as PersonaBot Memory #115 slice).
- Native file/Shell/Git access is wired through owned Orchestrator Session and Workspace Grant guard (earlier Foundation: Git working tree as PersonaBot Memory #115/Workspace Grants: folder access UI and enforced PersonaBot file boundary #116 slices).
- Native external Git history with code, binary files, and merge commits is visible as current Memory before a separate acceptance step (Make Git working tree the current PersonaBot memory #297, Spec: Memory Git graph, full-body diff, and branch time travel #259).
- Branch switch and file read work in one Session; Git conflicts preserve staged and working files (Spec: Memory Git graph, full-body diff, and branch time travel #259, including Slice: switch an existing Memory branch in a live Orchestrator Session #261 and Slice: Orchestrator coordinates a conflicted Memory branch switch #263).
- Channel Memory list, text/binary preview, Git graph, and diff reflect the current repository; refresh/restart remain consistent (Make Git working tree the current PersonaBot memory #297, Spec: Memory Git graph, full-body diff, and branch time travel #259, Deliver external Memory changes through durable Bot Inbox #473).
- Trusted observation/command provenance and explicit recovery remain accurate under reset, merge, branch movement, and dirty working trees; Human commands use the Host-owned local Human identity.
- Focused integration tests, typecheck, lint, format, build, real DSH/LLM run, and Human QA pass.
Out of scope
Model-visible Memory CRUD tools; initial creation import UI (tracked in #298); vector/RAG; a second content authority; automatically overwriting or merging existing Memory.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
DoodleBears commentedon Sep 21, 2026
Slice 1(Host foundation)已提交:PR #173
已落地:
memory/repository.ts(ensureMemoryRepository/inspectMemoryRepository)—— mkdir +git init -b main+ identity +.gitattributes;只在新仓库或无 HEAD 时做 seed commit;重新打开绝不自动提交(修掉了原来 dirty 树被当成 "Initialize memory repository" 提交的 bug)。initializeMemory钩子;失败返回memory-unavailable(bridge 同码)且不写 bot record,重试幂等。orchestratorCwd(bot),ownership 的cwdReference记录仓库路径;Assignment 暂时保留 runtime workspace 直到 Workspace Grants: folder access UI and enforced PersonaBot file boundary #116。MemoryService.storeForSession走SessionOwnership.resolve;unowned session 或仓库未就绪 → 返回 undefined(fail closed),不再cwd → findByWorkspace反推。memory/tools.ts与 4 个工具注册;developer reference 现在发布空 tools 列表。本票剩余(后续 slice):
证据:全量 555 passed(新增 repository lifecycle 4 项、registry fail-closed、ownership 解析、跨 session 服务路径;DM turn E2E 断言 Orchestrator cwdReference 为仓库路径);lint/typecheck/format/changelog/build 全绿。
Merge pull request #173 from BotHarness/feat/115-memory-foundation
DoodleBears commentedon Sep 21, 2026
Tracer 计划(按 tracer-bullet 概念重排)+ TB2 已就绪
不需要等 memory 功能全做完才有可验收切片。按最小端到端路径拆:
bots/<slug>/memory/与git status看到 provisional 文件。不需要 surface、不需要 accepted commit。TB2 的无-LLM 前置证据(真实 Host,
DSH_HOME=~/.dsh-bh115,端口 3083,main7415d9a):bots/<slug>/memory/{.git,.gitattributes},seed commit163f4ef Initialize memory repository;retryable)后,ownership 行为root_role=orchestrator、cwd_reference=<…>/bots/<slug>/memory—— 证明 Orchestrator cwd 已指向 Memory Repository;channelSend6ms 返回(Tracer: 发送解耦——Channel 消息提交后立即返回,Bot Inbox 异步消化 #140 语义不变)。运行真实 LLM 的 TB2 只差一步:在 3083 的 Web UI Settings 里配置模型 + API key(credentials 走 DSH credentials service,不进 repo)。之后 DM「记住:Acme 决定 Q4 续约。」,检查
~/.dsh-bh115/botharness/bots/<slug>/memory/是否出现 LLM 写入的 Markdown(git status显示 provisional)。DoodleBears commentedon Sep 21, 2026
TB2 通过(真实 LLM,端到端) —— 修复见 PR #176
真实 LLM(隔离实例 3085,key 来自机器级 secret)发出的 DM「请把这件事记到你的记忆里:Acme 决定 Q4 续约」的结果:
bash/read/write/edit/glob/grep/web_search… + BotHarness 的 4 个),并且自行写入记忆仓库(没有委托 Assignment,符合「不必然委托」)。facts/acme.md(含「日期 | 事实 | 来源」表格)+ 更新MEMORY.md索引。410f4dc memory: Acme 决定 Q4 续约),并在 Channel 回复里给出两个路径与 commit hash,还主动说明「只记录了决定续约,合同金额/期限未记录」。git status干净,git log两条(seed commit + 记忆提交)。根因与修法(PR #176):没有 agent preset 的 session "resolves against the empty global layer" —— 只有 setup 里注册的 4 个工具。两个坑:
setup里调用agentPresets.mount();只传meta.agentPreset只会把名字记进 session header,不装配工具。ctx.get拿到的可能是尚未挂载的服务,第一次修复因此仍然只有 4 个工具。下一步(TB3):现在 bot 自己发的是 raw git commit(没有 actor/cause trailer、未进 accepted history)—— 这正是 #115 的 accepted Memory Commit 边界要接管的:post-turn reconcile 验证 provisional 变更并接受为 Memory Commit(记录 actor/cause/head),之后 surface 只展示 accepted lineage。
DoodleBears commentedon Sep 21, 2026
Prompt 行为矩阵(真实 LLM:
deepseek-official/deepseek-flash,reasoningEffort=high,同一 bot 连续 8 条 DM)facts/beta.md+MEMORY.md并自行 commit ✓research/release-flow.md)9e02370;source event 最终停在needs-repair(产出与回复都成功,turn 层面有异常)notes/index.md,「可以开 Assignment」)3cb6c6d✓(判断无需独立 cwd)结论
needs-repair,尽管 Assignment completed、Orchestrator 也写文件并回复。这会污染 Human Inbox 的 attention 状态,建议单独诊断(长 turn / Assignment 等待 / 工具错误后的状态机)。410f4dc/9e02370/3cb6c6d)都是 bot 自己发的 raw git commit(无 actor/cause、未进 accepted history)——正是 TB3(accepted Memory Commit 边界)要接管的部分。22 remaining items
DoodleBears commentedon Sep 25, 2026
2026-09-25 decision update — Git working tree is current Memory
Human clarified that a PersonaBot Memory Repository should behave like a normal Git repository. The checked-out working-tree files are the Bot's current Memory immediately, including code and binary files; native Git may fetch, clone, merge, reset, and switch branches as directed. There is no additional per-branch or per-commit "acceptance" step before the Bot may read current files. Git itself determines which paths and objects it can store. BotHarness continues to enforce Session ownership and safe filesystem access, and records operation audit/recovery checkpoints without making that ledger a second source of truth for current Memory.
The Bot chooses how to reconcile an external repository with existing Memory from the Human's task; when the strategy is ambiguous, it uses native DSH Ask Question. BotHarness does not add an import UI or replace native Git tools. This supersedes this issue's current Markdown-only, linear-history, accepted-commit authority requirements; the issue body and ADR/architecture will be updated with the implementation. First tracer: native Git changes the repo, the same Orchestrator Session reads the new working tree, and the Channel Memory surface shows the current files/branch/graph after refresh.
[-]Foundation: Memory Repository / Memory Service / accepted Memory Commit[/-][+]Foundation: Git working tree as PersonaBot Memory[/+]Clarify initial Git import scope
Merge main into Git working-tree Memory slice
Merge latest main into Memory working-tree slice
DoodleBears commentedon Sep 25, 2026
Agent work outcome — Git working tree tracer
codex/local/01a0cde3-1621-7382-96a1-852758cedfc0(not a DSH Session)notes.ts, Host restart, and Human QA of file/binary preview, branch switch, and refresh all passed.DoodleBears commentedon Sep 29, 2026
Agent work claim
codex/local/01a0e86b-16ab-7a01-baf9-e555eec3ea62(not a DSH Session)codex/115-memory-audit-recoveryKeep Memory turns and restore results truthful on capture failure
Record every explicit Memory restore as a checkpoint
Add audited Memory recovery checkpoints and explicit restore (#519)
DoodleBears commentedon Sep 29, 2026
Agent work outcome — Memory audit and recovery closeout
codex/local/01a0e86b-16ab-7a01-baf9-e555eec3ea62(not a DSH Session)0a8d2f5