fix(cli): docs ledger lazy file loading, stable tokens, ADR wiring#15932
Merged
Conversation
Contributor
🌱 Seed Test SelectorSelect languages to run seed tests for:
How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR. |
7a5ea08 to
2db8136
Compare
Populate the remaining snippets metadata path used during API-definition registration and add direct unit coverage for the language-specific payload builder. This keeps docs-ledger dynamic IR checks and uploads aligned with the actual snippet package/version inputs instead of empty placeholders, including the AUTO-version fallback behavior.
Sort apiDefinitionCollector entries by key before serializing the docs-ledger apiManifest blob. Map iteration order today depends on Promise.all completion order (random run-to-run), which leaks into the manifest blob hash and therefore the docs-ledger deployment hash. Pairs with the server-side (orgId, apiName, contentHash) dedup added in fern-platform: with both fixes, byte-identical publishes produce byte-identical apiManifests and a deterministic deployment hash.
…sage Instead of holding all file Buffers in memory for the entire publish duration, store only hash→filePath mappings. Re-read files on demand during the upload step, and only for blobs the server reports as missing.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Docs ledger publish improvements: lazy file blob loading, stable file tokens, ADR 0009/0011/0012 wiring.
Changes Made
publishDocs.ts,publishDocsLedger.ts,publishDocsLedgerPreview.ts): Instead of holding all file Buffers in memory for the entire publish duration, store onlyhash → filePathmappings. Files are re-read on demand during the upload step, and only for blobs the server reports as missing (CAS dedup means most republishes need zero re-reads).startDocsRegister— avoids minting non-deterministic UUID FileIds that would rotate deployment hashes on every publish.file:<sanitizedPath>tokens instead of UUIDs, enabling page-level CAS dedup./preview/initendpoint.buildLedgerInputusesstableStringify(sorted keys) so the apiManifest blob hash is deterministic regardless of Map insertion order.Testing
buildLedgerInput.test.ts,normalizeRepoUrl.test.ts)