Code reference detail
rope.rs
reqlan rq/core_analysis/crates/reqlan-analytical/src/rope.rs
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| algorithm | done | [rope] shall, in this order: 1. Resolve target: idea name, `path#idea`, file basename, or indexed code file. More than one match returns cardinality-free candidates ranked by [click] session context; none falls through to search. 2. Determine base [fray]: user input `--fray` when given, else the [dynamic-rope-tuning] base. 3. Apply [rope-tuning] to reach the effective fray, clamped to the [fray] cap. 4. Perform breadth-first search from the target up to effective-fray hops over content edges ( ideaset membership, imports, and comment links are excluded; a file centre starts one hop out on ideas that reference it ). 5. Score each neighbour with [rope-idea-cardinality]; normalise to the top candidate and drop ideas below a 0. 5 ratio. 6. Deduplicate using the click session store: skip ideas already surfaced in the session ( [click-store-context-optimisation] ). 7. Order the chain: hop distance ascending, then cardinality descending within a hop, then by name. 8. Return compact context: the centre target plus candidate rows ( names, ids, file URIs, scores, hops ). 9. Track the centre and listed ideas in the click session store. | 0.036 | |
| click-store-context-optimisation | done | [roping] should be served through the ["../ontology.rq".click], store. This is to prevent the retreival of the same idea into context multiple times. click session should be used to track visited ideas and avoid duplicates. When an idea is already in click session, rope should respect session context. When a [rope] target matches more than one idea, matches are ranked by [click] session context: hop distance from the session ' s surfaced ideas ( see ["../cli/click.rq".click_session] ). | 0.049 | |
| dynamic-rope-tuning | partial | Default [rope-tuning] may be considerate of spec graph topology. For example, as graph gets more complex, the [fray] should be adjusted to include more adjacent ideas. As requested node gets close to the root, the [fray] should be adjusted to include more adjacent ideas. Implemented complexity metric: idea count and edge density only; base fray = 2 + edge density clamped to 0.. 4. | 0.056 | |
| fray | done | Fray is like temperature. it describes how many adjacent ideas are included in a [rope] response. This should have a default, but user can [rope-tuning] to adjust the [fray]. The effective fray is capped at 6; a user `--fray` is clamped the same way as a tuned one. | 0.063 | |
| rope | done | Rope is the command / function used for [roping], It is used in the [analysers] and the [cli] / [mcp]. Surface: CLI `reqlan rope <target> [--fray <n>] [--tuning <mode>] [--graph]`, MCP tool `rope`, and AnalysisApi `rope`. Default `fray` is dynamic ( see [dynamic-rope-tuning] ); `--fray <n>` overrides it. Returns the chain of ideas around the target with each idea ' s context, respecting click session deduplication ( [click-store-context-optimisation] ). Ambiguous targets return ranked matches; no match falls through to search. The target may be `@root` ( [rope-graph] ). Implemented by ["../../crates/reqlan-analytical/src/rope.rs"], `rope` in ["../../crates/reqlan-analytical/src/api.rs"], `rope` in ["../../crates/reqlan-napi/src/analysis.rs"], `rope` in ["../../packages/analytical/src/native/native-analysis-api.ts"], ["../../packages/cli/src/commands/rope.ts"], and `handleRopeTool` in ["../../packages/mcp/src/server.ts"]. | 0.065 | |
| rope-graph | done | `--graph` on the CLI `rope` command renders the [rope-output] chain as a linearised graph in the terminal: the root at the top, then box-drawing lines ( `├─`, `└─`, `│` ) to each idea in chain order; the first drawn line runs from the root to the highest-cardinality idea. Each drawn node keeps its context lines, dim hops, and dim score per [rope-output]. Root selection: the target idea is the implicit root. The target `@root` ropes the project root instead: the ideas with no inbound content references ( nothing references them; ideaset membership does not count ) — the project ' s constitution. More than one root lists ranked matches; `@root` resolves before any other target form. `--graph` is a CLI render mode only: JSON and MCP output carry the same `via` rows and stay plain. | 0.045 | |
| rope-idea-cardinality | done | rope [idea] cardinality is defined by a combination of the file position ( i. e. depth ), the number of ideas linked one directionally to the [idea] lower on the same branch, and the idea ' s position in a page, the idea ' s references, and the idea ' s [katz_centrality]. Many cardinality signals may be combined. Formula: `cardinality = depth_weight * depth + branch_factor * direction_links + position_weight * page_position + reference_weight * inbound_refs + katz_weight * katz_centrality` Depth is the hop distance to the rope centre ( farther means lower ), `depth_gap = max_hops - hops`. Implemented as fixed constants in `cardinality_raw` in ["../../crates/reqlan-analytical/src/rope.rs"]; default: depth_weight = 0. 3, branch_factor = 1. 5, position_weight = 0. 2, reference_weight = 0. 2, katz_weight = 0. 3. | 0.047 | |
| rope-tuning | done | Depending on model, or harness, or user input, the [fray] can be adjusted. Tuning modes: `default`, `focused`, `exploratory`, `deep`. Effective fray per [dynamic-rope-tuning] base: `default` = base, `focused` = 1, `exploratory` = ceil ( base * 1. 5 ), `deep` = base * 2, always clamped to the [fray] cap. User input `--tuning <mode>` adjusts the fray accordingly; unknown modes are an error. | 0.056 |
Reference labels
algorithm, click-store-context-optimisation, dynamic-rope-tuning, fray, rope, rope-graph, rope-idea-cardinality, rope-tuning