Re-home paratext-bible-send-receive.d.ts seam, remove dead duplicate (PT-4213)#2570
Merged
Conversation
This was referenced Jul 16, 2026
rolfheij-sil
force-pushed
the
pt-4213-send-receive-dts-cleanup
branch
from
July 17, 2026 15:40
20136b7 to
47fba45
Compare
…dead duplicates Core carried two drifting copies of the Send/Receive extension's type declarations (under platform-scripture-editor and platform-get-resources), each visible only to its own extension's TS program, while part of the contract leaked to every other consumer through platform-get-resources.d.ts. Both copies had gone stale (junk ProjectFileType members, outdated command signatures), and the send-receive command declarations in platform-get-resources.d.ts conflict with the Send/Receive extension's own authoritative declarations in that extension's program (TS2717 on syncProjects today), because extension repos' typeRoots auto-include core extensions' advertised types files. Re-home the seam as a single copy in src/@types/paratext-bible-send-receive/ (ambient in core and in every bundled extension program via typeRoots, but not included by external extension repos' programs), re-synced from the extension's current contract and trimmed to the subset this repo consumes. Delete both stale copies, remove the send-receive declarations from platform-get-resources.d.ts, declare the two send-receive network events in NetworkEvents, and drop the no-longer-needed `as any` cast on the toolbar's openSyncStatus call. PT-4213 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lyonsil
force-pushed
the
pt-4213-send-receive-dts-cleanup
branch
from
July 18, 2026 01:05
47fba45 to
b0be72a
Compare
lyonsil
approved these changes
Jul 18, 2026
lyonsil
left a comment
Member
There was a problem hiding this comment.
@lyonsil partially reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved.
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.
What was wrong
Core carried two copies of the
paratext-bible-send-receivetype declarations:extensions/src/platform-scripture-editor/src/types/paratext-bible-send-receive.d.tsextensions/src/platform-get-resources/src/types/paratext-bible-send-receive.d.tsBecause loose
.d.tsfiles under an extension'ssrc/typesare only picked up by that extension's owninclude: ["src"](typeRoots only auto-include package folders via theirtypesentry), each copy was visible only to its own extension's program. Every other consumer (coresrc/, platform-scripture) got its send-receive typings from a third place — theparatextBibleSendReceive.*command declarations that had accumulated insideplatform-get-resources.d.ts— i.e. the seam worked by inclusion luck, not by design.The consequences:
Both copies drifted stale in different ways — junk
ProjectFileTypemembers ('' | 'edited' | 'new' | 'unregistered' | 'stuff'), outdatedResultStatus/ResultInfo/ResultsDatashapes, an oldVerseRef-based signature in one copy, missing newer commands/events.Cross-repo duplicate-identifier/merge noise: extension repos developed against core (including the Send/Receive extension itself) list core's
extensions/srcin theirtypeRoots, soplatform-get-resources.d.tsmerges into their programs. ItsparatextBibleSendReceive.syncProjectsdeclaration conflicts with the Send/Receive extension's own authoritative one, producing a live TS2717 in that extension's program today:What changed
src/@types/paratext-bible-send-receive/index.d.ts, re-synced from the Send/Receive extension's current contract and trimmed to the subset this repo actually consumes (commandsgetSharedProjects,sendReceiveProjects,openSyncStatus,commitChanges,commitDaily,syncProjects,syncOpenProjects,cancelSync; eventsonSyncStateChanged,onSyncProgress; the payload types they reference; the two settings).src/@typesis atypeRootsentry for core and every bundled extension (same mechanism assrc/@types/react-19-compat), so the seam is ambient in all of this repo's programs — while external extension repos' programs (which include core'sextensions/srcbut not core'ssrc/@types) no longer see core's copy at all, eliminating the duplicate/conflicting-declaration class of problem at the root.platform-get-resources.d.tsnow declares onlyplatformGetResources.*(with a comment explaining why send-receive declarations must not live there).NetworkEventsnow typesparatextBibleSendReceive.onSyncStateChanged/onSyncProgress(the established pattern, cf.platform-scripture.d.ts).(sendCommand as any)cast forparatextBibleSendReceive.openSyncStatus— the command is now properly declared.Why not the
platform-get-resources.d.tstypes entry (theplatform-scripture.d.tspattern)? That pattern is right for types an extension in this repo owns. Here the owner is a closed-source extension whose own program includes core's extension types entries, so any core copy of the module placed there collides with the authoritative declarations (duplicate identifiers for the module's types, TS2717 for any drifted command). The seam file's header documents this.Note:
syncProjectsdeliberately keeps this repo's C# stub shape (String[]?param, no return value — core's startup sync passesundefinedto mean "sync all"), rather than the extension's own(projectIds: string[]) => Promise<ResultsData>; the declaration's doc comment explains the difference.How verified
tsc --listFilesOnlyfor the root, platform-scripture-editor, platform-get-resources, and platform-scripture programs: each now contains exactly one file declaring theparatext-bible-send-receivemodule and its commands (the new seam file).npm run typecheck:coreandnpm run typecheck --workspaces --if-present: all clean.npm run build:types:papi.d.tsunchanged (no regen needed).vitest run src/renderer/components/platform-bible-toolbar.test.tsx: 21/21 pass (covers the de-castopenSyncStatuscall).Based on post-#2555 main (
b88969f), so no rebase pending. Part of PT-4213 (item 5).🤖 Generated with Claude Code
Self-review — 2026-07-17 (review-paratext methodology)
APPROVE — no blocking defect; the type-seam re-home is correct, minimal, and root-causes the TS2717 duplicate-type class. Four analysis passes (api / style / compliance / ux) per
.claude/agents/review-analyzer.md, run by a review-lead agent; author interview substituted with the PR body + PRD design records; every finding adversarially verified against code and tests.runScheduledSessionSyncto the exact seam file this PR renames/rewritessrc/@typesseam on whichever PR rebases second; trial-rebased and confirmed a loud content conflict (not a silent drop), with a typecheck backstop if ever mis-resolvedsendReceiveProjectssignature narrowed to a requiredprojectIdsparamplatform-enhanced-resourcesexcluded)syncProjectsdeliberately diverges from the extension's authoritative contractGates:
typecheck:corePASS,typecheck --workspaces --if-presentPASS (incl. 3 consumer extensions),build:types→papi.d.tsno diff,vitest platform-bible-toolbar.test.tsx21/21 PASS.This change is