Skip to content

fix: give hand-authored toolkit prose a source home in curation/ - #1112

Open
teallarson wants to merge 4 commits into
mainfrom
chore/extract-prose
Open

fix: give hand-authored toolkit prose a source home in curation/#1112
teallarson wants to merge 4 commits into
mainfrom
chore/extract-prose

Conversation

@teallarson

@teallarson teallarson commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Why

Hand-authored toolkit prose was stored only in generated data/toolkits/*.json. A forced regeneration has no previous output to carry forward, so it could silently delete documentationChunks, customImports, and subPages.

This gives that content a durable source of truth in curation/, so nightly generation can rebuild the JSON without losing editorial work.

How it fits

API + metadata ─┐
                ├─> generator + merger ─> data/toolkits/*.json ─> docs app
curation/ ──────┘             │
                              └─ force-regenerate remains lossless

The curation layer supplies the fields that do not come from an upstream API or LLM. It is loaded through the existing --custom-sections path and takes precedence over carry-forward from previous output.

Changes

  • Added 75 per-toolkit curation files, extracted verbatim from the committed artifacts.
  • Updated the custom-sections source to load a directory while retaining single-file compatibility.
  • Updated the nightly workflow to pass --custom-sections ./curation.
  • Added a re-runnable extraction script and regression coverage for forced regeneration.

Verification

  • All 117 toolkits reproduce their committed prose byte-for-byte.
  • Spot-checked rendered output across GitHub, Google Flights, Google News, ClickUp, and Jira.
  • Generator tests, typecheck, and lint pass.

Independent of #1106 and #1113; #1111 documents the hazard this fixes.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 6, 2026 6:52pm

Request Review

documentationChunks, customImports, and subPages have no upstream
source — they lived only inside the generated data/toolkits/*.json and
survived by carry-forward from the previous artifact. --force-regenerate
and --overwrite-output set the previous-output directory to undefined,
silently deleting all hand-authored prose (82 chunks and 2 subpages
across 75 toolkits).

Extract that prose into per-toolkit curation/<toolkitId>.json files and
read them back through --custom-sections, which the merger treats as
authoritative over carry-forward. The nightly workflow now passes
--custom-sections ./curation, so a forced regeneration preserves prose
instead of wiping it.

- custom-sections-file source now loads a directory of per-toolkit files
  (single-file layout still supported)
- scripts/extract-curation.ts is the one-time, re-runnable extractor
- curation/ is excluded from biome like its sibling data/toolkits/
- regression test asserts prose survives --force-regenerate

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@teallarson
teallarson force-pushed the chore/extract-prose branch from e2a5fac to 0587043 Compare August 5, 2026 20:50
@teallarson
teallarson changed the base branch from chore/single-source-of-truth to main August 5, 2026 20:50
scripts/ is not type-checked today; #1106 widens the generator project
to cover it, and under exactOptionalPropertyTypes plus
noUncheckedIndexedAccess this PR's files do not compile. Fixing it here
keeps the PR green whichever order the two land in.

- isNonEmptyArray returned boolean, so it narrowed nothing and the
  caller compensated with an 'as DocumentationChunk[]' cast. Making it a
  type predicate narrows properly and lets the cast go.
- previousToolkit is declared optional but --force-regenerate and
  --overwrite-output pass it explicitly as undefined, which
  exactOptionalPropertyTypes rejects. The type now says '| undefined',
  matching what callers actually do — that explicit undefined is the
  exact scenario the prose regression test covers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
teallarson and others added 2 commits August 6, 2026 14:49
The sibling generator scripts (validate-merge, sync-toolkit-sidebar,
check-stale-summaries, report-tool-metadata) resolve data/toolkits
through the shared resolver, which anchors on the repo root. This script
used bare relative paths, so it only worked when invoked from
toolkit-docs-generator/ and failed from the root — two conventions for
the same directory.

Anchor on the script's own location instead, matching how
verify-toolkit-join, sync-toolkit-sidebar, and validate-merge already
use import.meta.url. It now works from either directory. Verified from
both: identical output, 75 files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@teallarson
teallarson marked this pull request as ready for review August 6, 2026 21:17

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f17c6d7. Configure here.

--llm-concurrency 15 \
--exclude-file ./remove-toolkits.txt \
--ignore-file ./skip-toolkits.txt \
--custom-sections ./curation \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curation edits skipped unchanged

Medium Severity

The nightly job now uses --custom-sections ./curation, but --skip-unchanged only detects Engine definition changes. This means updates made solely to curation files are not picked up, causing data/toolkits to remain out of sync with the new source of truth.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f17c6d7. Configure here.

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