Skip to content

Follow up Gemini migration and Sutta metadata schemas - #187

Merged
anantham merged 4 commits into
mainfrom
codex/pr186-followups
Sep 24, 2026
Merged

anantham merged 4 commits into
mainfrom
codex/pr186-followups

Conversation

@anantham

@anantham anantham commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow up the merged Gemini SDK migration (#186): share the canonical translation JSON schemas, remove seven unused audio helpers, and add the optional Sutta metadata requested in #39, #40 and #42. Reconcile retired paths and resolved local investigations without changing their historical evidence.

Changes

  • Gemini translation and amendment calls share the normal JSON schemas (161 duplicate schema lines removed). This also adopts the canonical footnote description and proposal enums that the old Gemini copy omitted. Finish-reason rejection remains intact.
  • Audio storage utilities retain only formatDuration (126 → 8 lines); repository searches found no consumers of the other seven exports.
  • Add optional whole-work parallels, formula/refrain span references, and morphology function/semanticRole. All three existing compiler morphology schemas accept the new role fields; the rehydrator preserves them.
  • MN10 receives eight source-verified work parallels, one DN22 opening-formula reference, three form/function examples and two source citations. The compact JSON remains compact; removing these additions reproduces the previous JSON structurally. No source/translation text, alignment, tooltip or sense order changes. The field-level receipt is in docs/sutta-studio/curation/phase-a.md.
  • Correct current architecture/roadmap references and archive eleven already-implemented local fixes, including refactor(epub): decompose epubService into modular components #13 (its ETA work had already landed). Close local investigation feat(prompts): metadata preamble #7 as duplicate of local Comprehensive improvements: Import system, DB operations, UI enhancements, and automation #1, keeping all dossiers and deferred manual checks. These local IDs are unrelated to GitHub issue numbers.

Testing

  • Node 24.21.0: 319 files, 9,575 tests pass, 347 skipped, zero failures; seven new tests cover real SDK wire conversion and Sutta metadata/rehydration.
  • Typecheck, production build, client-secret scan, exact-base integrity and archive/index links pass. Lint: zero errors, 1,856 existing warnings.
  • Two bounded live calls to direct Google gemini-3.6-flash passed with the shared schemas: translation and amendment review (proposal: null), approximately $0.0036 from reported tokens. Synthetic text only; no key or private novel content in the branch.
  • All five CI jobs and the Vercel preview pass for d903445 (run 36043274326). CI line coverage 60.71% → 60.79%; statement coverage 59.17% → 59.25%. Codex review requested.
  • De-sprawl: retire Sutta Studio shims, single Gemini SDK, delete dead code #186 itself was merged only after its exact-head CI and earlier live translation, image and small compile checks passed.
  • Bundle comparison from local build logs: 40 JS assets, 6288.89 → 6287.78 kB total; gzip 1397.69 → 1397.95 kB (rounded, includes new reference metadata). No runtime speedup claimed. The removed Gemini schema getters had complexity 2/1/1; retained JSON getters stay 2/1/1 and formatDuration stays 1. No production any types removed.

Limits

The earlier live compile returned no ripples, so it did not establish whether the stripped map-value constraint changes output; responseJsonSchema is unchanged. No new renderer UI, browser acceptance, production model default, compiler unification (D2), or settings/provider architecture change is included. Historical manual acceptance gaps remain explicit. Read-only preview navigation reached Vercel sign-in, so no deployed browser-render acceptance is claimed.

Review checklist

  • Isolated task branch; existing root edits preserved
  • Focused commits, tests and documentation
  • No dependencies or credential changes
  • Ready for Codex review

Closes #39
Closes #40
Closes #42

Use the SDK JSON schema conversion for translation and amendment review. Preserve nullable objects and arrays; canonical proposal enums now reach Gemini. Verified real SDK request shapes and two bounded live calls.
Add optional packet work parallels, formula and refrain span references, and morphology function/semanticRole. Ground MN10 examples in existing curation and refreshed public SC references. Preserve all existing source, translation and alignment data. Refs #39, #40, #42.
Record PR #186 merge and live evidence, refresh current Sutta ownership, archive eleven implemented local fixes and close local #7 as duplicate. Keep historical dossiers and unresolved manual acceptance explicit.
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lexicon-forge Ready Ready Preview Sep 24, 2026 6:44pm UTC

@anantham

Copy link
Copy Markdown
Owner Author

@codex review the current PR diff. Review source, tests, docs and the bounded public Sutta metadata additions only; exclude unrelated novel/LFS content and local operator artifacts. Check Gemini nullable schema conversion and proposal enums, compatibility of optional fields, evidence scope of work versus phrase parallels, and truthful local issue status. No deployment or merge requested.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9034451c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread types/suttaStudio.ts
startWordId: string;
endWordId: string;
/** Phrase recurrence; separate from phase- or whole-work parallels. */
parallels?: ParallelRef[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve citation IDs on parallel references

When a packet contains both work-level and phrase-level references to the same work—as MN10 now does for DN22—neither new reference can identify which flat Citation supports it because ParallelRef has no citation field. The Suttaplex provider already emits citationId (services/providers/scSuttaplex.ts:95-101), but typing these additions as ParallelRef[] discards that provenance contract, and the new test only locates a hard-coded citation independently. Add an optional citation ID to ParallelRef and populate it on both workParallels and span parallels so a renderer or validator can audit each claim against the correct work- or phrase-scoped evidence.

Useful? React with 👍 / 👎.

@anantham
anantham merged commit 4acd0c1 into main Sep 24, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — d9034451 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant