AI SAFETY & DATA INTEGRITY

Solving the Agent Overwrite Problem: The Differential Timeline Pattern

The Differential Timeline prevents autonomous agents from corrupting personal markdown notes by intercepting edits, computing block-level AST diffs into .sphene/staged/<slug>.diff.json, and requiring human review before committing changes to disk. Agents can inspect projected post-patch content using include_staged: true, while the user retains ultimate veto authority.


The Destructive Nature of Direct Agent Overwrites

In typical LLM tool integrations, when an agent wants to append a bullet or update a status, it invokes a destructive write tool (such as write_file or overwrite_note). If the model hallucinates, drops paragraphs, or hallucinates syntax errors, the user's hard-earned personal notes are irretrievably clobbered on disk.

Sphene solves this architectural flaw by enforcing a zero-trust staging lifecycle:

1

Block-Level Staging

Agent updates are routed through StageAgentEdit, which computes deterministic line and block diffs against the committed file without modifying the disk file.

2

Folded Diff Awareness

Consecutive patches to the same document fold seamlessly into the active diff proposal, retaining the disk baseline as the reference point.

3

Human Veto Review

The human inspects color-coded red/green diff highlights in the Sphene Web UI and accepts or rejects the change with 1 click.

Staged Diff Awareness in MCP Tools

When an agent reads a note that currently has uncommitted staged edits, sphene_read returns the committed disk content accompanied by an explicit header notice:

[NOTICE: 1 pending staged modification awaiting user review at http://localhost:8743]

# Workspace / Architecture Roadmap
## Active Initiatives
- [x] SQLite WAL Concurrency Hardening

If the agent needs to verify how its own modifications look prior to user review, it passes include_staged: true:

// Tool Request
{
  "name": "sphene_read",
  "arguments": {
    "path": "Workspace/Architecture Roadmap.md",
    "include_staged": true
  }
}

The kernel returns the clean projected post-patch markdown, enabling the agent to reason about subsequent steps without risking unapproved disk mutations.

Safe Agent Memory for Your Notes

Deploy Sphene v2.2 with built-in Differential Timeline active by default.

Get Sphene Free