Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .cursor/rules/agent-workflow.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ inferring from code:
- Brownfield assumptions, role/capability tuning → `CODEBASE_REQUIREMENTS.md`.
- Why current design exists → `propose/completed/` and `plans/completed/`.
- Testing philosophy → `tests/README.md`.
- The currently-active per-PR plan → `plans/PLAN-TIER1B-COMPLETION.md`
with its companion prompts in `plans/CURSOR-PROMPTS-TIER1B.md`.
- Currently-active plans → `plans/PLAN-POST-TIER1B-FOLLOWUPS.md`
(PR-E1 + PR-E2 — deferred catches from Tier 1B reviews). Recently
completed Tier 1B plans live under `plans/completed/` (see
`PLAN-TIER1B-COMPLETION.md` and `CURSOR-PROMPTS-TIER1B.md` as
reference templates).

## Propose-then-implement culture

Expand Down Expand Up @@ -73,7 +76,7 @@ When you're given a per-PR task prompt from `plans/CURSOR-PROMPTS-*.md`:
exception: caller-side `HTTP_CALLS` / `ASYNC_CALLS` use option-(b)
*replacement* rather than union when any brownfield layer fires
on a method (single network packet → single edge). See
`plans/PLAN-TIER1B-COMPLETION.md` § "Caller-side composition
`plans/completed/PLAN-TIER1B-COMPLETION.md` § "Caller-side composition
divergence".
- Kuzu's Python binder rejects `dict` for `MAP` columns. Store all
map-shaped graph_meta data (`routes_by_framework`,
Expand Down
14 changes: 8 additions & 6 deletions .cursor/rules/project-overview.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ when needed.
- `tests/README.md` — testing philosophy.
- `propose/` and `propose/completed/` — design proposes; the active
ones describe in-flight scope (currently
`TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md` for B2b/B6, plus
`RANKING-MICROSERVICE-PROPOSE.md`,
`ENHANCED-ROLE-RECOGNITION-PROPOSE.md`,
`REFRESH-CODE-INDEX-AUTO-MODE-PROPOSE.md`,
`DEFERRED-REST-CLIENT-MIGRATION-PROPOSE.md`,
`PRODUCT-VISION.md`) and the completed ones explain *why* current
code looks the way it does.
code looks the way it does. Tier 1 + Tier 1B proposes
(`TIER1-COMPLETION-PROPOSE.md`, `TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`)
are now under `propose/completed/` since their PR sequences merged.
- `plans/` and `plans/completed/` — longer-form plans (e.g.
capabilities model, tier completions, brownfield role overrides).
Per-PR Cursor task prompts live alongside plans
(`CURSOR-PROMPTS-TIER1B.md` is the active one; PR-D1 and PR-D2
have shipped, PR-D3 is next).
Active plan: `PLAN-POST-TIER1B-FOLLOWUPS.md` (deferred catches from
Tier 1B reviews). Completed Tier 1B plans + cursor-prompts
(`PLAN-TIER1B-COMPLETION.md`, `CURSOR-PROMPTS-TIER1B.md`) are kept
under `plans/completed/` as reference templates.
- `.cursor/rules/breaking-changes.mdc` — the no-back-compat policy.

## File map (top of repo)
Expand All @@ -49,7 +51,7 @@ when needed.
|------|------|
| `server.py` | MCP stdio server. Every `@mcp.tool` lives here. |
| `search_lancedb.py` | Vector / hybrid / graph-expanded search; ranking. |
| `build_ast_graph.py` | Tree-sitter → Kuzu graph builder (full rebuild). Owns `pass1`–`pass5` (extends through `HTTP_CALLS` / `ASYNC_CALLS` caller edges as of ontology 7). PR-D3 will add `pass6_match_edges`. |
| `build_ast_graph.py` | Tree-sitter → Kuzu graph builder (full rebuild). Owns `pass1`–`pass6` (`pass5` emits `HTTP_CALLS` / `ASYNC_CALLS` caller edges; `pass6_match_edges` resolves cross-service / intra-service / ambiguous / phantom / unresolved match outcomes — ontology 7). |
| `kuzu_queries.py` | Read-only Cypher helpers used by the server. Includes `meta()` decoder for the Kuzu MAP-as-STRING JSON-blob columns. |
| `ast_java.py` | Tree-sitter Java parsing, role/capability inference, `_string_value_atoms` helper (shared by route/client/producer extractors), `_collect_outgoing_calls` for caller-side detection. |
| `graph_enrich.py` | `module` / `microservice` resolution, `BrownfieldOverrides` (route + role + capability + http client + async producer), meta-annotation walk, `resolve_routes_for_method` / `resolve_http_client_for_method` / `resolve_async_producer_for_method`. |
Expand Down
24 changes: 15 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ for tools that don't read `.cursor/rules/`.
- `CODEBASE_REQUIREMENTS.md` — Java-repo assumptions and tuning map.
- `propose/` and `plans/` (plus their `completed/` subdirs) —
in-flight scope and the rationale behind current design.
- Active proposes: `TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md` (B2b/B6
HTTP_CALLS / ASYNC_CALLS), `RANKING-MICROSERVICE-PROPOSE.md`,
- Active proposes: `RANKING-MICROSERVICE-PROPOSE.md`,
`ENHANCED-ROLE-RECOGNITION-PROPOSE.md`,
`REFRESH-CODE-INDEX-AUTO-MODE-PROPOSE.md`,
`DEFERRED-REST-CLIENT-MIGRATION-PROPOSE.md`, `PRODUCT-VISION.md`.
- Active plans: `PLAN-TIER1B-COMPLETION.md` and
`CURSOR-PROMPTS-TIER1B.md`. `PLAN-TIER1-COMPLETION.md` and
`CURSOR-PROMPTS-TIER1.md` are kept for reference even though
Tier 1 has fully merged.
- Completed: `propose/completed/CALL-GRAPH-PROPOSE.md`,
- Active plans: `PLAN-POST-TIER1B-FOLLOWUPS.md` (PR-E1/PR-E2 —
deferred catches collected from PR-D1/D2/D3 reviews).
- Completed (Tier 1 + Tier 1B): `propose/completed/TIER1-COMPLETION-PROPOSE.md`,
`propose/completed/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`,
`plans/completed/PLAN-TIER1-COMPLETION.md`,
`plans/completed/PLAN-TIER1B-COMPLETION.md`,
`plans/completed/CURSOR-PROMPTS-TIER1.md`,
`plans/completed/CURSOR-PROMPTS-TIER1B.md`. The two CURSOR-PROMPTS
files are kept as reference templates for future per-PR Cursor work.
- Older completed: `propose/completed/CALL-GRAPH-PROPOSE.md`,
`plans/completed/PLAN-CALL-GRAPH.md`,
`plans/completed/PLAN-CAPABILITIES-MODEL.md`,
`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES.md`,
Expand Down Expand Up @@ -62,7 +66,7 @@ Read these directly. Don't rely on rule files to mirror them.
are the only path to making this tool usable on legacy codebases.
New auto-detection logic must compose with brownfield (last layer
wins), never replace it. See
`plans/PLAN-TIER1B-COMPLETION.md` § "Caller-side composition
`plans/completed/PLAN-TIER1B-COMPLETION.md` § "Caller-side composition
divergence" for the one intentional exception (caller-side option-b
replacement rule for HTTP_CALLS / ASYNC_CALLS).
7. **Schema changes require a reindex** — update the README
Expand All @@ -81,7 +85,9 @@ Read these directly. Don't rely on rule files to mirror them.
## Per-PR Cursor task contract

