Skip to content

propose: cross_service_resolution config flag (brownfield-first opt-in)#26

Merged
HumanBean17 merged 1 commit into
masterfrom
propose/cross-service-resolution-flag
May 5, 2026
Merged

propose: cross_service_resolution config flag (brownfield-first opt-in)#26
HumanBean17 merged 1 commit into
masterfrom
propose/cross-service-resolution-flag

Conversation

@HumanBean17
Copy link
Copy Markdown
Owner

Summary

Single new config flag in .lancedb-mcp.yml:

cross_service_resolution: auto | brownfield_only  # default: auto

When set to brownfield_only, pass6_match_edges suppresses auto-extracted cross-service edges. Only edges where both sides are sourced from brownfield layers (@CodebaseRoute + @CodebaseClient, or YAML equivalents) remain cross_service. Auto-resolved cross-service candidates fall back to unresolved.

intra_service matching, phantom detection, ambiguous labelling, and the PR-E3 invariant guard remain active in both modes — they don't require microservice topology guessing.

Why

The brownfield system (Layers A/B/C covering roles, routes, clients, async producers) is already complete — verified 2026-05-06. @CodebaseRoute on the consumer + @CodebaseClient on the caller already produce cross_service edges through the same matcher path that handles built-in routes (pass6_match_edges does not filter by route_source_layer).

This flag exists for regaining control before real-project testing:

  • PR propose: @FeignClient is a caller, not an exposer #25 just discovered a wrong-direction EXPOSES bug the auto path was silently producing for ~3 weeks
  • No real-project shakedown has happened yet — only curated fixtures
  • A user who wants "annotate the legacy hot spots, get correct edges" should not need to trust the auto matcher
  • If brownfield_only proves too tedious on real code, flip back to auto — no rollback needed

Scope

Single PR, ~150 LOC. New _load_config_cross_service_resolution, new cross_service_resolution field on GraphTables, new _is_brownfield_sourced helper, gate inside pass6_match_edges, GraphMeta schema bump (ontology 7→8), 6 tests.

No new MCP tools, no new annotation types, no new client/route extraction logic.

Companion / sequencing

Decision points

§9 has 6 [TBD] items. Most importantly:

  • [TBD-2] Should brownfield client + auto route still produce a cross-service edge? Recommend NO for v1 (matches "regain control" intent). Revisit after real-project test.
  • [TBD-3] Use unresolved or a new suppressed_by_mode match value? Recommend unresolved for v1 (smaller enum surface).

Status

Draft. Awaiting review before drafting per-PR Cursor task prompt.

Single config flag in .lancedb-mcp.yml, default 'auto' (no behaviour
change). When set to 'brownfield_only', pass6_match_edges suppresses
auto-extracted cross-service edges; only edges where both sides
came from brownfield layers (@CodebaseRoute + @CodebaseClient or
YAML overrides) remain cross_service. intra_service, phantom,
ambiguous, and PR-E3 invariant guard all stay active.

Goal: regain control before testing on real brownfield project.
Auto path is preserved; flag lets user opt out of auto matching
without deleting infrastructure. Reassess after real-project data.
@HumanBean17 HumanBean17 merged commit d6e8da5 into master May 5, 2026
HumanBean17 added a commit that referenced this pull request May 5, 2026
…#27)

Implements the merged proposes (#25 #26) as per-PR plans following
the PLAN-POST-TIER1B-FOLLOWUPS structure: scope, out-of-scope,
background, failure modes, resolution with code anchors, tests
table, manual evidence, definition of done, risk register,
followups, references.

PLAN-FEIGN-NOT-AN-EXPOSER: single PR (PR-F1), gates EXPOSES
emission on route.kind != 'http_consumer', surfaces suppression
count in GraphMeta. No schema bump (additive nullable column).

PLAN-CROSS-SERVICE-RESOLUTION-FLAG: single PR (PR-G1), adds
cross_service_resolution flag (auto | brownfield_only) to
.lancedb-mcp.yml. Gates pass6_match_edges cross-service
candidates on _is_brownfield_sourced helper. Ontology bump 7->8.
HumanBean17 added a commit that referenced this pull request May 6, 2026
* chore: tidy completed plans/proposes and refresh stale docs

Move completed plans to plans/completed/:
- PLAN-CLIENT-ROLE-RENAME.md (PR #33 merged)
- PLAN-CROSS-SERVICE-RESOLUTION-FLAG.md (PR #30 merged)
- PLAN-FEIGN-NOT-AN-EXPOSER.md (PR #31 merged)

Move completed proposes to propose/completed/:
- CLIENT-ROLE-RENAME-PROPOSE.md (PR #28 merged)
- CROSS-SERVICE-RESOLUTION-FLAG-PROPOSE.md (PR #26 merged)
- FEIGN-NOT-AN-EXPOSER-PROPOSE.md (PR #25 merged)

Refresh active docs:
- README.md "Deferred" section: trace_request_flow, find_route_callers,
  HTTP_CALLS/ASYNC_CALLS are shipped (not deferred). Add explicit pointers
  to the still-active TIER2-INCREMENTAL-REBUILD and REFRESH-CODE-INDEX-AUTO-MODE
  proposes for the incremental Kuzu work.
- CODEBASE_REQUIREMENTS.md A.3: drop the stale 'ontology version 3' literal
  (now 9) and fix references to PLAN-CAPABILITIES-MODEL and CALL-GRAPH-PROPOSE
  to use their completed/ paths. Tense matches reality (call-graph layer is
  shipped, not deferred).
- CODEBASE_REQUIREMENTS.md B.9: same fix for the propose/DEFERRED-CALL-GRAPH-PROPOSE.md
  reference; the propose lives under propose/completed/CALL-GRAPH-PROPOSE.md.

No code changes. Test baseline unchanged: 290 passed, 4 skipped.

* docs: add inline Java stubs for @CodebaseRoute / @CodebaseClient / @CodebaseProducer

Per pushback on PR #34: the route, client, and producer brownfield
annotations were mentioned 4x in README + CODEBASE_REQUIREMENTS but
their @interface stubs were never shown inline. Users had to spelunk
through tests/fixtures/ to know what to copy into their project.

README §5 'Brownfield overrides — Last resort — source stubs' now has
three explicit subsections:

  - 3a. Roles & capabilities — @CodebaseRole / @CodebaseCapability
        / @CodebaseCapabilities (class-level), with usage example.
  - 3b. Routes — @CodebaseRoute / @CodebaseRoutes +
        CodebaseRouteFrameworkKind / CodebaseRouteKind (method-level),
        with HTTP-endpoint and Kafka-consumer usage examples.
  - 3c. Clients & producers — @CodebaseClient / @CodebaseClients and
        @CodebaseProducer / @CodebaseProducers (method-level), with
        rest_template + kafka_send usage examples.

Stub Java in the doc matches the verbatim sources under
tests/fixtures/brownfield_route_stubs/ and brownfield_client_stubs/
(also referenced for copy-paste). Enum values mirror VALID_ROUTE_*
and VALID_CLIENT_KINDS in java_ontology.py.

CODEBASE_REQUIREMENTS.md A.2.1 updated to enumerate all three
annotation families (roles, routes, clients/producers) and link to
the matching README sections instead of only mentioning role stubs.

No code change. Test baseline unchanged: 290 passed, 4 skipped.
@HumanBean17 HumanBean17 deleted the propose/cross-service-resolution-flag branch May 10, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant