overleaf-review 0.5.0 → 0.6.0

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,80 @@ 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
+ It differs from consolidation: the proposed text may change, and selected older suggestion cards
216
+ are replaced by a new pending revision under the authenticated account.
217
+
218
+ Fetch the current text/review state, edit the local file, and extend the normal block manifest:
219
+
220
+ ```json
221
+ {
222
+ "replacements": [
223
+ {
224
+ "before": "The current paragraph, including pending suggestions.",
225
+ "after": "The coherently rewritten paragraph. Its explanation incorporates the correction.",
226
+ "supersedes": ["existing-change-id-1", "existing-change-id-2"],
227
+ "reason": "Incorporates the correction into a more coherent explanation.",
228
+ "comments": [
229
+ {
230
+ "thread": "existing-thread-id",
231
+ "anchorAfter": "Its explanation incorporates the correction.",
232
+ "reply": "Rewritten to incorporate your correction and clarify the explanation."
233
+ }
234
+ ]
235
+ }
236
+ ]
237
+ }
238
+ ```
239
+
240
+ ```sh
241
+ overleaf-review review plan --file main.tex --edits blocks.json --out reviewed-plan.json
242
+ overleaf-review review submit --plan reviewed-plan.json
243
+ ```
244
+
245
+ The `supersedes`, `comments`, or `reason` fields select reviewed-overlap planning automatically.
246
+ Every block needs a paragraph-level `reason`. Omit `supersedes`/`comments` or use empty arrays
247
+ when that block has no corresponding overlaps. `reply` is optional. Use `occurrence` in a comment
248
+ mapping when `anchorAfter` occurs more than once in the revised block. To highlight the entire
249
+ revised paragraph, set `anchorAfter` equal to `after`.
250
+
251
+ The tool lists unapproved overlapping IDs and threads. All fragments of each selected suggestion
252
+ and the full affected comment anchor must be contained in its approved block; it will not silently
253
+ expand the scope. Suggestions from other authors may be explicitly superseded. Their original
254
+ content and attribution are retained in the full plan/receipt, not falsely attributed to the new
255
+ revision. Existing thread IDs, messages, author metadata, and resolution state are preserved;
256
+ only approved anchors move. Suggestions and comments outside the blocks retain their identities
257
+ and content, with positions shifted as needed.
258
+
259
+ The plan shows **underlying**, **current**, and **proposed** text for each block. The underlying
260
+ text excludes the selected pending suggestions. Submission undoes those ranges and writes the
261
+ new whole-block revision, then reanchors the existing threads in the same OT update. It does
262
+ not accept older suggestions first. Rejecting the new revision restores that underlying text;
263
+ it does not recreate the old suggestion cards. Later manual review uses Overleaf's native anchor
264
+ behavior; this command is not a background service that restores anchors after future rejections.
265
+
266
+ Reviewed rewrites require a saved plan and synchronization base, use a separate plan kind, and
267
+ cannot be forced with `--allow-overlap`, `--direct`, `--unsafe-no-base` or `--acknowledge-ambiguous`.
268
+ Any unapproved overlap, changed local intent, or changed document/review state before submission
269
+ blocks the write. Coordinate a quiet editing window: the server does not provide a conditional
270
+ transaction spanning text, ranges and threads, and post-write verification is not a rollback.
271
+
272
+ Replies are posted only after the manuscript, anchors, range identities, author attribution and
273
+ rejection baseline have been verified. A receipt separately tracks text verification and each
274
+ reply. If a definite reply failure leaves follow-up pending, resubmitting the same plan resumes
275
+ without rewriting the manuscript. A lost reply acknowledgement can be reconciled from its new
276
+ message ID or an unambiguous new same-author message; without proof it remains quarantined and
277
+ is not automatically reposted. An uncertain text update always requires manual reconciliation.
278
+ Keep the plan and receipts when resuming; do not use a fresh plan to bypass an uncertain attempt.
279
+
280
+ Verification: `npm run probe:reviewed-model` covers other-author suggestions and existing-thread
281
+ reanchoring against pinned upstream range logic. The opt-in
282
+ `npm run probe:reviewed-live -- --project <test-id> --confirm-test-project` creates a new scratch
283
+ document and threads, verifies anchor movement, a reviewed rewrite, explanatory reply and retry,
284
+ and checks existing documents were unchanged. It does not impersonate another account.
285
+
211
286
  ### Consolidation of existing suggestions
212
287
 
213
288
  `review consolidate --doc main.tex --author <user-id> --out .overleaf/consolidation.json`