Repository navigation
Recipes: nested steps on pages, checker fixes, three refactors and seven new run-on-each recipes - #49
Merged
Merged
Conversation
… 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
- 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
5 tasks done
…jan-sqmrwy-recipes Seven recipes built on run-on-each
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
PR 1 of 3 from the "run on each" recipe brief (
research/each-recipe-prototypes/TASK.mdonclaude/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 witheach, 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-urlsandparse-user-agents-from-access-log.P1. Nested steps on recipe pages.
RecipeArticlenow renders what runs insideeach,branchandmacrosteps, 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 theiflag) and a non-defaultonError. 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 andrenderToStaticMarkup-safe, and the pre-rendered/recipes/<slug>/HTML now contains, for example, the UTM drop listutm_*. The "skip a step" section also names the top-level step that a failing nested step sits in, instead of "a later step".onErrornotes ("A line whose steps fail comes out empty."). The JWT and domain recipes depend ononError: 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()andlaneBranch()indefine.ts, with regex condition flags normalized.branch()andeach()are now built on them. CLAUDE.md is updated.P4.
gzip_decompress. fflate's streamingGunzipchecks a header only once it has the whole header. So{,[,}orH4sIAAAAended 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).
eachfails the "2+ steps" rule; acharacter-count-per-line-shaped recipe (each → branch with two utilities and a pass-through lane) still passes. Both are tested.primaryQuerythat 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'sNprefix, 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.\nfailed.\/escapes; a failed record staying in the output as Base64; CR becoming LF.bulk-utm-link-builder: the lookbehind sed becomeseach(lines: unescape_html → query_params_normalize), with all six params explicit. Regression, documented in the guide and CHANGELOG:utm_tags inside a#fragmentor hash route are no longer removed.Also fixed (found while validating):
RecipePagekept running its skip-trace pipelines (1 + one per step) after unmount. Thecancelledflag only suppressedsetSkip. The runs went through the same executor the next page uses, and they leakedexecutecalls into the next RecipePage test. Theeachrefactor made those runs slower, so the test began failing intermittently under full-suite load. The effect now aborts with anAbortController: 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.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-secretalready does. The pending manual extension release (would be 1.4.2, already waiting pernpm run release -- plan) fixes it. Consider running it before or right after merging. This PR doesn't change the extension orextensionBridge.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
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 andheadTerm.gzip_decompress: short non-gzip and truncated-header input.RecipePage.test.tsx: abort on unmount.RecipePage.test.tsxfor the Excel recipe's new step 3 name.step_countnow usescountSteps(analytics counts nested steps), and the extension test uses a fake extension that knowseach.npm test,npm run typecheckplustsconfig.worker.json,e2e,benchand everypackages/*/tsconfig.json, andnpm run lint.npm run build(including the CSP check frommain),npm run check:bundle(within budget),npm run build:seowith OG images, andnpm run check:recipes(20/20 plus cross-recipe rules).Checklist
npm test,npm run typecheckandnpm run lintpassindex.test.ts,guide.md(npm run check:guides -- <id>) and regenerated_generated/files (npm run gen) (no new utilities; recipe_generated/regenerated)## [Unreleased]inCHANGELOG.mdrelease:minor(new features) orrelease:major(breaking changes) if a patch release isn't right🤖 Generated with Claude Code
https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz