Skip to content

Seven recipes built on run-on-each - #52

Merged
Murraylr merged 1 commit into
claude/magical-ramanujan-sqmrwyfrom
claude/magical-ramanujan-sqmrwy-recipes
Oct 8, 2026
Merged

Murraylr merged 1 commit into
claude/magical-ramanujan-sqmrwyfrom
claude/magical-ramanujan-sqmrwy-recipes

Conversation

@Murraylr

@Murraylr Murraylr commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

What and why

PR 2 of 3 from the "run on each" recipe brief. Stacked on String-Utility-Belt/string-utility-belt#49, because it needs that PR's nested-step rendering (otherwise the tracker list, the lane conditions and the nested date conversion would be invisible on the pages) and its laneEach() helper. Merge #49 first; this PR then retargets to main, or retarget it by hand if the base branch isn't deleted automatically.

Each recipe was rebuilt in src/recipes/ from the reviewed draft (nothing was copied from the research folder) and re-verified against current main. Every sample is synthetic: example.com hosts, RFC 5737 IPs, and tokens and payloads produced by the research generators.

Recipe Query Chain
env-file-to-kubernetes-secret env file to kubernetes secret env_to_json (stop on error) → each(values: base64_encode) → wrap in a v1 Secret → json_to_yaml
convert-unix-timestamps-in-json convert unix timestamps in json to dates json_flatten → each(values: timestamp_convert if 10/13-digit epoch, 2008–2033) → json_unflatten
decode-jwts-in-log-file decode multiple jwt tokens extract_preset jwt, unique → each(lines, onError empty: jwt_decode payload → laneEach(values: timestamp_convert if 2014–2033)) → jsonl_to_json
remove-tracking-parameters-from-urls remove tracking parameters from urls unescape_html → each(lines: query_params_normalize with the curated drop list, only on a bare link with a query)
hash-email-list-for-customer-match hash emails for customer match remove spaces/quotes/zero-width → lowercase → Gmail dots → each(lines: SHA-256 if one address)
extract-domains-from-urls extract domain from url list each(lines, onError empty: keep first URL → add https:// if no scheme → url_parse → $.hostname) → drop www.
parse-user-agents-from-access-log parse user agents from access log keep the UA field → each(lines, includeEmpty: user_agent_parse) → jsonl_to_json → json_to_csv (8 columns)

Changes from the drafts, and why:

  • .env: the parse step's why no longer claims "the way dotenv libraries do". It says that an unquoted value ends at # (python-dotenv and Compose), and the guide tells readers to quote values containing # because Node's dotenv cuts at any #.
  • Timestamps: the draft's why said byte counts never match, but 1.2–2 GB byte counts do. It now points to the guide, which lists the false positives: costMicros, 1.2–2 GB byte counts, and 10/13-digit ids starting 12–19.
  • JWT: the raw nested-each literal is now laneEach(), labelled "dates in every claim".
  • Tracking parameters:
    • added __s (Drip), _kx (Klaviyo), ck_subscriber_id (Kit) and _ga, with a _kx link in the email sample;
    • the guide says why si and ref are kept;
    • uses the tightened ONE_LINK_WITH_QUERY lane condition (i flag).
  • Domains: the clean step now also cuts at a comma. A CSV row used to give example.com,home, because commas are legal in a parsed host; a DNS hostname can't contain one, so the cut is safe. A third sample, "Rows of a CSV file", covers it.
  • User agents:
    • Started from discovery/verified/ua-def.ts (8 columns). The query is "parse user agents from access log", which doesn't contain the user_agent_parse head term ("user agent parser").
    • onError: 'stop' on the each. The parser never throws on text, so this only fires past the 100k-item budget, and the run then stops at step 2 with "the input has N lines; one run can process at most 100000" instead of a misleading "invalid JSON" two steps later. I tested both.
    • No raw-UA column. With no JSON-merge or column-paste utility, it needs a 5-step branch inside the each, which makes the page harder to read than the column helps. Rows map 1:1 to input lines (blank lines included), and the guide explains how to paste the CSV beside the source lines. A ua field on user_agent_parse would make it one column name (see follow-ups).
    • A comment in recipe.ts notes that the goldens act as a canary for ua-parser-js bumps.
  • Privacy: the .env, JWT and email guides each have a privacy section. The page itself stores nothing, but "Open in the editor" puts the input in the editor's History (on by default; the History menu → untick remember inputs, clear all), and a share link carries the input in the URL.
  • decode-kubernetes-secret now lists env-file-to-kubernetes-secret as related, in both directions.

Every guide states its limits, and I reproduced each limit against the recipe before writing it down, for example: URL-encoded JWTs, the # fragment and ; queries, &, a label before a URL, health-checker UAs, and the 100k budget.

For you to decide (not done here)

Sponsor topics. src/app/sponsors/topics.ts (new on main) sells explicit page lists, and its comment says a page joins a topic only when it's added there. I left the seven recipes out, because adding them changes what a sponsor buys. Natural fits:

  • env-file-to-kubernetes-secret → kubernetes-cloud
  • decode-jwts-in-log-file → auth-tokens
  • convert-unix-timestamps-in-json → data-formats
  • hash-email-list-for-customer-match → security-hashing

Browser extension

Like the recipes in #49, these use each, so the published extension (1.4.1) shows "needs a newer version" until the pending manual extension release goes out. This PR doesn't touch the extension or the bridge.

Follow-ups (from the brief, not done here)

  • slug perLine param and apostrophe folding
  • punycode_encode perLine and UTS Look up the VS Code publisher member ID in a way that works for an app #46 mapping
  • hash output-format param, and MD5 in hash (the email guide points to the md5 utility instead)
  • a YAML 1.1 compatibility option on json_to_yaml (would quote on/yes/no keys for kubectl)
  • a key-aware condition for json-values items (would fix the timestamp page's false positives)
  • numeric keys in json5_parse
  • new: a ua (raw string) field on user_agent_parse, behind a param, for a raw-UA CSV column

PR 3 (five tier-2 recipes) is on hold until these pages have traffic data, as agreed.

Label

release:minor + enhancement: these are new site pages, and existing pipelines behave as before.

How it was tested

  • npm run check:recipes: 20/20 recipes plus the cross-recipe rules (unique titles, descriptions and queries; the head-term rule from Recipes: nested steps on pages, checker fixes, three refactors and seven new run-on-each recipes #49; prose overlap).
  • Probed each recipe with messy input beyond its samples, using the build's engine. Every documented limit was reproduced, and nothing else surprising turned up.
  • Cross-checks:
    • the email hashes match sha256sum, and John_Smith@gmail.com gives Meta's documented hash;
    • md5 matches md5sum;
    • the jq one-liner in the timestamp guide was run with jq 1.7.
  • npm test (7042 passed), npm run typecheck plus the worker, e2e, bench and every packages/* config, and npm run lint.
  • npm run build (including the new CSP check on every pre-rendered page), npm run check:bundle, and npm run build:seo with OG images (earlier on this branch).
  • Screenshots of the pre-rendered JWT page (each inside each) and tracking-parameter page (lane condition and drop list visible).

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: everything runs locally; the guides explain history and share links)

🤖 Generated with Claude Code

https://claude.ai/code/session_016MBDS61t2hQgzoraTNWAvz


Generated by Claude Code

- 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 added enhancement New feature or request release:minor labels Oct 8, 2026 — with Claude
@Murraylr
Murraylr merged commit 6fa06fb into claude/magical-ramanujan-sqmrwy Oct 8, 2026
@Murraylr
Murraylr deleted the claude/magical-ramanujan-sqmrwy-recipes branch October 8, 2026 03:58
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