De-sprawl: retire Sutta Studio shims, single Gemini SDK, delete dead code - #186
Merged
Merged
Conversation
… shims
The compiler, benchmark scripts and tests now import services/sutta-studio/
{llm,prompts,schemas,utils,passes} directly. The six Phase-4 shims
(suttaStudioPass{Prompts,Runners}.ts, compiler/{llm,prompts,schemas,utils}.ts)
have no remaining importers. The schema test's cross-location identity check
becomes a canonical-export check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W
migrateFromLocalStorage, isMigrationCompleted and resetMigrationState had zero importers (DESPRAWL T2.4b). The live model-field repair is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W
GeminiAdapter (translate + chatJSON), the Gemini image branch and the Gemini response schemas move off the legacy @google/generative-ai SDK. Abort signals travel in config.abortSignal. The new SDK returns empty text for blocked responses instead of throwing, so the empty-response error now names the block/finish reason. Drops @google/generative-ai plus two unused packages (@types/jszip — jszip ships its own types — and ts-prune). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W
- Six Sutta Studio re-export shims with no importers (CONSOLIDATION Phase 4).
- services/audio/storage/{cache,opfs}.ts: zero importers and committed with
literal \n escapes, so tsconfig/vitest/eslint had to exclude them; those
exclusions (and a stale pinning.ts entry) go too.
- public/debug-chapter2.js: one-off console diagnostic shipped to every user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@google/genai's text getter returns text from candidates whose finishReason is SAFETY, RECITATION or LANGUAGE; the legacy SDK's text() threw for these. translate and chatJSON now share responseTextOrThrow, which restores that rejection. Found in review of #186; regression tests fail without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W
This was referenced Sep 24, 2026
This branch was successfully deployed
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.
Owner-approved simplification pass from a review of open issues and the DESPRAWL roadmap. It is mostly behavior-preserving; the three Gemini request/response changes listed under "Behavior changes" are the exceptions.
Changes
1. Sutta Studio shims retired (CONSOLIDATION Phase 4, partial)
services/compiler/*,services/sutta-studio/prompts/skeleton.ts, benchmark scripts and tests importservices/sutta-studio/{llm,prompts,schemas,utils,passes}directly.services/suttaStudioPass{Prompts,Runners}.ts,services/compiler/{llm,prompts,schemas,utils}.ts.schemas-canonical.test.ts: the cross-location identity check becomes a canonical-export check. ThewordRange/refrainIdguards are unchanged.services/compiler/{index,skeleton}.tsstay; retiring them depends on Phase 2d and decision D2.2. Single Gemini SDK (
@google/genai)GeminiAdapter(translate+chatJSON), the Gemini image branch inimageService.tsand the Gemini response schemas move off the legacy@google/generative-ai.config.abortSignal. Cancellation was checked with a loopback HTTP test during review.responseTextOrThrow, which keeps the legacy SDK's rule: text from a candidate whosefinishReasonisSAFETY,RECITATIONorLANGUAGEis rejected. The new SDK'stextgetter would otherwise return it. Review found this in0207fdb;c174b18fixes it, and the regression tests fail without the fix.3. Dead code and dependencies
migrateFromLocalStorage,isMigrationCompletedandresetMigrationState, which had zero importers (DESPRAWL T2.4b).services/audio/storage/{cache,opfs}.ts. They had zero importers and were committed with literal\nescapes, so they needed exclusions intsconfig.json,vitest.config.tsandeslint.config.mjs. Those exclusions are removed, along with a stalepinning.tsentry.services/audio/storage/utils.tsstays becauseAudioPlayer.tsxusesformatDuration.public/debug-chapter2.js, a one-off console diagnostic that was shipped to every user.@google/generative-ai,@types/jszip(jszip ships its own types) andts-prune(unused).Behavior changes (all Gemini; confirmed in review)
Empty response from Gemini API (SAFETY), and blocked candidates raiseGemini response blocked (<reason>).additionalPropertiesis stripped fromchatJSONschemas by the new SDK'sprocessJsonSchema. This includes Sutta Studio's string-valuedripplesmap constraint. The difference in the request payload is proven; the effect on Google's output is untested.responseModalitiesmoves from the request's top level intogenerationConfig, which is the location Google's API reference documents. This is likely a correction, but it is still a change.Verification
0207fdb, with 347 skipped each. No existing test changed status.c174b18), run in a Node 22 container: typecheck passes, lint has 0 errors, the build passes, and 9,567 tests pass (5 are new). The one failure, inindrasNetImageProvider.test.ts, is specific to this Node 22 environment; it passes on Node 24.Follow-ups (not in this PR)
translationResponseSchema.ts(~130 lines) and the provider branch intranslationService.tscould be dropped, because the new SDK accepts the JSON schemas directly. This needs a live test first.ripplesmap constraint matters to Gemini output, pass it throughresponseJsonSchemainstead ofresponseSchema.services/audio/storage/utils.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_011d1MbSabs9nA9d9w8pxP1W