Skip to content

Recipes: nested steps on pages, checker fixes, three refactors and seven new run-on-each recipes - #49

Merged
Murraylr merged 7 commits into
mainfrom
claude/magical-ramanujan-sqmrwy
Oct 8, 2026
Merged

Murraylr merged 7 commits into
mainfrom
claude/magical-ramanujan-sqmrwy

Conversation

@Murraylr

@Murraylr Murraylr commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Update: String-Utility-Belt/string-utility-belt#52 (the seven new recipes) was merged into this branch, so this PR now ships PR 1 and PR 2 together. Its description has the recipe-by-recipe detail, the sponsor-topic decision and the follow-ups. I relabelled this PR release:minor + enhancement: #52's labels don't count, because it merged into this branch rather than main, and new site pages are a minor bump. CI is green on the combined head, and it still merges cleanly with main at 1.7.1 (that release added no CHANGELOG section, so the [Unreleased] entries stay where they are).

What and why

PR 1 of 3 from the "run on each" recipe brief (research/each-recipe-prototypes/TASK.md on claude/practical-wright-7rmlbt, used as read-only reference; nothing from that folder is copied here). It adds the prerequisites the new recipes need, refactors three shipped recipes with each, and, through #52, adds seven new recipes: env-file-to-kubernetes-secret, convert-unix-timestamps-in-json, decode-jwts-in-log-file, remove-tracking-parameters-from-urls, hash-email-list-for-customer-match, extract-domains-from-urls and parse-user-agents-from-access-log.

P1. Nested steps on recipe pages. RecipeArticle now renders what runs inside each, branch and macro steps, recursively. For each nested step it shows the utility link, the label, the changed params (ParamList), the condition (same wording as top-level, plus "ignoring case" for the i flag) and a non-default onError. It also shows the each split ("Each line / value of the JSON object / … goes through:", with "empty ones included" when relevant) and the branch lanes with their merge mode. It is still pure and renderToStaticMarkup-safe, and the pre-rendered /recipes/<slug>/ HTML now contains, for example, the UTM drop list utm_*. The "skip a step" section also names the top-level step that a failing nested step sits in, instead of "a later step".

  • Beyond the brief: I added onError notes ("A line whose steps fail comes out empty."). The JWT and domain recipes depend on onError: empty, and without the note a visitor can't tell why some lines come out blank.

P2. Step counts now read "1 step" or "N steps" through a shared stepCountText(), on the page and on the OG card.

P3. laneEach() and laneBranch() in define.ts, with regex condition flags normalized. branch() and each() are now built on them. CLAUDE.md is updated.

P4. gzip_decompress. fflate's streaming Gunzip checks a header only once it has the whole header. So {, [, } or H4sIAAAA ended with no member and no error, and the trailer check then reported "integrity check failed". It now checks the magic bytes and the 20-byte minimum first, so these inputs report "not valid gzip data…". Tests cover each of those inputs.

P5. Checker loopholes (both done).

  • (a) Utility steps are now counted through containers. One utility wrapped in each fails the "2+ steps" rule; a character-count-per-line-shaped recipe (each → branch with two utilities and a pass-through lane) still passes. Both are tested.
  • (b) A primaryQuery that contains a utility title's head term (the part before " — ", minus a trailing "Online") is refused. I ran it against all 246 utility titles, the 13 shipped queries and the 13 planned ones. It catches only "bulk slug generator" and has no false positives; the shortest head terms are two words ("hex dump", "url parser").

Refactors (each has updated: 2026-10-08; all goldens are byte-identical):

  • excel-column-to-sql-in-clause: each(lines: sql_escape {ansi, wrap}) → join → wrap. The mysql and mssql flavors now work per value. The guide replaces the MySQL backslash workaround with "switch step 3's flavor to mysql" (keeping the NO_BACKSLASH_ESCAPES caveat), explains mssql's N prefix, and says "untick wrap in quotes" for numeric IDs. Snowflake is no longer mentioned.
  • decode-cloudwatch-logs-data (variant C): goes from 6 steps to 4 and still shows the decoded envelope as a step. The kinesis sample is now a 2-record batch (from the research generator), with the same output.
    • Removed limits: only the first record of a batch was decoded, events printed by Python or Node failed, and messages ending in a literal \n failed.
    • New limits in the guide, each one reproduced: a bare value wrapped across lines; \/ escapes; a failed record staying in the output as Base64; CR becoming LF.
    • The no-payload case differs from the brief: pretty-printed JSON with no payload comes back as the input itself, not empty (only one-line JSON gives empty output). The guide says so.
    • The jq one-liners loop over the records of a batch; I ran them against the samples.
  • bulk-utm-link-builder: the lookbehind sed becomes each(lines: unescape_html → query_params_normalize), with all six params explicit. Regression, documented in the guide and CHANGELOG: utm_ tags inside a #fragment or hash route are no longer removed.

Also fixed (found while validating): RecipePage kept running its skip-trace pipelines (1 + one per step) after unmount. The cancelled flag only suppressed setSkip. The runs went through the same executor the next page uses, and they leaked execute calls into the next RecipePage test. The each refactor made those runs slower, so the test began failing intermittently under full-suite load. The effect now aborts with an AbortController: the in-flight run is cancelled and no new one starts. A test reproduces this: it fails with 7 calls without the fix and 2 with it.

⚠️ Browser extension

