coduck 0.15.1__tar.gz → 0.15.2__tar.gz

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.
Files changed (76) hide show
  1. {coduck-0.15.1 → coduck-0.15.2}/PKG-INFO +76 -38
  2. {coduck-0.15.1 → coduck-0.15.2}/README.md +75 -37
  3. {coduck-0.15.1 → coduck-0.15.2}/pyproject.toml +1 -1
  4. {coduck-0.15.1 → coduck-0.15.2}/pyproject.toml.orig +1 -1
  5. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/SKILL.md +25 -14
  6. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/cli.py +11 -5
  7. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/migrations.py +7 -1
  8. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/actions.js +1 -0
  9. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/dialogs.css +2 -1
  10. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/review.js +8 -2
  11. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/state.js +2 -2
  12. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/threads.css +5 -0
  13. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/threads.js +32 -9
  14. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/review.py +105 -37
  15. coduck-0.15.2/src/coduck/schema/7/edit.schema.json +32 -0
  16. coduck-0.15.2/src/coduck/schema/7/event.schema.json +151 -0
  17. coduck-0.15.2/src/coduck/schema/7/note.schema.json +36 -0
  18. coduck-0.15.2/src/coduck/schema/7/review.schema.json +92 -0
  19. coduck-0.15.2/src/coduck/schema/7/spec.schema.json +55 -0
  20. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/server.py +16 -4
  21. {coduck-0.15.1 → coduck-0.15.2}/LICENSE +0 -0
  22. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/__init__.py +0 -0
  23. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/__main__.py +0 -0
  24. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/driver.py +0 -0
  25. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/git.py +0 -0
  26. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/gitattributes +0 -0
  27. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/app.js +0 -0
  28. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/blocks.js +0 -0
  29. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/core.js +0 -0
  30. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/edits.js +0 -0
  31. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/favicon.svg +0 -0
  32. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/files.css +0 -0
  33. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/files.js +0 -0
  34. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/index.html +0 -0
  35. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/list.css +0 -0
  36. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/list.js +0 -0
  37. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/picker.js +0 -0
  38. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/runs.css +0 -0
  39. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/runs.js +0 -0
  40. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/style.css +0 -0
  41. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/tasks.css +0 -0
  42. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/tasks.js +0 -0
  43. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/tasktab.js +0 -0
  44. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/highlight.js.LICENSE +0 -0
  45. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/highlight.min.js +0 -0
  46. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/hljs-github.min.css +0 -0
  47. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/markdown-it.LICENSE +0 -0
  48. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/markdown-it.min.js +0 -0
  49. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/mermaid.LICENSE +0 -0
  50. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/page/vendor/mermaid.min.js +0 -0
  51. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/runs.py +0 -0
  52. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/1/edit.schema.json +0 -0
  53. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/1/event.schema.json +0 -0
  54. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/1/review.schema.json +0 -0
  55. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/2/edit.schema.json +0 -0
  56. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/2/event.schema.json +0 -0
  57. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/2/review.schema.json +0 -0
  58. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/3/edit.schema.json +0 -0
  59. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/3/event.schema.json +0 -0
  60. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/3/note.schema.json +0 -0
  61. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/3/review.schema.json +0 -0
  62. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/4/edit.schema.json +0 -0
  63. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/4/event.schema.json +0 -0
  64. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/4/note.schema.json +0 -0
  65. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/4/review.schema.json +0 -0
  66. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/5/edit.schema.json +0 -0
  67. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/5/event.schema.json +0 -0
  68. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/5/note.schema.json +0 -0
  69. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/5/review.schema.json +0 -0
  70. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/5/spec.schema.json +0 -0
  71. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/6/edit.schema.json +0 -0
  72. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/6/event.schema.json +0 -0
  73. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/6/note.schema.json +0 -0
  74. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/6/review.schema.json +0 -0
  75. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/schema/6/spec.schema.json +0 -0
  76. {coduck-0.15.1 → coduck-0.15.2}/src/coduck/tasks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coduck
3
- Version: 0.15.1
3
+ Version: 0.15.2
4
4
  Summary: A local review tool that keeps code reviews in git refs
5
5
  Keywords: code review,git,agents
6
6
  Author: Evert Lammerts
@@ -45,12 +45,12 @@ Windows, which lacks the file locks and process groups it uses.
45
45
  coduck -h
46
46
  ```
47
47
 
48
- Or from a release tag of a clone of CoDuck's repository, the newest tag in place of `v0.15.1`. An install from a
48
+ Or from a release tag of a clone of CoDuck's repository, the newest tag in place of `v0.15.2`. An install from a
49
49
  tag, not from the working files, keeps a running server on code that does not change under it.
50
50
 
51
51
  ```sh
52
52
  git clone <the URL of CoDuck's repository> coduck
53
- uv tool install "git+file://$PWD/coduck@v0.15.1"
53
+ uv tool install "git+file://$PWD/coduck@v0.15.2"
54
54
  ```
55
55
 
56
56
  2. **Start the server** and leave it running. It serves every registered repo, on 127.0.0.1 only; opening a
@@ -259,13 +259,18 @@ The mode switch in the top bar reads Comments: Scratch or Direct. The browser re
259
259
  - **Scratch** holds comments and edits back. New threads, replies, resolves and reopens, applied suggestions, file
260
260
  edits and their withdrawals, and description edits are drafts, marked as such, that you can change or delete. Post all
261
261
  opens the dialog "Post your review", which lists the drafts and takes an optional summary and a verdict, Comment
262
- or Approve, and writes all drafts in one commit, so that a waiting author wakes once. When you choose Approve
262
+ or Approve, and writes all drafts in one commit, so that a waiting author wakes once. On a review that is approved
263
+ or ready the dialog has a third choice, Comment and mark not ready: it posts as Comment does, with the mark needs
264
+ input that ends the approval (see [The state of a review](#the-state-of-a-review)), and like Comment it needs
265
+ drafts or a summary to post. When you choose Approve
263
266
  while threads are not resolved, the dialog says how many, lists each with a link to it, and its button reads
264
267
  "Approve anyway". A thread counts as the review will hold it once the drafts are posted: a drafted resolve
265
268
  resolves it, and a drafted reopen and a drafted new thread are not resolved. When a write still on its way
266
269
  brings a thread the dialog did not name, Post review asks again before it posts. Approving with open threads is
267
270
  allowed.
268
- - **Direct** posts each action at once.
271
+ - **Direct** posts each action at once. On a review that is approved or ready, a composer of a comment, a reply or
272
+ a message in the conversation has a second button beside its submit, Comment and mark not ready, which posts the
273
+ message with the mark needs input. Ctrl or Cmd with Enter posts it without the mark.
269
274
 
270
275
  A change of base, a change of project, a note and Done act at once in both modes. Drafts are kept on the server's
271
276
  disk, outside git, and survive a reload and a restart.
@@ -428,21 +433,38 @@ Set project, picks a project in use, takes a new name, or drops the project.
428
433
 
429
434
  An open review is in one of three states, read from what the review holds:
430
435
 
431
- - **Approved**: the reviewer's latest verdict is Approve, the branch's head is still the head that Post all saw, and
432
- no other change came after it. A Post all that saw no head, because the branch was gone or the review was written
433
- before writes recorded heads, approves nothing.
436
+ - **Approved**: the reviewer approved the branch with a Post all, the branch's head is still the head that Post all
437
+ saw, and nothing since ended the approval. A Post all that saw no head, because the branch was gone or the review
438
+ was written before writes recorded heads, approves nothing.
434
439
  - **Ready**: approved, and the author gave the ready signal, `coduck ready`, after that Post all: nothing more is
435
440
  in flight.
436
441
  - **Needs input**: every other open review.
437
442
 
438
- A change is what can make a reader look again: another head of the branch than the one a write saw (every write
439
- records the head it saw, so a new commit, a reset, a rebase and a deleted branch all count, whatever the commits'
440
- times), a new description, a new base, a message (a new thread, a reply, a message in the conversation, by either
441
- side, or a Post all after the approving one), or a thread opened again. A change ends an approval and the ready signal with it, so a review that was approved goes
442
- back to needs input. What an approving Post all writes itself, its drafts and its summary, is part of the approval.
443
- None of these is a change: a note, the author taking in edits with `coduck pull`, a resolve, a change of project,
444
- an edit or a suggestion applied by the reviewer and its withdrawal, a migration, an approval and the ready signal.
445
- A commit on the base is no change either. A finished review has no such state.
443
+ An approval, and the ready signal with it, ends when:
444
+
445
+ - the branch's head is another than the one the approving Post all saw: every write records the head it saw, so a
446
+ new commit, a reset, a rebase and a deleted branch all count, whatever the commits' times;
447
+ - the description or the base is another than the one the approving Post all left, by either side, a description
448
+ drafted in Scratch mode and posted with Post all included; what that Post all wrote itself is part of the
449
+ approval, and a description or a base changed back to what it was ends nothing;
450
+ - a message is posted with the mark needs input, by either side: in the page with Comment and mark not ready, a
451
+ second button beside the submit of a comment, a reply or a message in the conversation in Direct mode, or the
452
+ third choice of Post all; with the command, `coduck reply -i` or `coduck comment -i`, also together with `-w`.
453
+
454
+ A message without the mark ends nothing, whoever writes it: a reply, a new thread, a message in the conversation,
455
+ a Post all with the verdict Comment. Nor does any of these: a resolve or a reopen, a note, the author taking in
456
+ edits with `coduck pull`, a change of project, an edit or a suggestion applied by the reviewer and its withdrawal,
457
+ a migration, an approval, the ready signal, a commit on the base. What is new for the reviewer
458
+ does not depend on the mark: every message is new for them as [What is new for you](#what-is-new-for-you) says,
459
+ with the mark or without it. A finished review has no state.
460
+
461
+ The mark is for a message that asks something of the other side or reports something that needs their action, such
462
+ as a check that failed upstream; an acknowledgement, or a report that needs nothing, goes without it. It is recorded
463
+ as an event `needs-input` at the end of the conversation, in the commit of its message, under the writer's name and
464
+ on their side, and the conversation shows it as a line, "NAME marked the review as needing input". The page offers
465
+ it only on a review that is approved or ready. A command takes `-i` on any open review, where it changes the state
466
+ only of an approved or ready one, and a finished review refuses it. The mark is no one's word in the conversation:
467
+ which threads `coduck show -u` lists does not depend on it.
446
468
 
447
469
  **Approve**, a verdict of Post all, says the reviewer is satisfied with the branch as it stands. The review stays
448
470
  open, so that later changes, such as a fix for a check that fails upstream, come back in the same review, and the
@@ -473,6 +495,9 @@ word is the author's is no reason by itself: once you have written anywhere in t
473
495
  read from the review alone, so `coduck list` and other tools see the same; what this browser last showed is the
474
496
  row's own "N new".
475
497
 
498
+ A message with the mark needs input (see [The state of a review](#the-state-of-a-review)) counts here as any
499
+ message does: the mark changes none of these reasons.
500
+
476
501
  ### Notes
477
502
 
478
503
  A note is a fact about a review that nobody is asked to answer, such as where its pull request is or which review
@@ -560,7 +585,9 @@ Two sessions under two names can work on one review, and each one's writes, note
560
585
  with their ids, oldest first, every thread and the pending edits, and last the line `version: <id>`. A note's
561
586
  first line is `note <id> by NAME at TIME`, with `, changed by NAME at TIME` once it was changed, and its Markdown
562
587
  follows, indented. A message that a session posted for the reviewer shows its author as
563
- `REVIEWER (through NAME)`, NAME being that session. With `-u` it prints only what waits on the caller, the name
588
+ `REVIEWER (through NAME)`, NAME being that session. The conversation shows the ready signal as
589
+ `NAME gave the ready signal at TIME` and the mark needs input as `NAME marked the review as needing input at
590
+ TIME`. With `-u` it prints only what waits on the caller, the name
564
591
  `-n` gives or else `coduck.cliuser`: the open threads whose last word is another name's, and the pending edits;
565
592
  a message the caller posted for the reviewer is the caller's own word. Each thread's first
566
593
  line says where its lines are now, as `now lines 23 to 24`, or that it is outdated, with its place when it has
@@ -589,10 +616,13 @@ between is missed, from the reviewer or from another session under another name.
589
616
 
590
617
  ### Answering
591
618
 
592
- - `coduck reply [-r [REPO/]N] [-w] THREAD FILE` adds a message to a thread; THREAD is a thread id or
619
+ - `coduck reply [-r [REPO/]N] [-w] [-i] THREAD FILE` adds a message to a thread; THREAD is a thread id or
593
620
  `conversation`.
594
- - `coduck comment [-r [REPO/]N] [-w] PATH:N[-M] [old] FILE` starts a thread on lines N to M of a file at the head
595
- of the branch, or with the word `old` on the lines of the merge base.
621
+ - `coduck comment [-r [REPO/]N] [-w] [-i] PATH:N[-M] [old] FILE` starts a thread on lines N to M of a file at the
622
+ head of the branch, or with the word `old` on the lines of the merge base.
623
+ - `-i`, on either, posts the message with the mark needs input, also together with `-w`: on an approved or ready
624
+ review it ends the approval and the ready signal; see [The state of a review](#the-state-of-a-review). It is
625
+ taken on any open review and refused, with exit 1 and nothing written, on a finished one.
596
626
  - `coduck resolve [-r [REPO/]N] THREAD` and `coduck reopen [-r [REPO/]N] THREAD`.
597
627
 
598
628
  ### Posting for the reviewer
@@ -604,8 +634,9 @@ reads it when it runs, on the reviewer's side, and both also record the name the
604
634
  gives or else `coduck.cliuser`: each event as `through`, and the commit in a trailer `Through`. A new thread
605
635
  records it on its opening as well as on its message. A `Through` trailer counts only beside `Role: reviewer`.
606
636
 
607
- It is the reviewer's word: it is a message and so a change that ends an approval, the page shows it under the
608
- reviewer's name, and it answers what the author's side wrote before it, so that those messages are no longer [new
637
+ It is the reviewer's word: with `-i` it carries the mark needs input on the reviewer's side, recorded with the
638
+ same `through`, and ends an approval as the reviewer's own mark does; the page shows it under the reviewer's name,
639
+ and it answers what the author's side wrote before it, so that those messages are no longer [new
609
640
  for the reviewer](#what-is-new-for-you). It is no look at the review: commits, a new description or base and the
610
641
  ready signal that were new for the reviewer stay new, and a review the reviewer has not written in themselves stays
611
642
  not reviewed yet. For `wait` and `show -u` it is the posting session's own: it is news for every other name and
@@ -650,10 +681,12 @@ An edit still pending when the review is marked done is never taken in.
650
681
  ### Saying it is ready
651
682
 
652
683
  `coduck ready [-r [REPO/]N]` gives the ready signal on an approved review: nothing more is in flight. It writes a
653
- `ready` event in the conversation, in one commit named `ready`, and prints `review N is ready`. It is refused, and
654
- exits 1, unless the review is approved with no change since the approval; on a review that is ready already it
655
- writes nothing and exits 0. It is news for the reviewer and no change. Anything written or committed after it that
656
- is a change, such as a commit or a message, takes the review back to needs input.
684
+ `ready` event in the conversation, in one commit named `ready`, and prints `review N is ready`. It is given on a
685
+ review that is approved, as [The state of a review](#the-state-of-a-review) has it, and refused, with exit 1, on any
686
+ other, so also after a message with the mark needs input until the reviewer approves again; on a review that is
687
+ ready already it writes nothing and exits 0. It is news for the reviewer and ends nothing. After it, another head
688
+ of the branch, a new description or base, or a message with the mark needs input takes the review back to needs
689
+ input; a message without the mark, by either side, leaves it ready.
657
690
 
658
691
  ### Notes
659
692
 
@@ -1190,25 +1223,26 @@ event per line, the pending edits under `edits/`, and a file per note under `not
1190
1223
  was added, its place in the order the notes were added, its Markdown and, once it was changed, who changed it, on
