gitoria

kunibert

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8d34ca338d34ca33records: repo rename (gitoria#53)mre8d34ca33/lib/review-wake.hl

4.5 KB

  1. $mode = 'static'
  2. import { ledger } from './review-memory.hl'
  3. import { RULES_VERSION, CALIBRATION, noSuggestions } from './review-prompt.hl'
  4. rules = "Memory rules:
  5. - 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.
  6. - 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.
  7. - 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.
  8. - If a thread's problem is fixed by the new code, reply briefly with resolve: true.
  9. - \"findings\" holds only NEW points: problems in the new changes, or ones you missed before.
  10. - verdict reflects the whole PR as it stands now: unresolved blocking points still count.
  11. - 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."
  12. freshThreads = (Hybrid state, Hybrid updates) => {
  13. open = []
  14. for (t of state.threads) {
  15. if (!t.vendored && !t.resolved && !t.settled && !state.settled.includes(t.key)) { open.push(t.key + ' ' + t.path + ':' + t.line + ' [' + t.axis + '] ' + t.title) }
  16. }
  17. return '
  18. ' + rules + '
  19. Open threads from earlier reviews:
  20. ' + open.join('
  21. ') + '
  22. Re-check each open thread against the current head. If still valid, do NOT report it again as a new finding: add a reply to that key in replies, with body = a short current assessment and resolve=false. If fixed, reply to that key with resolve=true.
  23. Settled thread ledger (never raise again):
  24. ' + ledger(state, true) + '
  25. Settled keys (never raise again): ' + state.settled.join(', ') + '
  26. Thread updates:
  27. ' + updates.join('
  28. ')
  29. }
  30. wakePrompt = (Hybrid state, String sha, Boolean rewritten, Boolean emptyDelta, Hybrid updates, Boolean forced, String specChanged = null) => {
  31. let parts = ['Wake-up: pull request head is now ' + sha.slice(0, 10) + '. The working tree is that commit.']
  32. if (forced) { parts.push('The author requested another look (@kunibert note or forced wake): look again at your open threads and the changes below, still within the memory rules below; Review again or @kunibert reset starts a fresh session.') }
  33. 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.') }
  34. 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.') }
  35. 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.') }
  36. else { parts.push('No new commits since your last review; do not re-review code you already reviewed.') }
  37. 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.') }
  38. 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.') }
  39. if (updates.length > 0) { parts.push('Updates on your review threads since your last run:') parts.push(updates.join('
  40. ')) }
  41. else { parts.push('No updates on your review threads.') }
  42. if (state.pending.length > 0) { parts.push(state.pending.join('
  43. ')) }
  44. let open = []
  45. for (t of state.threads) { if (!t.resolved && !t.settled) { open.push(t.key) } }
  46. if (open.length > 0) { parts.push('Keys of the threads your last review posted (for "replies"; resolve those the new code fixes):
  47. ' + open.join('
  48. ')) }
  49. parts.push('Settled keys (never raise again): ' + state.settled.join(', '))
  50. if (state.rules == null || state.rules < RULES_VERSION) { parts.push(CALIBRATION) }
  51. parts.push(rules)
  52. parts.push(noSuggestions)
  53. parts.push('Answer in the same JSON format as before (summary, axes, verdict, findings, replies, gates). No gates have run: gates="not run".')
  54. return parts.join('
  55. ')
  56. }

Branches

Latest commits

  • 8d34ca33records: repo rename (gitoria#53)mre
  • 1e05cb3fMerge branch 'repo-rename' into mainKunibert
  • 6ee0d2e9|||PR intake: match a delivery by repo.id and signature, not URLs (gitoria#53 rename)mre
  • 900ffcd4status: routgermre
  • 59b0b793log: routger merge waitmre
  • e52f094alog: routger intake check (hycon#122)mre
  • f979027frecords: design rule livemre
  • 71efaf84Merge branch 'design-guard' into mainKunibert
  • c0656581|||PR Flag removal of a documented design as major unless his recorded yes is linked; rules version 5mre
  • 901cdd75records: L10 update 2 livemre
  • 4a68016bMerge branch 'hl-standard-l10b' into mainKunibert
  • 246d0f30|||PR HL-STANDARD L10 update (hybriel ab293e5a), rules version 4mre
  • 1aa4d64crecords: HL-STANDARD L10 update livemre
  • 2b04c240Merge branch 'hl-standard-l10' into mainKunibert
  • 88c7b09d|||PR HL-STANDARD L10 update (hybriel 5885d688), rules version 3mre
  • 00869ecbrecords: gitoria#50 step 3 livemre
  • f97a0e5fMerge branch 'hl-standard' into mainKunibert
  • 9710e39fType STANDARD as String (L10, Kunibert review)mre
  • 4140b664|||PR Review against HL-STANDARD and cite rule ids (gitoria#50 step 3)mre
  • 75c6888drecords: gitoria#50 step 1 connected and provenmre