Skip to content

RULES.md: settle the writeup's contradictions by date - #77

Merged
asubbarao merged 4 commits into
mainfrom
rules-newer-wins
Oct 19, 2026
Merged

asubbarao merged 4 commits into
mainfrom
rules-newer-wins

Conversation

@asubbarao

Copy link
Copy Markdown
Owner

The what-alok-said writeup listed seven places where his messages disagree with RULES.md. RULES.md was curated on 10-17, so they are settled by date, the writeup's own rule (newer wins):

  • Newer (10-18), RULES.md changes: 12 allows a plain concat for a statement with few holes (templates are for the four shapes); 5 allows one ->> per receipt body field until quackapi returns typed replies.
  • Older, RULES.md stands: dispatch even one statement, dollar quotes, WITH ORDINALITY over array_agg ORDER BY, no regex on backend data, dispatch shape mandatory.

The writeup's section 6 now records the outcome instead of open questions. No hook changes: no check enforces concat chains, and sql_json_extract only warns.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NCnrCZ6kWmagfJjoK8jVGQ

… per receipt field); older ones settled for RULES.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCnrCZ6kWmagfJjoK8jVGQ
@asubbarao
asubbarao enabled auto-merge October 19, 2026 08:22
@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/review: failure

  • skills/self-dispatch/RULES.md:27 RULES.md 5 / check 7 (results come back as columns): The allowance names no shape, so receipt.body ->> 'x' repeated on every field across a query reads as allowed, which is the '100 line ->>' pattern he rejected. 'One per field' also doesn't say where the extraction should happen.
    Rewrite: Until quackapi returns typed replies, a receipt body field may be read with one ->> (no chained arrows), once, in the CTE right after the unnest, which names it as a column for every later reader; no ladders, no from_json structures (10-18).
  • skills/what-alok-said/writeups/2026-10-18.md:393 RULES.md 25 (delete wrong advice; settle contradictions instead of piling them up): Section 6 now settles concat and the single ->>, but sections the PR left alone still contradict it: 2.2 says 'section 6 holds the open concat question' and that the ->> allowance 'is in section 6', 2.10 still says 'no multi-part concat (RULES.md 12, 17; see section 6)' and that the 10-14 ORDER BY message waits 'until he rules', and section 4 item 6 plus its closing line say two rules 'wait on his ruling'. Those are now wrong advice.
    Rewrite: In the same PR, update the stale lines. 2.2: 'Render each row's statement into a sql column (word arrays plus quote_literal, a named template, or a plain concat for few holes; RULES.md 12).' and 'One ->> per receipt body field is allowed until quackapi returns typed replies (RULES.md 5); ladders and from_json structures are out.' 2.2 ordering: 'use WITH ORDINALITY / array_sort (RULES.md 2); the older 10-14 array_agg(... ORDER BY ...) message lost (section 6).' 2.10: 'Otherwise statements are word arrays plus quote_literal, or a plain concat with few holes (RULES.md 12).' Section 4: delete item 6 and change the closing line to 'That is 40 rules a hook could catch, plus the 18 named at the end of section 3.'
  • skills/self-dispatch/RULES.md:49 RULES.md 17 / check 6 (templates are few, canonical, named by shape): The added list says there are four template shapes (sql, shell, network, bash loop fallback), but rule 17 in the same file says templates/ holds five (shell, pipeline, sql, network, loop), so the file now disagrees with itself about which templates exist.
    Rewrite: 12. Readable strings. Arrays of words, a canonical template with holes (rule 17: shell, pipeline, sql, network, loop), or a plain concat when a statement has only a few holes (10-18); no || chains, no chr(39)/chr(10)

Opus 5.5, duckstack review queue (duckstack-review skill)

… drops every 'open / waits on his ruling' line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCnrCZ6kWmagfJjoK8jVGQ
@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/review: failure

  • skills/self-dispatch/RULES.md:50 RULES.md 25 (delete wrong advice) / duckstack-review check 6: Rule 12 now allows a plain concat, but this PR leaves duckstack-review check 6 ('Statements come from word arrays and quote_literal, or a generic tera template') and manifesto §3 unchanged. Reviewers will flag the newly allowed concat, and 'few holes' has no bound, while writeup section 3 calls 'concat chains over two parts' hook-checkable.
    Rewrite: 12. Readable strings. Arrays of words, a canonical template with holes (rule 17: shell, pipeline, sql, network, loop), or one plain concat of at most two holes (10-18); no || chains, ... — and in the same PR change duckstack-review SKILL.md check 6 to: "Statements come from word arrays and quote_literal, a generic tera template that only substitutes, or one concat of at most two holes (RULES.md 12)."
  • skills/what-alok-said/writeups/2026-10-18.md:391 RULES.md 17 / RULES.md 25: This line says templates are for four shapes (sql, shell, network, bash loop fallback), but RULES.md 12 and 17 as changed in this PR list five canonical templates (shell, pipeline, sql, network, loop), so the settled outcome disagrees with the rule it claims to record.
    Rewrite: - Concat for a statement with few holes (10-18): templates are for the canonical shapes in RULES.md 17 (shell, pipeline, sql, network, loop); a plain concat is enough otherwise. RULES.md 12 now says so.

Opus 5.5, duckstack review queue (duckstack-review skill)

…he writeup agree with RULES.md 12 and 17

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCnrCZ6kWmagfJjoK8jVGQ
@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/rules: success

  • existing sql_vague_cte_names in skills/duckstack-review/SKILL.md#2.sql: Name every CTE for what it holds (content_first_100, self_dispatch), not t / x / sd / tmp.
  • existing sql_vague_cte_names in skills/duckstack-review/SKILL.md#5.sql: Name every CTE for what it holds (content_first_100, self_dispatch), not t / x / sd / tmp.

duckstack review queue, rule gate (hooks/hook_checks.sql)

@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/review: failure

  • skills/what-alok-said/writeups/2026-10-18.md:232 RULES.md 12, 17: 'a plain concat with few holes' and 'Templates only for statements with many holes' (line 231) don't match RULES.md 12/17. Those rules allow any canonical-shape template and limit concat to one call with at most two holes.
    Rewrite: - Templates come from the canonical set by shape (RULES.md 17: shell, pipeline, sql, network, loop). Otherwise statements are word arrays plus quote_literal, or one plain concat of at most two holes (RULES.md 12).
  • skills/what-alok-said/writeups/2026-10-18.md:61 RULES.md 12: 'a plain concat for few holes' is looser than RULES.md 12's 'one plain concat of at most two holes', so a reader of the writeup could justify a concat with three or more holes.
    Rewrite: (word arrays plus quote_literal, a named template, or one plain concat of at most two holes; RULES.md 12)
  • skills/self-dispatch/RULES.md:27 RULES.md 13 (internal contradiction): The new allowance of one ->> per receipt body field clashes with rule 13, which still bans 'selector-taking extractors in committed code' with no exception, so the rules file now says two different things about the same expression.
    Rewrite: In rule 13 change the clause to: "json_extract ladders and selector-taking extractors in committed code (except the single ->> per receipt body field allowed by rule 5)", and keep line 27 as written.

Opus 5.5, duckstack review queue (duckstack-review skill)

… concat bound everywhere

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCnrCZ6kWmagfJjoK8jVGQ
@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/rules: success

  • existing sql_vague_cte_names in skills/duckstack-review/SKILL.md#2.sql: Name every CTE for what it holds (content_first_100, self_dispatch), not t / x / sd / tmp.
  • existing sql_vague_cte_names in skills/duckstack-review/SKILL.md#5.sql: Name every CTE for what it holds (content_first_100, self_dispatch), not t / x / sd / tmp.

duckstack review queue, rule gate (hooks/hook_checks.sql)

@asubbarao

Copy link
Copy Markdown
Owner Author

duckstack/review: success

No findings.

Opus 5.5, duckstack review queue (duckstack-review skill)

@asubbarao
asubbarao merged commit b1cd8e5 into main Oct 19, 2026
3 checks passed
@asubbarao
asubbarao deleted the rules-newer-wins branch October 19, 2026 08:37
asubbarao added a commit that referenced this pull request Oct 19, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant