Skip to content

Commit 361fc0d

Browse files
address PR review: MCP producer strings and pass6 producer_kind
Update server tool descriptions for the four-kind graph surface; use ProducerRow.producer_kind in pass6 async rematch; fix AGENT-GUIDE v14 banner tense. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1b79373 commit 361fc0d

3 files changed

Lines changed: 20 additions & 12 deletions

File tree

build_ast_graph.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,10 +2142,11 @@ def _micro_factor(member: MemberEntry | None) -> float:
21422142
member = member_by_id.get(producer.member_id) if producer else None
21432143
base = row.confidence / max(1e-9, (0.3 * _micro_factor(member)))
21442144
src_route = route_by_id.get(row.route_id)
2145+
async_kind = producer.producer_kind if producer else "kafka_send"
21452146
call = OutgoingCallDecl(
21462147
method_fqn=f"{member.parent_fqn}#{member.decl.signature}" if member else "",
21472148
method_sig=member.decl.signature if member else "",
2148-
client_kind="kafka_send",
2149+
client_kind=async_kind,
21492150
channel="async",
21502151
feign_target_name="",
21512152
feign_target_url="",

docs/AGENT-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
> Calibrated against ontology version **14** (see `ast_java.ONTOLOGY_VERSION` /
1616
> `java_ontology.EDGE_SCHEMA` + valid sets): canonical edge navigation schema in
1717
> `docs/EDGE-NAVIGATION.md`. v14 re-index required; `HTTP_CALLS` is `Client → Route`;
18-
> PR-C adds `Producer` + `DECLARES_PRODUCER` and flips `ASYNC_CALLS`.
18+
> `Producer` + `DECLARES_PRODUCER` and `ASYNC_CALLS` (`Producer → Route`) ship in v14.
1919
> Still includes stored `OVERRIDES` Symbol→Symbol edges and v12 HTTP brownfield
2020
> (`@CodebaseHttpClient`, shared `CodebaseHttpMethod` enum, inbound layer-C HTTP routes
2121
> replace same-method built-in rows). **Design rationale:** navigation surface and tools —

server.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"Java codebase graph navigator (LanceDB + Kuzu). "
2828
"Tools: search (NL/code locate), find (structured NodeFilter), describe (one node + edge_summary: stored edge-label counts and optional composed keys for type Symbols and override-axis virtual keys for method Symbols), "
2929
"neighbors (one hop; you MUST pass direction in|out AND edge_types list — no defaults), "
30-
"resolve (identifier-shaped lookup for symbol/route/client — three statuses one|many|none). "
30+
"resolve (identifier-shaped lookup for symbol/route/client/producer — three statuses one|many|none). "
3131
"NodeFilter `filter` is a JSON object (preferred); a JSON-encoded string is also accepted as a fallback. "
3232
"Unknown filter keys and populated fields not applicable to the effective node kind fail with success=false and message. "
3333
"Edge labels: EXTENDS, IMPLEMENTS, INJECTS, OVERRIDES, DECLARES, DECLARES_CLIENT, DECLARES_PRODUCER, CALLS, EXPOSES, HTTP_CALLS, ASYNC_CALLS. "
@@ -385,7 +385,8 @@ async def search(
385385
"Exact structured listing for one node kind. Per-kind applicable fields: **symbol** — "
386386
"microservice, module, role, exclude_roles, annotation, capability, fqn_prefix, symbol_kind, symbol_kinds; "
387387
"**route** — microservice, module, http_method, path_prefix, framework; **client** — microservice, module, "
388-
"source_layer, client_kind, target_service, target_path_prefix, http_method. "
388+
"source_layer, client_kind, target_service, target_path_prefix, http_method; **producer** — microservice, "
389+
"module, source_layer, producer_kind, topic_prefix. "
389390
"Wildcards in prefix fields are rejected. An empty filter (`{}`) or `filter=None` means no predicate (all nodes of "
390391
"that kind; use pagination). Unknown keys or inapplicable populated fields return success=false. "
391392
"Successful responses echo `limit`/`offset` and may include `hints` (advisory next-step strings)."
@@ -395,7 +396,8 @@ async def find(
395396
kind: Literal["symbol", "route", "client", "producer"] = Field(
396397
description=(
397398
"Which graph table to search. 'symbol' = declarations, "
398-
"'route' = endpoints, 'client' = outbound clients."
399+
"'route' = endpoints, 'client' = outbound HTTP clients, "
400+
"'producer' = outbound async producers."
399401
)
400402
),
401403
filter: dict[str, Any] | str = Field(
@@ -429,8 +431,9 @@ async def describe(
429431
id: str | None = Field(
430432
default=None,
431433
description=(
432-
"Graph node id: sym:, route:, or client: prefix "
433-
'(e.g. sym:com.bank.chat.core.api.ChatController#joinOperator(JoinOperatorRequest)). '
434+
"Graph node id: sym:, route:, client:, or producer: prefix "
435+
'(e.g. sym:com.bank.chat.core.api.ChatController#joinOperator(JoinOperatorRequest); '
436+
"producer:svc|com.foo.Bar#send()|kafka_send|orders.created). "
434437
"When set, takes precedence over fqn."
435438
),
436439
),
@@ -453,7 +456,9 @@ async def describe(
453456
),
454457
)
455458
async def neighbors(
456-
ids: str | list[str] = Field(description="Origin symbol/route/client id, or list for batch"),
459+
ids: str | list[str] = Field(
460+
description="Origin symbol/route/client/producer id, or list for batch",
461+
),
457462
direction: Literal["in", "out"] = Field(
458463
description="Required. 'in' = predecessors (callers), 'out' = successors (callees). No default.",
459464
),
@@ -494,8 +499,8 @@ async def neighbors(
494499
@mcp.tool(
495500
name="resolve",
496501
description=(
497-
"Identifier-shaped node lookup (FQN, sym:/route:/client: id, HTTP method+path, "
498-
"route path template, client target_service, or target+path pair). Returns "
502+
"Identifier-shaped node lookup (FQN, sym:/route:/client:/producer: id, HTTP method+path, "
503+
"route path template, client target_service, target+path pair, or producer topic). Returns "
499504
"status=one (single node), many (≥2 ranked candidates with reason), or none "
500505
"(no match — fall back to search(query=...) for natural language or fuzzy text). "
501506
"Optional hint_kind narrows to symbol, route, client, or producer. "
@@ -508,11 +513,13 @@ async def neighbors(
508513
)
509514
async def resolve(
510515
identifier: str = Field(
511-
description="Identifier-shaped node lookup (FQN, id prefix, route path, client target, …)",
516+
description=(
517+
"Identifier-shaped node lookup (FQN, id prefix, route path, client target, producer topic, …)"
518+
),
512519
),
513520
hint_kind: Literal["symbol", "route", "client", "producer"] | None = Field(
514521
default=None,
515-
description="Optional kind constraint. Omit to search all three kinds.",
522+
description="Optional kind constraint. Omit to search symbol, route, client, and producer.",
516523
),
517524
) -> mcp_v2.ResolveOutput:
518525
return await asyncio.to_thread(mcp_v2.resolve_v2, identifier, hint_kind, None)

0 commit comments

Comments
 (0)