add describe-time producer and override-route hints#164
Conversation
Close #161: emit symmetric road-sign hints for DECLARES_PRODUCER, DECLARES.DECLARES_PRODUCER, OVERRIDDEN_BY.DECLARES_PRODUCER, and OVERRIDDEN_BY.EXPOSES rollups plus producer-node declaring-method hint. Co-authored-by: Cursor <cursoragent@cursor.com>
HumanBean17
left a comment
There was a problem hiding this comment.
Review summary
Verdict: Approve — small, correctly scoped fix for #161. I don't see a functional bug in the hint logic.
What works well
- All five missing describe hints are implemented with the expected traversal shapes, atomic
EdgeTypeliterals (no dot-keys in emissions), and the same priority bands as existing client/route hints. - Producer leaf nodes follow the same early-return pattern as
route/client; type and method branches mirror the symmetric triggers. - Tests are mostly at the right layer: bank-chat e2e for type/method/producer leaf hints;
override_axis_rollup_smokee2e forOVERRIDDEN_BY.EXPOSES; parametrized ≤120-char sweep for all new templates. - No unnecessary schema/ontology/re-index churn — accurate for this PR.
Nits (non-blocking)
-
OVERRIDDEN_BY.DECLARES_PRODUCERcoverage is weakest —test_hints_describe_method_producers_in_overriders_emitsis syntheticgenerate_hints(...)only, whileclients_in_overridersuses bank-chat androutes_in_overridersusesoverride_axis_graph+ realdescribe_v2. No fixture currently produces that rollup key. Follow-up: extendoverride_axis_rollup_smoke(or a tiny brownfield stub) with override methods that declare producers, mirroringtest_describe_abstract_method_with_route_override_emits_exposes. -
Propose/catalog hygiene —
mcp_hints.pystill references the locked v1 catalog inHINTS-ROAD-SIGNS-PROPOSE.mdAppendix A, which doesn't list these five templates. Worth a short amendment note so the lock doc and code don't diverge. -
docs/AGENT-GUIDE.mddrift — override-axis section still documents onlyOVERRIDDEN_BY.DECLARES_CLIENT/OVERRIDDEN_BY.EXPOSES, notOVERRIDDEN_BY.DECLARES_PRODUCER(already inmcp_v2.py/server.py). Optional doc follow-up. -
Tiny test inconsistency — parametrized length test uses
{"id": "a"}forTPL_DESCRIBE_METHOD_PRODUCERS_IN_OVERRIDERSwhile siblings usesym:a(harmless for length-only). -
Duplicated
override_axis_graphfixture — copied fromtest_mcp_v2_compose.py; fine for this PR, could move toconftest.pylater.
Note on hint cap
A method with full override-axis rollups plus multiple leaf edges can exceed five candidates; finalize_hint_list drops lower-priority leaf hints first. Pre-existing behavior, not introduced here.
Please confirm CI green on this branch (Actions was pending at review time).
Extend override_axis_rollup_smoke with abstract/concrete Kafka producer override; replace synthetic producers-in-overriders hint test with describe_v2 e2e. Amend HINTS-ROAD-SIGNS Appendix A and AGENT-GUIDE for DECLARES_PRODUCER / OVERRIDDEN_BY.DECLARES_PRODUCER parity. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Closes #161.
mcp_hints.pyfor the producer axis (DECLARES.DECLARES_PRODUCER,DECLARES_PRODUCER,OVERRIDDEN_BY.DECLARES_PRODUCER) and the missing override-route axis (OVERRIDDEN_BY.EXPOSES), plus producer-node declaring-method hint.generate_hintswith the same priorities as symmetric client/route hints.tests/test_mcp_hints.py.No schema change, no re-index, no ontology bump.
Test plan
.venv/bin/ruff check ..venv/bin/python -m pytest tests/test_mcp_hints.py -v(110 passed, 2 skipped).venv/bin/python -m pytest tests -v(579 passed; 18 CLI failures are pre-existing env issue — systemjava-codebase-ragnot editable venv install)Made with Cursor