You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the protocol-aware cross-repo intelligence design in #292, I'd like to
contribute NATS subject detection as part of the Tier 2 typed-message pub/sub work.
The appendix in #292 already includes a Rust entry for async-nats but the most
common NATS client languages in production microservice stacks — Go, TypeScript,
and Python — are missing. I run a microservice fleet using NATS and can provide
real-world test fixtures.
Problem
Currently, NATS publish/subscribe connections between services are invisible to
codebase-memory-mcp. Given this code:
No ASYNC_CALLS or EMITS/LISTENS_ON edges are emitted between these services
today. The subject string "orders.created" is a literal at the call site —
exactly the case cbm can handle statically — but the NATS client patterns aren't
in service_patterns.c.
Proposed solution
Proposed Solution
Add NATS pattern entries to the service-pattern registry proposed in #292 for
these languages and clients:
Language
Client library
Publisher pattern
Subscriber pattern
Go
nats.go
nc.Publish(subject, data)
nc.Subscribe(subject, handler)
Go
nats.go JetStream
js.Publish(subject, msg)
js.Subscribe(subject, handler)
TypeScript
nats.ws / nats.deno
nc.publish(subject, payload)
nc.subscribe(subject, opts)
Python
nats-py
await nc.publish(subject, payload)
await nc.subscribe(subject, cb=handler)
Rust
async-nats
client.publish(subject, payload)
client.subscribe(subject)
NATS subjects are always literal strings or constants at the call site — no
generic type params, no config resolution needed. This makes it a clean Tier 2
addition with high precision/recall.
What I'll Deliver
Pattern definitions for the 5 cases above
Test fixtures: two minimal services (Go publisher → TypeScript subscriber)
under testdata/cross-repo/nats/
Tests in tests/test_pipeline.c asserting EMITS/LISTENS_ON edges are
emitted correctly
Wildcard subject handling (orders.*, events.>) documented as a known
limitation (dynamic matching, out of scope for v1)
What I'm NOT doing (to keep scope small)
No config-resolved subject names (that's Tier 4)
No wildcard-to-wildcard cross-repo matching (too ambiguous statically)
What problem does this solve?
Summary
Following the protocol-aware cross-repo intelligence design in #292, I'd like to
contribute NATS subject detection as part of the Tier 2 typed-message pub/sub work.
The appendix in #292 already includes a Rust entry for
async-natsbut the mostcommon NATS client languages in production microservice stacks — Go, TypeScript,
and Python — are missing. I run a microservice fleet using NATS and can provide
real-world test fixtures.
Problem
Currently, NATS publish/subscribe connections between services are invisible to
codebase-memory-mcp. Given this code:
Service A (Go) — publisher:
Service B (TypeScript) — subscriber:
Service C (Python) — subscriber:
No
ASYNC_CALLSorEMITS/LISTENS_ONedges are emitted between these servicestoday. The subject string
"orders.created"is a literal at the call site —exactly the case cbm can handle statically — but the NATS client patterns aren't
in
service_patterns.c.Proposed solution
Proposed Solution
Add NATS pattern entries to the service-pattern registry proposed in #292 for
these languages and clients:
nats.gonc.Publish(subject, data)nc.Subscribe(subject, handler)nats.goJetStreamjs.Publish(subject, msg)js.Subscribe(subject, handler)nats.ws/nats.denonc.publish(subject, payload)nc.subscribe(subject, opts)nats-pyawait nc.publish(subject, payload)await nc.subscribe(subject, cb=handler)async-natsclient.publish(subject, payload)client.subscribe(subject)NATS subjects are always literal strings or constants at the call site — no
generic type params, no config resolution needed. This makes it a clean Tier 2
addition with high precision/recall.
What I'll Deliver
under
testdata/cross-repo/nats/tests/test_pipeline.cassertingEMITS/LISTENS_ONedges areemitted correctly
orders.*,events.>) documented as a knownlimitation (dynamic matching, out of scope for v1)
What I'm NOT doing (to keep scope small)
Questions for Maintainers
to
service_patterns.cwhile the registry design is still being validated byTier 1 (feat: Tier 1 cross-repo gRPC matching + production-readiness fixes #293)?
testdata/cross-repo/nats/fixtures live — in-tree orexternal fixtures repo?
orders.*) emit edges with awildcard: trueproperty, or be skipped entirely in v1?
Happy to start after getting feedback here. I can also help with other NATS
client languages (Rust, Java) if useful.
Relates to: #292
Blocked by (soft): #293 (Tier 1 architecture validation)
Alternatives considered
No response
Confirmations