Skip to content

feat(cli): add weave apply to materialize entity edits onto files#123

Merged
rs545837 merged 1 commit into
mainfrom
feat/weave-apply
Jul 1, 2026
Merged

feat(cli): add weave apply to materialize entity edits onto files#123
rs545837 merged 1 commit into
mainfrom
feat/weave-apply

Conversation

@rs545837

@rs545837 rs545837 commented Jul 1, 2026

Copy link
Copy Markdown
Member

What

weave tracks entity edits in the CRDT (via the MCP tools and claim flows) but had no way to write them back to the working files, so an edit stayed in the CRDT and never reached disk. weave apply <files...> closes that loop: it reconstructs each file from its authoritative CRDT entity content plus the interstitial text between entities, and writes it out.

Why

This is the write side of weave. Paired with sem on the read side, an agent reads and understands code with sem, edits entities in weave's CRDT, and runs weave apply to project those edits onto the files, entirely in entity space and immune to line drift.

How

Reuses the existing find_repo_root and reconstruct_file_from_crdt; the command only wires them to disk. Verified end to end locally: edit an entity via the MCP, weave apply <file>, and sem confirms the structural edit landed with untouched entities and whitespace preserved.

Follow-up (not in this PR)

sync_from_files should gain an authority guard so a local entity edit is never clobbered by a re-sync, making the CRDT genuinely the source of truth under concurrent activity.

weave tracks entity edits in the CRDT (via the MCP tools and claim flows)
but had no way to write them back to the working files, so an edit stayed
in the CRDT and never reached disk. `weave apply <files...>` closes that
loop: it reconstructs each file from its authoritative CRDT entity content
plus the interstitial text between entities, and writes it out.

This is the write side of weave. Paired with sem on the read side, an agent
reads and understands code with sem, edits entities in weave's CRDT, and
runs `weave apply` to project those edits onto the files, entirely in
entity space and immune to line drift. Reuses the existing find_repo_root
and reconstruct_file_from_crdt; the command only wires them to disk.
@rs545837 rs545837 merged commit f1ae8d8 into main Jul 1, 2026

@inspect-review inspect-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inspect review

Triage: 4 entities analyzed | 0 critical, 0 high, 3 medium, 1 low
Verdict: standard_review

Findings (0)


Reviewed by inspect | Entity-level triage found 0 high-risk changes

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