- Shell 100%
Comment-only contract alignment from user-service #25 R2: RESOLVED_NEW_PROVIDER_LINK broadened to the cross-provider case (binding preserved, step-up mandatory); persistence/Kafka fault documented as UNAVAILABLE (retryable), INTERNAL reserved for non-transient. No wire change. R1 CONDITIONAL_APPROVE; the single MINOR (INTERNAL->UNAVAILABLE cross-service coordination) is moot — social-login is not yet a caller (PR-2), so no StatusCode.INTERNAL branch exists to break; closed via the PR description per the reviewer's guidance. |
||
|---|---|---|
| .forgejo | ||
| avro | ||
| family/v1 | ||
| realtime/v1 | ||
| scripts | ||
| shared/v1 | ||
| user/v1 | ||
| .gitignore | ||
| buf.gen.yaml | ||
| buf.yaml | ||
| README.md | ||
aim2be protobuf tree
Status: L-1 substrate-prep authoring. Authored 2026-05-14 per .planning/23-stage-b-proto-contracts.md. Files compile against buf v1.x + protoc-gen-go / protoc-gen-java / protoc-gen-grpc-java / protoc-gen-ts / grpc_tools.protoc.
Stage B target: every cross-service contract (Centrifugo channel envelope + proxy callback gRPC services + intra-cluster service-to-service gRPC) lives here. Per-service codegen lands in _gen/ (gitignored).
Layout
protobuf/
├── README.md # this file
├── buf.yaml # buf module config + lint rules
├── buf.gen.yaml # codegen targets (Java + TS + Python)
├── realtime/
│ └── v1/
│ ├── envelope.proto # Tag-based event envelope (Centrifugo channel payload)
│ ├── connect.proto # connect_proxy.Validate
│ ├── subscribe.proto # subscribe_proxy.Authorize
│ ├── publish.proto # publish_proxy.Validate
│ └── rpc.proto # rpc_proxy.Route
└── shared/
└── v1/
└── ids.proto # strong-typed UUID wrapper messages
Future additions (post-L0):
identity/v1/— identity-service gRPC + Avro eventsfamily/v1/,diary/v1/,calendar/v1/,notification/v1/,chatbot/v1/— per-service gRPC + eventsobservability/v1/error_event.proto— structured error event schema per ADR-0013
Versioning
realtime/v1/*.protofrozen at Stage B L7 close.- Minor version bumps (add optional field) allowed; require backward-compat.
- Major version bumps (remove or renumber field) require 90-day deprecation window + new
realtime/v2/directory.
buf-lint + buf-breaking
CI is wired in .forgejo/workflows/buf-lint.yml (runner label
aim2be-rework). Three jobs run on every push to main and every
pull-request targeting main:
buf lint— STANDARD + COMMENTS rules (configured inbuf.yaml).buf build -o /dev/null— validates the whole module compiles.scripts/check-import-direction.sh— mechanical guard forbiddingrealtime/v1/*.protofrom importingfamily/v1/...oruser/v1/.... Seebuf.yamlfor the rationale (producer-owned realtime/v1 must stay a leaf of the import graph; reverse coupling is a layering violation).
buf breaking --against '.git#tag=release/v1.0' will be added after
the L7 release tag lands.
Manual contract test for the import-direction guard:
# Add a forbidden import temporarily:
printf '\nimport "family/v1/family_context.proto";\n' >> realtime/v1/connect.proto
./scripts/check-import-direction.sh # exit code 1 + finding printed
git checkout -- realtime/v1/connect.proto
./scripts/check-import-direction.sh # exit code 0
Codegen
buf generate emits to _gen/ (gitignored):
- Java:
_gen/java/com/aim2be/...— vendored into each Java service via Mavensystemscope or local Nexus. - TypeScript:
_gen/ts/— published as@aim2be/protobuflocal npm package for PWA + Capacitor. - Python:
_gen/python/— published asaim2be-protobufwheel for chatbot-service.
buf and protoc invocations live in CI; local dev uses buf mod update + buf generate.
Authority
This directory is the canonical source of truth for every Stage B contract. Per .planning/23-stage-b-proto-contracts.md:
Single shared proto tree, vendored into each consuming service via the standard buf/grpc-tooling pipeline.
NOT in any submodule. Centralization is deliberate — schema evolution requires a single PR review surface.