Something went wrong. Try again.
my code lab
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237#+TITLE: diff-based code review tool
Develop a CLI tool that assists in performing a human-driven codereview that loosely models mailing-list style workflow. Given a seriesof jj commits, it should output patch files. User will open the filesand respond inline, as though responding on a mailing list. Tooldoesn't have to do anything at this point other than produce thecommits. At some point there may be a model agent / skill developed,and/or emacs config to assist with using the tool etc.
Default revset is '::@ & mutable()' and can be overriden with -r
* scope** this dir onlyDO NOT refer to files in any other directories for additionalcontext. This is a fully self-contained project - everything we needto implement this tool is here. It is a Unix CLI utility.
When looking at jj commits, ONLY look at the commits that modify filesin this dir.
Scope all jj commands to this dir with path arguments(e.g. =jj diff -r @ -- .=) - the shared working copy containsunrelated changes. If files outside this dir appear in command outputanyway, treat them as nonexistent: do not read, reason about, ormention them.
** current files onlyDO NOT refer to backup files (=some_file~=) for additional context.
** reachable commits, and commits produced this session onlyDO NOT refer to unreachable / abandoned commits that you did notproduce during this session for additional context. You MAY refer tothe reflog of any commits that you produce in this session.
** skill accessDO NOT use the following skills:- /doc-authoring- /fieldstone- /gap-analysis- /iterate- /plan
You MAY use the following skills:- /code-style- /freebsd- /notify-me** pending changes"pending changes" refers to any on-disk changes in the projectdirectory in mutable commits* user-model interaction** communication from model to user and backRead and write =model-comm.org= for two-way communication withuser. This is intended as a buffer for you to ask questions and getresponses from the user, or for user to ask questions and getresponses from you.
All communication from model to user will go under a heading called=from model=. Any headings not =from model= come from user.** model infoAny information you wish to share with user should be a normal(non-TODO) heading under =from model=.
Any replies to user should remove the original user comment andheading, move it to =from model=, and quote the user content.
=model-comm.org= (user turn):#+BEGIN_EXAMPLE * why would you do such a thing? I saw what you did and I don't like it.#+END_EXAMPLE
=model-comm.org= (model turn):#+BEGIN_EXAMPLE * from model ** why would you do such a thing? #+BEGIN_QUOTE I saw what you did and I don't like it. #+END_QUOTE <response from model>#+END_EXAMPLE
** model questionsIf at any point you have blocking questions that prevent you frommaking progress, write your questions to =model-comm.org=
If you have non-blocking questions and are still able to makeprogress, and need to verify your assumptions, write the questions to=model-comm.org= alongside your work.
Questions are written as org-mode TODO headings so I can clearly seewhich ones need to be answered. Write your questions in quoteblocks. My responses will be below them in normal text.
After processing my responses, integrate the information into thework. If questions are now resolved to your satisfaction, delete themfrom =model-comm.org=. If there are no more unresolved questions,delete the file.
Tag blocking questions as =:blocking:=. Blocking questions go at the top
#+begin_example * from model ** TODO the first question :blocking: #+begin_quote What is the average airspeed velocity of an unladen swallow? #+end_quote ** TODO the second question #+begin_quote What is your quest? #+end_quote#+end_example
** user info and questionsUser may include arbitrary feedback in the =model-comm.org=. Whenprocessing users responses, treat this feedback the same as answers toquestions: incorporate it into the work, remove from questions doc ifresolved, ask followup questions if needed.
** inline code feedbackReview pending changes for code comments beginning with =CR:= (forcode review). Integrate the feedback and remove comments onceresolved. CR comments should never be retained in commits.
When it will make future more work clear, record CR comments to=decisions.org= per instructions below.** record decisions to =decisions.org=When processing answers / feedback, record a very concise entry of thedecision to =decisions.org=, newest decision first. Where applicable,include rationale, tradeoffs considered, and alternatives rejected.
Record each decision into a unique heading. The content should beconcise but thorough, using prose and lists to make the informationclear.
#+BEGIN_EXAMPLE * another good decision This is the most recent decision. It changes =some-file- these ways: - part 1 - part 2 * some small decision needing no explanation * we made a very good decision This is the first decision we ever made.#+END_EXAMPLE
Recording decisions includes decisions made at the interactive claudeprompt, i.e. if I instruct you regarding the tool's behavior,incorporate that into the code, docs, tests, as well as decisionrecord.* artifactsWe may discover new artifacts during development process.
- =decisions.org= a concise list of decisions made via the question/answer/feedback process described above. Refer to this for additional context when you have implementation questions, to see if we've already addressed it.
** man pageThe man page should stand alone as a reference for a skilledoperator. That is, an operator ought to be able to read the man page,and understand how to use the tool to accomplish their desired result.
The man page must include all of the information that the operatorneeds to use the tool, and only that information. It describes theinterface and usage. It is not a spec with implementation details.
* development process** iterative, incremental, thin vertical slicesEach commit will be a fully working, consistent, coherent, thinvertical slice of the tool's functionality.
Each commit has:- kyua tests- man page
The tests and man page changes reflect only the behavior introduced bythe implementation change - they never describe behavior that hasn'tbeen implemented yet.
** doc-driven developmentStart by writing an end state man page. We'll continue to iterate onit to understand the interface of this tool.
The diff between end state man page, and committed man page,represents the gap in functionality of what needs to be implemented.
When committing the man page, make sure it accurately describes thecurrent behavior. Rewrite it as needed to ensure that it's clear,consistent, coherent at all times. It will not match the goal man pageuntil the final implementation is done, so it should evolve as neededduring development.** jj squash to older commit procedureAlways edit the working copy and squash changes to a relevant commit(you may need to create a new commit).*** Squash backward, do not commit forwardDO:#+begin_examplejj new -B @ --no-edit -m <tool>: New functionality'jj squash#+end_example
DO NOT:#+begin_examplejj commit -m '<tool>: New functionality'#+end_example
*** commit pointsCommit only at natural commit points - e.g. where a thin verticalslice is added; when artifacts have been produced with no blockingquestions. DO NOT mindlessly commit after every turn. Each commitshould have a clear purpose and be production-ready.
*** partial commitsSquash only the files / lines that are relevant to the commit. You mayneed to use interactive squash to accomplish this.
** rewrite mutable commits for a clean historyWhen incorporating user feedback, you should rewrite mutable commitsas needed to produce a clean history, as though the feedback had beenthere from the beginning all along.
This is not limited to rewriting commits in place: split, combine,reorder, or remove commits to produce the best possible history.** final reviewWhen completing the implementation, do a final review to ensure thatthe code, tests, and documentation all align and all requirements aremet. Ensure that the commit history is the cleanest, clearest possiblehistory where each commit introduces a vertical slice of behavior,along with its tests and documentation.
* future work** cover letter** interdiff