1191
1224
  which side and when, and a file per run specification under `specs/`: its name, Python version and requirements,
1192
1225
  who made it, when and in which place of their order, and once it was changed, who changed it and when. The
1193
- conversation's log also holds the ready signals. Each commit's message names the action on its first line,
1194
- and as trailers below it the branch head and merge base the review compared then (`Head`, `Merge-Base`), the side
1195
- that wrote it (`Role`, `reviewer` or `agent`), for a message a command posted for the reviewer the name it was
1196
- posted through (`Through`), and the version of CoDuck that wrote it (`Coduck`; `Redline` on a commit written through
1197
- format 5, when CoDuck had that name). Each event records its author and
1198
- its side as `author` and `role`, and a message and the opening of a thread that a command posted for the reviewer
1199
- the name they were posted through as `through`.
1226
+ conversation's log also holds the ready signals and the marks needs input. Each commit's message names the action
1227
+ on its first line, and as trailers below it the branch head and merge base the review compared then (`Head`,
1228
+ `Merge-Base`), the side that wrote it (`Role`, `reviewer` or `agent`), for a message a command posted for the
1229
+ reviewer the name it was posted through (`Through`), and the version of CoDuck that wrote it (`Coduck`; `Redline` on
1230
+ a commit written through format 5, when CoDuck had that name). Each event records its author and its side as
1231
+ `author` and `role`, and a message, the opening of a thread and the mark needs input that a command posted for the
1232
+ reviewer the name they were posted through as `through`.
1200
1233
 
1201
1234
  `review.json` holds `format`, the number of the form the review is stored in; a review without it is in format 1,
1202
1235
  everything written before version 0.9.0, format 2 what 0.9.0 and 0.10.0 wrote, and format 3 what 0.11.0 and 0.12.0
1203
1236
  wrote, which added the ready signal and notes, format 4 what 0.13.0 to 0.14.3 wrote, which added `through`, and
1204
1237
  format 5 what the last version named redline wrote, which was never released and added run specifications. Through
1205
- format 5 CoDuck was named redline, and a review was the ref `refs/redline/<number>`. This version writes and reads
1206
- format 6, which is format 5 under the ref `refs/coduck/<number>`. The package ships a JSON Schema (draft 2020-12) for each format, under
1238
+ format 5 CoDuck was named redline, and a review was the ref `refs/redline/<number>`. Format 6, what 0.15.0 and 0.15.1
1239
+ wrote, is format 5 under the ref `refs/coduck/<number>`. This version writes and reads format 7, which adds the mark
1240
+ needs input, an event of the conversation. The package ships a JSON Schema (draft 2020-12) for each format, under
1207
1241
  `coduck/schema/<format>/` in the installed package and `src/coduck/schema/` in its source: `review.schema.json` for
1208
1242
  `review.json`, `event.schema.json` for one line of a thread's log, `edit.schema.json` for the record of an edit,
