Repository navigation
Conversation
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
queue.sql is one query: listing (git fetch, then gh pr list), programs (gate.sql or launch.sql per PR with a step due, each its own duckdb process), resulting (each pending review's result file), then the GitHub posts. Every dispatched statement is rendered from a template declared in intent, with the command words as columns. gate.sql is the per-PR program: it reads only the changed files, once per side (git_read_each), and keeps main's rule that a hit main's copy already has is 'existing', not a block. launch.sql reads the rubric files with one read_text, gets title and body from gh in its own process (free text never crosses the queue's shell), and runs the reviewer from REVIEW_CLAUDE, REVIEW_SETTINGS and REVIEW_SCHEMA, which queue.sql declares as data and passes single-quoted in the program's env. queue_seed.json and review_launch.tera are gone. Length (sql_file_too_long): gate.sql 119 lines now holds the changed-file reads, added lines and prompt sections that main's 257-line queue.sql held; queue.sql is 131, launch.sql 24, 274 in all against main's 305. Each is one concern: the tick, one PR's facts, one PR's review launch. Tested: every open PR forced through the rules gate, github_posts from main's queue and this one compared with duck_diff: 13 posts, 9 identical, 4 comments with the same lines in a fixed order (main's order within a file was arbitrary). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
da5b89a to
b40ce81
Compare
|
duckstack/rules: success
duckstack review queue, rule gate (hooks/hook_checks.sql) |
|
duckstack/review: failure
Opus 5.5, duckstack review queue (duckstack-review skill) |
The review queue's tick (
skills/duckstack-review/queue.sql) is now oneWITHquery, following Alok's review of the tick (relayed by the rules session).Shape.
intentdeclares everything the tick uses. That covers each command split by role, put together with same-query aliases: for example,[gh, 'pr', 'list'],['--repo', gh_repo]and the list flags becomelist_concat(gh_pr_list, repo_args, list_flags). It also covers the paths (fromgetenv('HOME'), once), the claude settings and schema, every status description and comment signature (status_texts[context][state],signatures[context]), the GitHub URL templates, the comment template and the GraphQL auto-merge mutation.tera_render.concat('SELECT * FROM read_json($src$', <line>, ' |$src$)'). Dollar quotes, because the commands carry single quotes. The merge base readsread_lines(..., "trim" := true)the same way, so there is no nested quoting.SELECT <row>, '<stage>' AS stage, array_agg(selfdispatch(<statement>)) AS receipts … GROUP BY ALL, thenCROSS JOIN UNNEST(receipts), so each receipt sits beside its own row's columns. There are no parallel lists and noreceipts[n].UNION ALL BY NAMEand unnested once. It flags any non-2xx receipt.git fetchmain and the PR heads, thengh pr list --draft=false --json number,headRefOid. An empty list is zero rows.gh pr view <n> --json id,headRefOid,autoMergeRequest,statusCheckRollup,title,body; thenplannedcomputes the step duegit merge-base origin/main <head>, only for PRs with a step duegate.sql, orlaunch.sqlwhen the review is due, each its ownduckdb -fprocessread_json(<result file>)for a pending review with a result fileThen statuses, signed comments and GraphQL auto-merge go to api.github.com, as
array_agg(quackapi_post(...))grouped by post, with the headers declared inintent.Git.
git_diff_tree,git_treeandread_blobovergit://URIs, with constants from env.row_number(), minus the old file's copies byANTI JOIN. There is no list slice.branch_diffcompares local branches of dev's own repo withorigin/staging, andgit_changeswalks every commit of every branch.Why gate.sql and launch.sql are their own processes. They
.readthe hook's view chain (src,n,tc_src,toolcall_facts, ...), so those names never reach dev's catalog. Each gets its PR as env, built as data: oneMAPper PR, each value sh-quoted by onetera_render('becomes'\''), so a title or body with apostrophes,$or backticks arrives unchanged.The launch.
launch.sql.reads gate.sql, then builds the prompt in one SELECT: the rubric files (a JSON list), the PR's title and body (PR_TITLEandPR_BODY, from the queue's owngh pr view), andreview_prompt.tera. ItCOPYs that row into| (cd … && mkdir -p … && $REVIEW_CLAUDE … > $REVIEW_RESULT.part; mv …) 0<&0 > /dev/null 2>&1 &. sh gives a background job/dev/nullas stdin unless0<&0keeps the pipe.Receipt bodies.
quackapi_postreturns the body as VARCHAR. Each stage casts it once,TRY_CAST(receipt.body AS JSON[]), and reads each field it uses with one->>. The status and error are read as typed fields ofreceipt.Length (
sql_file_too_longwarns). queue.sql is 169 lines: about 40 are the claude schema, settings, status texts, URLs and mutation carried as data inintent, about 20 areintent's split command words, and 19 are the header. gate.sql is 105 lines, about 40 of them moved over from the old queue.sql. launch.sql is 24 lines.Behaviour kept: both statuses and their descriptions; the signed comments; GraphQL auto-merge; results at
~/.duck/review/results/<pr>-<sha12>.json(claude'sstructured_output, and a non-JSON result postserrorwith its text); a re-run when an errored review's result file is removed; base, diff and gate only for PRs with a step due. Every changed file,hooks/check_hits.sqlincluded, is now a section of the reviewer's prompt.Tested, with nothing posted. Old (64742eb) and new ticks, each a copy with posting replaced by its post list and the launch replaced by the gate, run back to back on the same open PRs:
EXCEPT ALLboth ways over every stage's receipts is empty, except theviewingbodies, which now carry title and body, and the gate's two dropped env keys (GH_BIN,GH_REPO, no longer read).pr_added_linesfor Self-dispatch shape is a block; mined rules become hook checks #61: 335 rows on both, withEXCEPT ALLempty both ways (0.10 s / 0.30 s old, 0.26 s / 0.08 s new).',",$HOME, backticks and a newline goes through sh andprintenvunchanged.🤖 Generated with Claude Code