When picking up a per-PR Cursor task prompt (e.g. one of the entries
under `plans/CURSOR-PROMPTS-TIER1B.md`):
under `plans/CURSOR-PROMPTS-<topic>.md`; see
`plans/completed/CURSOR-PROMPTS-TIER1B.md` as the canonical reference
template):

- Treat the prompt's **Out of scope** list as binding. Sentinel grep
patterns in the prompt must return zero on `git diff master..HEAD`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Cursor task prompts — Tier 1 completion (PR-A1 → PR-C)

Status: **completed — all PRs merged**. Kept as a reference template for
future per-PR Cursor delegation work.

One prompt per PR. Each is **self-contained**: copy the prompt verbatim
into Cursor, attach the files listed in its `@-files` block, and let
Sonnet execute. Each prompt fits comfortably in a single Sonnet session.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Cursor task prompts — Tier 1B completion (PR-D1 → PR-D3)

Status: **completed — all PRs merged**. Kept as a reference template for
future per-PR Cursor delegation work.

One prompt per PR. Each is **self-contained**: copy the prompt verbatim
into Cursor, attach the files listed in its `@-files` block, and let
Sonnet execute. Each prompt fits comfortably in a single Sonnet session.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Plan: Tier 1 completion (B2a + B4 + B5)

Status: **ready to implement**. Self-contained: an agent picking this up
Status: **completed — shipped via PR-A1 → PR-C** (merged 2026-04 → 2026-05). Self-contained: an agent picking this up
should be able to land it without re-deriving the design. Pairs with
[`propose/TIER1-COMPLETION-PROPOSE.md`](../propose/TIER1-COMPLETION-PROPOSE.md)
[`propose/TIER1-COMPLETION-PROPOSE.md`](../../propose/completed/TIER1-COMPLETION-PROPOSE.md)
(scope, rationale, schema). The follow-on proposal
[`propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`](../propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md)
[`propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`](../../propose/completed/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md)
(B2b + B6) depends on this plan landing first — **do not pre-implement
its hooks here**.