1209
- from format 3 `note.schema.json` for a note, and from format 5 `spec.schema.json` for a run specification. Format
1210
- 6's are strict: they name every field and allow no other, and allow `through` only beside the role `reviewer`.
1211
- Format 1's say what earlier versions could write.
1243
+ from format 3 `note.schema.json` for a note, and from format 5 `spec.schema.json` for a run specification. The
1244
+ schemas of formats 6 and 7 are strict: they name every field and allow no other, and allow `through` only beside the
1245
+ role `reviewer`. Format 1's say what earlier versions could write.
1212
1246
 
1213
1247
  A version reads one format. A review in an older one is refused wherever it is read, by every command and by the
1214
1248
  server, with `review N of REPO is in format F; run coduck migrate`, and one in a newer format with `written by a
@@ -1242,6 +1276,10 @@ what the browser kept for the page under the old name: paste the key that `coduc
1242
1276
  every review shows as unread once. The settings are not taken over either: set `coduck.webuser` and
1243
1277
  `coduck.cliuser` where `redline.webuser` and `redline.cliuser` were set.
1244
1278
 
1279
+ The step to format 7 changes nothing but the format. The state of a review is read by the rule of this version
1280
+ whatever format its past was written in: an open review whose approval only messages without the mark followed is
1281
+ approved again after the migration, and ready when the ready signal came after that approval.
1282
+
1245
1283
  On an upgrade, stop the server, install the new version, run `coduck migrate`, and start the server again, so that
1246
1284
  no server of the older version writes into a review of the new format.
1247
1285
 
@@ -22,12 +22,12 @@ Windows, which lacks the file locks and process groups it uses.
22
22
  coduck -h
23
23
  ```
24
24
 
25
- Or from a release tag of a clone of CoDuck's repository, the newest tag in place of `v0.15.1`. An install from a
25
+ Or from a release tag of a clone of CoDuck's repository, the newest tag in place of `v0.15.2`. An install from a
26
26
  tag, not from the working files, keeps a running server on code that does not change under it.
27
27
 
28
28
  ```sh
29
29
  git clone <the URL of CoDuck's repository> coduck
