kunibert
All repositories: gitoria
2.4 KB
$mode = 'static'import { run } from 'hl:proc'import { require } from './review-output.hl'// Read the optional ignore file from the exact PR HEAD, also before a worktree exists.vendoredPaths = (String repo, String head, Hybrid configured) => {prefixes = []for (p of configured) { if (p != '' && !prefixes.includes(p)) { prefixes.push(p) } }names = run(['git', 'ls-tree', '--name-only', head, '--', '.kunibertignore'], { cwd = repo, timeout = 30 })require(names.exit == 0, 'cannot look up .kunibertignore at PR head')if (!names.lines.includes('.kunibertignore')) { return prefixes }file = run(['git', 'show', head + ':.kunibertignore'], { cwd = repo, timeout = 30 })require(file.exit == 0, 'cannot read .kunibertignore at PR head')for (line of file.lines) {p = line.trim()if (p != '' && !p.startsWith('#') && !prefixes.includes(p)) { prefixes.push(p) }}return prefixes}isVendored = (String path, Hybrid prefixes) => {for (p of prefixes) { if (path.startsWith(p)) { return true } }return false}// Keep old keys stable, but settle these threads before thread updates and wake prompts.settleVendored = (Hybrid state, Hybrid prefixes) => {for (let i = 0; i < state.threads.length; i = i + 1) {t = state.threads[i]if (isVendored(t.path, prefixes)) {t.vendored = truet.settled = trueif (!state.settled.includes(t.key)) { state.settled.push(t.key) }state.threads[i] = t}}return state}// Only app findings enter applyResult: framework findings never get a thread key.appResult = (Hybrid result, Hybrid prefixes, Hybrid state, String link) => {app = []framework = []for (f of result.findings) {if (isVendored(f.path, prefixes)) { framework.push(f) } else { app.push(f) }}replies = []for (r of result.replies) {let vendored = falsefor (t of state.threads) { if (t.key == r.thread && t.vendored) { vendored = true } }if (!vendored) { replies.push(r) }}result.findings = appresult.framework = frameworkresult.replies = repliesresult.vendoredLink = linkif (prefixes.length > 0) {result.verdict = app.length == 0 ? 'approve' : 'comment'for (f of app) { if (f.severity == 'blocker' || f.severity == 'major') { result.verdict = 'request_changes' } }}return result}
Branches
Latest commits
- 795a20carecords: guard fix live (PR 8)mre
- 6981d96fMerge branch 'fresh-on-nocmd' into mainKunibert
- 37c47840runner: one shared prompt for both fresh-session fallbacks (L16)mre
- f945d2e1|||PR runner: a resumed run with no command on a new head gets one fresh session instead of a tool errormre
- 10b2a49estatus: PR 314, guard fix proposedmre
- e73995a3log: hycon PR 314 approved after fresh reviewmre
- f60427falog: hycon PR 314 false tool errormre
- 481974f7log: Hermes accepts PR 259 findingmre
- bb0976acrecords: hycon PR 259 design findingmre
- 5c637c24records: hycon PR 259 false tool errormre
- a344c406log: routger 132 reviewedmre
- 56e70dcbrecords: review time limit 1800 s (routger 132)mre
- c3a304c5Merge branch 'job-timeout' into mainKunibert
- 402bfeb0|||PR runner: the model run uses the job's time limit (jobTimeoutSeconds), not a fixed 900 smre
- 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