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/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) |
1 similar comment
|
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) |
1 similar comment
|
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/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) |
1 similar comment
|
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) |
Mined all 5,361 of Alok's SQL/dispatch prompts (Claude + Codex, 09-14 to 10-18) with the agent-stream skill's prompts query. RULES.md gains rules 28-49; 16 of them are now hook checks (shellfs tail/head, timeout, sed/awk, sleep, nested duckdb, curl to /sql, exit hacks, _auto readers, nested replace, list_transform(range), range dispatch sources, row_to_json, first/last_value, QUALIFY, /Users paths, read_text pipes). The dispatch shape check now blocks: canonical template by name, selfdispatch macro, array_agg + CROSS JOIN UNNEST. duckstack-review gets a self-dispatch checklist covering status, unparsed bodies and timeouts; its examples use the canonical templates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pipe checks share one fact, sql_shellfs_pipe_words, in toolcall_facts.
- || true check is a list_filter over terms, not a list of booleans.
- unnest ban scoped to receipts; rule 2 owns ordering (WITH ORDINALITY only numbers).
- Rule 17 names the three templates that exist (shell, sql, bash_loop fallback).
- Review examples use getenv('HOME') for template_path and a $opt$ options string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A checked-in .sql run with duckdb -f as its own process (how the hooks and the review queue's per-PR programs run) is not the nested inline program the rule bans. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e QUALIFY check - toolcall_facts keeps one word list per shellfs command (sql_shellfs_pipes), so co-occurrence checks (duckdb + -c, curl + :9495) stay inside one command. - sql_uses_canonical_template is the one place the template names live. - sql_qualify folded into sql_row_number_pick (any QUALIFY warns). - list_transform(range) check reads args[1] directly. - Manifesto and the UNNEST hook message: array_agg ORDER BY orders, ORDINALITY numbers. - Rule 43 drops the secondhand 'len(array_agg) is a count' line; Alok's own 10-05/10-08 words recommend len(array_agg). - Session example: no options string, read_json detects NDJSON; adds failed flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
toolcall_facts matches each statement's tera_render literals against glob(~/.duck/deploy/skills/self-dispatch/templates/*.tera), inside sql_statement_facts so the AST parse is shared (a separate view re-parsed and ran out of memory). Same peak memory and time as main on the same inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tera_render node joins the folder's files by name, so the separate CTE, its DISTINCT, the HOME concat and the final join are gone. Tested on two events: a dispatch naming shell.tera passes the shape check, an inline template blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
toolcall_facts parses each shellfs literal with parse_ast_list(…, 'bash') and keeps the programs it runs (basenames, $(...) included) and its words. The pipe checks and sql_shellfs_grep now match executables: 'git log --grep tail' and 'echo "sleep"' no longer fire; '/usr/bin/sed' and '$(sleep 1)' do. The template match is one LEFT JOIN glob inside node_facts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der, split command words RULES 34a-c: the generated statement carries the row's keys (no parallel arrays matched by position); one tera_render per statement; command words split by role and joined with same-query aliases. New block sql_tera_nested: a tera_render inside another's arguments, found from the AST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- RULES 34a: array_agg({key cols..., 'receipt': selfdispatch(sql)}), UNNEST, read
d.key next to d.receipt.* (no parallel arrays).
- RULES 34b: nested tera_render is fine when a statement dispatches further
(an array sent to another host's :9495); sql_tera_nested block removed.
- network.tera: one POST per row; canonical.sql example 4, tested on dev
(nested post to :9495 returned answer 42 with its row's target).
- Rule 17 names the four templates; git comes from dev's duck_tails views.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sql_dispatch_positional: a self-dispatch that indexes an array by a column (array_extract(col, col)) is the parallel-array pairing; the message gives the row+receipt array_agg form. Tested: the parallel form is caught, the struct form passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill's core example aggregated receipts alone, so any agent needing a row's key afterwards invented parallel arrays. It now aggregates the row with its receipt (verified on dev: 46 folders, each receipt beside its folder_name), names the four templates incl. network.tera, allows nesting, and points git at dev's duck_tails views. The description says when to reach for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill now leads with the pure form Alok gave: concat each row's statement, SELECT the row's columns with array_agg(selfdispatch(sql)) GROUP BY ALL, then CROSS JOIN UNNEST, so every receipt sits beside its row (verified on dev, ls -la per folder, all 200). Templates are for statements with many holes. sql_dispatch_shape no longer demands a template (it blocked the plain concat); the template-folder fact is gone. Examples and checklists use the group-by form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SKILL.md headline: hostfs ls(quote_literal(path)) per folder, with the rows dev returned (and the 500 rows a bad column gives); no shell text parsing. - network.tera: dollar-quoted url and body, the post itself as the statement. - canonical example 4 labels dev as dev; says to put another host:9495 in. - toolcall_facts parses each shell literal once (rtrim once). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eturns typed replies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct dispatch shape, rows shown - RULES 34a and the review checklist teach concat(..., quote_literal(path), ...) instead of a || chain - canonical.sql example 4 posts to httpbin, not dev's own /sql - sql_dispatch_shape again requires array_agg over selfdispatch itself; list_transform_range drops f.args[1] - toolcall_facts: one column per line - duckstack-review examples show the rows they returned on dev Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed transcript example - sql_shellfs_exit_hack matches a true or : command in the parsed shellfs pipe instead of substrings; catches ||true, /usr/bin/true and ':', no longer fires on quoted text. - network.tera unnests quackapi_post, so status, reason and body come back as columns. - canonical.sql and self-dispatch SKILL.md examples derive the failed flag. - duckstack-review GOOD example joins open sessions to agent.messages with the filter pushed in, instead of reading whole raw transcripts. - Failed statements are recorded as 422 (measured 10-19), not 500. - RULES.md: main's #77 text wins on rules 2, 17 and 18; rule 28 defers to main's rule 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ede0abf to
1fd0918
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) |
Written by Opus 5.5 (Claude Code) for Alok.
What changed
Dispatch shape blocks (
sql_dispatch_shape). A query that callsselfdispatchmust collect it witharray_agg/list(selfdispatch(...))and read the results back withCROSS JOIN UNNEST. Each row's statement may be a concat or a template; the check does not look at templates. A newsql_dispatch_direct_postcheck blocks hand-writtenquackapi_post(':9495/sql', …)calls.16 new hook checks, all mined from Alok's corrections. They cover:
tail/head,timeout,sed/awk/tr/cut,sleep, nestedduckdb -c, curl to dev, andtrue/:exit hacks;_autoreaders andread_textover a pipe;replace(replace()),list_transform(range()),rangeas a dispatch source,row_to_jsonpassed to Tera,first_value/last_value,QUALIFY, and hard-coded/Users/paths.Each check was tested with a counter-example that fires; a clean
read_csv('cmd |')does not.RULES.md adds rules 28–49, mined from all 5,361 of Alok's SQL and dispatch prompts (Claude and Codex, 09-14 to 10-18). Rebased on main: RULES.md: settle the writeup's contradictions by date #77's text wins on rules 2, 5, 12, 17 and 18, and rule 28 defers to rule 5.
duckstack-review gains a 10-point self-dispatch checklist: rows, concat or template, macro, UNNEST, receipts as columns, status, unparsed bodies, timeouts, narrow statements, and order.
network.tera (new): one request per row to another host, never dev's own :9495; it unnests
quackapi_post, so status, reason and body come back as columns.Found while testing: when a generated statement fails, dev returns a non-200 with the error in the body, and
receipt.errorstays NULL. On 10-19 binder, parser, cast and missing-file errors all came back as 422 (a 500 was seen 10-18). A failure check therefore testsreceipt.status IS DISTINCT FROM 200; every example derives that flag.File length (gate warning sql_file_too_long):
hooks/hook_checks.sqlis one data relation, one row per check. Its single concern is the list of checks, so adding a check adds a row; this PR adds 16.hooks/toolcall_facts.sqlis the hook's parse of a tool call into facts. This PR adds one fact column,shellfs_pipes(each shellfs command parsed with sitting_duck's bash grammar).Splitting either file would scatter one relation across files.
Review rounds:
optionskey).parse_ast_list(…, 'bash')and match the programs it runs.git log --grep tailandecho "sleep"no longer fire;/usr/bin/sedand$(sleep 1)do.sql_shellfs_exit_hacknow uses the parsed pipe (list_has_any(pipe.commands, ['true', ':'])). On six hook events: before,|| truehit,||true,|| /usr/bin/trueand|| :were missed, andecho "a || true b"was a false positive; after, the four hacks hit and the quoted text and a clean pipe do not. The transcript GOOD example joins open sessions toagent.messageswith the filter pushed in: 56 prompt rows, 14.6 KB, where the raw.jsonlread returned 4.5 MB and 10.7 MB bodies and a 507.Known follow-ups (not in this PR)
skills/self-dispatch/references/five_stage_pipeline.sqlstill uses inline$t$statements and::JSON[]over receipt bodies.server/lake.sql,server/ext_catalog.sql,skills/crawl/references/crawl_rows.sqlanduseful_queries.sql. 3 more userangeas a source. Any future PR that edits one of them must convert it./Userspaths,read_textpipes) fire on existing code, includingcanonical.sql'stemplate_path.🤖 Generated with Claude Code