Repository navigation
Agent CLI: describe, apply, and an editor that follows project.json - #31
Open
ryanrhughes wants to merge 4 commits into
Open
ryanrhughes wants to merge 4 commits into
ryanrhughes wants to merge 4 commits into
Conversation
`omareel describe BUNDLE` prints the edited timeline as JSON for scripts and AI agents: the recording and output, clips and zooms with their source and output spans, clicks (normalized positions), keyboard shortcuts and idle stretches mapped onto the edited timeline, the rest of project.json as settings, and the speeds, layouts and fits the editor allows. `omareel apply BUNDLE OPS.json|-` runs edit operations (split, delete, trim, speed, layout, zoom, set and the rest) through editor::Document, so they are checked as the editor checks them. All or nothing: a failing operation saves nothing and the JSON report names it. Operations take output seconds, or source seconds with "timeline": "source". --dry-run checks without saving; --describe adds the resulting timeline. Both commands run before any Qt application is made. The editor polls project.json's modification time and size every 400 ms and before each autosave. A project another program wrote is taken in as one undoable change (the editor's own state, unsaved edits included, is the undo step) instead of being overwritten, and the top bar says "Updated from project.json" for a few seconds. A file that doesn't parse yet is left until it does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s more
From review:
- Ctrl+S, the Save button and export saved without looking at project.json, so an apply
landing within one poll was overwritten and never shown. Every save now takes in
another program's project first. Autosave leaves a project.json that doesn't parse
alone and the top bar says so ("project.json can't be read · Ctrl+S overwrites it").
An explicit save or an export replaces it. A window closing with unsaved edits keeps a
project.json written since its last look.
- The reload applies the corrections opening a bundle makes (the recording back as the
first clip of a timeline of inserted videos; audio the recording lacks stays off), so
the editor and `describe` agree and a touched file doesn't count as a change.
- describe and apply open read-only: a project.json needing a defaults migration is
migrated in memory and written only when apply saves.
- apply --dry-run copies no inserted video into media/, and a failing batch removes the
copies it made.
- edit-zoom's `to` keeps the zoom before a cut, as zoom's does. zoom refuses a span under a
second, levels outside 1–4, and output times past the end, as delete does too.
- Arguments that aren't UTF-8 no longer abort through rust::String.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The reviewed changes appear safe to merge. SummaryAdds JSON commands to describe and edit recordings, plus editor reloads when
Reviews (3) · Last reviewed commit: "Agent CLI: a refused apply removes only ..." · Reviewed by Greptile |
…paths Fixes from the 0.6 review of #31: - apply saved project.json without checking it was still the file it read, so an editor autosave during the operations (an insert's copy takes a while) was overwritten. It now refuses to save when the file changed meanwhile, says so, and removes the videos it copied. The same cleanup runs when the save itself fails. - `{"ops": {...}}` (not a list) parsed as an empty batch and reported success; it's an error. - `set` checked the path's first part before set_project_value dropped empty parts, so ".clips" got past the guard. The path is normalised first, and `version` and `defaultsVersion` are refused too. - A dry-run insert predicts the name the real import picks (`clip-2.mp4` when taken). - describe lists each shortcut at its own time; shortcuts pressed within 0.6 s shared the first one's. - The editor's "can't be read" warning cleared only on the next save or reload; putting the file back as the editor has it now clears it (projectReadable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanrhughes
added a commit
that referenced
this pull request
Nov 26, 2026
…mes its real file Fixes from the 0.6 review of #36 (after merging the leaves' review fixes): - `delete` with output-timeline `ranges` cut each range from the last without joining them, so after [2,4] the times in [1,3] had moved: [[1,3],[2,4]] removed 4 s instead of 3. The ranges are all checked against the video as it is, joined, then cut. - A dry-run `music` reported `media/<name as given>`; it names the file the import would make (sanitised, -2 when taken), through the same helper the insert's dry run now uses. - The leaves' media naming (#31's planned names, #34's own partial file per copy) is one helper, free_media_name, with the fallback name the music import passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the 0.6 adversarial review: when apply refused to save (project.json changed meanwhile, or the save failed) it removed every file new in media/ since it started, which included a video the editor or another apply had just inserted and saved. It now removes only the copies its own inserts made (apply_ops_copying). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanrhughes
added a commit
that referenced
this pull request
Nov 26, 2026
… kept in the bundle Merges #31's fix (a refused apply removes only its own copies; Applied carries them). Found by the 0.6 adversarial review of #42: inside an agent's scope a background image in the scratch directory was allowed, but the runner removes that directory when the run ends, leaving the project pointing at nothing. apply copies such an image into media/ and points the project there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first step toward letting AI agents (and scripts) edit recordings: read the edited timeline as JSON, run checked edits, and have an open editor follow along.
omareel describe BUNDLEPrints the edited timeline as JSON:
project.jsonassettings;omareel apply BUNDLE OPS.json|-editor::Document, so they are checked exactly as the editor checks them.split,delete,trim,remove-clip,merge,move-clip,reset-trims,speed,layout,fit,insert,zoom,edit-zoom,remove-zoom,clear-zooms,regenerate-zooms,set."timeline": "source"gives recording times instead, which no edit moves."operation 2 (speed): speed must be one of …"). Video copies made byinsertare removed again.--dry-runchecks without writing anything;--describeadds the resulting timeline to the report.describeandapplyopen bundles read-only (a project.json that needs a defaults migration is migrated in memory) and run before any Qt application is created.Live reload in the editor
project.json's modification time and size every 400 ms and before every save (autosave, Ctrl+S, export).describeagree.Tested
cargo test -p omareel_core: 226 unit tests and 58 goldens. The new tests cover:media/untouched;QT_QPA_PLATFORM=offscreen ctest: 4/4 pass.omareel editrunning offscreen on a generated bundle:applywas taken in and saved by the editor once, about 0.7 s later, with the applied edits intact;A follow-up PR, stacked on this one, ships an agent skill that teaches coding agents to use these commands.
🤖 Generated with Claude Code