Skip to content

chore(adr): record protobuf rpc over nats micro binding decision#471

Open
yordis wants to merge 1 commit into
mainfrom
yordis/copy-adr-0016-nats-rpc
Open

chore(adr): record protobuf rpc over nats micro binding decision#471
yordis wants to merge 1 commit into
mainfrom
yordis/copy-adr-0016-nats-rpc

Conversation

@yordis

@yordis yordis commented Jul 4, 2026

Copy link
Copy Markdown
Member
  • First-party protobuf services on NATS had no governing rule for subjects, error signaling, or discovery, exposing them to the same mapping drift that motivated ADR 0011 for the JSON-RPC family.
  • The trogon.nats.micro.v1alpha1 annotations already ship in trogon-proto without an ADR defining what they mean on the wire.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only; no runtime or implementation changes in this PR.

Overview
Adds ADR 0016, which records how first-party protobuf service definitions map onto NATS micro (the protobuf counterpart to ADR 0011 for JSON-RPC).

The decision ties trogon.nats.micro.v1alpha1 annotations to wire behavior: each annotated service becomes one micro service with per-rpc endpoints, subjects derived from prefix + service + method name, success vs failure signaled only via Nats-Service-Error-Code, content-type rules from ServiceOptions, and shared discovery/load-balancing via micro rather than per-service inventing. It explicitly rejects JSON-RPC binding, ad-hoc mappings, and tunneled gRPC.

The ADR index gains a link to the new record. ADR 0017 (decider commands) is referenced as a specialization of this binding.

Reviewed by Cursor Bugbot for commit 571e4cc. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0cd7f88-7e04-440e-8313-cb36deae641c

📥 Commits

Reviewing files that changed from the base of the PR and between d840eb8 and 571e4cc.

📒 Files selected for processing (2)
  • docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
  • docs/adr/index.md

Walkthrough

This PR adds a new Architecture Decision Record (ADR 0016) documenting how annotated Protocol Buffers services bind to NATS micro, covering service/endpoint mapping, subject derivation, error discrimination via headers, content-type negotiation, and lists it in the ADR index.

Changes

ADR Documentation

Layer / File(s) Summary
ADR 0016 content
docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
New ADR defining protobuf service-to-NATS-micro-service and rpc-to-endpoint mapping, subject derivation, success/error discrimination via the Nats-Service-Error-Code header, content-type negotiation, invariants, rejected alternatives, consequences, and references.
ADR index registration
docs/adr/index.md
Adds an entry linking to ADR 0016 in the Records index list.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • TrogonStack/trogonai#396: Both PRs add ADR documentation for NATS-based RPC bindings and update docs/adr/index.md to register the new ADR entries.

Poem

A rabbit hops through docs so neat,
ADR sixteen, quite a feat! 🐇
Protobuf and NATS now bind as one,
Subjects derived, the mapping's done,
Headers whisper success or strife,
Index updated, docs come to life. 📜✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the new ADR recording the protobuf RPC over NATS micro binding decision.
Description check ✅ Passed The description matches the PR goal by discussing subject mapping, error signaling, discovery, and the existing NATS micro annotations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/copy-adr-0016-nats-rpc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant