Skip to content

Commit 6da2e6d

Browse files
authored
chore(definitions): delete the vendored protos and their codegen (#1326)
1 parent 0086a36 commit 6da2e6d

63 files changed

Lines changed: 144 additions & 7380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/agents/proto-change-tracer.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ When proto definitions change, trace the impact through the full dependency chai
1313
## Architecture: Proto → Feature Chain
1414

1515
```
16-
definitions/<service>/protos/src/main/proto/ ← .proto files
17-
[protobuf codegen]
16+
com.flipcash:{ocp,flipcash2}-client-protocol ← published artifact, pinned in libs.versions.toml
17+
[generated in its own repo — nothing runs protoc here]
1818
↓
1919
com.codeinc.<service>.gen.<domain>.v1 ← Generated stubs (GrpcKt, request/response classes)
2020
↓
@@ -29,15 +29,20 @@ services/<service>/ — *Controller.kt ← User-facing abstraction (r
2929
apps/flipcash/shared/*/ or features/*/ ← ViewModels consume controllers
3030
```
3131

32-
**Proto packages:**
33-
- Flipcash: `com.codeinc.flipcash.gen.<domain>.v1` (phone, account, email, profile, push, activity, event, settings, iap, moderation, thirdparty)
34-
- OpenCode: `com.codeinc.opencode.gen.<domain>.v1` (transaction, account, currency, messaging)
32+
**Proto packages** (the artifact coordinate is `com.flipcash`; the packages inside are not):
33+
- Flipcash, from `flipcash2-client-protocol`: `com.codeinc.flipcash.gen.<domain>.v1` (phone, account, email, profile, push, activity, event, settings, iap, moderation, thirdparty)
34+
- OpenCode, from `ocp-client-protocol`: `com.codeinc.opencode.gen.<domain>.v1` (transaction, account, currency, messaging)
35+
36+
To read a generated stub, look in the resolved artifact under `~/.gradle/caches/modules-2/`
37+
or in the client repo's build output — there is no generated source tree in this project.
3538

3639
## Analysis Process
3740

3841
### 1. Identify what changed in the proto definitions
3942

40-
Compare the current proto files with the previous version (use git diff on `definitions/`). Identify:
43+
The `.proto` sources are not in this repo. Diff the contract between the old and new
44+
artifact versions with `gh api repos/code-payments/<ocp|flipcash2>-client-protocol/compare/<old>...<new>`,
45+
or read `proto/` in a local clone at each tag. Identify:
4146
- New services or RPCs
4247
- Changed request/response message fields
4348
- New or modified enum values

‎.claude/skills/fetch-protos/SKILL.md‎

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
name: fetch-protos
33
description: >
4-
Fetch latest protobuf definitions, verify build, summarize API changes,
5-
and scaffold new service stubs. Usage: /fetch-protos [flipcash|opencode] [commit_sha]
4+
Bump a client-protocol artifact, summarize the contract changes it carries,
5+
and scaffold new service stubs. Usage: /fetch-protos [flipcash|opencode] [version]
66
user-invocable: true
7-
argument-hint: "[flipcash|opencode] [commit_sha]"
7+
argument-hint: "[flipcash|opencode] [version]"
88
allowed-tools:
99
- Bash
1010
- Read
@@ -17,79 +17,92 @@ allowed-tools:
1717

1818
# Fetch Protos
1919

20-
Fetch protobuf definitions from upstream repos, verify they compile, summarize
21-
API changes, and scaffold missing service layer implementations.
20+
The protos are no longer vendored here. Both contracts arrive as published
21+
artifacts, so "fetching" is bumping a version pin and reacting to what the new
22+
version changed.
23+
24+
| Target | Artifact | Client repo | Upstream contract |
25+
|--------|----------|-------------|-------------------|
26+
| `flipcash` | `com.flipcash:flipcash2-client-protocol` | `code-payments/flipcash2-client-protocol` | `code-payments/flipcash2-protobuf-api` |
27+
| `opencode` | `com.flipcash:ocp-client-protocol` | `code-payments/ocp-client-protocol` | `code-payments/ocp-protobuf-api` |
2228

2329
## Pre-flight context
2430

25-
- Current proto files: !`find definitions/*/protos/src/main/proto -name "*.proto" 2>/dev/null | wc -l | tr -d ' '` proto files across targets
26-
- Git status: !`git status --short definitions/`
31+
- Pinned versions: !`grep -E "^(ocp|flipcash2)-client-protocol = " gradle/libs.versions.toml`
32+
- Git status: !`git status --short gradle/libs.versions.toml services/`
2733

2834
## Input
2935

30-
Parse `$ARGUMENTS` to determine targets and optional commit SHA.
36+
Parse `$ARGUMENTS` to determine targets and an optional version.
3137

3238
**Rules:**
3339
- Known targets: `flipcash`, `opencode`
34-
- If no targets specified, fetch **both** (`flipcash` and `opencode`)
35-
- A hex string (7+ chars) as the last argument is treated as a commit SHA
40+
- If no targets specified, check **both**
41+
- A semver-looking string as the last argument is the version to move to; without
42+
one, use the latest release
3643
- Examples:
37-
- `/fetch-protos` → fetch flipcash + opencode at HEAD
38-
- `/fetch-protos flipcash` → fetch flipcash only
39-
- `/fetch-protos opencode abc1234` → fetch opencode at commit abc1234
40-
- `/fetch-protos flipcash opencode` → fetch both explicitly
44+
- `/fetch-protos` → check both artifacts for newer releases
45+
- `/fetch-protos flipcash` → flipcash only, latest release
46+
- `/fetch-protos opencode 0.2.0` → opencode at 0.2.0
4147

4248
## Steps
4349

44-
### Step 1 — Fetch protos
45-
46-
For each target, run the fetch script from the repo root:
50+
### Step 1 — Find the release
4751

4852
```bash
49-
bash scripts/fetch-protos.sh -t <target> [commit_sha]
53+
gh release list --repo code-payments/<ocp|flipcash2>-client-protocol --limit 10
5054
```
5155

52-
Target-to-repo mapping (handled by the script):
53-
| Target | Repository |
54-
|--------|-----------|
55-
| `flipcash` | `git@github.com:code-payments/flipcash2-protobuf-api.git` |
56-
| `opencode` | `git@github.com:code-payments/ocp-protobuf-api.git` |
56+
Compare against the pin in `gradle/libs.versions.toml`. If the pinned version is
57+
already the latest and no version was requested, say so and stop.
58+
59+
If the contract change you want has **not been released**, it has to land in the
60+
client repo first: sync its protos at the upstream SHA, regenerate, and publish.
61+
That repo's README covers it — this skill does not do it.
5762

58-
Show the script output to the user.
63+
### Step 2 — Bump the pin
64+
65+
Edit `gradle/libs.versions.toml`:
66+
67+
```toml
68+
ocp-client-protocol = "<new>" # or flipcash2-client-protocol
69+
```
5970

60-
### Step 2 — Diff and summarize changes
71+
### Step 3 — Diff and summarize the contract change
6172

62-
Run `git diff` on the proto directories to identify what changed:
73+
The `.proto` sources are not in this repo. Diff them between the two release tags:
6374

6475
```bash
65-
git diff --stat definitions/
66-
git diff definitions/
76+
gh api repos/code-payments/<repo>/compare/<old-version>...<new-version> \
77+
--jq '.files[] | select(.filename | startswith("proto/")) | .filename'
6778
```
6879

69-
For each changed `.proto` file, summarize:
80+
Read the patch for each changed file. Summarize:
7081
- **New RPCs** added to services
7182
- **Modified RPCs** (changed request/response types or fields)
7283
- **Removed RPCs**
7384
- **New/modified messages** and fields
7485

75-
Present a structured change summary table to the user. If nothing changed, report
76-
that protos are already up to date and stop here.
86+
Present a structured change summary table. If the diff carries no `proto/` change,
87+
the release is generator or packaging work only — say so, and expect no service
88+
layer impact.
7789

78-
### Step 3 — Build verification
90+
### Step 4 — Build verification
7991

80-
Build the definitions modules to verify the protos compile:
92+
Build the service module that consumes the artifact:
8193

8294
```bash
83-
./gradlew :definitions:flipcash:models:assembleDebug :definitions:opencode:models:assembleDebug
95+
./gradlew :services:<flipcash|opencode>:assembleDebug
8496
```
8597

86-
Only build the targets that were fetched. If the build fails, show errors and stop.
98+
Only build the targets that were bumped. If the build fails, show errors and stop —
99+
a removed or renamed field breaks compilation here, which is the point.
87100

88-
### Step 4 — Detect service layer impact
101+
### Step 5 — Detect service layer impact
89102

90-
#### 4a — RPC changes
103+
#### 5a — RPC changes
91104

92-
For each new or modified RPC found in Step 2:
105+
For each new or modified RPC found in Step 3:
93106

94107
1. Identify which service proto file it belongs to (e.g., `account/v1/flipcash_account_service.proto`)
95108
2. Search for the corresponding Api class in `services/<target>/src/**/network/api/`
@@ -103,7 +116,7 @@ Present a report:
103116
| `NewRpc` | missing | missing | missing | missing | **New — needs scaffolding** |
104117
| `ModifiedRpc` | exists | exists | exists | exists | **Signature may need update** |
105118

106-
#### 4b — Message field changes (domain models)
119+
#### 5b — Message field changes (domain models)
107120

108121
For each message with added or removed fields (e.g., `UserFlags`, `UserProfile`):
109122

@@ -156,7 +169,7 @@ For **read-only** fields (e.g., booleans like `enablePhoneNumberSend`):
156169

157170
Present a report of domain model updates needed and apply them after user confirmation.
158171

159-
### Step 5 — Scaffold new service stubs
172+
### Step 6 — Scaffold new service stubs
160173

161174
For RPCs marked as needing scaffolding, ask the user if they want to scaffold them.
162175
If confirmed, generate code following the patterns below.
@@ -269,13 +282,13 @@ suspend fun newRpc(...): Result<DomainType> {
269282
If a new Repository interface+impl pair was created, add a `@Provides` binding in
270283
the corresponding Hilt module (`FlipcashModule.kt` or `OpenCodeModule.kt`).
271284

272-
### Step 6 — Review and commit
285+
### Step 7 — Review and commit
273286

274287
Show the user a summary of all changes (proto updates + any scaffolded code).
275288

276289
Offer to commit with a conventional commit message:
277290
```
278-
chore(protos): update <target> protobuf definitions
291+
chore(protos): bump <flipcash2|ocp>-client-protocol to <version>
279292
```
280293

281294
If service stubs were also scaffolded, suggest a separate commit:
@@ -285,7 +298,7 @@ feat(<target>): scaffold service stubs for new RPCs
285298

286299
## Never
287300

288-
- Edit generated protobuf code in `definitions/*/models/build/`
301+
- Try to edit the generated protobuf code — it lives in the published artifact
289302
- Commit without user approval
290303
- Skip build verification
291304
- Scaffold service code without asking the user first

‎.github/labeler.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- "apps/flipcash/shared/transfers/**"
99
- "apps/flipcash/shared/bills/**"
1010
- "apps/flipcash/shared/google-play-billing/**"
11-
- "definitions/**/micropayment/**"
1211

1312
"area: crypto":
1413
- changed-files:
@@ -68,7 +67,6 @@
6867
- "services/flipcash-compose/**"
6968
- "services/opencode/**"
7069
- "services/opencode-compose/**"
71-
- "definitions/**"
7270

7371
"area: onramp":
7472
- changed-files:

‎CLAUDE.md‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ services/
4444
opencode/ — Open Code Protocol gRPC services
4545
*-compose/ — Compose wrappers for services
4646
47-
definitions/
48-
flipcash/ — Protobuf definitions for Flipcash
49-
opencode/ — Protobuf definitions for OCP
50-
5147
libs/ — 20+ internal libraries
5248
crypto/ — Solana, Kin, Ed25519, encryption, key management
5349
network/ — Connectivity, JWT, exchange rates, Coinbase
@@ -86,7 +82,7 @@ The feature plugin automatically includes `:libs:logging`, `:ui:core`, `:ui:comp
8682

8783
- **CompositionLocal injection**: `MainActivity` provides dozens of controllers/services via `CompositionLocalProvider` — features access dependencies through `Local*` composition locals rather than direct injection
8884
- **Feature modules are self-contained**: Each has its own state, controllers, and UI; communicates via shared modules
89-
- **Protobuf models**: Backend models are generated from `.proto` files in `definitions/`; don't hand-edit generated code
85+
- **Protobuf models**: Backend models come from the published `com.flipcash:{ocp,flipcash2}-client-protocol` artifacts, not from protos in this repo; the contracts are generated in their own repos
9086
- **Dark mode only**: App forces `MODE_NIGHT_YES`
9187

9288
## Namespaces

‎README.md‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ graph TD
6262
Features["apps/flipcash/features/* — 26 self-contained screens"]
6363
Shared["apps/flipcash/shared/* — coordinators / controllers / services"]
6464
Services["services/* — gRPC wrappers (API → Service → Repository → Controller)"]
65-
Defs["definitions/* — protobuf sources + generated models"]
6665
UI["ui/* — Compose components, theme, navigation, scanner"]
6766
Libs["libs/* — crypto, network, logging, currency (leaf utilities)"]
6867
69-
App --> Features --> Shared --> Services --> Defs --> Libs
68+
App --> Features --> Shared --> Services --> Libs
7069
Features --> UI --> Libs
7170
Services --> Libs
7271
```
@@ -83,7 +82,7 @@ persistence, payments, the design system, testing, and more.
8382
| Navigation | Jetpack **Navigation 3** + a custom `CodeNavigator` |
8483
| DI | **Hilt** + `CompositionLocal` |
8584
| Async | Kotlin **Coroutines + Flow** (MVI via `BaseViewModel<State, Event>`) |
86-
| Networking | **gRPC + Protobuf**; Retrofit/OkHttp for REST |
85+
| Networking | **gRPC + Protobuf** (contracts from the published `com.flipcash:{ocp,flipcash2}-client-protocol` artifacts); Retrofit/OkHttp for REST |
8786
| Persistence | **Room** (per-user database) + DataStore |
8887
| Crypto | **Ed25519**, BIP39 mnemonic/key derivation, **Solana** |
8988
| Build | Gradle convention plugins, KSP, **Java 21** |
@@ -93,7 +92,6 @@ persistence, payments, the design system, testing, and more.
9392
```
9493
apps/flipcash/ Main app + feature (26) and shared modules
9594
services/ gRPC clients: flipcash, opencode (+ Compose wrappers)
96-
definitions/ Protobuf sources and generated models
9795
libs/ Reusable utilities (crypto, network, logging, currency, …)
9896
ui/ Compose design system, navigation, scanner, biometrics
9997
vendor/ Third-party SDKs (Kik scanner, OpenCV, TipKit)

‎build.gradle.kts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ plugins {
2828
alias(libs.plugins.bugsnag.gradle) apply false
2929
alias(libs.plugins.secrets) apply false
3030
alias(libs.plugins.navigation.safeargs) apply false
31-
alias(libs.plugins.protobuf) apply false
3231
alias(libs.plugins.androidx.room) apply false
3332
alias(libs.plugins.screenshot) apply false
3433
alias(libs.plugins.kover)

‎definitions/flipcash/models/.gitignore‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎definitions/flipcash/models/build.gradle.kts‎

Lines changed: 0 additions & 74 deletions
This file was deleted.

‎definitions/flipcash/protos/.gitignore‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎definitions/flipcash/protos/build.gradle.kts‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)