Versionierung der Arbeitsbereiche: Verlauf je Datei mit Agent, Lauf und Vorfassung (#719)
Eigene inhaltsadressierte Ablage (Agents/.history/objects, SHA-256) statt Git, Journal FileHistory in state.db. Jeder Schreibweg - FileRW write/append/copy/ delete/stock_add, FTP- und RocketChat-Downloads - legt die alte Fassung ab und verbucht die Aenderung mit RunId. Externe Aenderungen findet ein Abgleich beim Start und stuendlich. Aufbewahrung nach Tagen und Fassungen, verwaiste Objekte werden entfernt. WebUI: Dateiverlauf mit Filter, Diff und Wiederherstellen nur durch den Menschen mit Grund. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
621a83de43
commit
e9c39c3c96
@@ -374,6 +374,34 @@ public sealed class SqliteStorage
|
||||
Json TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- #719: The history of the workspaces. Append-only; only the retention removes lines,
|
||||
-- never a file's newest. Path is relative to the Agents folder.
|
||||
CREATE TABLE IF NOT EXISTS FileHistory (
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
Workspace TEXT NOT NULL,
|
||||
Path TEXT NOT NULL,
|
||||
Action TEXT NOT NULL,
|
||||
AgentId TEXT NULL,
|
||||
RunId TEXT NULL,
|
||||
HashBefore TEXT NULL,
|
||||
HashAfter TEXT NULL,
|
||||
SizeAfter INTEGER NULL,
|
||||
Stored INTEGER NOT NULL DEFAULT 0,
|
||||
OccurredAt TEXT NOT NULL,
|
||||
Note TEXT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS IX_FileHistory_Path ON FileHistory (Path, Id);
|
||||
CREATE INDEX IF NOT EXISTS IX_FileHistory_Run ON FileHistory (RunId);
|
||||
|
||||
-- #719: What the history knows each file to be now — the reconciliation compares against it.
|
||||
CREATE TABLE IF NOT EXISTS FileHistoryState (
|
||||
Path TEXT PRIMARY KEY,
|
||||
Workspace TEXT NOT NULL,
|
||||
Hash TEXT NOT NULL,
|
||||
Size INTEGER NOT NULL,
|
||||
Modified INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- #720: Writes refused because they would have lost someone's change.
|
||||
CREATE TABLE IF NOT EXISTS FileConflicts (
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
Reference in New Issue
Block a user