Skip to content

Commit c343cd5

Browse files
add pr-3 docs for http brownfield enum and exclusivity
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8265af7 commit c343cd5

3 files changed

Lines changed: 44 additions & 11 deletions

File tree

docs/AGENT-GUIDE.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212
> `neighbors` arguments, pass stringified JSON, or use vector search for
1313
> questions the graph answers exactly. This guide keeps them on the rails.
1414
>
15-
> Calibrated against ontology version **11** (see `ast_java.ONTOLOGY_VERSION` /
16-
> `java_ontology.py` valid sets). Design rationale:
17-
> [`propose/completed/MCP-API-V2-REDESIGN-PROPOSE.md`](../propose/completed/MCP-API-V2-REDESIGN-PROPOSE.md).
15+
> Calibrated against ontology version **12** (see `ast_java.ONTOLOGY_VERSION` /
16+
> `java_ontology.py` valid sets): HTTP brownfield rename (`@CodebaseHttpClient`),
17+
> shared `CodebaseHttpMethod` enum, inbound layer-C HTTP routes replace same-method
18+
> built-in rows. **Design rationale:** navigation surface and tools —
19+
> [`propose/completed/MCP-API-V2-REDESIGN-PROPOSE.md`](../propose/completed/MCP-API-V2-REDESIGN-PROPOSE.md);
20+
> HTTP brownfield rename, `CodebaseHttpMethod`, and exclusivity —
21+
> [`propose/HTTP-ROUTE-METHOD-ENUM-PROPOSE.md`](../propose/HTTP-ROUTE-METHOD-ENUM-PROPOSE.md).
1822
1923
---
2024

@@ -51,6 +55,14 @@ Treat the following as out of frame:
5155
When MCP disagrees with the open file, the file wins; report the
5256
disagreement as evidence of staleness, not as a contradiction.
5357

58+
### Brownfield HTTP annotations (exclusivity)
59+
60+
When a method carries **`@CodebaseHttpRoute`** or **`@CodebaseHttpClient`** (including plural containers), the extractor treats that annotation as the **only** source of truth for the facets it declares (`path`, HTTP verb, `targetService`, `clientKind`, etc.). Framework annotations on the **same** method that would normally drive route or client inference—Spring MVC/WebFlux mapping annotations, **`@FeignClient`**-scoped method mappings, JAX-RS verb annotations, and the like—are **bypassed** for that axis. Do not assume the graph “merges” brownfield with the framework row; for inbound HTTP, layer-C brownfield routes **replace** same-method built-in Spring rows in the graph.
61+
62+
**Observability:** If brownfield and shadowable framework annotations **co-exist** on a method, a **verbose** graph build emits a structured stderr line with **`event=brownfield-exclusivity-shadowing`** (severity INFO), listing which framework annotation simple names were skipped. Typical operator invocation: `.venv/bin/python build_ast_graph.py --source-root … --kuzu-path … --verbose`. Non-verbose builds may omit this traffic.
63+
64+
**UC10 (silent disagreement):** The brownfield annotation wins even when its HTTP verb or path disagrees with what Spring or Feign shows on the method (for example Feign **`@GetMapping`** vs brownfield **`CodebaseHttpMethod.POST`**). There is **no** merge-time warning for that mismatch—wrong assumptions surface at runtime (for example HTTP 405) or through code review. When auditing, prefer the indexed brownfield row and, if needed, the verbose shadowing log over the framework-only reading.
65+
5466
**Workflow (GPS model):**
5567