30
- uv tool install "git+file://$PWD/coduck@v0.15.1"
30
+ uv tool install "git+file://$PWD/coduck@v0.15.2"
31
31
  ```
32
32
 
33
33
  2. **Start the server** and leave it running. It serves every registered repo, on 127.0.0.1 only; opening a
@@ -236,13 +236,18 @@ The mode switch in the top bar reads Comments: Scratch or Direct. The browser re
236
236
  - **Scratch** holds comments and edits back. New threads, replies, resolves and reopens, applied suggestions, file
237
237
  edits and their withdrawals, and description edits are drafts, marked as such, that you can change or delete. Post all
238
238
  opens the dialog "Post your review", which lists the drafts and takes an optional summary and a verdict, Comment
239
- or Approve, and writes all drafts in one commit, so that a waiting author wakes once. When you choose Approve
239
+ or Approve, and writes all drafts in one commit, so that a waiting author wakes once. On a review that is approved
240
+ or ready the dialog has a third choice, Comment and mark not ready: it posts as Comment does, with the mark needs
241
+ input that ends the approval (see [The state of a review](#the-state-of-a-review)), and like Comment it needs
242
+ drafts or a summary to post. When you choose Approve
240
243
  while threads are not resolved, the dialog says how many, lists each with a link to it, and its button reads
241
244
  "Approve anyway". A thread counts as the review will hold it once the drafts are posted: a drafted resolve
242
245
  resolves it, and a drafted reopen and a drafted new thread are not resolved. When a write still on its way
243
246
  brings a thread the dialog did not name, Post review asks again before it posts. Approving with open threads is
244
247
  allowed.
245
- - **Direct** posts each action at once.
248
+ - **Direct** posts each action at once. On a review that is approved or ready, a composer of a comment, a reply or
249
+ a message in the conversation has a second button beside its submit, Comment and mark not ready, which posts the
250
+ message with the mark needs input. Ctrl or Cmd with Enter posts it without the mark.
246
251
 
247
252
  A change of base, a change of project, a note and Done act at once in both modes. Drafts are kept on the server's
248
253
  disk, outside git, and survive a reload and a restart.
@@ -405,21 +410,38 @@ Set project, picks a project in use, takes a new name, or drops the project.
405
410
 
406
411
  An open review is in one of three states, read from what the review holds:
407
412
 
408
- - **Approved**: the reviewer's latest verdict is Approve, the branch's head is still the head that Post all saw, and
409
- no other change came after it. A Post all that saw no head, because the branch was gone or the review was written
410
- before writes recorded heads, approves nothing.
413
+ - **Approved**: the reviewer approved the branch with a Post all, the branch's head is still the head that Post all
414
+ saw, and nothing since ended the approval. A Post all that saw no head, because the branch was gone or the review
415
+ was written before writes recorded heads, approves nothing.
411
416
  - **Ready**: approved, and the author gave the ready signal, `coduck ready`, after that Post all: nothing more is
412
417
  in flight.
413
418
  - **Needs input**: every other open review.
414
419
 
415
- A change is what can make a reader look again: another head of the branch than the one a write saw (every write
416
- records the head it saw, so a new commit, a reset, a rebase and a deleted branch all count, whatever the commits'
417
- times), a new description, a new base, a message (a new thread, a reply, a message in the conversation, by either
418
- side, or a Post all after the approving one), or a thread opened again. A change ends an approval and the ready signal with it, so a review that was approved goes
419
- back to needs input. What an approving Post all writes itself, its drafts and its summary, is part of the approval.
420
- None of these is a change: a note, the author taking in edits with `coduck pull`, a resolve, a change of project,
421
- an edit or a suggestion applied by the reviewer and its withdrawal, a migration, an approval and the ready signal.
422
- A commit on the base is no change either. A finished review has no such state.
420
+ An approval, and the ready signal with it, ends when:
421
+
422
+ - the branch's head is another than the one the approving Post all saw: every write records the head it saw, so a
423
+ new commit, a reset, a rebase and a deleted branch all count, whatever the commits' times;
424
+ - the description or the base is another than the one the approving Post all left, by either side, a description
425
+ drafted in Scratch mode and posted with Post all included; what that Post all wrote itself is part of the
426
+ approval, and a description or a base changed back to what it was ends nothing;
427
+ - a message is posted with the mark needs input, by either side: in the page with Comment and mark not ready, a
428
+ second button beside the submit of a comment, a reply or a message in the conversation in Direct mode, or the
429
+ third choice of Post all; with the command, `coduck reply -i` or `coduck comment -i`, also together with `-w`.
430
+
431
+ A message without the mark ends nothing, whoever writes it: a reply, a new thread, a message in the conversation,
432
+ a Post all with the verdict Comment. Nor does any of these: a resolve or a reopen, a note, the author taking in
433
+ edits with `coduck pull`, a change of project, an edit or a suggestion applied by the reviewer and its withdrawal,
434
+ a migration, an approval, the ready signal, a commit on the base. What is new for the reviewer
435
+ does not depend on the mark: every message is new for them as [What is new for you](#what-is-new-for-you) says,
436
+ with the mark or without it. A finished review has no state.
437
+
438
+ The mark is for a message that asks something of the other side or reports something that needs their action, such
439
+ as a check that failed upstream; an acknowledgement, or a report that needs nothing, goes without it. It is recorded
440
+ as an event `needs-input` at the end of the conversation, in the commit of its message, under the writer's name and
441
+ on their side, and the conversation shows it as a line, "NAME marked the review as needing input". The page offers
442
+ it only on a review that is approved or ready. A command takes `-i` on any open review, where it changes the state
443
+ only of an approved or ready one, and a finished review refuses it. The mark is no one's word in the conversation:
444
+ which threads `coduck show -u` lists does not depend on it.
423
445
 
424
446
  **Approve**, a verdict of Post all, says the reviewer is satisfied with the branch as it stands. The review stays
425
447
  open, so that later changes, such as a fix for a check that fails upstream, come back in the same review, and the
@@ -450,6 +472,9 @@ word is the author's is no reason by itself: once you have written anywhere in t
450
472
  read from the review alone, so `coduck list` and other tools see the same; what this browser last showed is the
451
473
  row's own "N new".
452
474
 
475
+ A message with the mark needs input (see [The state of a review](#the-state-of-a-review)) counts here as any
476
+ message does: the mark changes none of these reasons.
477
+
453
478
  ### Notes
454
479
 
455
480
  A note is a fact about a review that nobody is asked to answer, such as where its pull request is or which review
@@ -537,7 +562,9 @@ Two sessions under two names can work on one review, and each one's writes, note
537
562
  with their ids, oldest first, every thread and the pending edits, and last the line `version: <id>`. A note's
538
563
  first line is `note <id> by NAME at TIME`, with `, changed by NAME at TIME` once it was changed, and its Markdown
539
564
  follows, indented. A message that a session posted for the reviewer shows its author as
540
- `REVIEWER (through NAME)`, NAME being that session. With `-u` it prints only what waits on the caller, the name
565
+ `REVIEWER (through NAME)`, NAME being that session. The conversation shows the ready signal as
566
+ `NAME gave the ready signal at TIME` and the mark needs input as `NAME marked the review as needing input at
567
+ TIME`. With `-u` it prints only what waits on the caller, the name
541
568
  `-n` gives or else `coduck.cliuser`: the open threads whose last word is another name's, and the pending edits;
542
569
  a message the caller posted for the reviewer is the caller's own word. Each thread's first
543
570
  line says where its lines are now, as `now lines 23 to 24`, or that it is outdated, with its place when it has
@@ -566,10 +593,13 @@ between is missed, from the reviewer or from another session under another name.
566
593
 
567
594
  ### Answering
568
595
 
569
- - `coduck reply [-r [REPO/]N] [-w] THREAD FILE` adds a message to a thread; THREAD is a thread id or
596
+ - `coduck reply [-r [REPO/]N] [-w] [-i] THREAD FILE` adds a message to a thread; THREAD is a thread id or
570
597
  `conversation`.
571
- - `coduck comment [-r [REPO/]N] [-w] PATH:N[-M] [old] FILE` starts a thread on lines N to M of a file at the head
572
- of the branch, or with the word `old` on the lines of the merge base.
598
+ - `coduck comment [-r [REPO/]N] [-w] [-i] PATH:N[-M] [old] FILE` starts a thread on lines N to M of a file at the
599
+ head of the branch, or with the word `old` on the lines of the merge base.
600
+ - `-i`, on either, posts the message with the mark needs input, also together with `-w`: on an approved or ready
601
+ review it ends the approval and the ready signal; see [The state of a review](#the-state-of-a-review). It is
602
+ taken on any open review and refused, with exit 1 and nothing written, on a finished one.
573
603
  - `coduck resolve [-r [REPO/]N] THREAD` and `coduck reopen [-r [REPO/]N] THREAD`.
574
604
 
575
605
  ### Posting for the reviewer
@@ -581,8 +611,9 @@ reads it when it runs, on the reviewer's side, and both also record the name the
581
611
  gives or else `coduck.cliuser`: each event as `through`, and the commit in a trailer `Through`. A new thread
582
612
  records it on its opening as well as on its message. A `Through` trailer counts only beside `Role: reviewer`.
583
613
 
584
- It is the reviewer's word: it is a message and so a change that ends an approval, the page shows it under the
585
- reviewer's name, and it answers what the author's side wrote before it, so that those messages are no longer [new
614
+ It is the reviewer's word: with `-i` it carries the mark needs input on the reviewer's side, recorded with the
615
+ same `through`, and ends an approval as the reviewer's own mark does; the page shows it under the reviewer's name,
616
+ and it answers what the author's side wrote before it, so that those messages are no longer [new
586
617
  for the reviewer](#what-is-new-for-you). It is no look at the review: commits, a new description or base and the
587
618
  ready signal that were new for the reviewer stay new, and a review the reviewer has not written in themselves stays
588
619
  not reviewed yet. For `wait` and `show -u` it is the posting session's own: it is news for every other name and
@@ -627,10 +658,12 @@ An edit still pending when the review is marked done is never taken in.
627
658
  ### Saying it is ready
628
659
 
629
660
  `coduck ready [-r [REPO/]N]` gives the ready signal on an approved review: nothing more is in flight. It writes a
630
- `ready` event in the conversation, in one commit named `ready`, and prints `review N is ready`. It is refused, and
631
- exits 1, unless the review is approved with no change since the approval; on a review that is ready already it
632
- writes nothing and exits 0. It is news for the reviewer and no change. Anything written or committed after it that
633
- is a change, such as a commit or a message, takes the review back to needs input.
661
+ `ready` event in the conversation, in one commit named `ready`, and prints `review N is ready`. It is given on a
662
+ review that is approved, as [The state of a review](#the-state-of-a-review) has it, and refused, with exit 1, on any
663
+ other, so also after a message with the mark needs input until the reviewer approves again; on a review that is
664
+ ready already it writes nothing and exits 0. It is news for the reviewer and ends nothing. After it, another head
665
+ of the branch, a new description or base, or a message with the mark needs input takes the review back to needs
666
+ input; a message without the mark, by either side, leaves it ready.
634
667
 
635
668
  ### Notes
636
669
 
@@ -1167,25 +1200,26 @@ event per line, the pending edits under `edits/`, and a file per note under `not
1167
1200
  was added, its place in the order the notes were added, its Markdown and, once it was changed, who changed it, on
