[EPIC][expert] Write / edit / create expert: symbolic target resolution, typed changes, preimage safety, and model fallback #415
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#415
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #376
Depends on: #377, #380
Integrates with: #379, #382, #355, #93/#99 freshness
Goal
Add the canonical Write Expert responsible for reasoning about and producing typed
edit/2andcreate/2actions while preserving exact target/preimage identity, source knowledge freshness, Frozen Spec obligations and canonical authority/effect semantics.The Write Expert owns the reasoning and payload-production layer. It does not receive ambient filesystem authority and it does not bypass the existing write/effect boundary.
This preserves #355 / D6-11:
Responsibilities
Deterministic-first editing
Use symbolic/structural transforms where possible, for example:
These paths use zero model calls.
Model fallback
For genuinely generative code/text changes that cannot be derived mechanically, the expert may explicitly invoke a model fallback.
The fallback receives bounded relevant context/spec/evidence and returns candidate typed change data, not authority and not trusted code execution.
Required path:
Only the model call is metered. The Write Expert invocation itself remains free.
Preimage / concurrent-change safety
Every mutation should bind to expected current state where possible:
If authoritative bytes/state changed after planning, return a structured stale/conflict outcome and re-resolve/replan rather than clobber.
Multi-file writes
Support a typed change set with explicit dependencies and atomicity/partial-failure semantics appropriate to the existing effect/tool layer.
Do not publish a supposedly current Project KB from half-completed intermediate state. Compose with #219/#99 dirty/coalescing/freshness work.
Cooperation
Acceptance
edit/2andcreate/2route to Write Expert through #377/#379.delete/1,run/1,index/1,sync_remote/1cannot route to Write Expert.Non-goals
Refs #376 #377 #379 #380 #382 #355 #93 #99 #141