Expand Down Expand Up @@ -32,7 +32,7 @@ Three sub-features ship in **three independent PRs** (see §Rollout).
- **Brownfield surface extends `BrownfieldOverrides` — does not parallel
it.** The route resolver mirrors `resolve_role_and_capabilities`
shape-for-shape. See
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
— **mandatory reading** before touching §PR-A3.
- **Confidence-scored edges.** Same three-strategy ladder as
`pass3_calls`: literal=1.0, SpEL=0.85, constant_ref=0.7.
Expand Down Expand Up @@ -502,7 +502,7 @@ Update `_INSTRUCTIONS` to mention the new tools and the deferred
**Goal:** Make the route detector work on legacy codebases that use
custom (non-Spring) annotations. Mirrors the existing role/capability
brownfield system **exactly**. **Mandatory reading before this PR:**
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md).
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md).

## File-by-file changes

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Plan: Tier 1B completion (B2b + B6)

Status: **ready to implement**. Self-contained: an agent picking this up
Status: **completed — shipped via PR-D1 → PR-D3** (merged 2026-05). Self-contained: an agent picking this up
should be able to land it without re-deriving the design. Pairs with
[`propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`](../propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md)
[`propose/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`](../../propose/completed/TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md)
(scope, rationale, schema). Tier 1
([`PLAN-TIER1-COMPLETION.md`](PLAN-TIER1-COMPLETION.md)) **must be
merged** — this plan reads `Route` rows produced by `pass4_routes` and
Expand Down Expand Up @@ -47,7 +47,7 @@ The three sub-features ship in **three independent PRs** (see §Rollout).
expose multiple paths via path arrays.) See §Caller-side composition
divergence below for the algorithm.
Re-read
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
[`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
before touching §PR-D2.
- **One three-strategy resolver, two callers.** PR-A2's
`_route_value_atoms` (`ast_java.py:1041`) is renamed to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Tier 1 completion — active proposal
# Tier 1 completion — proposal (shipped)

Status: **activeready for planning**. Pairs with the borrow guide
[`reports/what-to-borrow-from-cmm.md`](../reports/what-to-borrow-from-cmm.md)
Status: **completedshipped via PR-A1 → PR-C** (merged 2026-04 → 2026-05). Moved to `propose/completed/` after PR-D3 (Tier 1B) landed. Pairs with the borrow guide
[`reports/what-to-borrow-from-cmm.md`](../../reports/what-to-borrow-from-cmm.md)
and follows on from the completed
[`propose/completed/CALL-GRAPH-PROPOSE.md`](completed/CALL-GRAPH-PROPOSE.md).
[`propose/completed/CALL-GRAPH-PROPOSE.md`](CALL-GRAPH-PROPOSE.md).

This proposal closes out **Tier 1 of the borrow guide** within the
**static-analysis scope**. It explicitly defers items that require
Expand Down Expand Up @@ -947,10 +947,10 @@ follow-ups, in order of leverage:
## 11. References

- [`TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md`](TIER1B-HTTP-ASYNC-EDGES-PROPOSE.md) - B2b + B6 propose
- [`reports/what-to-borrow-from-cmm.md`](../reports/what-to-borrow-from-cmm.md) — original borrow guide (Tier 1 §B1–B5).
- [`propose/completed/CALL-GRAPH-PROPOSE.md`](completed/CALL-GRAPH-PROPOSE.md) — completed call-graph proposal; same shape & style.
- [`reports/call-graph-review.md`](../reports/call-graph-review.md) — review that surfaced the resolver / extractor invariants.
- [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md) — **mandatory reading** for the implementer of §4.6 (brownfield route resolver mirrors this design).
- [`reports/what-to-borrow-from-cmm.md`](../../reports/what-to-borrow-from-cmm.md) — original borrow guide (Tier 1 §B1–B5).
- [`propose/completed/CALL-GRAPH-PROPOSE.md`](CALL-GRAPH-PROPOSE.md) — completed call-graph proposal; same shape & style.
- [`reports/call-graph-review.md`](../../reports/call-graph-review.md) — review that surfaced the resolver / extractor invariants.
- [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md) — **mandatory reading** for the implementer of §4.6 (brownfield route resolver mirrors this design).
- `graph_enrich.py` §"brownfield role / capability overrides" — the
existing implementation B2a extends.
- CMM source for pattern reference (read, don't fork):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# B2b + B6 — `HTTP_CALLS` / `ASYNC_CALLS` + cross-service matcher

Status: **activeready to implement**. Tier 1 (B2a + B4 + B5) is
merged; the `Route` schema in §3.1 has been verified against what
shipped. The implementable plan derived from this proposal lives at
[`plans/PLAN-TIER1B-COMPLETION.md`](../plans/PLAN-TIER1B-COMPLETION.md);
Status: **completedshipped via PR-D1 → PR-D3** (merged 2026-05).
Moved to `propose/completed/` once Tier 1B was complete. The
implementable plan derived from this proposal lives at
[`plans/PLAN-TIER1B-COMPLETION.md`](../../plans/completed/PLAN-TIER1B-COMPLETION.md);
per-PR Sonnet/Cursor prompts at
[`plans/CURSOR-PROMPTS-TIER1B.md`](../plans/CURSOR-PROMPTS-TIER1B.md).
[`plans/CURSOR-PROMPTS-TIER1B.md`](../../plans/completed/CURSOR-PROMPTS-TIER1B.md).

This document is now the **rationale + interface contract** that the
plan implements. Section 11 lists the open questions that have been
Expand All @@ -21,12 +21,12 @@ Before working on this proposal, read in order:

1. [`TIER1-COMPLETION-PROPOSE.md`](TIER1-COMPLETION-PROPOSE.md) §4
(B2a `Route` + `EXPOSES`) — defines every join key used here.
2. [`reports/what-to-borrow-from-cmm.md`](../reports/what-to-borrow-from-cmm.md)
2. [`reports/what-to-borrow-from-cmm.md`](../../reports/what-to-borrow-from-cmm.md)
§B2 (Route shape) and §B6 (cross-service edges).
3. [`reports/call-graph-review.md`](../reports/call-graph-review.md)
3. [`reports/call-graph-review.md`](../../reports/call-graph-review.md)
— same correctness invariants apply (microservice scoping,
confidence semantics, phantom-id collisions).
4. [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
4. [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md)
— brownfield surface for the **caller** side mirrors the same
pattern as B2a (see §6).
5. CMM source (pattern reference, do not port):
Expand Down Expand Up @@ -215,7 +215,7 @@ rename `_route_value_atoms` (`ast_java.py:1041`) → `_string_value_atoms`
and re-use from the new `pass5_imperative_edges`. No separate
extraction PR — the rename + four call-site updates ship in PR-D1
as a single atomic change. See
[`plans/PLAN-TIER1B-COMPLETION.md`](../plans/PLAN-TIER1B-COMPLETION.md)
[`plans/PLAN-TIER1B-COMPLETION.md`](../../plans/completed/PLAN-TIER1B-COMPLETION.md)
§ PR-D1 deliverable #1.

### 5.3 Final confidence
Expand Down Expand Up @@ -376,7 +376,7 @@ New `graph_enrich.resolve_http_client_for_method` and

**Resolved:** the full per-PR test inventory (48 cases across PR-D1,
D2, D3) lives in
[`plans/PLAN-TIER1B-COMPLETION.md`](../plans/PLAN-TIER1B-COMPLETION.md)
[`plans/PLAN-TIER1B-COMPLETION.md`](../../plans/completed/PLAN-TIER1B-COMPLETION.md)
§ PR-D1.4 / PR-D2.4 / PR-D3.5 with one row per case (name + assertion).
Mandatory buckets covered there:

Expand Down Expand Up @@ -465,7 +465,7 @@ but conservative.
## 12. References

- [`TIER1-COMPLETION-PROPOSE.md`](TIER1-COMPLETION-PROPOSE.md) — B2a, B4, B5 (active).
- [`reports/what-to-borrow-from-cmm.md`](../reports/what-to-borrow-from-cmm.md) §B2, §B6.
- [`reports/call-graph-review.md`](../reports/call-graph-review.md) — invariants this proposal must not regress.
- [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md) — mandatory reading for §6.
- [`reports/what-to-borrow-from-cmm.md`](../../reports/what-to-borrow-from-cmm.md) §B2, §B6.
- [`reports/call-graph-review.md`](../../reports/call-graph-review.md) — invariants this proposal must not regress.
- [`plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md`](../../plans/completed/PLAN-BROWNFIELD-ROLE-OVERRIDES-design-fixes.md) — mandatory reading for §6.
- [`propose/PRODUCT-VISION.md`](PRODUCT-VISION.md) §3 — `HTTP_CALLS` / `ASYNC_CALLS` are listed as *planned*; this proposal flips them to *shipped*.