Skip to content

fix(replay): make bundled-openapi.json patch include-only#173

Merged
gavinsharp merged 1 commit into
mainfrom
gavinsharp/replay-include-only-patch
Jun 9, 2026
Merged

fix(replay): make bundled-openapi.json patch include-only#173
gavinsharp merged 1 commit into
mainfrom
gavinsharp/replay-include-only-patch

Conversation

@gavinsharp

@gavinsharp gavinsharp commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Rewrites the Fern replay patch that preserves our bundled-openapi.json packaging so it is include-only, fixing the "unresolved customization conflict" that has shown up on pyproject.toml and src/phenoml/core/client_wrapper.py on every SDK regeneration.

No code or packaging behavior changes — the include block in pyproject.toml is untouched and still ships the bundled spec. This only edits .fern/replay.lock. The package version is unchanged (15.1.0), so this does not publish.

Background

The bundled openapi.json packaging can't be expressed in Fern's Python generator config (re-declaring [tool.poetry] to add include is a TOML error), so it's preserved across regenerations via a Fern replay patch. That patch (patch-6516695e) was originally captured from the #169 release commit, which bundled two unrelated things:

  1. the durable Poetry include = [{ path = "src/phenoml/openapi/openapi.json", … }] block, and
  2. version-string edits anchored to the generator's placeholder — version = "0.0.0.dev0" → "15.0.3" in pyproject.toml and the same in the User-Agent / X-Fern-SDK-Version headers in client_wrapper.py.

Fern now auto-versions during generation (it emits a real version, not the 0.0.0.dev0 placeholder), so the patch's 0.0.0.dev0 anchors never match and those hunks conflict on every regen — flagging both files as unresolved customizations even though the working tree ends up correct. The include hunk itself always applies cleanly; only the version hunks are the problem.

What changed

In .fern/replay.lock, patch-6516695e is rewritten to carry only the pyproject.toml include hunk:

  • dropped the two version hunks (pyproject.toml version + the two client_wrapper.py header strings),
  • dropped src/phenoml/core/client_wrapper.py from the patch's files,
  • recomputed content_hash with Fern's own algorithm (sha256 of the patch text minus From /index /Date: lines),
  • removed the now-irrelevant theirs_snapshot / status fields (Fern's own patch-creation writes neither).

The version strings are owned by Fern's generator and should never have lived in a replay patch; leaving them out lets Fern manage versions while the patch only preserves the one thing the generator can't emit itself.

Verifying

After merge, an observe-only regen confirms it without publishing:

fern generate --group python-sdk --version auto   # opens a PR; do NOT merge it

Expected: no "unresolved customization" banner, the include block present in the generated pyproject.toml, and the replay patch still include-only. If Fern's reconciliation were to re-pollute it, this PR is trivially revertable (it only touches the lock file).


Note

Low Risk
Lock-file-only change to Fern replay metadata; no application code or published package behavior is modified.

Overview
Narrows the Fern replay patch patch-6516695e in .fern/replay.lock so it only re-applies the Poetry include block that bundles src/phenoml/openapi/openapi.json into wheels/sdists.

The patch no longer touches pyproject.toml version or client_wrapper.py User-Agent / SDK version hunks (those were anchored to the old 0.0.0.dev0 placeholder and conflicted on every regen now that Fern emits real versions). client_wrapper.py is dropped from the patch’s files list, content_hash is updated, and theirs_snapshot / status: unresolved metadata is removed.

No SDK packaging or runtime behavior changes — only how regenerations reconcile customizations.

Reviewed by Cursor Bugbot for commit b82a1ee. Bugbot is set up for automated code reviews on this repo. Configure here.

The replay patch that preserves the Poetry include block for the bundled
openapi.json (patch-6516695e, from #169) also carried version-string edits
anchored to the generator placeholder (0.0.0.dev0). Fern now auto-versions on
generation, so those hunks never match and conflict on every regen, flagging
pyproject.toml + client_wrapper.py as unresolved customizations.

Rewrite the patch to carry only the pyproject.toml include hunk: drop the two
version hunks, drop client_wrapper.py from files, recompute content_hash, and
remove the stale theirs_snapshot/status fields. No packaging or code change;
version stays 15.1.0 so this does not publish.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gavinsharp gavinsharp merged commit 7fa59d2 into main Jun 9, 2026
6 checks passed
gavinsharp added a commit that referenced this pull request Jun 9, 2026
…oding (#177)

The 2026-06-09 snapshot-encoding migration (regen #175) re-entangled the
[tool.poetry] version line that #173 had stripped: it captured theirs_snapshot
at the autoversioned 15.1.1 while the base generation carries the 0.0.0.dev0
placeholder, so the 3-way merge derives a spurious version customization that
conflicts on every subsequent version bump. Confirmed via trial regen #176
(applied=0 conflicts=1, the "unresolved customization conflicts" banner returned).

Set theirs_snapshot's [tool.poetry] version to the base placeholder (0.0.0.dev0)
so the customization delta is include-only — the merge then takes the generated
(autoversioned) value with no conflict. Also revert patch_content to the
include-only form (content_hash back to 29d85120). Lock-only; version stays at
15.2.0 (already published) so this does not republish.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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