Skip to content

add: Grok transfer lesson — same weatherwise program on a second model - #4

Open
rdtiv wants to merge 7 commits into
mainfrom
x/feat/grok-transfer
Open

add: Grok transfer lesson — same weatherwise program on a second model#4
rdtiv wants to merge 7 commits into
mainfrom
x/feat/grok-transfer

Conversation

@rdtiv

@rdtiv rdtiv commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Closes #3.

A reader who finished docs/typescript.md rebuilds the same weather assistant against Grok. Transfer document, not a second 13-part course.

What this is

  • docs/grok.md owns src/grok-*.ts. Claude’s docs/typescript.md / src/usage.ts stay Claude (series-nav banner only).
  • Ledger helpers live in src/grok-usage.ts and write the same 15-column usage.csv. fromResponses subtracts cached_tokens so input_tokens stays the uncached remainder.
  • SDK is openai + Responses API (baseURL: https://api.x.ai/v1). Not the AI SDK.
  • One Node on the machine: floor 22. CI is 22.x and 24.x. Type-along readers npm install openai and add each grok* script the same way the TypeScript lesson adds Claude scripts.

Verify

  • npm run typecheck
  • npm run verify:docs (both documents)
  • CI on this PR (keyless)

Live-probed 2026-08-14 (grok-4.6): Responses streaming, responses.parse + zodTextFormat, function_call.arguments as a JSON string, web_search_call is server-side (loop only function_call), prompt_cache_key is a first-class field.

Do not merge unless you want this on main. Operator owns merge.

Does not touch issue #1 / PR #2 / .claude/worktrees/.

rdtiv added 6 commits August 14, 2026 00:43
Port the Grok mission skill, dual-driver rule, and landed.sh from 1269j.
Drop 1269j site-law, operator-exec, and Vercel app-root text. Ignore both
drivers' worktree roots so git clean -x cannot wipe live checkouts.
Install openai as a root dep, add grok* npm scripts, and teach
check-docs.ts that grok-*.ts belong to docs/grok.md. Extract
fromAnthropic/fromResponses so one usage.csv can price both vendors.
A store:false grok-4.6 call reported input_tokens as the full prompt
and cached_tokens as a subset. Ledger input_tokens stays the remainder.
usage.ts is built by docs/typescript.md. Putting fromResponses and
logGrokCall there forced the Claude tutorial to reprint them. Those
helpers belong in src/grok-usage.ts / docs/grok.md instead.
docs/grok.md builds src/grok-*.ts. Ledger helpers live in grok-usage.ts
so the Claude TypeScript document does not reprint them. Existing series
docs only get a nav banner. Same usage.csv columns, same WeatherRequest.
Raise the project floor to Node 22 so Claude and Grok share one install.
CI is 22.x and 24.x. grok.md now installs openai and adds each script
the same way typescript.md does, instead of claiming they already exist.
Replace they/theirs/someone/the owner with Claude, Grok, xAI, and
your program. Plant the two ideas in §0 with what to type and what
you will see. Add first-call failure table, checkpoints, and a
restart ritual when flipping MEMORY.
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.

Grok transfer lesson: the same weatherwise program on a second model

1 participant