Skip to content

Commit fc45fc2

Browse files
address PR #196 review on hints JSON ids propose
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>
1 parent f232aeb commit fc45fc2

2 files changed

Lines changed: 110 additions & 90 deletions

File tree

propose/DESCRIBE-HINTS-STRUCTURAL-PROPOSE.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
**Depends on (landed):** describe rollups (`DECLARES.*`, `OVERRIDDEN_BY.*`), stored `OVERRIDES`, v4 `TPL_FIND_SUCCESS_HTTP_TARGETS` / `TPL_FIND_SUCCESS_ASYNC_TARGETS` strings.
1414

15+
**Depends on (implementation):** [`HINTS-MCP-JSON-IDS-PROPOSE.md`](./HINTS-MCP-JSON-IDS-PROPOSE.md) — tier A–H emissions use JSON `neighbors` fragments and **40-char hex** `id` in char-cap tests, not `neighbors(['{id}'],…)` / `sym:…`.
16+
1517
## TL;DR
1618

1719
- Extend the **`describe` success-path** hint catalog in `mcp_hints.py` with **10 hint rows** (tiers 1–2; **7** new `TPL_DESCRIBE_*` constants, reuse find v4 strings for **I/J**).
@@ -55,12 +57,12 @@ All tier-1 rows require:
5557

5658
### Tier 1 — type wiring (P0)
5759

58-
| ID | Trigger | Template constant | Emission (≤120 chars with realistic `sym:…` id) |
59-
|----|---------|-------------------|--------------------------------------------------|
60-
| **A** | `decl_kind == "interface"` and `IMPLEMENTS.in > 0` | `TPL_DESCRIBE_TYPE_IMPLEMENTORS` | `implementors: neighbors(['{id}'],'in',['IMPLEMENTS'])` |
61-
| **B** | `decl_kind == "class"` and `IMPLEMENTS.out > 0` | `TPL_DESCRIBE_TYPE_IMPLEMENTS` | `implements: neighbors(['{id}'],'out',['IMPLEMENTS'])` |
62-
| **C** | `decl_kind == "class"` and `role == "SERVICE"` and `INJECTS.out > 0` | `TPL_DESCRIBE_TYPE_DEPENDENCIES` | `dependencies: neighbors(['{id}'],'out',['INJECTS'])` |
63-
| **D** | `decl_kind in {interface, class}` and `INJECTS.in > 0` | `TPL_DESCRIBE_TYPE_INJECTORS` | `injectors: neighbors(['{id}'],'in',['INJECTS'])` |
60+
| ID | Trigger | Template constant | Emission (≤120 chars; `id` = 40-char hex; see HINTS-MCP-JSON-IDS fallout) |
61+
|----|---------|-------------------|-------------------------------------------------------------------------------------|
62+
| **A** | `decl_kind == "interface"` and `IMPLEMENTS.in > 0` | `TPL_DESCRIBE_TYPE_IMPLEMENTORS` | `{"ids":"{id}","direction":"in","edge_types":["IMPLEMENTS"]}` |
63+
| **B** | `decl_kind == "class"` and `IMPLEMENTS.out > 0` | `TPL_DESCRIBE_TYPE_IMPLEMENTS` | `{"ids":"{id}","direction":"out","edge_types":["IMPLEMENTS"]}` |
64+
| **C** | `decl_kind == "class"` and `role == "SERVICE"` and `INJECTS.out > 0` | `TPL_DESCRIBE_TYPE_DEPENDENCIES` | `{"ids":"{id}","direction":"out","edge_types":["INJECTS"]}` |
65+
| **D** | `decl_kind in {interface, class}` and `INJECTS.in > 0` | `TPL_DESCRIBE_TYPE_INJECTORS` | `{"ids":"{id}","direction":"in","edge_types":["INJECTS"]}` |
6466

6567
**Notes:**
6668

@@ -73,9 +75,9 @@ All tier-1 rows require:
7375

7476
| ID | Trigger | Template | Emission |
7577
|----|---------|----------|----------|
76-
| **E** | method/constructor; `1 <= CALLS.out <= 9`; no tier-1 rollup on parent (N/A here); **gate:** `role != "OTHER"` OR `CALLS.out >= 3` | `TPL_DESCRIBE_METHOD_OUTBOUND_CALLS` | `outbound calls: neighbors(['{id}'],'out',['CALLS'])` |
77-
| **G** | method; `OVERRIDES.out > 0`; **`not _override_axis_would_emit(edge_summary)`** — true when any key `k` with `k == "OVERRIDDEN_BY"` or `k.startswith("OVERRIDDEN_BY.")` has `out > 0` (same keys as override rollups today) | `TPL_DESCRIBE_METHOD_SUPER_DECL` | `super declaration: neighbors(['{id}'],'out',['OVERRIDES'])` |
78-
| **H** | method; `int(record.data.unresolved_call_sites_total or 0) > 0` | `TPL_DESCRIBE_METHOD_UNRESOLVED` | `unresolved: neighbors(['{id}'],'out',['CALLS'],include_unresolved=True)` |
78+
| **E** | method/constructor; `1 <= CALLS.out <= 9`; no tier-1 rollup on parent (N/A here); **gate:** `role != "OTHER"` OR `CALLS.out >= 3` | `TPL_DESCRIBE_METHOD_OUTBOUND_CALLS` | `{"ids":"{id}","direction":"out","edge_types":["CALLS"]}` |
79+
| **G** | method; `OVERRIDES.out > 0`; **`not _override_axis_would_emit(edge_summary)`** — true when any key `k` with `k == "OVERRIDDEN_BY"` or `k.startswith("OVERRIDDEN_BY.")` has `out > 0` (same keys as override rollups today) | `TPL_DESCRIBE_METHOD_SUPER_DECL` | `{"ids":"{id}","direction":"out","edge_types":["OVERRIDES"]}` |
80+
| **H** | method; `int(record.data.unresolved_call_sites_total or 0) > 0` | `TPL_DESCRIBE_METHOD_UNRESOLVED` | `{"ids":"{id}","direction":"out","edge_types":["CALLS"],"include_unresolved":true}` |
7981
| **I** | `kind == "client"` and `HTTP_CALLS.out > 0` | `TPL_FIND_SUCCESS_HTTP_TARGETS` (existing) | same as find v4 |
8082
| **J** | `kind == "producer"` and `ASYNC_CALLS.out > 0` | `TPL_FIND_SUCCESS_ASYNC_TARGETS` (existing) | same as find v4 |
8183

0 commit comments

Comments
 (0)