Skip to content

Vibe projects, step 1: files behind checkpoints, Undo AI change, Versions - #458

Merged
AVADSA25 merged 5 commits into
mainfrom
vibe-projects
Oct 18, 2026
Merged

AVADSA25 merged 5 commits into
mainfrom
vibe-projects

Conversation

@AVADSA25

Copy link
Copy Markdown
Owner

What

Vibe step 1 from docs/VIBE-PROJECTS-DESIGN.md. Until now an AI reply overwrote the editor and the saved copy, with no way back (Monaco's setValue clears undo, /api/vibe/save is INSERT OR REPLACE on one column).

  • A project is a folder ~/codec-workspace/vibe/<id>/ with a hidden .vibe/ (settings, checkpoint history, stored file versions). No git needed.
  • Every AI change is applied as files behind a checkpoint taken before and after. Undo AI change, a Versions drawer (coloured diff, Restore) and Revert to before this on each AI message. Restore and undo write a new checkpoint; nothing is rewritten or deleted.
  • A reply with several labelled code blocks fills one editor tab per file while it streams; Stop puts every file back as it was. The preview inlines local css and js.
  • Old single-file sessions open as before; the first message sent from one creates a project seeded with what the editor shows. Deleting a project moves its folder to ~/.codec/trash/vibe/.
  • VIBE_PROJECTS_ENABLED=false makes the routes answer 404 and the page falls back to single-file Vibe.

Safety

Path rules in safe_rel (no .., absolute, .vibe, .git, links, secret-looking names; 1 MB, 200 files, 50 per reply); one writer (_write_bytes_locked); a damaged history cannot write outside the project. Audit events carry ids and counts only. Page code puts every name and label on the page with textContent.

Checked

  • 46 engine/API tests, 28 helper tests, 10 page tests; four deliberate breakages (no link guard, restore keeps new files, undo ignores restores, no checkpoint before an AI change) are each caught.
  • 1,074 tests across every file that reads a changed page, route or asset pass; ruff check . clean; skill manifest current.
  • Browser, fake AI stream, scratch folders: two-file reply, single reply, Undo, Stop mid-stream, Versions diff + Restore, old session, missing folder, phone width. One real bug found there and fixed.
  • Not done: the live dashboard has to restart for the new routes; until then the page falls back to single-file Vibe.

Rollback

VIBE_PROJECTS_ENABLED=false, or revert this PR. The project_id column on vibe_sessions is harmless if left.

Step 2 (three panes, hideable code, live preview) follows in its own PR.

🤖 Generated with Claude Code

Mikarina13 and others added 5 commits October 18, 2026 18:54
…code)

Proposal only, waiting for owner approval.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gine and API)

- codec_vibe_projects.py: a project is a folder with a hidden .vibe/ (settings, checkpoint
  history, stored file versions). Every AI change is applied behind a checkpoint taken
  before and after; restore and undo write a new checkpoint, nothing is deleted.
- routes/vibe_projects.py: /api/vibe/projects/... (files, apply, checkpoints, diff, restore,
  undo, delete to trash); VIBE_PROJECTS_ENABLED=false answers 404.
- routes/vibe.py: a session remembers its project (nullable project_id, old databases upgrade in place).
- Path rules: no .., absolute, .vibe, .git, links, secret-looking names; 1 MB / 200 files / 50 per reply.
- 46 tests, each rule checked by breaking it on purpose.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- A reply with several labelled code blocks fills one editor tab per file while it streams
  and is applied as one checkpoint; Stop puts every file back as it was.
- Undo AI change, Versions (diff, Restore) and Revert to before this on each AI message.
- Preview inlines local css and js; old single-file sessions open as before.
- static/vibe-files.js (pure helpers, tested in Node) and static/vibe-projects.js (controller).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…switch, don't-touch)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…signature

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AVADSA25
AVADSA25 merged commit 3db05c0 into main Oct 18, 2026
1 check passed
@AVADSA25
AVADSA25 deleted the vibe-projects branch October 19, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants