Skip to content

propose: FEIGN_CLIENT role → CLIENT + HTTP_CLIENT capability#28

Merged
HumanBean17 merged 2 commits into
masterfrom
propose/client-role-rename
May 6, 2026
Merged

propose: FEIGN_CLIENT role → CLIENT + HTTP_CLIENT capability#28
HumanBean17 merged 2 commits into
masterfrom
propose/client-role-rename

Conversation

@HumanBean17
Copy link
Copy Markdown
Owner

@HumanBean17 HumanBean17 commented May 6, 2026

Scope

Propose-only: rename role enum FEIGN_CLIENTCLIENT and add HTTP_CLIENT capability. Implementation lands in PR-H1 after PR-F1 (#27 plans) and PR-G1 (#27 plans) ship.

Also deletes propose/DEFERRED-REST-CLIENT-MIGRATION-PROPOSE.md (2026-04-26) which reached the opposite conclusion. The architecture has moved on since then — capabilities exist, brownfield overrides exist, @CodebaseRole exists — so its reasoning no longer applies.

TL;DR

  • Single source-of-truth flip in ast_java.py:90: "FeignClient": "FEIGN_CLIENT""FeignClient": "CLIENT"
  • Add "FeignClient": "HTTP_CLIENT" to _TYPE_ANN_TO_CAPABILITY (ast_java.py:111-114)
  • MESSAGE_PRODUCER already exists for KafkaTemplate/RabbitTemplate/JmsTemplate/StreamBridge/ApplicationEventPublisher — no async work in this propose
  • No auto-promotion expansion: RestTemplate/WebClient users keep their existing role and opt into CLIENT via brownfield @CodebaseRole(role="CLIENT")
  • Hard rename — no deprecation alias. MCP bundle has no users yet; breaking changes are explicitly allowed. FEIGN_CLIENT is removed from VALID_ROLES in the same PR; the existing validator rejects it with an error that lists the allowed roles.

Why

Vocabulary cleanup driven by brownfield annotation honesty:

If you annotate a non-Feign class with @CodebaseRole(role="FEIGN_CLIENT"), that's a smell — the annotation lies about what the class is. CLIENT is honest; HTTP_CLIENT (capability) describes how it talks.

This mirrors the existing CONTROLLER (Spring-native role) + REST_CONTROLLER/MESSAGE_LISTENER (capability/peer) pattern.

Scope discipline

  • ✅ No auto-promotion expansion (RestTemplate/WebClient stay where they are)
  • ✅ No async role changes — MESSAGE_PRODUCER already covers it
  • ✅ Ships after PR-F1 and PR-G1 (decision Q1=b in chat)
  • ✅ Single role enum change; capability added; no alias machinery (reuses existing VALID_ROLES check)
  • ✅ ~105 LOC implementation, 9 tests, ontology bump 8→9 (or 7→8 if PR-G1 hasn't shipped first)

§9 [TBD]

5 items, all with v1 recommendations. Most important:

  • TBD-1: @CodebaseRole(role="CLIENT") without @CodebaseCapability("HTTP_CLIENT") — accept as-is (capabilities are independent; user may have gRPC client where HTTP_CLIENT would be wrong)
  • TBD-2: search weight — keep _ROLE_SCORE_WEIGHTS["CLIENT"] = 0.06 (same as FEIGN_CLIENT today)
  • TBD-3: keep as separate PR-H1 (don't fold into F1/G1)

Sequencing

  1. PR-F1 (Feign-not-an-exposer, plan in plans: PR-F1 (Feign-not-an-exposer) + PR-G1 (cross_service_resolution flag) #27) lands → ontology 7→8
  2. PR-G1 (cross_service_resolution flag, plan in plans: PR-F1 (Feign-not-an-exposer) + PR-G1 (cross_service_resolution flag) #27) lands → no bump
  3. PR-H1 (this propose's implementation) lands → ontology 8→9, hard rename

Companion docs

Out of scope

  • Implementation (separate PR-H1, plan to follow if propose approved)
  • Async role/capability changes (MESSAGE_PRODUCER already covers it)
  • Auto-promoting RestTemplate/WebClient (brownfield only)
  • Database migration tooling for old graphs (full rebuild on ontology bump, as today)
  • Backwards-compat alias for FEIGN_CLIENT (no users yet → hard rename is fine)

Add CLIENT-ROLE-RENAME-PROPOSE.md:
- Rename role enum FEIGN_CLIENT → CLIENT (Spring-native vocabulary)
- Add HTTP_CLIENT capability (peer to MESSAGE_PRODUCER which already exists)
- Keep auto-promotion scoped exactly as today (only @FeignClient interfaces)
- RestTemplate/WebClient users opt in via brownfield @CodebaseRole annotations
- Two-phase deprecation alias: FEIGN_CLIENT accepted as alias for one release
- Ships AFTER PR-F1 and PR-G1; ontology bump 8→9 (or 7→8 if order changes)

Delete DEFERRED-REST-CLIENT-MIGRATION-PROPOSE.md:
- Superseded by the new propose
- Its 2026-04-26 conclusion (REST_CLIENT as capability, not role rename)
  is reversed by this proposal — the architecture has moved on:
  capabilities already exist, brownfield overrides already exist, and
  @CodebaseRole already lets users assign primary roles honestly.
MCP bundle has no users yet — breaking changes are explicitly allowed.
Simpler, smaller, cleaner:

- Remove FEIGN_CLIENT from VALID_ROLES in the same PR (no alias)
- Brownfield YAML/annotation inputs that still say FEIGN_CLIENT fail
  validation via the existing VALID_ROLES check; error message lists
  allowed roles, redirecting users to CLIENT + HTTP_CLIENT
- No new helper code in graph_enrich.py (was ~15 LOC alias machinery)
- LOC estimate ~120 → ~105
- Test #4 flipped from 'alias translated' to 'role rejected'
- §9 [TBD] reduced from 7 → 5 (alias-specific items removed)
- Risks table updated (row 1 likelihood N/A; old row 6 'alias complexity'
  removed)
@HumanBean17 HumanBean17 merged commit f78ecf8 into master May 6, 2026
HumanBean17 added a commit that referenced this pull request May 6, 2026
…ty (#32)

Implements propose merged in #28. Sequences after PR-F1 (#31, merged) and
PR-G1 (#30, merged). Hard rename — no deprecation alias, MCP bundle has
no users yet and breaking changes are explicitly allowed.

Single PR, ~115 LOC, ontology bump 8→9. Single source-of-truth flips at
ast_java.py:91 (role) and ast_java.py:114 (HTTP_CLIENT capability);
VALID_ROLES / VALID_CAPABILITIES are auto-derived so no java_ontology.py
edit needed.

9 new tests in tests/test_client_role_rename.py target ~290 passed,
4 skipped (281 baseline + 9).

Plan delta from propose: test #4 asserts warn-and-drop behaviour
(stderr warning + override silently dropped) matching actual
graph_enrich.py:443-447, 481-486, NOT raised ValueError as the propose's
example suggested.

Out of scope: async role/capability changes (MESSAGE_PRODUCER already
covers Kafka/Rabbit/JMS), auto-promoting RestTemplate/WebClient to
HTTP_CLIENT (brownfield-only opt-in), backwards-compat alias,
RegisterRestClient (followup #3).
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/client-role-rename 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