Skip to content

Spec: Memory Git graph, full-body diff, and branch time travel #259

Closed
5 of 5 issues completed
Closed

Description

@DoodleBears

Part of #114. Related: #115 (current Memory acceptance), #75 (Channel UI breadth).

Problem Statement

A Human cannot understand a PersonaBot's Git-backed Memory Repository as a branching history from the Channel. The current Memory sidebar lists only accepted commits and places a raw diff inside the narrow sidebar. Current Memory acceptance requires one linear accepted HEAD, so native Git checkout and branching can leave the repository in a provisional or rejected state even when the Human intentionally wants to revisit older memory.

Here “Git graph” means the repository's commit/ref graph, not the semantic “Memory Graph” excluded by #115 and #75.

Solution

Show the Memory Repository's native Git graph in the PersonaBot DM's right Channel sidebar: all local branches and their reachable commits, current HEAD/branch, parent edges, and clear accepted, pending, or needs-repair markers. Clicking a commit replaces the entire Channel body with a readable file list and diff. Returning to Chat preserves the scroll position and unsent draft.

A “Continue from here” action creates a new branch at the selected historical commit and switches the repository to it. The Orchestrator manages the native Git operation and coordinates any concurrent Assignment or worktree conflict. A clear Human request proceeds immediately; an ambiguous decision is asked through DSH's native Ask Question seam rendered in the Channel. An existing Orchestrator Session is not restarted: subsequent file reads use the newly checked-out working tree, while content already assembled into that Session's context remains historical context.

User Stories

  1. As a Human, I want a graph of all local Memory branches and commits, so that I can see how my PersonaBot's memory evolved.
  2. As a Human, I want the current branch and HEAD marked, so that I know which memory files the Orchestrator will read next.
  3. As a Human, I want accepted, pending, and needs-repair commits distinguished, so that raw Git history is not mistaken for accepted Memory authority.
  4. As a Human, I want to select a commit and inspect its changed files, so that I can understand a memory change.
  5. As a Human, I want that commit's diff to occupy the entire Channel body, so that it is readable at normal chat width.
  6. As a Human, I want to return to Chat without losing my draft or reading position, so that inspecting history does not interrupt conversation.
  7. As a Human, I want to create a new branch from an older commit and switch to it, so that I can continue from a previous memory state while preserving the original branch.
  8. As a Human, I want explicit branch instructions executed without an extra confirmation question, so that deliberate requests are direct.
  9. As a Human, I want an ambiguous branch choice presented through DSH's native Ask Question in the Channel, so that I can decide before the Orchestrator acts.
  10. As a Human, I want switching progress, conflicts, and results reported in the Channel, so that I know what the Orchestrator did.
  11. As a Human, I want unfinished edits preserved when Git cannot switch cleanly, so that branch navigation does not destroy work.
  12. As an Orchestrator, I want to coordinate an Assignment that touches files relevant to a branch switch, so that I can resolve the conflict without treating the UI as a second Git actor.
  13. As an Orchestrator, I want later file reads in my existing Session to see the new working tree, so that work can continue without recreating the Session.
  14. As an Orchestrator, I want a missing file on the target branch to behave as an ordinary missing file, so that time travel does not fabricate old contents.
  15. As a Human, I want branch and commit status to survive a Host restart, so that the graph remains a trustworthy view of the repository.

Implementation Decisions

  • Use the Memory Repository's native Git objects and refs as the graph source. Do not add a second commit graph store. The Memory Service contributes acceptance and repair metadata as an overlay; a raw commit is not automatically an accepted Memory Commit.
  • Extend Memory acceptance/reconciliation beyond its current single linear accepted HEAD assumption while preserving validation, actor/cause attribution, and durable accepted-commit authority. Branching must not silently turn an unvalidated commit into accepted Memory.
  • Expose bounded, validated graph/commit/diff read models from the Host Memory Service through the existing Client bridge. The Client neither reads the repository directly nor invokes raw Git.
  • Keep commit inspection as Client presentation state scoped to the selected PersonaBot DM. The selected commit replaces the Channel body's primary content and composer until the Human returns to Chat; Chat draft and scroll state are preserved.
  • Route a Human branch action to the Orchestrator. The Orchestrator owns native Git switch/create and coordinates conflicting Memory edits or Assignments. Start the attempt immediately; a Git conflict can delay completion. Do not force-discard changes.
  • Existing Sessions remain alive. File reads after a successful switch use the current working tree, including normal missing-file results. Already assembled Session context and Persona snapshots are not retroactively rewritten.
  • Use DSH's native user-question Service and agent-scoped request seam for genuinely ambiguous Human decisions. Bridge those requests and answers into the Channel; do not invent a replacement model-facing question tool.
  • Preserve product responsibility: the Orchestrator manages Memory changes. A Workspace Grant that technically covers the Memory path does not itself prove exclusive write isolation.

Testing Decisions

  • Test observable behavior at the highest practical seam: a real PersonaBot DM, Host Memory Service, real Git Repository, and live DSH Orchestrator Session. Avoid tests that only mirror graph lane or component implementation.
  • Host integration coverage: multi-branch Git history and status overlay; branching from a historical commit; accepted versus unaccepted commits; conflict preservation; restart/requery; bounded diff and invalid commit inputs. Extend the existing Memory acceptance integration tests.
  • Client integration coverage: select commit, full-body diff, return to Chat with draft/scroll intact, and clear branch/provisional/error states.
  • Live end-to-end coverage: provide a reachable QA URL; use a real LLM-backed Orchestrator request to create/switch a branch; verify the same Session reads the new branch's file contents or normal absence; exercise a dirty-worktree conflict and an ambiguous request through native Ask Question. Save local UI screenshots for Human review.
  • Stop after each tracer bullet for Human QA: first graph/diff, then real branch switching and same-Session memory reads.

Out of Scope

First implementation does not add merge, branch deletion, force reset, remote Git sync, a semantic Memory Graph, or a model-visible Memory CRUD tool. Those are separate follow-up slices.

Further Notes

The current #115 implementation exposes accepted history and diff but rejects divergent or nonlinear HEADs. The current Memory sidebar renders raw diff inside the sidebar. This spec changes both behaviors deliberately. Split implementation into dependency-linked tracer tickets with /to-tickets after publication; the first ticket must be Human-testable, not a disconnected backend or UI mock.

Activity

  1. added this to the v1.1 milestone on Sep 24, 2026
  2. added
    ready-for-agentFully specified, ready for an AFK agent
    area:fullstackEnd-to-end Host and Client implementation
    feature:memoryPersonaBot Memory Repository and Memory Service
    scope:specNormative specification for follow-on slices
    on Sep 24, 2026
  3. modified the milestones: v1.1, v1.0 on Sep 24, 2026
  4. DoodleBears commented on Sep 25, 2026

    @DoodleBears
    ContributorAuthor

    #259 delivery complete

    All five dependency-linked, Human-testable slices are merged and closed:

    Each slice had a real DSH end-to-end path and Human QA. The final #264 QA confirmed the selected branch, file read, answer card terminal state after refresh, and option sizing. This closes the Git graph / branch time-travel specification. #114 remains open for the separate Memory foundation, Workspace Grant, and Assignment acceptance work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:fullstackEnd-to-end Host and Client implementationfeature:memoryPersonaBot Memory Repository and Memory Serviceready-for-agentFully specified, ready for an AFK agentscope:specNormative specification for follow-on slices

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions