kunibert
All repositories: gitoria
4.3 KB
$mode = 'static'isList = (value) => {return hlTypeName(value) == 'Hybrid' && JSON.stringify(value).startsWith('[')}require = (Boolean ok, String message) => {if (!ok) { hlError(message) }}parseResult = (String text) => {r = JSON.parse(text.trim())require(hlTypeName(r.summary) == 'String', 'result.summary must be a string')require(isList(r.findings), 'result.findings must be an array')require(isList(r.replies), 'result.replies must be an array')require(hlTypeName(r.axes.correctness) == 'String' && hlTypeName(r.axes.spec) == 'String' && hlTypeName(r.axes.standards) == 'String', 'result.axes must have three string axes')require(['approve', 'comment', 'request_changes'].includes(r.verdict), 'invalid verdict')require(hlTypeName(r.gates) == 'String', 'result.gates must be a string')for (let i = 0; i < r.findings.length; i = i + 1) {let f = r.findings[i]if (!['correctness', 'spec', 'standards'].includes(f.axis)) { f.axis = 'correctness' }require(hlTypeName(f.path) == 'String' && hlTypeName(f.title) == 'String' && hlTypeName(f.body) == 'String', 'invalid finding text')require(hlTypeName(f.line) == 'Number' && f.line >= 1 && f.line % 1 == 0, 'invalid finding line')require(['blocker', 'major', 'minor', 'nit'].includes(f.severity), 'invalid finding severity')r.findings[i] = f}for (reply of r.replies) {require(hlTypeName(reply.thread) == 'String' && hlTypeName(reply.body) == 'String' && hlTypeName(reply.resolve) == 'Boolean', 'invalid reply')}return r}parseEvents = (Hybrid lines) => {let session = nulllet message = ''let error = nulllet usage = { input_tokens = 0, cached_input_tokens = 0, output_tokens = 0 }// Tool executions the model made (kunibert#11): a command_execution item that completed is a success, any other end (failed/declined) a failure.// A tool call that could not even start (missing helper, broken sandbox) makes no item at all, so "no successful command" is the signal.let commandsOk = 0let commandsFailed = 0let spawnFailures = 0for (line of lines) {if (!line.startsWith('{')) { continue }e = JSON.parse(line)if (e.type == 'thread.started' && e.thread_id) { session = e.thread_id }if (e.type == 'item.completed' && e.item.type == 'agent_message' && hlTypeName(e.item.text) == 'String') { message = e.item.text }if (e.type == 'item.completed' && e.item.type == 'command_execution') {if (e.item.status == 'completed') { commandsOk = commandsOk + 1 }else {commandsFailed = commandsFailed + 1out = hlTypeName(e.item.aggregated_output) == 'String' ? e.item.aggregated_output : ''if (out.includes('failed to spawn') || out.includes('bwrap:') || out.includes('Operation not permitted')) { spawnFailures = spawnFailures + 1 }}}if (e.type == 'error' || e.type == 'turn.failed') {error = e.messageif (error == null) { error = e.error.message }if (error == null) { error = JSON.stringify(e) }}if (e.usage != null) {for (key in e.usage) {require(hlTypeName(e.usage[key]) == 'Number', 'invalid usage counter')if (usage[key] == null) { usage[key] = 0 }usage[key] = usage[key] + e.usage[key]}}}return { =session, =message, =error, =usage, =commandsOk, =commandsFailed, =spawnFailures }}// needsCode: the run must have read the code (first review, new head, forced); a wake on an unchanged head may answer from memory.// No result without evidence that the tools worked: no successful command while the code had to be read, or only failed commands that// show a spawn/sandbox failure, is an error, whatever "review" the model wrote (kunibert#11). One failed command among successes is normal.checked = (Hybrid events, Number code, Boolean needsCode = true) => {require(code == 0 && events.error == null, 'codex failed (' + code + '): ' + events.error)require(events.commandsOk > 0 || (!needsCode && events.spawnFailures == 0), 'the model\'s tools failed')require(events.message != '', 'codex produced no final message')return { session = events.session, usage = events.usage, result = parseResult(events.message) }}
Branches
Latest commits
- bd3591c7conductor: gates run on the live day44 binarymre
- 47f747a7records: jukebox #9 fix livemre
- 0a3169fdMerge branch 'vendored-size' into mainKunibert
- e447bb09Vendored size fix: keep renames with an app side whole; type the filter parameter (L10)mre
- 99ccc742Vendored size fix: no renames in the app diff, filter the resumed delta toomre
- 1a52e100|||PR Diff size limit counts only app files when vendored paths are setmre
- 50a1867estatus: jukebox #9mre
- c57484e6log: jukebox #9 diff sizemre
- 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