kunibert
All repositories: gitoria
3.8 KB
$mode = 'static'\\ THE ONE FILE that knows gitoria's event names and field paths (apps-api.md v0, section 4).\\ When the contract changes (the [OPEN] marks), only this file changes.headerEvent = 'x-push-event'headerDelivery = 'x-push-delivery'headerSignature = 'x-push-signature-256'signaturePrefix = 'sha256='eventNames = ['ping', 'pull_request', 'review_requested', 'review_comment', 'pull_comment', 'review_thread']botMention = '@kunibert'isKnown = (name) => {return name != null && eventNames.includes(name)}\\ the repo id the secret is keyed by; null when the body has nonerepoId = (body) => {if (body.repo == null || body.repo.id == null) { return null }return '' + body.repo.id}\\ `@kunibert reset` / `@kunibert <text>` at the start of a comment: { reset } or { note } or nullmention = (text) => {if (hlTypeName(text) != 'String') { return null }t = text.trim()if (!t.toLowerCase().startsWith(botMention)) { return null }rest = t.slice(botMention.length).trim()if (rest == '') { return null }if (rest.toLowerCase() == 'reset') { return { reset = true } }return { note = rest }}\\ A change a job can use, from one parsed event. Answer: { kind, reason, ... }\\ kind: 'ignore' | 'ping' | 'review' | 'thread-state' | 'close'\\ A review/thread-state change carries: repo, number, head, time, pull, force, reset, threads, notes, replyCandidate.\\ review: starts or updates a review job. thread-state: only records a resolved/settled flip (no review).\\ replyCandidate: a review_comment; the queue makes it threadReplyOnly when it brings no new head.classify = (String name, Hybrid body) => {action = body.actionpull = body.pullif (name == 'ping') { return { kind = 'ping' } }if (pull == null || pull.number == null || repoId(body) == null) { return { kind = 'ignore', reason = 'no repo.id or pull.number' } }change = {kind = 'review'repoId = repoId(body)repo = body.reponumber = pull.numberhead = pull.headtime = body.timepull = pullforce = falsereset = falsethreads = []notes = []delivery = body.deliveryevent = name + '.' + actionreplyCandidate = false}if (name == 'pull_request') {if (action == 'closed' || action == 'merged') { change.kind = 'close'return change }if (pull.draft == true) { return { kind = 'ignore', reason = 'draft pull request' } }if (action == 'opened' || action == 'reopened' || action == 'synchronize' || action == 'ready') { return change }return { kind = 'ignore', reason = 'pull_request.' + action + ' not handled' }}if (pull.draft == true) { return { kind = 'ignore', reason = 'draft pull request' } }if (name == 'review_requested') {change.force = truereturn change}if (name == 'review_comment' && action == 'created') {change.threads.push({ event = 'review_comment.created', thread = body.thread, comment = body.comment })change.replyCandidate = truereturn change}if (name == 'review_thread' && (action == 'resolved' || action == 'unresolved')) {change.threads.push({ event = 'review_thread.' + action, thread = body.thread })change.kind = 'thread-state'return change}if (name == 'pull_comment' && action == 'created') {let m = nullif (body.comment != null) { m = mention(body.comment.body) }if (m == null) { return { kind = 'ignore', reason = 'comment without @kunibert' } }if (m.reset) { change.reset = true change.force = true }if (m.note != null) { change.force = true change.notes.push({ text = m.note, by = body.comment.author }) }return change}return { kind = 'ignore', reason = name + '.' + action + ' not handled' }}
Branches
Latest commits
- 070e01a4Records: parkmre
- bf8af0dcRecords: v1.4 checkedmre
- 44af321bRecords: contract v1.4mre
- 310f3fd0Records: outdated semanticsmre
- 268ebfe6Records: #11 proven live and closedmre
- 88e8aad3Records: K11 verified and deployedmre
- cd4cb09cNo review and status error when the model's tools did not run (kunibert#11)Kunibert
- a6b54efaStatus updatemre
- 5a72268eRecords: #4-#10 done, #11 started, review package on #1mre
- 194c7da6Records: real proof greenmre
- cdfa94a9Records: AppArmor profile for the review sandboxmre
- c1bf02d8Status: sandbox blockermre
- 88aaacc5Records: real proof part 2 (posting works, sandbox blocked by AppArmor userns)mre
- 401df4e8Records: review user logged inmre
- 6ca681b3Records: login command, status cleanupmre
- 6b8d763cRecords: review user, device login startedKunibert
- 07025b99Open the job worktree read-only for the review user before each model runKunibert
- 2a44bd54Runner CLI: --review-user/--codex-bin/--work-dir work in every modeKunibert
- 2177f66fReview model runs as its own unix user (reviewUser, codexBin, workDir)Kunibert
- 35df8306Records: live service on byrodin, real proof part 1Kunibert