propose: JSON-shaped hint ids for MCP copy safety (#195)#196
propose: JSON-shaped hint ids for MCP copy safety (#195)#196HumanBean17 wants to merge 2 commits into
Conversation
Document combo 1+2+6: JSON-shaped hint emissions, agent guide and server ids docs, and alignment with 40-char hex symbol ids. Co-authored-by: Cursor <cursoragent@cursor.com>
HumanBean17
left a comment
There was a problem hiding this comment.
Critical review (propose-only PR)
Solid direction: root cause matches #195, combo 1+2+6 is the right default, and scoping out coercion / ontology bump is correct. The coordination callout with DESCRIBE-HINTS-STRUCTURAL-PROPOSE.md is valuable.
Before merging this propose (and definitely before the implementation PR), I'd tighten a few gaps that will otherwise bite the implementer.
1. 120-char cap is not theoretical — several locked templates will overflow
The propose defers shortening to "Open Questions" / implementation, but you can quantify this now with a realistic 40-char symbol id:
| Template (label prefix) | Current (approx) | JSON canonical (approx) |
|---|---|---|
routes via members: |
102 | 122 |
clients in overriders: |
118 | 138 |
So at least the OVERRIDDEN_BY.* override-axis strings need an explicit per-template plan (shorter label, drop label, abbreviate keys, or first-hop-only) in this propose, not left as TBD. Otherwise the implementation PR will either fail existing char-cap tests or silently weaken the road-sign contract.
Also flag templates that are already near/over cap today with optional params (TPL_NEIGHBORS_CALLS_* with edge_filter=…, structural row H with include_unresolved=True in DESCRIBE-HINTS-STRUCTURAL-PROPOSE.md) — JSON + boolean keys makes this worse.
2. "Entire hint surface" is only half-specified
§1 locks a neighbors JSON object shape, but the inventory still leaves copy-risk on other tools:
TPL_FIND_EMPTY_RESOLVE—resolve(identifier, hint_kind='{kind}')(Python kwargs / single quotes)TPL_RESOLVE_NONE_TRY_FIND_*—filter={{path_prefix: '…'}}(Python dict + format escaping)TPL_RESOLVE_NONE_TRY_SEARCH—search(query='…')TPL_SEARCH_WEAK—find(role=…)
These are the same class of failure for agents that paste into MCP JSON (especially filter / edge_filter, which the guide already warns about for stringified JSON). Either:
- extend the canonical contract to
find/resolve/searchJSON fragments (even if shorter prose for empty-find), or - narrow the scope statement to neighbors-shaped emissions + ontology
typical_traversals, and explicitly defer the resolve/find/search templates.
Right now §1 says "entire" but §2 only details neighbors + docs.
3. Batch / fake id hints need a locked decision, not only a recommendation
TPL_NEIGHBORS_SUCCESS_HTTP_TARGETS / _ASYNC_TARGETS / _CALLERS / _HANDLER still emit client_ids, handler_ids, etc. — that's the primary copy-paste footgun for multi-row results. Open Question 1's recommended prose is good; please promote it to a normative rule in §1 (and add one example emission) so implementation doesn't re-litigate.
4. Cross-propose / in-flight plan sequencing
Good that you block merging structural hints on the old shape. Two more coordination notes for the implementation PR author:
- Update
DESCRIBE-HINTS-STRUCTURAL-PROPOSE.mdtier table (rows A–H still showneighbors(['{id}'],…)) in the same PR that lands JSON hints — your sequencing §4 says this; worth making it a checklist item under Scope. plans/PLAN-OVERRIDDEN-BY-DOT-KEY-TRAVERSAL.mdalso rewrites several of the sameTPL_DESCRIBE_METHOD_*strings — call out merge order vs that plan so two branches don't fight over Appendix A locks.
5. Small inaccuracies / nits
- Inventory lists
tests/test_java_ontology.py"(if present)" — there is no such file; drop or point attests/test_mcp_hints.pyonly. DESCRIBE-HINTS-STRUCTURALtier table still says "≤120 chars with realisticsym:…id" — implementation should use hex ids per §6; align that prose when you amend the structural propose.- Consider a lightweight
plans/PLAN-HINTS-MCP-JSON-IDS.md+CURSOR-PROMPTS-…for the ~23neighbors(templates + ontology traversals + EDGE-NAVIGATION regen — repo handoff norm for this size of change.
Verdict
Approve the problem diagnosis and combo 1+2+6. I'd merge this propose after folding in (1) char-cap math with explicit template fallout, (2) resolve/find/search hint contract or narrowed scope, and (3) locked batch-id wording.
Implementation PR should not close #195 until templates + tests + README/AGENT-GUIDE/server descriptions land (PR body already says that — good).
Add 40-char char-cap fallout table, normative batch-id rule, narrow scope to neighbors-shaped templates, and align structural propose tier emissions with JSON + hex ids. Co-authored-by: Cursor <cursoragent@cursor.com>
What
Adds
propose/HINTS-MCP-JSON-IDS-PROPOSE.mdfor #195 (fix combo 1 + 2 + 6).Why now
Battle testing showed agents copy Python-style
neighbors(['<id>'],…)from road-sign hints into MCPids, producingUnknown id prefix for \['']`. README/AGENT-GUIDE examples also teach misleadingsym:` FQN ids while the graph stores 40-char hex symbol ids.Highlights
{"ids":"<id>",…}) acrossmcp_hints.pyandEDGE_SCHEMA.typical_traversalsserver.pyidsdescription: hints are advisory; never"['…']"stringsr:/c:/p:terminals); drop misleadingsym:examplesTests
Docs-only; baseline unchanged.
Out of scope
Implementation deferred to a follow-up PR per the propose sequencing section.
Closes #195 when implementation lands; this PR only adds the design propose.
Made with Cursor