overleaf-review 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -186,7 +186,8 @@ and keep independent decisions separate. Author attribution remains unchanged.
186
186
  Blocks must be separated and must explain the entire local diff. The plan embeds the resolved
187
187
  blocks; it never rereads or silently reinterprets the manifest during submission. Concurrent edits
188
188
  outside blocks are preserved; any comment, pending suggestion, or concurrent edit touching a block
189
- stops planning rather than silently fragmenting it. Narrow the block or resolve the conflict.
189
+ stops ordinary block planning rather than silently fragmenting it. For deliberately reviewed
190
+ overlaps, use the manifest fields below; otherwise narrow the block or resolve the conflict.
190
191
  `--edits` requires `--file` and a saved base; it cannot be combined with `--direct` or `--unsafe-no-base`.
191
192
 
192
193
  Without explicit blocks, tracked suggestions group nearby word edits into phrase replacements. For example, rewriting
@@ -208,6 +209,87 @@ Overlap transformations can alter the actual count, so this is a preflight guard
208
209
  exact prediction. Splitting a revision into batches does not remove accumulated pending ranges.
209
210
  Grouping applies to new pushes; it does not consolidate or accept suggestions already on Overleaf.
210
211
 
212
+ ### Holistic paragraph rewrites over reviewed suggestions and comments
213
+
214
+ Use this when a paragraph rewrite intentionally incorporates or supersedes existing suggestions.
215
+
216
+ To regroup existing fragmented suggestions **without changing their proposed wording**, set
217
+ `before` and `after` to the same paragraph text and explicitly list the suggestion IDs in
218
+ `supersedes`. Keep the local file unchanged for that block. This is supported from v0.6.1;
219
+ the proposal must still differ from the underlying text obtained by rejecting those suggestions.
220
+ Affected comments still require explicit anchor mappings, and all stale-plan and verification
221
+ checks still apply. Ordinary replacements without selected suggestions cannot be no-ops.
222
+ It differs from consolidation: the proposed text may change, and selected older suggestion cards
223
+ are replaced by a new pending revision under the authenticated account.
224
+
225
+ Fetch the current text/review state, edit the local file, and extend the normal block manifest:
226
+
227
+ ```json
228
+ {
229
+ "replacements": [
230
+ {
231
+ "before": "The current paragraph, including pending suggestions.",
232
+ "after": "The coherently rewritten paragraph. Its explanation incorporates the correction.",
233
+ "supersedes": ["existing-change-id-1", "existing-change-id-2"],
234
+ "reason": "Incorporates the correction into a more coherent explanation.",
235
+ "comments": [
236
+ {
237
+ "thread": "existing-thread-id",
238
+ "anchorAfter": "Its explanation incorporates the correction.",
239
+ "reply": "Rewritten to incorporate your correction and clarify the explanation."
240
+ }
241
+ ]
242
+ }
243
+ ]
244
+ }
245
+ ```
246
+
247
+ ```sh
248
+ overleaf-review review plan --file main.tex --edits blocks.json --out reviewed-plan.json
249
+ overleaf-review review submit --plan reviewed-plan.json
250
+ ```
251
+
252
+ The `supersedes`, `comments`, or `reason` fields select reviewed-overlap planning automatically.
253
+ Every block needs a paragraph-level `reason`. Omit `supersedes`/`comments` or use empty arrays
254
+ when that block has no corresponding overlaps. `reply` is optional. Use `occurrence` in a comment
255
+ mapping when `anchorAfter` occurs more than once in the revised block. To highlight the entire
256
+ revised paragraph, set `anchorAfter` equal to `after`.
257
+
258
+ The tool lists unapproved overlapping IDs and threads. All fragments of each selected suggestion
259
+ and the full affected comment anchor must be contained in its approved block; it will not silently
260
+ expand the scope. Suggestions from other authors may be explicitly superseded. Their original
261
+ content and attribution are retained in the full plan/receipt, not falsely attributed to the new
262
+ revision. Existing thread IDs, messages, author metadata, and resolution state are preserved;
263
+ only approved anchors move. Suggestions and comments outside the blocks retain their identities
264
+ and content, with positions shifted as needed.
265
+
266
+ The plan shows **underlying**, **current**, and **proposed** text for each block. The underlying
267
+ text excludes the selected pending suggestions. Submission undoes those ranges and writes the
268
+ new whole-block revision, then reanchors the existing threads in the same OT update. It does
269
+ not accept older suggestions first. Rejecting the new revision restores that underlying text;
270
+ it does not recreate the old suggestion cards. Later manual review uses Overleaf's native anchor
271
+ behavior; this command is not a background service that restores anchors after future rejections.
272
+
273
+ Reviewed rewrites require a saved plan and synchronization base, use a separate plan kind, and
274
+ cannot be forced with `--allow-overlap`, `--direct`, `--unsafe-no-base` or `--acknowledge-ambiguous`.
275
+ Any unapproved overlap, changed local intent, or changed document/review state before submission
276
+ blocks the write. Coordinate a quiet editing window: the server does not provide a conditional
277
+ transaction spanning text, ranges and threads, and post-write verification is not a rollback.
278
+
279
+ Replies are posted only after the manuscript, anchors, range identities, author attribution and
280
+ rejection baseline have been verified. A receipt separately tracks text verification and each
281
+ reply. If a definite reply failure leaves follow-up pending, resubmitting the same plan resumes
282
+ without rewriting the manuscript. A lost reply acknowledgement can be reconciled from its new
283
+ message ID or an unambiguous new same-author message; without proof it remains quarantined and
284
+ is not automatically reposted. An uncertain text update always requires manual reconciliation.
285
+ Keep the plan and receipts when resuming; do not use a fresh plan to bypass an uncertain attempt.
286
+
287
+ Verification: `npm run probe:reviewed-model` covers other-author suggestions and existing-thread
288
+ reanchoring against pinned upstream range logic. The opt-in
289
+ `npm run probe:reviewed-live -- --project <test-id> --confirm-test-project` creates a new scratch
290
+ document and threads, verifies anchor movement, a reviewed rewrite, explanatory reply and retry,
291
+ and checks existing documents were unchanged. It does not impersonate another account.
292
+
211
293
  ### Consolidation of existing suggestions
212
294
 
213
295
  `review consolidate --doc main.tex --author <user-id> --out .overleaf/consolidation.json`