14 cross-service protocol linkers (PR 2/5)#377
Draft
Shidfar wants to merge 7 commits into
Draft
Conversation
Core framework for 14 protocol linkers: - servicelink.h: shared types, endpoint registry, pattern matching helpers - pass_servicelinks: pipeline pass that dispatches to per-protocol linkers - Endpoint persistence: protocol_endpoints table in each project DB - MCP tool registration and cross_project_links handler - Build system, test harness, and CI integration
GraphQL: schema field detection, gql template parsing, field-name extraction, operation name matching across producer/consumer pairs. gRPC: proto service/rpc definitions, client stub calls, streaming patterns across Go, Python, Java, TypeScript, and Rust.
Cloud messaging linkers for AWS and Apache Kafka: - Kafka: producer/consumer topic detection across Java, Python, Go, TS - SQS: queue URL and queue name extraction, send/receive matching - SNS: topic ARN detection, publish/subscribe patterns - EventBridge: event bus, rule, and put-events pattern detection
Message broker protocol linkers: - GCP Pub/Sub: topic/subscription detection, Terraform subscriber configs - RabbitMQ: exchange/queue binding, AMQP topic wildcard matching - MQTT: topic publish/subscribe with wildcard (+/#) matching - NATS: subject publish/subscribe with wildcard (*/>) matching - Redis Pub/Sub: channel publish/subscribe detection
Real-time and RPC protocol linkers: - WebSocket: connection URL detection, send/receive message matching - SSE: EventSource URL detection, event stream endpoint matching - tRPC: router procedure definitions, client hook call matching
Activates the linker files added by the prior cherry-picks: - Makefile.cbm: add 14 servicelink_*.c to PIPELINE_SRCS, add 14 TEST_SERVICELINK_*_SRCS test declarations, extend ALL_TEST_SRCS - pass_servicelinks.c: restore the LINKERS dispatch table to the full 14-entry list and remove the empty-table guard - pipeline.c: allocate cbm_sl_endpoint_list_t at function top (alongside path_aliases) so cleanup can free it safely even when the early cancel check goto's into cleanup before ctx is declared - test_main.c: register the 14 suite_servicelink_* test suites
This was referenced May 26, 2026
Removes stale-fact drift from the fork era (language/agent counts, install one-liner, feature bullets) flagged in PR DeusData#295's close comment. No URL substitutions involved — README's links already pointed at DeusData; this only reverts the content body. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the 14 protocol linkers that populate the empty dispatch table introduced by #376.
Stacked on #376 — please review that first. Until #376 merges, this PR's diff includes both #376 and PR 2 commits; it'll narrow to PR-2-only after #376 lands.
Commits
feat: add GraphQL and gRPC protocol linkersfeat: add Kafka, SQS, SNS, and EventBridge protocol linkersfeat: add Pub/Sub, RabbitMQ, MQTT, NATS, and Redis Pub/Sub linkersfeat: add WebSocket, SSE, and tRPC protocol linkersbuild: wire 14 protocol linkers into pipeline— restores the full LINKERS table inpass_servicelinks.c, adds source files to PIPELINE_SRCS, registers the 14suite_servicelink_*tests, and fixes a pre-existing latent UB bug incbm_pipeline_run(see below)Pre-existing UB bug fix in
cbm_pipeline_runThe plumbing commit in #376 added
cbm_sl_endpoint_list_free((cbm_sl_endpoint_list_t *)ctx.endpoints);to thecleanup:block. Butctxis declared after the early-cancel check (if (rc != 0 || check_cancel(p)) { goto cleanup; }), so when cancellation fires before any pipeline work, the cleanup block reads uninitialized stack memory throughctx.endpoints.I caught this with ASan in
test_integ_pipeline_cancel: the uninitialized slot happened to contain a stale sqlite-freed address from the previoustest_integ_mcp_list_projects(sqlite'spcache1EnforceMaxPagefreed memory duringcbm_store_close, and that address landed inctx.endpoints's slot on the cancel test's stack frame), surfacing as aheap-use-after-freeincbm_sl_endpoint_list_free. It's latent UB — the fulloss/clean-featuresstack passed because subsequent commits' stack-layout shifts happened to put NULL/safe values there.Fix: declare
cbm_sl_endpoint_list_t *endpoints = NULL;at the top ofcbm_pipeline_runalongsidepath_aliases, allocate the list after the cancel check, assign toctx.endpoints, and freeendpoints(notctx.endpoints) in the cleanup block. Safe regardless of which goto fires, sinceendpointsis declared before all gotos and initialized to NULL (andcbm_sl_endpoint_list_free(NULL)is a no-op).Test plan
./scripts/test.shpasses (3796/3796, ASan + UBSan)suite_servicelink_*test suites greentest_integ_pipeline_cancelUpstream overlap audit (re-checked against
upstream/main@ 6226972)Since this PR was opened the audit has been re-run on current upstream. Findings:
internal/cbm/service_patterns.c(lines 152-248) — library detection tables for kafka, sqs, sns, eventbridge, pubsub, rabbitmq/amqp, nats, redis, mqtt, grpc, graphql, trpcsrc/pipeline/pass_calls.c:253-257— emitsHTTP_CALLSandASYNC_CALLSedges with broker metadatasrc/pipeline/pass_parallel.c:1221-1327— emitsGRPC_CALLS,GRAPHQL_CALLS,TRPC_CALLSedgessrc/pipeline/pass_cross_repo.c:match_typed_routes(line 492) — cross-repo typed-route matching for gRPC/GraphQL/tRPCsrc/pipeline/pass_cross_repo.c:match_async_routes(line 330) — cross-repo matching for messaging protocols*_CALLSedges rather than emitting them in parallel.Marking remains draft until reviewed against this audit. PR #380 establishes the architectural reconciliation (cedes 4 protocols to upstream); the consolidated shape of this PR depends on how that lands.