Outcome
Use real Git as the source of truth for every Flect app while keeping the default experience as simple as one-click Undo and a quiet visual history. Git must protect the work, not become a review gate the user has to operate.
Dependencies
Builds on the live canvas in #32 and the canonical persistent workspace in #33. Import, sharing, and provenance features consume this contract.
Required behavior
- Keep one canonical source workspace shared by the agent, compiler, running canvas, history, and export.
- Create an automatic checkpoint after every valid change that becomes visible on the running canvas.
- Keep the last-known-good checkpoint active when a patch or build fails; failed attempts remain diagnostic context, not visible history entries.
- Present history as prompt/summary, time, and optional visual preview. Diffs and commit details are progressive disclosure.
- Make Undo, Redo, and Restore immediate and safe without asking the user to choose branches, stages, commits, or reset modes.
- Give the agent bounded Git tools for status, diff, checkpoint, restore, and export.
- Preserve an ordinary repository that can be opened with normal Git tooling at any time.
- Handle stale edits, concurrent tabs, storage quota, interrupted writes, and corrupt history without losing the last-known-good state.
- Internal refs, receipts, and recovery metadata may exist, but stay out of the main editing flow.
Acceptance criteria
- Fifty consecutive successful UI edits produce fifty ordered, recoverable checkpoints without blocking the composer or canvas.
- A failed edit leaves the running app and latest good checkpoint unchanged while giving the same agent actionable diagnostics.
- Undo and Redo update the running canvas in under 100 ms on the reference fixture without a full reload or state loss.
- History is understandable without Git vocabulary and opens directly to the relevant visible change.
- Restoring any of the last fifty checkpoints produces the exact source, assets, dependencies, and preview state recorded for it.
- The agent and running canvas always report the same workspace revision; stale tool results are rejected.
- Reload, offline reopen, multi-tab contention, quota pressure, and interrupted checkpoint tests preserve recoverability.
- Exported work opens as a normal Git repository with readable commits and no proprietary source format.
- No ordinary edit requires Keep, Reject, Review, Reset, branch management, or a manual commit.
Non-goals
- Exposing the full Git command model in the default UI.
- Requiring review approval before a valid local UI change appears.
- Replacing Git with a proprietary history database.
- Automatically pushing or sharing work without explicit user intent.
Outcome
Use real Git as the source of truth for every Flect app while keeping the default experience as simple as one-click Undo and a quiet visual history. Git must protect the work, not become a review gate the user has to operate.
Dependencies
Builds on the live canvas in #32 and the canonical persistent workspace in #33. Import, sharing, and provenance features consume this contract.
Required behavior
Acceptance criteria
Non-goals