Skip to content

Feat: Add command to promote working memory to main scope (greplica graph promote) #22

Description

@Pallavikumarimdb

Problem

Currently, Greplica separates memory into a main scope (committed repo facts) and a working scope (local session edits). When coding agents run the greplica-update-working-memory skill, new claims, flows, and components are written to the working scope.

However, there is no command to promote or "commit" these working claims into the main scope of the branch. The working memory continues to grow indefinitely relative to the main scope, making it hard to maintain a clean boundary between stable codebase facts and active branch-specific modifications.

Proposed Solution

Introduce a new CLI command—greplica graph promote (or greplica graph commit)—that promotes the current working scope changes into the target branch's main scope.

Expected Behavior

  1. Command:
    greplica graph promote [--scope <scope_id>]
  2. Action:
    • It takes all components, flows, claims, and edges created under the working scope.
    • Re-assigns their memberships to the parent main scope (or the target branch's scope).
    • Cleans up the working scope (making it empty and ready for the next session).
  3. Prerequisites for Branch-Awareness (Branch-aware memory: claims may not hold across git branches #20):
    • Having this promotion command is a critical building block for multi-branch merging. Once working memory is promoted to its branch scope, git branch merging can be handled cleanly at the branch-scope level rather than mixing with active uncommitted session memory.

Example Workflow

  1. Work session: Agent makes edits, adds 3 new claims to working.
  2. Verification: Tests pass, feature is complete.
  3. Commit Memory: Developer or agent runs greplica graph promote.
  4. Result: The 3 claims are now permanent parts of the main graph scope. working is cleared.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions