Skip to content

docs: preserve cached examples across unrelated API changes - #1228

Open
dev-seth-vapi wants to merge 1 commit into
mainfrom
dvsth/fern-granular-example-cache
Open

dev-seth-vapi wants to merge 1 commit into
mainfrom
dvsth/fern-granular-example-cache

Conversation

@dev-seth-vapi

@dev-seth-vapi dev-seth-vapi commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What changed

An API edit previously invalidated every cached Fern example because both the GitHub Actions restore key and each entry included the full API inputs. Cache entries now depend on their own inputs and the complete transitive closure of referenced schemas and examples. Unrelated endpoint and type edits can reuse existing examples.

GitHub Actions retains the tooling-specific cache across API changes. Changes to Fern, the adapter, runtime, or parser settings still invalidate the relevant cache. Non-local references bypass caching. Missing targets, recursive references, diagnostics, corrupt entries, and independently returned objects retain safe handling.

This changes only the docs repository. Validation, examples, SDK snippets, and the API playground remain enabled.

Validation

  • 14 cache tests pass, including unrelated changes, transitive changes, cycles, added and deleted targets, referenced examples, request/response examples, and the pinned resolver's pointer escaping.
  • The unrelated-change regression test fails against the previous implementation.
  • JavaScript syntax checks and diff whitespace checks pass.
  • Full-site cold check passed with 2,266 misses. Validation setup took 668 seconds.
  • Warm full-site check passed in 19.61 seconds with 2,266 hits and zero misses.
  • Changing the allowed credential ID in CreateByoPhoneNumberDTO completed in 18.89 seconds with 2,263 hits and only 3 misses (99.87% reuse). Inspected the persisted generated result and confirmed it contains the new allowed value.
  • Changing a documented Twilio phone-number field also regenerated only 3 entries. Editing the unpublished JWT schema regenerated none.
  • Restoring the original schema returned to 2,266 hits and zero misses. All temporary API edits were restored.
  • Cold, warm, changed-schema, and restored checks report zero errors and the same 11 warnings. Warning text was compared for equality.
  • GitHub's Fern check passed. The full preview publication is still running its initial cold build.

These are local full-site check measurements, not production publishing timings. This format change requires one fresh cache fill. Shared-type edits can legitimately invalidate many entries.

The adapter still requires the exact checksum of Fern 5.112.0. The dependency traversal was checked against its two wrapped example generators and reference resolver.

@dev-seth-vapi
dev-seth-vapi marked this pull request as ready for review September 16, 2026 21:12
@lightsage-app

lightsage-app Bot commented Sep 16, 2026

Copy link
Copy Markdown

Lightsage docs evals

Result: passed
Staging docs: https://vapi-preview-01a0ac1f-6e2a-7600-931b-a78da9407c4c.docs.buildwithfern.com
Commit: d17e5c2

Average score: 100/100
Passed: 3/3

Eval ID Status Score Model Tools Docs 404
08e24c18-82a0-45de-abdc-d237bd12bc0f Pass 100 codex/gpt-5.4 37 1
08e24c18-82a0-45de-abdc-d237bd12bc0f Pass 100 cursor/auto 9 0
08e24c18-82a0-45de-abdc-d237bd12bc0f Pass 100 claude-code/global.anthropic.claude... 14 0

@github-actions

Copy link
Copy Markdown
Contributor

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.

2 participants