Skip to content

Add conditional prompt-history commands and restart recovery - #61

Draft
ethanfel wants to merge 1 commit into
nightlyfrom
sceneweaver-prompt-history
Draft

ethanfel wants to merge 1 commit into
nightlyfrom
sceneweaver-prompt-history

Conversation

@ethanfel

Copy link
Copy Markdown
Owner

Companion editors currently cannot verify which working branch supplied prompt history or safely retry a save after losing its response. This adds scoped history reads and optional conditional commands to the existing endpoint. For example, retrying an acknowledged-on-disk fork with the same operation ID returns its receipt instead of creating another child.

List/revision responses echo the project, scene and working branch, plus a history revision stamp. Version 1 commands support save, explicit fork, activate, label, archive and delete with ownership checks, stale-state rejection and durable receipts. Legacy editor requests retain their behavior. Loading or activating saved history does not apply its text to Plan JSON.

A recovery journal commits revision files, index and receipt together as durable intent. Native store reads/writes finish an interrupted command before returning state, including a crash after a mutable prompt file changes but before its index. I/O errors return 500 so clients retain the exact request and check its receipt. Receipts are not evicted; new commands stop at 1,024 per scene history. The protocol document describes restart, copied-branch and single-process boundaries.

Validation: existing Python history and JavaScript ancestry tests pass; new store tests cover concurrent authors, immutable/mutable forks, interruptions between file writes, restart/retry and named/copied branch isolation. Tests of the real HTTP handlers with CPU-only ComfyUI stubs cover scope echo, read/status/retry, 409 conflicts, 500 interrupted writes and the real 423 ownership guard. Python compilation and diff checks pass. All projects are temporary fixtures; production workflow validation remains pending.

This draft targets nightly and supports SceneWeaver's saved prompt history workspace. It does not include or depend on the other open SceneWeaver integration PRs.

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.

1 participant