packages/sdk/js v2 gen tree does not round-trip: build.ts regenerates ~12k lines of types.gen.ts on main
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- bun, typescript
- Domain
- api, build-system, ci-cd
Research direction
Run packages/sdk/js/script/build.ts on a clean main checkout and inspect the generated changes under src/v2/gen, especially types.gen.ts and sdk.gen.ts. Compare the generated tree with the committed files, then review the existing reproducibility check from the non-JSON-response work. Done means the v2 tree regenerates without a diff and the final tsc step passes.
Written by the indexing model from the issue text.
Description
What
Running packages/sdk/js/script/build.ts on a clean checkout of main regenerates src/v2/gen/types.gen.ts with a ~12k-line diff (and sdk.gen.ts changes), then fails at its trailing tsc step. The committed v2 gen tree and the output of bun dev generate + codegen have drifted apart.
Why it matters
script/publish.ts runs build.ts inside prepareReleaseFiles() on every release, so what ships in @opencode-ai/sdk/v2 is the regenerated tree — not the reviewed, committed one. Any post-codegen patch (SseFn, and the JSON-parse guard being added in the non-JSON-response PR) is only as reproducible as this tree.
Evidence
Observed while adding a "SDK codegen is reproducible" CI check for the non-JSON-response PR: the patched client/client.gen.ts round-trips byte-for-byte, but types.gen.ts does not, so the check had to be scoped to the patched file. The build's final tsc fails on the regenerated types (e.g. FileSystemEntry no longer exported).
Suggested fix
Regenerate and commit the v2 gen tree from current main, then widen the CI check to git diff --exit-code -- src/v2/gen so it can never drift silently again.
- Dominant language
- TypeScript
- Stars
- 813
- Forks
- 134
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 65
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AltimateAI/altimate-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AltimateAI/altimate-code#1359 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AltimateAI/altimate-code#1323 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AltimateAI/altimate-code#1288 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AltimateAI/altimate-code#1284 ·
All issues in AltimateAI/altimate-code
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100