Skip to content

Commit abcfe6f

Browse files
author
xmtp-coder-agent
committed
chore: update generated protos
1 parent 1b615d1 commit abcfe6f

47 files changed

Lines changed: 4083 additions & 386 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Issue 86 Design
2+
3+
## 1. Summary
4+
5+
Issue 86 requires this repository's checked-in protobuf-generated artifacts to be refreshed against the latest XMTP proto definitions on the `xmtp/proto` `main` branch. The change should be generator-driven, preserve this repository's local notification service contract, and result in a PR containing only the generated updates and any minimal dependency adjustments required to keep the codebase green.
6+
7+
## 2. Project Goals & Non-Goals
8+
9+
**Goals**
10+
11+
- Refresh generated protobuf outputs derived from `buf.build/xmtp/proto` so they match the latest upstream `main` schema available at execution time.
12+
- Preserve generation of this repository's local notification service protos from `proto/notifications/v1/service.proto`.
13+
- Keep all checked-in generated surfaces consistent across Go server code, Swift client artifacts, and integration test client code.
14+
- Verify the regenerated code still builds and passes the repository's automated validation commands.
15+
16+
**Non-Goals**
17+
18+
- Changing the semantics of `proto/notifications/v1/service.proto` or the notification server API.
19+
- Refactoring application logic outside the minimal adjustments needed to compile against regenerated protos.
20+
- Introducing new code generation tooling beyond the Buf-based workflow already present in the repository.
21+
22+
## 3. Context
23+
24+
**Catalysts**
25+
26+
- GitHub issue: https://github.com/xmtp/example-notification-server-go/issues/86
27+
28+
**Codebase**
29+
30+
- `dev/gen-proto` regenerates local notification Go and TypeScript outputs, then regenerates upstream XMTP proto outputs, and clears `pkg/proto` before generation.
31+
- `buf.gen.yaml` defines root-level generation targets, including `pkg/proto` and `swift/`.
32+
- `proto/buf.gen.yaml` defines local notification service generation into `pkg/proto` and `integration/src/gen`.
33+
- `pkg/proto/` contains checked-in Go artifacts generated from both local and upstream protos.
34+
- `swift/` contains checked-in Swift artifacts generated from both local and upstream protos.
35+
- `integration/src/gen/` contains the generated TypeScript integration client for the local notification service.
36+
- `.github/workflows/test.yml`, `.github/workflows/lint.yml`, and `.github/workflows/buf.yml` define the repository's verification baseline.
37+
38+
**External docs**
39+
40+
- XMTP proto upstream: https://github.com/xmtp/proto
41+
- Buf module source used by generation: `buf.build/xmtp/proto`
42+
43+
**Impact area**
44+
45+
- `pkg/proto/**`
46+
- `swift/**`
47+
- `integration/src/gen/**`
48+
- `go.mod` / `go.sum` only if regeneration forces dependency updates
49+
50+
## 4. System Design
51+
52+
**Architecture overview**
53+
54+
The repository already has the required generation workflow, but it is split across two Buf templates. The implementation will use `proto/buf.gen.yaml` for local notification Go and TypeScript artifacts, `buf.gen.yaml` for local Swift notification artifacts, and the existing upstream generation path for XMTP proto artifacts from the latest available upstream schema. After regeneration, any compile or test failures caused by updated generated types will be fixed with the smallest application-side changes necessary to restore compatibility.
55+
56+
**New or modified interfaces**
57+
58+
No new interfaces are expected. Generated interfaces in `pkg/proto`, `swift`, and `integration/src/gen` may change to reflect upstream proto evolution.
59+
60+
**Key functions**
61+
62+
- `dev/gen-proto` SHALL remain the entrypoint for upstream proto regeneration.
63+
- Root `buf.gen.yaml` SHALL remain the source of truth for cross-language generation targets.
64+
- `proto/buf.gen.yaml` SHALL remain the source of truth for local notification service generation targets.
65+
66+
**Alternatives considered**
67+
68+
- Manual edits to checked-in generated files were rejected because they would drift from the established Buf workflow.
69+
- Updating only Go outputs was rejected because the repository checks in generated Swift and integration client artifacts that must stay synchronized with the same schema set.
70+
71+
## 5. Libraries & Utilities Required
72+
73+
**External dependencies**
74+
75+
| Package | Version | Purpose |
76+
|---------|---------|---------|
77+
| `buf` | existing CLI in repo environment | Regenerate protobuf artifacts from local and upstream schemas |
78+
79+
**Internal modules**
80+
81+
| Module | Path | Purpose |
82+
|--------|------|---------|
83+
| proto generator | `dev/gen-proto` | Regenerates upstream and local proto outputs |
84+
| root buf config | `buf.gen.yaml` | Defines Go and Swift generation targets |
85+
| local buf config | `proto/buf.gen.yaml` | Defines Go and integration TypeScript generation targets |
86+
87+
## 6. Testing & Validation
88+
89+
### Acceptance Criteria
90+
91+
1. WHEN the repository proto refresh workflow is run against the latest `buf.build/xmtp/proto` module THE SYSTEM SHALL regenerate checked-in upstream XMTP proto artifacts under `pkg/proto` and `swift` to match the latest upstream schema.
92+
2. WHEN proto regeneration completes THE SYSTEM SHALL preserve generation of the local notification service artifacts under `pkg/proto/notifications/v1`, `swift/notifications/v1`, and `integration/src/gen/notifications/v1`.
93+
3. WHEN regenerated proto outputs introduce compile-time API changes THE SYSTEM SHALL update the minimal affected application code so the repository builds successfully without changing notification service behavior.
94+
4. THE SYSTEM SHALL NOT include manual edits to generated protobuf files that cannot be reproduced by the repository's Buf generation configuration.
95+
5. WHEN verification commands are run after regeneration THE SYSTEM SHALL pass the repository's unit test and lint-relevant checks required for a reviewable PR.
96+
97+
### Edge Cases
98+
99+
- Upstream proto changes may remove or rename generated fields or packages used by server code.
100+
- Plugin version differences may change generated file headers or import layouts without semantic API changes.
101+
- Local notification service generation must remain intact even though `dev/gen-proto` removes `pkg/proto` before regeneration.
102+
- Generated output may require `go.mod` or `go.sum` updates if the generated code now references newer runtime packages.
103+
104+
### Verification Commands
105+
106+
- `./dev/gen-proto`
107+
- `buf generate`
108+
- `go test -p 1 ./...`
109+
- `buf lint proto`
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Issue 86 Task Decomposition
2+
3+
> **Source spec:** `docs/plans/2026-04-03-issue-86-design.md`
4+
> **Generated:** 2026-04-03
5+
6+
**Goal:** Refresh this repository's checked-in protobuf artifacts to the latest upstream XMTP proto `main` state while preserving local notification service generation and keeping the repository green.
7+
8+
**Phases:**
9+
1. Regenerate Protos — refresh upstream and local generated artifacts from the existing Buf workflow
10+
2. Compatibility Fixes — repair any compile or test fallout caused by regenerated APIs
11+
3. Verification — run repo validation and confirm no manual drift remains
12+
13+
### Task 1: Regenerate checked-in proto artifacts
14+
15+
**Files:**
16+
- Modify: `pkg/proto/**`
17+
- Modify: `swift/**`
18+
- Modify: `integration/src/gen/**`
19+
- Modify: `go.mod`
20+
- Modify: `go.sum`
21+
22+
- [ ] **Step 1: Write failing test**
23+
```sh
24+
./dev/gen-proto
25+
buf generate
26+
git diff --exit-code -- pkg/proto swift integration/src/gen go.mod go.sum
27+
```
28+
Expected: FAIL — `git diff --exit-code` exits non-zero because checked-in generated files are stale relative to the required generation entrypoints.
29+
30+
- [ ] **Step 2: Verify test fails**
31+
Run: `git diff --stat -- pkg/proto swift integration/src/gen go.mod go.sum`
32+
Expected: Non-empty diff showing generated artifact updates from `./dev/gen-proto` and `buf generate`.
33+
34+
- [ ] **Step 3: Implement minimal code**
35+
```sh
36+
./dev/gen-proto
37+
buf generate
38+
```
39+
Keep the generated outputs from those commands as the implementation. Do not hand-edit generated files. If generation updates `go.mod` or `go.sum`, keep those reproducible changes.
40+
41+
- [ ] **Step 4: Verify test passes**
42+
```sh
43+
./dev/gen-proto
44+
buf generate
45+
git diff --exit-code -- pkg/proto swift integration/src/gen go.mod go.sum
46+
```
47+
Expected: PASS for reproducibility after the generated changes are committed in the worktree context. Re-running the entrypoints should not create additional drift beyond the checked-in update set.
48+
49+
- [ ] **Step 5: Commit**
50+
`git add pkg/proto swift integration/src/gen go.mod go.sum && git commit -m "chore: regenerate protobuf artifacts"`
51+
52+
### Task 2: Restore compatibility with regenerated APIs
53+
54+
**Files:**
55+
- Modify: `pkg/**/*.go`
56+
- Modify: `mocks/*.go`
57+
- Test: `pkg/**/*_test.go`
58+
59+
- [ ] **Step 1: Write failing test**
60+
```go
61+
// Example focused red test command for the first broken package:
62+
// go test ./pkg/xmtp -run TestDecodeGroupMessage
63+
```
64+
Run: `go test -p 1 ./...`
65+
Expected: FAIL with the first compile or API mismatch introduced by regenerated protos.
66+
67+
- [ ] **Step 2: Verify test fails**
68+
Run: `go test -p 1 ./...`
69+
Expected: The same failure reproduces consistently until the affected code is updated.
70+
71+
- [ ] **Step 3: Implement minimal code**
72+
```go
73+
// Update only the smallest affected application and test sites to use the
74+
// regenerated proto APIs while preserving existing notification behavior.
75+
```
76+
Apply the minimal compatibility edits in application or test code. Do not change notification service semantics.
77+
78+
- [ ] **Step 4: Verify test passes**
79+
Run: `go test -p 1 ./...`
80+
Expected: PASS
81+
82+
- [ ] **Step 5: Commit**
83+
`git add pkg mocks go.mod go.sum && git commit -m "fix: adapt code to regenerated protos"`
84+
85+
### Task 3: Run final verification
86+
87+
**Files:**
88+
- Modify: none expected
89+
- Test: repository verification commands
90+
91+
- [ ] **Step 1: Write failing test**
92+
Run: `buf lint proto`
93+
Expected: PASS. Any failure becomes required remediation.
94+
95+
- [ ] **Step 2: Verify test fails**
96+
Run: `golangci-lint run --timeout=5m --config dev/.golangci.yaml && ./dev/lint-shellcheck && buf breaking --against \"https://github.com/xmtp/example-notification-server-go.git#branch=main,subdir=proto\" proto`
97+
Expected: PASS. Any failure becomes required remediation.
98+
99+
- [ ] **Step 3: Implement minimal code**
100+
Apply the smallest fixes required to satisfy verification while keeping generated outputs reproducible from the checked-in Buf configuration.
101+
102+
- [ ] **Step 4: Verify test passes**
103+
Run: `buf lint proto && golangci-lint run --timeout=5m --config dev/.golangci.yaml && ./dev/lint-shellcheck && buf breaking --against "https://github.com/xmtp/example-notification-server-go.git#branch=main,subdir=proto" proto && go test -p 1 ./... && ./dev/integration`
104+
Expected: PASS
105+
106+
- [ ] **Step 5: Commit**
107+
`git add -A && git commit -m "test: finalize proto refresh verification"`
108+
109+
## Requirement Coverage Matrix
110+
111+
| # | EARS Requirement | Task(s) |
112+
|---|------------------|---------|
113+
| 1 | WHEN the repository proto refresh workflow is run against the latest `buf.build/xmtp/proto` module THE SYSTEM SHALL regenerate checked-in upstream XMTP proto artifacts under `pkg/proto` and `swift` to match the latest upstream schema. | Task 1 |
114+
| 2 | WHEN proto regeneration completes THE SYSTEM SHALL preserve generation of the local notification service artifacts under `pkg/proto/notifications/v1`, `swift/notifications/v1`, and `integration/src/gen/notifications/v1`. | Task 1, Task 3 |
115+
| 3 | WHEN regenerated proto outputs introduce compile-time API changes THE SYSTEM SHALL update the minimal affected application code so the repository builds successfully without changing notification service behavior. | Task 2 |
116+
| 4 | THE SYSTEM SHALL NOT include manual edits to generated protobuf files that cannot be reproduced by the repository's Buf generation configuration. | Task 1, Task 3 |
117+
| 5 | WHEN verification commands are run after regeneration THE SYSTEM SHALL pass the repository's unit test and lint-relevant checks required for a reviewable PR. | Task 2, Task 3 |
118+
| 6 | `dev/gen-proto` SHALL remain the entrypoint for upstream proto regeneration. | Task 1 |
119+
| 7 | Root `buf.gen.yaml` SHALL remain the source of truth for cross-language generation targets. | Task 1, Task 3 |
120+
| 8 | `proto/buf.gen.yaml` SHALL remain the source of truth for local notification service generation targets. | Task 1, Task 3 |

pkg/proto/device_sync/content.pb.go

Lines changed: 23 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)