1168
1201
  which side and when, and a file per run specification under `specs/`: its name, Python version and requirements,
1169
1202
  who made it, when and in which place of their order, and once it was changed, who changed it and when. The
1170
- conversation's log also holds the ready signals. Each commit's message names the action on its first line,
1171
- and as trailers below it the branch head and merge base the review compared then (`Head`, `Merge-Base`), the side
1172
- that wrote it (`Role`, `reviewer` or `agent`), for a message a command posted for the reviewer the name it was
1173
- posted through (`Through`), and the version of CoDuck that wrote it (`Coduck`; `Redline` on a commit written through
1174
- format 5, when CoDuck had that name). Each event records its author and
1175
- its side as `author` and `role`, and a message and the opening of a thread that a command posted for the reviewer
1176
- the name they were posted through as `through`.
1203
+ conversation's log also holds the ready signals and the marks needs input. Each commit's message names the action
1204
+ on its first line, and as trailers below it the branch head and merge base the review compared then (`Head`,
1205
+ `Merge-Base`), the side that wrote it (`Role`, `reviewer` or `agent`), for a message a command posted for the
1206
+ reviewer the name it was posted through (`Through`), and the version of CoDuck that wrote it (`Coduck`; `Redline` on
1207
+ a commit written through format 5, when CoDuck had that name). Each event records its author and its side as
1208
+ `author` and `role`, and a message, the opening of a thread and the mark needs input that a command posted for the
1209
+ reviewer the name they were posted through as `through`.
1177
1210
 
1178
1211
  `review.json` holds `format`, the number of the form the review is stored in; a review without it is in format 1,
1179
1212
  everything written before version 0.9.0, format 2 what 0.9.0 and 0.10.0 wrote, and format 3 what 0.11.0 and 0.12.0
1180
1213
  wrote, which added the ready signal and notes, format 4 what 0.13.0 to 0.14.3 wrote, which added `through`, and
1181
1214
  format 5 what the last version named redline wrote, which was never released and added run specifications. Through
1182
- format 5 CoDuck was named redline, and a review was the ref `refs/redline/<number>`. This version writes and reads
1183
- format 6, which is format 5 under the ref `refs/coduck/<number>`. The package ships a JSON Schema (draft 2020-12) for each format, under
1215
+ format 5 CoDuck was named redline, and a review was the ref `refs/redline/<number>`. Format 6, what 0.15.0 and 0.15.1
1216
+ wrote, is format 5 under the ref `refs/coduck/<number>`. This version writes and reads format 7, which adds the mark
1217
+ needs input, an event of the conversation. The package ships a JSON Schema (draft 2020-12) for each format, under
1184
1218
  `coduck/schema/<format>/` in the installed package and `src/coduck/schema/` in its source: `review.schema.json` for
1185
1219
  `review.json`, `event.schema.json` for one line of a thread's log, `edit.schema.json` for the record of an edit,
1186
- from format 3 `note.schema.json` for a note, and from format 5 `spec.schema.json` for a run specification. Format
1187
- 6's are strict: they name every field and allow no other, and allow `through` only beside the role `reviewer`.
1188
- Format 1's say what earlier versions could write.
1220
+ from format 3 `note.schema.json` for a note, and from format 5 `spec.schema.json` for a run specification. The
1221
+ schemas of formats 6 and 7 are strict: they name every field and allow no other, and allow `through` only beside the
1222
+ role `reviewer`. Format 1's say what earlier versions could write.
1189
1223
 
1190
1224
  A version reads one format. A review in an older one is refused wherever it is read, by every command and by the
1191
1225
  server, with `review N of REPO is in format F; run coduck migrate`, and one in a newer format with `written by a
@@ -1219,6 +1253,10 @@ what the browser kept for the page under the old name: paste the key that `coduc
1219
1253
  every review shows as unread once. The settings are not taken over either: set `coduck.webuser` and
1220
1254
  `coduck.cliuser` where `redline.webuser` and `redline.cliuser` were set.
1221
1255
 
1256
+ The step to format 7 changes nothing but the format. The state of a review is read by the rule of this version
1257
+ whatever format its past was written in: an open review whose approval only messages without the mark followed is
1258
+ approved again after the migration, and ready when the ready signal came after that approval.
1259
+
1222
1260
  On an upgrade, stop the server, install the new version, run `coduck migrate`, and start the server again, so that
1223
1261
  no server of the older version writes into a review of the new format.
1224
1262
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "coduck"
3
- version = "0.15.1"
3
+ version = "0.15.2"
4
4
  description = "A local review tool that keeps code reviews in git refs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "coduck"
3
- version = "0.15.1"
3
+ version = "0.15.2"
4
4
  description = "A local review tool that keeps code reviews in git refs"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: coduck
3
- description: Work with local code reviews in CoDuck, which keeps each review of a branch in a git ref of its repo and shows it to the reviewer in a web page served on localhost. Use when you are asked for a review of a branch in CoDuck, or your instructions say an effort's work is reviewed there; covers the name you write under, opening the review and writing its description, the loop of reading what waits on you, answering and waiting, posting a message for the reviewer when they tell you to, taking in the reviewer's edits with coduck pull and committing them, changing the base and the project, writing and checking epic and task files, the states of a review, what an approval means and the ready signal you give after it, notes, how a review ends with Done, and what you never do.
3
+ description: Work with local code reviews in CoDuck, which keeps each review of a branch in a git ref of its repo and shows it to the reviewer in a web page served on localhost. Use when you are asked for a review of a branch in CoDuck, or your instructions say an effort's work is reviewed there; covers the name you write under, opening the review and writing its description, the loop of reading what waits on you, answering and waiting, posting a message for the reviewer when they tell you to, taking in the reviewer's edits with coduck pull and committing them, changing the base and the project, writing and checking epic and task files, the states of a review, when a message carries the mark needs input, what an approval means and the ready signal you give after it, notes, how a review ends with Done, and what you never do.
4
4
  ---
