Skip to content

feat(studio): annotations for HTML sources via sidecar file#37

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-html-annotations
Jul 18, 2026
Merged

feat(studio): annotations for HTML sources via sidecar file#37
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-html-annotations

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #16.

Goal: the annotate-for-the-agent workflow works for HTML-dialect scenarios — it was explicitly skipped ("HTML sources have no place to store them").

  • foo.htmlfoo.annotations.json sidecar, identical annotation object format as JSON scenarios. Lazily created on first comment, deleted when the last one is removed, corrupt sidecars fail loudly and are never overwritten. The HTML source is never touched by annotations.
  • Merged into raw["annotations"] at studio load/hot-reload and in rustmotion::loader::load_input (new additive load_html_annotations_sidecar), so the panel, info, still, render and validate all see the same scenario. The agent flagged that validate/render go through a separate CLI load path outside its authorized scope — hooked up during integration review (6 lines in validation.rs), keeping both loaders coherent.
  • Writes carry the PR fix(studio): surface write/reload errors, restore debounce, avoid mutex poisoning #30 guarantees: visible write_error, generation bump, no silent failures.
  • apply-annotations skill updated: read/resolve annotations inline for JSON, in the sidecar for HTML.
  • Known v1 limit: the sidecar is not watched; external edits appear at the next HTML reload.

Tests: 9 new (TDD red-first): path derivation, merge, empty/missing reads, creation format, remove-and-delete-when-empty, corrupt-never-overwritten, loader merge, corrupt-fails-load, missing-is-empty. 190 total, all green.

Verify: cargo check -p rustmotion-studio ✓ · cargo test --workspace → 190 passed ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

The studio's flagship review feature was inoperative for HTML
scenarios (annotations were explicitly skipped). Now:

- foo.html annotations live in foo.annotations.json, same object
  format as the JSON scenarios' annotations field; lazily created,
  deleted when empty, corrupt sidecars error loudly and are never
  overwritten; the HTML source itself is never modified
- studio load/hot-reload and rustmotion's load_input merge the
  sidecar into raw['annotations'] so the panel, info, still, render
  and validate all see the same scenario (validation.rs hooked up
  during integration review — both loaders stay coherent)
- append/delete on HTML sources carry the PR #30 guarantees (visible
  write_error, generation bump, no silent failures)
- apply-annotations skill documents where annotations live per source

Known v1 limit: the sidecar itself is not watched; external edits
show up at the next HTML reload.
@LeadcodeDev
LeadcodeDev merged commit 98f9fa4 into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/studio-html-annotations branch July 18, 2026 21:15
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.

feat(studio): annotations for HTML sources via sidecar file

1 participant