Skip to content

feat(turd): show what each choice changes + recipe-comparison diffs - #70

Merged
ApocDev merged 3 commits into
mainfrom
feat/turd-detail-recipe-diff
Jul 1, 2026
Merged

feat(turd): show what each choice changes + recipe-comparison diffs#70
ApocDev merged 3 commits into
mainfrom
feat/turd-detail-recipe-diff

Conversation

@ApocDev

@ApocDev ApocDev commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Why

The assistant and the TURD page only understood branches that replace a recipe (the turd_replacements table), so branches that instead unlock a brand-new recipe were invisible. Asked "which Moondrop TURD is best?", the assistant confidently reported a single choice — the master actually has three (Copper addition, Moon light, Carbon capture). The /turd page had the same blind spot and showed each choice as an opaque "N recipes" count.

What

Assistant / data

  • New turdChoices tool + recipeInfo.turd enrichment walk the tech-prerequisite graph, so the agent sees every branch of a master: its description, the recipes it swaps (old→new) or newly unlocks, and its modules. Prompt updated to consult it and never assume a single choice.
  • Import tech descriptions (new technologies.description column + migration).

/turd page

  • Each choice now lists its concrete recipe changes (old→new swaps, + new unlocks) with icons and the master/branch descriptions, instead of a bare count.
  • Effect pills are color-coded (speed / productivity / energy) with a tooltip clarifying they act on the affected buildings.

Recipe-comparison hover (reusable RecipeDiff, also ready for Py recipe tiers)

  • In/out diff with conventional add/remove/change coloring, colored time (faster/slower), and base /s throughput with % change.
  • A choice's module is applied to a swapped recipe's rate only when it runs in the affected building — skipped for building-construction recipes (a recipe that builds a machine gets no module bonus). Productivity skips ignored_by_productivity outputs (barrels/catalysts); speed scales all outputs.

Also

  • fix(db): the schema change surfaced a latent issue — makeTestDb built tables by pushing schema.ts while production applies migrations, so the first incremental ALTER collided. Test DBs now provision through the real migration path.
  • fix(assistant): sending with no OpenRouter key returned a 500 the UI swallowed (the conversation died silently). Now an up-front banner (linking to Settings) shows when no key is set, and send errors render inline.

Verify

  • vp check clean; vp test 170 passing.
  • Imported the real dump and confirmed moondrop-upgrade's three branches + descriptions; verified live: the /turd detail, recipe-diff tooltips (incl. the productivity-only-where-it-applies and barrel-exclusion behavior), and the no-key banner.

Docs updated (README.md, docs/ai-assistant.md).

ApocDev added 3 commits July 1, 2026 11:11
makeTestDb generated DDL straight from schema.ts, so a test db never
recorded the drizzle migration journal. The first incremental ALTER
migration then re-added a column the push had already created. Provision
test dbs the way production does — apply the bundled migrations — so tests
exercise the real path and incremental migrations don't collide.
The assistant and the TURD page only knew about branches that *replace* a
recipe (the turd_replacements table), so branches that unlock a brand-new
recipe were invisible — the agent reported moondrop-upgrade as a single
choice when it actually has three.

- turdChoices tool + recipeInfo enrichment walk the tech-prerequisite graph,
  so the agent sees every branch: its description, the recipes it swaps
  (old->new) or newly unlocks, and its modules.
- Import tech descriptions (new technologies.description column).
- /turd page: each choice lists its concrete recipe changes with icons and
  descriptions instead of a bare 'N recipes' count; effect pills color-coded.
- Recipe-comparison hover (reusable for Py recipe tiers): in/out diff, colored
  time, base per-second throughput with % change. A choice's module is applied
  to a swapped recipe's rate only when it runs in the affected building (skipped
  for building-construction recipes); productivity skips ignored-by-productivity
  outputs like barrels.
Sending a message with no key configured returned a 500 the UI never
surfaced, so the conversation just died silently. Show an up-front banner
(linking to Settings) when no key is stored or in the env, and render the
request error if a send fails anyway.
@ApocDev
ApocDev merged commit 88e4fec into main Jul 1, 2026
1 check passed
@ApocDev
ApocDev deleted the feat/turd-detail-recipe-diff branch July 1, 2026 15:37
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