5668
1. **Locate**`search` (natural language / fragment) or `find` (structured `NodeFilter`).
@@ -193,7 +205,7 @@ Exact allowed values for roles, capabilities, client kinds, etc. live in `java_o
193205
- **Batching:** Multiple origins are expanded; pagination slices the **combined** edge list — use larger `limit` when batching many ids.
194206
- **Confidence:** Cross-service edges (`HTTP_CALLS`, `ASYNC_CALLS`) carry confidence, strategy, and match metadata on `edge.attrs` (`attrs.confidence`, `attrs.strategy`, `attrs.match`). Low confidence means the resolver had to guess at the route binding — treat it as a **resolver gap signal**, not a hallucination. Report low-confidence edges with their confidence value, not as facts. Intra-service edges (`CALLS`, `INJECTS`, `IMPLEMENTS`, `EXTENDS`, `DECLARES`, `DECLARES_CLIENT`, `EXPOSES`) faithfully represent the static graph; the resolved set is still a **lower bound** under reflection / dynamic dispatch (see *What this MCP is NOT*).
195207

196-
### Ontology glossary (version 11)
208+
### Ontology glossary (version 12)
197209

198210
Source of truth: `java_ontology.py`. Strings are case-sensitive.
199211

plans/PLAN-HTTP-ROUTE-METHOD-ENUM.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Plan: HTTP brownfield enum method, `@CodebaseHttpClient` rename, inbound exclusivity
22

3-
Status: **active (planning)**. This plan implements
3+
Status: **complete**. This plan implements
44
[`propose/HTTP-ROUTE-METHOD-ENUM-PROPOSE.md`](../propose/HTTP-ROUTE-METHOD-ENUM-PROPOSE.md).
5+
PR-1 and PR-2 landed earlier on `master`; PR-3 adds agent docs and the v2 addendum
6+
[`propose/completed/BROWNFIELD-ANNOTATIONS-V2-ADDENDUM-HTTP-METHOD-ENUM.md`](../propose/completed/BROWNFIELD-ANNOTATIONS-V2-ADDENDUM-HTTP-METHOD-ENUM.md).
57

68
Depends on: **none** (lands on current `master`).
79

@@ -210,9 +212,9 @@ Landing order: **PR-1 → PR-2 → PR-3**.
210212

211213
## Definition of done (PR-3)
212214

213-
- [ ] Agent guide documents exclusivity + UC10.
214-
- [ ] Addendum file exists and links parent propose + this plan.
215-
- [ ] No Python behaviour change in PR-3.
215+
- [x] Agent guide documents exclusivity + UC10.
216+
- [x] Addendum file exists and links parent propose + this plan.
217+
- [x] No Python behaviour change in PR-3.
216218

217219
---
218220

@@ -243,11 +245,13 @@ Landing order: **PR-1 → PR-2 → PR-3**.
243245
3. No remaining `CodebaseClient` / `CodebaseClients` in production Python, tests, or fixture Java per grep contract.
244246
4. Completed propose addendum exists under `propose/completed/`.
245247

248+
These criteria are met on `master` after PR-3.
249+
246250
# Tracking
247251

248-
- `PR-1`: _pending_
249-
- `PR-2`: _pending_
250-
- `PR-3`: _pending_
252+
- `PR-1`: _merged_
253+
- `PR-2`: _merged_
254+
- `PR-3`: _merged_
251255

252256
# Optional companion
253257

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Addendum: HTTP brownfield enum method, `@CodebaseHttpClient` rename, inbound exclusivity
2+
3+
This file extends **[`BROWNFIELD-ANNOTATIONS-V2-PROPOSE.md`](./BROWNFIELD-ANNOTATIONS-V2-PROPOSE.md)** without editing that document’s body (immutable parent).
4+
5+
## References
6+
7+
- Design: [`../HTTP-ROUTE-METHOD-ENUM-PROPOSE.md`](../HTTP-ROUTE-METHOD-ENUM-PROPOSE.md)
8+
- Execution plan: [`../../plans/PLAN-HTTP-ROUTE-METHOD-ENUM.md`](../../plans/PLAN-HTTP-ROUTE-METHOD-ENUM.md)
9+
- Agent-facing summary: [`../../docs/AGENT-GUIDE.md`](../../docs/AGENT-GUIDE.md) (brownfield HTTP exclusivity subsection)
10+
11+
## What landed (summary)
12+
13+
- **`@CodebaseClient` / `@CodebaseClients`** renamed to **`@CodebaseHttpClient` / `@CodebaseHttpClients`** on source stubs and in the extractor; no backward-compat alias for the old simple names.
14+
- Shared **`CodebaseHttpMethod`** enum (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`) on both **`@CodebaseHttpRoute`** and **`@CodebaseHttpClient`** stubs; `method` is mandatory on clients and is no longer a string on the annotation surface.
15+
- **Inbound HTTP brownfield exclusivity:** layer-C **`@CodebaseHttpRoute`** rows **replace** same-method built-in Spring HTTP rows in merge (aligned with async behaviour); wire-format `http_method` strings remain enum `.name()` values.
16+
- **Structured stderr events:** **`brownfield-exclusivity-shadowing`** (INFO) on extractor co-presence of brownfield HTTP annotations with shadowable framework annotations; **`brownfield-method-string-literal`** (WARN) when `method` is still a string literal mid-migration. Merge code does not emit the INFO event (single trigger in `ast_java.py`).
17+
- **`ONTOLOGY_VERSION` 12**; operators should **re-index** after upgrading so `meta_chain` keys and annotation simple names match the post-rename extractor (see README “Re-index required” callouts).

0 commit comments

Comments
 (0)