0%

Suggestion-application protocol (collect + conflict + apply)

Goal

Collect MachineApplicable suggestions and apply them safely at suggestion granularity.

Implementation Sketch

Collect every MachineApplicable Suggestion (each an atomic Vec<Substitution>); enforce the in-file span invariant (skip+report any substitution span not resolving to the file under rewrite); per-suggestion conflict resolution (drop the WHOLE suggestion if any of its substitutions overlaps another’s); apply surviving edits highest-offset-first in one pass.

Spec References

ori-fix-proposal.md §Suggestion-application protocol steps 2-5, §Batching behavior

Work Items

  • Collect MachineApplicable suggestions from structured_suggestions
  • In-file span invariant: skip+report cross-file substitution spans
  • Per-suggestion atomic conflict resolution (drop whole suggestion on any overlap)
  • Apply surviving edits highest-offset-first in one pass