5
5
 
6
6
  # Work with a CoDuck review
@@ -67,8 +67,8 @@ NAME show` before you replace it with `coduck -n NAME describe FILE`.
67
67
 
68
68
  1. `coduck -n NAME show -u` prints only what waits on you: every thread that is open, the conversation among them,
69
69
  whose last word is another name's (a message, a reopen, an applied suggestion or a verdict; a change of base or
70
- of project is no one's word), and the pending edits. A resolved thread is not open. Its last line is
71
- `version: <id>`; keep that id. Without `-u`, `show` prints the review's title, branches and state, its
70
+ of project and a mark needs input are no one's word), and the pending edits. A resolved thread is not open. Its
71
+ last line is `version: <id>`; keep that id. Without `-u`, `show` prints the review's title, branches and state, its
72
72
  description, every thread and the pending edits; `-j` prints JSON with the version as a field.
73
73
  2. Act on each item: answer every thread that waits on you, change what was asked, and take pending edits in with
74
74
  `coduck -n NAME pull` (below).
@@ -124,6 +124,13 @@ of someone else.
124
124
  name and none for yours, so post for the reviewer under a name of your own, never under the name of a session
125
125
  that waits on the review, which would then not wake. Only messages can be posted so: `-w` exists on `reply` and
126
126
  `comment` alone.
127
+ - `-i` on `reply` and `comment` posts the message with the mark needs input, also together with `-w`: on an
128
+ approved or ready review it ends the approval, and the ready signal with it, so the review needs the reviewer
129
+ again. Use it when your message asks something of the reviewer or reports something that needs an action of
130
+ theirs, such as a question you cannot go on without, a check that failed upstream, or a change you made after the
131
+ approval that they must look at. Never use it for an acknowledgement ("done", "thanks", "merged it"), and never
132
+ for a report that needs nothing of them. A message without `-i` takes no review out of approved or ready. With
133
+ `-w`, use `-i` only when the reviewer told you to mark their message so.
127
134
  - Leave resolving to the reviewer unless you are asked to resolve a thread (`coduck -n NAME resolve THREAD`, and
128
135
  `coduck -n NAME reopen THREAD`).
129
136
  - A suggestion in a message of the reviewer's is theirs to apply in the page. Once applied, it reaches you as a
@@ -244,23 +251,27 @@ project, it added nothing for you to answer: act on what `show -u` shows, and wa
244
251
  ## The state of the review
245
252
 
246
253
  An open review needs input, is approved, or is ready; `coduck list` and `coduck -n NAME show` print the state. It
247
- is approved while the reviewer's latest verdict is an approval and nothing changed since. A change is another head
248
- of the branch than the one the approval saw (a new commit, and also a reset, a rebase or a deleted branch), a new
249
- description or base, a message by either side (a reply, a new thread, a message in the conversation), or a thread
250
- opened again; a change takes an approved or ready review back to needs input. A note, a run specification, `pull`,
251
- a resolve, a change of project and the ready signal are no change.
254
+ is approved from the reviewer's approval until one of these ends it: another head of the branch than the one the
255
+ approval saw (a new commit, and also a reset, a rebase or a deleted branch), a new description or base, or a message
256
+ with the mark needs input, by either side (yours with `-i`; the reviewer's from the page). The end of an approval
257
+ takes an approved or ready review back to needs input. A message without the mark ends nothing, whoever writes it:
258
+ a reply, a new thread, a message in the conversation, a review the reviewer posts with the verdict Comment. Nor does a
259
+ resolve or a reopen, a note, a run specification, `pull`, a change of project or the ready signal. The conversation
260
+ shows each mark as a line, `NAME marked the review as needing input at TIME`.
252
261
 
253
262
  ## When the reviewer approves
254
263
 
255
264
  An approval means the reviewer is satisfied with the branch as it stands. An approval is no permission to push,
256
265
  merge or commit elsewhere, which keep their own rules. Go on with what your instructions say comes after a review.
257
266
  After an approval, finish what you have in flight, add the notes the reviewer needs for the next step (such as a
258
- link that opens the pull request), then say `coduck -n NAME ready` last. What you write or commit after that and
259
- is a change takes the review back to needs input, so say in plain words what happened and why, for a reader who did
260
- not see what you saw. `ready` is refused unless the review is approved with no change since, and changes nothing on
261
- a review that is ready already. The reviewer sees the ready signal as new until they write or you write again; once
262
- the next step has happened (the pull request exists, the branch was merged), write the note that says where the work
263
- went, which also takes that mark away. Keep waiting: the review is still open, so that later changes, such as a fix
267
+ link that opens the pull request), then say `coduck -n NAME ready` last. A message without `-i` after that leaves
268
+ the review ready, so answer and report as usual. A commit, a new description or base, or a message with `-i` takes
269
+ the review back to needs input: when you need the reviewer again, as for a check that fails upstream, say so in a
270
+ message with `-i`, in plain words of what happened and why, for a reader who did not see what you saw. `ready` is
271
+ given on a review that is approved and refused on any other, so also after a mark until the reviewer approves again,
272
+ and changes nothing on a review that is ready already. The reviewer sees the ready signal as new until they write
273
+ or you write again; once the next step has happened (the pull request exists, the branch was merged), write the note
274
+ that says where the work went, which also takes that mark away. Keep waiting: the review is still open, so that later changes, such as a fix
264
275
  for a check that fails upstream, come back to the reviewer in the same review.
265
276
 
266
277
  ## Notes
@@ -95,8 +95,11 @@ def parser() -> argparse.ArgumentParser:
95
95
  showing.add_argument("-j", dest="json", action="store_true", help="print JSON, in which each thread carries position, its lines while it is current, and place, the lines it sits on, notes holds the notes and specs the run specifications")
96
96
 
97
97
  for_reviewer = "Only a message can be posted for the reviewer, and only where git names the reviewer, by coduck.webuser or else user.name."
98
- replying = command("reply", "add a message to a thread", f"Add a message to a thread, or to the conversation. With -w, post it for the reviewer: it is the reviewer's message, under the reviewer's name and on their side, and it records the caller's name as the one it was posted through. {for_reviewer}")
98
+ marking = "With -i, the message carries the mark needs input, recorded in the conversation: it ends the approval of an approved or ready review, and the ready signal with it, and changes the state of no other open review; a finished review refuses it. A message without the mark ends no approval."
99
+ mark_help = "mark the message needs input, for one that asks something of the reviewer or reports what needs their action; it ends an approval"
100
+ replying = command("reply", "add a message to a thread", f"Add a message to a thread, or to the conversation. With -w, post it for the reviewer: it is the reviewer's message, under the reviewer's name and on their side, and it records the caller's name as the one it was posted through. {for_reviewer} {marking}")
99
101
  replying.add_argument("-w", dest="for_reviewer", action="store_true", help="post the message for the reviewer, through the caller's name")
102
+ replying.add_argument("-i", dest="needs_input", action="store_true", help=mark_help)
100
103
  replying.add_argument("thread", metavar="THREAD", help="a thread id, or conversation")
101
104
  replying.add_argument("file", metavar="FILE", help="the message, or - for standard input")
102
105
 
@@ -104,15 +107,16 @@ def parser() -> argparse.ArgumentParser:
104
107
  sub = command(name, f"{name} a thread", f"{verb} a thread.")
105
108
  sub.add_argument("thread", metavar="THREAD", help="a thread id")
106
109
 
107
- commenting = command("comment", "start a thread on lines of the branch", f"Start a thread on lines of the branch head, or with old of the merge base. With -w, start it for the reviewer: it is the reviewer's thread, under the reviewer's name and on their side, and it records the caller's name as the one it was posted through. {for_reviewer}")
108
- commenting.usage = "coduck comment [-h] [-r [REPO/]N] [-w] PATH:N[-M] [old] FILE"
110
+ commenting = command("comment", "start a thread on lines of the branch", f"Start a thread on lines of the branch head, or with old of the merge base. With -w, start it for the reviewer: it is the reviewer's thread, under the reviewer's name and on their side, and it records the caller's name as the one it was posted through. {for_reviewer} {marking}")
111
+ commenting.usage = "coduck comment [-h] [-r [REPO/]N] [-w] [-i] PATH:N[-M] [old] FILE"
109
112
  commenting.add_argument("-w", dest="for_reviewer", action="store_true", help="start the thread for the reviewer, through the caller's name")
113
+ commenting.add_argument("-i", dest="needs_input", action="store_true", help=mark_help)
110
114
  commenting.add_argument("where", metavar="PATH:N[-M]", help="the file and its lines N to M")
111
115
  commenting.add_argument("rest", nargs="+", metavar="[old] FILE", help="old for the merge base's lines; the message, or - for standard input")
112
116
  commenting.set_defaults(usage=commenting)
113
117
 
114
118
  command("pull", "take in the pending edits", "Apply the review's pending edits to the worktree and its index, oldest first, and mark them taken; committing them is yours. It runs in the worktree of the review's repo that has the review's branch checked out, also with -r REPO/N, and prints a line per edit; the line of an edit that replaced earlier ones ends with the edits it replaces, oldest first.")
115
- command("ready", "say that nothing more is in flight", "Give the ready signal on an approved review: say that nothing more is in flight. Refused unless the review is approved with no change since the approval; on a review that is ready already it writes nothing. A change after it, such as a commit or a message, takes the review back to needs input.")
119
+ command("ready", "say that nothing more is in flight", "Give the ready signal on an approved review: say that nothing more is in flight. Given on a review that is approved, and refused on any other; on a review that is ready already it writes nothing. Another head of the branch, a new description or base, or a message with the mark needs input (reply -i, comment -i) after it takes the review back to needs input; a message without the mark does not.")
116
120
  noting = command("note", "add, change or remove a note", "Add a note to the review: a fact about it that nobody needs to answer, such as where its pull request is, in Markdown of at most 10000 characters. With -e, change note ID; with -d, remove it. A review of any state takes notes. A note changes no state, is new for no one and wakes no waiting caller.")
117
121
  noting.usage = "coduck note [-h] [-r [REPO/]N] (FILE | -e ID FILE | -d ID)"
118
122
  noting.add_argument("-e", dest="change", metavar="ID", help="change note ID to the Markdown of FILE")
@@ -267,7 +271,7 @@ def run(args: argparse.Namespace) -> int:
267
271
  old, file = len(args.rest) == 2, args.rest[-1]
268
272
  record = review.load(git_dir, number).review
269
273
  action = {"kind": "thread", "anchor": review.agent_anchor(git_dir, record, args.where, old), "body": read_text(file)}
270
- made = review.act(git_dir, number, writer, args.command, review.action_of(action))
274
+ made = review.act(git_dir, number, writer, args.command, review.action_of(action), getattr(args, "needs_input", False))
271
275
  print(f"{args.command}: review {number}" + (f", thread {made['thread']}" if "thread" in made else ""))
272
276
  return 0
273
277
 
@@ -372,6 +376,8 @@ def event_lines(item: dict) -> list[str]:
372
376
  return [f" {who} changed the project from {item.get('from', 'none')} to {item.get('to', 'none')} at {at}"]
373
377
  if kind == review.READY:
374
378
  return [f" {who} gave the ready signal at {at}"]
379
+ if kind == review.NEEDS_INPUT:
380
+ return [f" {who} marked the review as needing input at {at}"]
375
381
  return [f" {who} {'resolved' if kind == 'resolve' else 'reopened'} it at {at}"]
376
382
 
377
383
 
@@ -69,7 +69,13 @@ def to_6(git_dir: Path, number: int, current: review.Snapshot) -> dict[str, byte
69
69
  return {"review.json": review.dump(current.review | {"format": 6})}
70
70
 
71
71
 
72
- STEPS: dict[int, Callable[[Path, int, review.Snapshot], dict[str, bytes]]] = {1: to_2, 2: to_3, 3: to_4, 4: to_5, 5: to_6}
72
+ def to_7(git_dir: Path, number: int, current: review.Snapshot) -> dict[str, bytes]:
73
+ """Format 7: the conversation can hold the mark needs input of a message, rule 85; nothing changes but the
74
+ format."""
75
+ return {"review.json": review.dump(current.review | {"format": 7})}
76
+
77
+
78
+ STEPS: dict[int, Callable[[Path, int, review.Snapshot], dict[str, bytes]]] = {1: to_2, 2: to_3, 3: to_4, 4: to_5, 5: to_6, 6: to_7}
73
79
 
74
80
 
75
81
  def finishing(git_dir: Path, number: int, tip: str) -> str: