chore(api): consume the published contract packages - #645
Merged
Conversation
FlipcashAPI vendored a copy of both proto sets and their generated Swift. It now depends on code-payments/ocp-client-protocol and code-payments/flipcash2-client-protocol at 0.1.0 and re-exports them, so the contract is generated in one place instead of once per app. Android consumes the Kotlin half of the same two packages. Exports.swift uses @_exported so `import FlipcashAPI` keeps working: none of the 109 importers change, and no target gains a package dependency, because the app already reaches FlipcashAPI transitively through FlipcashCore. The released Swift is byte-identical to what was committed here, with one filename difference: Core's messaging service shipped as flipcash_messaging_v1_* because the local generator renamed it to dodge a basename collision in the merged module. The two packages are separate modules, so the collision is gone and the rename with it — the Swift types (Flipcash_Messaging_V1_* vs Ocp_Messaging_V1_*) never differed. grpc-swift-2 and grpc-swift-protobuf drop out of this manifest; they arrive transitively from the packages, which pin them.
Scripts/run cloned the upstream contract repos into FlipcashAPI/Sources and drove protoc over the result. Those directories are gone, so the script and the three it calls now write into nothing. Scripts/gengoogle stays — it builds the Firebase plist and has never had anything to do with protos. Docs that described the local pipeline described a pipeline that no longer exists: technology-stack.md, hard-rules.md, the CLAUDE.md index and generated-files rule, the proto-change-tracer agent's chain diagram, and the fetch-protos skill. The skill keeps its name and its useful half — trace the impact, scaffold the service stubs — but its first four steps are now a version bump rather than a regeneration, and its release step points at the package repos, where releasing is a deliberate human step.
This was referenced Aug 25, 2026
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.
FlipcashAPIvendored a copy of both proto sets and their generated Swift, andScripts/runregenerated it locally. Both are gone. The package now depends on
ocp-client-protocolandflipcash2-client-protocolat0.1.0and re-exports them, so the contract is generated once instead of once per app. TheAndroid side consumes the Kotlin half of the same two packages in
code-android-app#1325.
Why the umbrella instead of importing the modules directly
Exports.swiftis two@_exported importlines. That keepsimport FlipcashAPIworking in all109 files that write it, and it means no target gains a package dependency — the app already
reaches
FlipcashAPItransitively throughFlipcashCore, which is the only thing that names it(
.package(path: "../FlipcashAPI")). No.pbxprojedits.FlipcashAPIheld no hand-written code, so there is nothing left in it but the re-export.One filename changed, no code did
The released Swift is byte-identical to what was committed here, except that Core's messaging
service shipped as
flipcash_messaging_v1_messaging_service.*. That prefix came fromScripts/run, which renamed the file to avoid a basename collision with the OCP messagingservice inside the single merged module. The two packages are separate modules now, so the
collision cannot happen and the rename is gone with it. The Swift type names
(
Flipcash_Messaging_V1_*vsOcp_Messaging_V1_*) were always distinct and are unchanged.grpc-swift-2andgrpc-swift-protobufalso leave this manifest — they arrive transitively fromthe packages, which pin them.
Second commit: the pipeline that fed the deleted directories
Scripts/run,pull_protos,generate, andinstall-grpc-swift-2-plugin.shcloned upstreaminto
FlipcashAPI/Sourcesand ran protoc over it. Those paths no longer exist, so the scriptsare dead.
Scripts/gengooglestays — it builds the Firebase plist and never touched protos.The docs that described the pipeline are updated rather than deleted:
technology-stack.md,hard-rules.md, theCLAUDE.mdindex and generated-files rule, and theproto-change-traceragent's chain diagram. The
fetch-protosskill keeps its name and its useful half — trace theimpact, scaffold the service stubs — but its first four steps are a version bump now, and
releasing a contract change points at the package repos, where it stays a deliberate human step.
Follow-ups, deliberately not here
Retiring
scripts/proto-parity.shand the client repos'verify-parity.sh: both compare eachapp's own generated output against the packages', and neither app has independent output left
once this and #1325 land.