The published extension (1.4.1) predates each. Once this merges, "Save to extension" on the three refactored recipes and all seven new ones shows "This recipe needs a newer version of the extension" for current extension users; decode-kubernetes-secret already does. The pending manual extension release (would be 1.4.2, already waiting per npm run release -- plan) fixes it. Consider running it before or right after merging. This PR doesn't change the extension or extensionBridge.ts.

Label

release:minor + enhancement, for the seven new recipe pages. On their own, the fixes and refactors would be a patch.

How it was tested

  • New tests:
    • RecipeArticle.test.tsx: nested each-in-each with condition, params and onError; branch lanes, empty lane and merge; static markup; skip naming; singular step count.
    • check.test.ts: both loopholes and headTerm.
    • gzip_decompress: short non-gzip and truncated-header input.
    • RecipePage.test.tsx: abort on unmount.
  • Updated RecipePage.test.tsx for the Excel recipe's new step 3 name. step_count now uses countSteps (analytics counts nested steps), and the extension test uses a fake extension that knows each.
  • npm test, npm run typecheck plus tsconfig.worker.json, e2e, bench and every packages/*/tsconfig.json, and npm run lint.
  • npm run build (including the CSP check from main), npm run check:bundle (within budget), npm run build:seo with OG images, and npm run check:recipes (20/20 plus cross-recipe rules).
  • Checked the pre-rendered HTML for nested steps, and looked at screenshots of the UTM, CloudWatch, JWT, tracking-parameter (1280px) and Excel (390px) pages.

Checklist

  • npm test, npm run typecheck and npm run lint pass
  • New utilities have index.test.ts, guide.md (npm run check:guides -- <id>) and regenerated _generated/ files (npm run gen) (no new utilities; recipe _generated/ regenerated)
  • User-visible changes are noted under ## [Unreleased] in CHANGELOG.md
  • Labelled release:minor (new features) or release:major (breaking changes) if a patch release isn't right
  • If the change affects what data leaves the browser, the privacy policy is updated (no change to data flows)

🤖 Generated with Claude Code

https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz

claude added 4 commits October 8, 2026 00:36
… gzip

The streaming reader checks a header only once it has all of it, so a
few bytes of anything ({, [, a cut-off H4sIAAAA) ended the stream with no
member and no error, and the trailer check reported a failed CRC-32.
Check the magic bytes and the 20-byte minimum first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz
- define.ts: laneEach() and laneBranch() build nested containers with
  regex condition flags normalized, like the top-level builders.
- check.ts: count utility steps through containers, so one utility
  wrapped in run-on-each is no longer a recipe on its own.
- check.ts: refuse a primaryQuery that contains a utility guide title's
  head term ("bulk slug generator" vs /util/slug/). On the 13 shipped
  and 13 planned queries it catches only that one.

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

- RecipeArticle renders the steps inside run-on-each, branch and macro
  steps recursively: utility link, label, changed params, condition,
  failure policy, the each split and the branch merge. The pre-rendered
  page is all a crawler sees, so a setting inside a lane must show there.
- The skip section names the top-level step a failing nested step is in.
- "1 step", not "1 steps", on the page and on the OG card.
- RecipePage aborts its skip-trace runs when the page unmounts, instead
  of running them on while the next page waits for the executor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz
- excel-column-to-sql-in-clause: sql_escape runs per value, so the mysql
  and mssql flavors work (mysql used to merge the column into one value).
- decode-cloudwatch-logs-data: every record of a batch is decoded, events
  printed by Python or Node are found, and a message ending in a literal
  \n no longer fails (6 steps to 4; the kinesis sample is now a 2-record
  batch with the same golden output).
- bulk-utm-link-builder: old utm_* tags are dropped with
  query_params_normalize per link (keys with digits, without = or
  percent-encoded now go too). utm_ tags inside a #fragment stay.

Goldens are unchanged on every sample. Guides, CHANGELOG and CLAUDE.md
updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz
@Murraylr
Murraylr requested a review from a team October 8, 2026 00:37
claude added 2 commits October 8, 2026 03:10
- env-file-to-kubernetes-secret: .env → Secret manifest with data:
  (not stringData, which kubectl's YAML 1.1 reads on/yes/no as booleans)
- convert-unix-timestamps-in-json: flatten → per-value epoch → ISO → unflatten
- decode-jwts-in-log-file: every distinct token's payload, date claims as ISO
- remove-tracking-parameters-from-urls: curated drop list per bare link
- hash-email-list-for-customer-match: Google's normalization, SHA-256 per line
- extract-domains-from-urls: hostname per line with the browser's URL rules
- parse-user-agents-from-access-log: UA field per line → CSV

Guides name each recipe's limits; the pages people paste secrets or
personal data into explain the editor's input history and share links.
decode-kubernetes-secret links back to the .env recipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz
@Murraylr Murraylr mentioned this pull request Oct 8, 2026
5 tasks done
…jan-sqmrwy-recipes

Seven recipes built on run-on-each
@Murraylr Murraylr added enhancement New feature or request release:minor labels Oct 8, 2026 — with Claude
@Murraylr Murraylr changed the title Recipes: show nested steps, close checker loopholes, refactor three recipes with run-on-each Recipes: nested steps on pages, checker fixes, three refactors and seven new run-on-each recipes Oct 8, 2026
@Murraylr
Murraylr merged commit 2f2a314 into main Oct 8, 2026
8 of 9 checks passed
@Murraylr
Murraylr deleted the claude/magical-ramanujan-sqmrwy branch October 8, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants