gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc9b48bfec9b48bfeVendor Hybriel plugins; deploy ships bin/ from zig-outKunibertc9b48bfe/lib/review-wake.hl

3.7 KB

  1. $mode = 'static'
  2. import { RULES_VERSION, CALIBRATION, noSuggestions } from './review-prompt.hl'
  3. rules = "Memory rules:
  4. - A thread that is resolved, or where the author replied with a reason you accept, is settled: never raise that point again, not as a new finding and not reworded.
  5. - If the author shows your point was wrong, say so plainly in that thread (start the reply with \"Withdrawn:\") and resolve it; do not restate it.
  6. - If a reply does not convince you and the point still matters, answer in that thread through \"replies\" (thread key, e.g. T3) instead of a new finding. Keep it short.
  7. - If a thread's problem is fixed by the new code, reply briefly with resolve: true.
  8. - \"findings\" holds only NEW points: problems in the new changes, or ones you missed before.
  9. - verdict reflects the whole PR as it stands now: unresolved blocking points still count.
  10. - Scope is exactly .kunibert/pr.diff (merge base..head). Code that arrived by merging the base branch into the PR is not the author's change: never review it and never report it as scope creep."
  11. wakePrompt = (Hybrid state, String sha, Boolean rewritten, Boolean emptyDelta, Hybrid updates, Boolean forced, String specChanged = null) => {
  12. let parts = ['Wake-up: pull request head is now ' + sha.slice(0, 10) + '. The working tree is that commit.']
  13. if (forced) { parts.push('The author asked for a review again: look again at your open threads and the changes below, still within the memory rules below; a full fresh review is @kunibert reset, not this.') }
  14. if (rewritten) { parts.push('The branch history was rewritten since your last review, so there is no reliable delta: re-read .kunibert/pr.diff for what changed.') }
  15. else if (state.head != sha && emptyDelta) { parts.push('New commits since your last review (' + state.head.slice(0, 10) + '..' + sha.slice(0, 10) + ') touch none of this PR\'s files (e.g. a merge from the base branch): there is no new PR code to review.') }
  16. else if (state.head != sha) { parts.push('Changes since your last review (' + state.head.slice(0, 10) + '..' + sha.slice(0, 10) + ', limited to the files of this PR, so changes merged in from the base branch are left out) are in .kunibert/delta.diff. Review those. The whole PR diff, which is the scope, is in .kunibert/pr.diff: a delta hunk that is not part of it came from the base branch.') }
  17. else { parts.push('No new commits since your last review; do not re-review code you already reviewed.') }
  18. if (specChanged == 'changed') { parts.push('The linked tickets changed since your last review: the current text is in .kunibert/spec.md (a later comment overrules the description and earlier comments). Re-read it before you judge the spec axis.') }
  19. else if (specChanged == 'gone') { parts.push('The linked tickets changed since your last review: none is linked or readable now, so there is no .kunibert/spec.md any more.') }
  20. if (updates.length > 0) { parts.push('Updates on your review threads since your last run:') parts.push(updates.join('
  21. ')) }
  22. else { parts.push('No updates on your review threads.') }
  23. if (state.pending.length > 0) { parts.push(state.pending.join('
  24. ')) }
  25. let open = []
  26. for (t of state.threads) { if (!t.resolved && !t.settled) { open.push(t.key) } }
  27. if (open.length > 0) { parts.push('Keys of the threads your last review posted (for "replies"; resolve those the new code fixes):
  28. ' + open.join('
  29. ')) }
  30. parts.push('Settled keys (never raise again): ' + state.settled.join(', '))
  31. if (state.rules == null || state.rules < RULES_VERSION) { parts.push(CALIBRATION) }
  32. parts.push(rules)
  33. parts.push(noSuggestions)
  34. parts.push('Answer in the same JSON format as before (summary, axes, verdict, findings, replies, gates). No gates have run: gates="not run".')
  35. return parts.join('
  36. ')
  37. }

Branches

Latest commits

  • c9b48bfeVendor Hybriel plugins; deploy ships bin/ from zig-outKunibert
  • a41ba15fKunibert: event intake, git cache, review runner, posting, linked tickets, deploy filesKunibert