Code reference detail
server.test.ts
packages/mcp/test/server.test.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| diff | done | Compare ideas in two git snapshots. The key is the file path plus the [idea_name]. The command reads `.rq` files from git and parses each snapshot. It does not read or write the ideas index. Line position does not count. The same body and attributes at a different line are unchanged. Content is the idea body plus its attributes. Change kinds: - created — the key exists only on the right snapshot - deleted — the key exists only on the left snapshot - modified — the key exists on both snapshots and the content differs - moved — the name exists in exactly one file on each side, the paths differ, and the content is the same The same name in more than one file on one side stays on the path-plus-name key. A renamed idea is deleted plus created. Unchanged ideas are omitted. A reference-only edit stays modified. No arguments: if any `.rq` path is staged, unstaged, or untracked and not gitignored, the left side is `HEAD` and the right side is that pending snapshot. Otherwise the left side is `HEAD~1` and the right side is `HEAD`. A non- `.rq` change does not select the pending snapshot. One argument: that revision against `HEAD`. Two arguments: the first revision against the second. A target is a branch, a commit, `HEAD`, `~N` ( `HEAD~N` ), or `<rev>~N`. The pending snapshot uses the working-tree file for an unstaged edit, the index blob when the working tree matches `HEAD`, and the working-tree file when a path is both staged and unstaged. An untracked `.rq` file that git does not ignore is included. If `HEAD` has no parent, the left snapshot is empty and every idea on `HEAD` is created. A missing revision or a directory that is not a git repository is an error. Exit status is 2. A successful diff exits 0, including an empty diff. When a side is filled by a default, the human CLI and [diff_webview] print a header `Comparing <from> -> <to>` before the rows. Explicit two-argument runs omit that header. `--json` and MCP stay a row array only. Surfaces: CLI `reqlan diff` ( [commands] ), MCP [skills_and_mcp.mcp_diff], and [diff_webview]. Engine: ["../../crates/reqlan-analytical/src/diff.rs"]. Git spawns stay hidden ( [consumption_silence] ). Related: [architecture] [function_parity] [idea] [idea_reference] [diff_verbosity] [diff_cli_color] | 0.163 | |
| diff_verbosity | done | Three levels. The default is summary. CLI: `--verbosity summary|references|text`, or `-v` / `-vv`. MCP and [diff_webview] use the same three values. - summary — change kind, idea name, and file. `fromFile` only for moved. - references — summary, plus [idea_reference] targets added on the right and removed from the left. Order each list by name. Omit a target that is on both sides. - text — summary, plus the body and attributes before and after. Created shows the right side. Deleted shows the left side. Modified shows both. Moved has no text change. Do not list reference names at this level. Attributes stay inside modified. The references level does not print attribute text. The text level prints body lines, then attribute lines as `@name` / `@name value`. `--json` omits `references` and `text` at summary. It adds `references` at references only. It adds `text` at text only. | 0.071 | |
| mcp_package | `packages/mcp` ( `@reqlan/mcp` ) is a stdio MCP server over the analytical analysis API — no VS Code host required. Entry: [mcp_main] via ["../packages/mcp/bin/mcp.js"]. Binary name `reqlan-mcp`. Used by Cursor and other MCP clients per [chat_participant_doc.mcp] and [skills_and_mcp.mcp_tools]. Search and retrieval use ["./extension/agent/skills-and-mcp.rq".mcp_click_retrieval] ( `click` ) only. npm `mcpName` is `io.github.littletuna4/reqlan` for MCP Registry ownership checks ( ["../packages/mcp/package.json"] ). Published to npm with language, analytical, and CLI per [package_versioning] and [distribution.version_management] ( `mcp/v*` ). Windows ESM entry uses `pathToFileURL` like ["./cli/cli_package.rq".windows_esm_entry]. | 0.109 | ||
| scope | These requirements describe the cross-package system architecture of the reqlan monorepo: language definition, language server, ideas index, editor product, and companion tools. They are distinct from [extension_scope.scope], which bounds only the VS Code extension and LSP product surface. Language concepts live in [ontology]; syntax truth lives in [syntax]; editor module contracts live under extension / module. Grouped as [workspace_packages], [language_runtime], and [product_map]. | 0.040 | ||
| check | done | `reqlan check` should run perform the following checks: - ensure all rq [reference] point to real nodes, unless rq ignored with [comment_reference_ignore]. - this tests rqcomments point to real parts of the namespace, that code references exist, and that rq references exists. - report unresolved imports: [check_unresolved_imports]. - report a comment reference with invalid syntax: [code_comment_syntax_errors]. - report a qualified reference whose file is not on disk: [check_qualified_missing_file]. - report a qualified reference whose `.rq` file does not declare the idea: [check_qualified_missing_idea]. - it should really just be a wrapper of the [index] and return the issues ( as a pipe, terminal output, or json ). Issue order: [check_order_by_target]. Sparse wildcards: [check_wildcard_sparse] via flags [check_wildcard_zero] and [check_wildcard_one]. Path globs: [check_glob_patterns]. Skip missing targets: [check_skip_targets] [check_skip_gitignored_targets]. CLI: ["../cli/cli_package.rq".commands]. MCP: ["../extension/agent/skills-and-mcp.rq".mcp_check]. CI: [check_meta_implementation]. Site demo: ["../site/site.rq".broken_links_showcase]. | 1.000 | |
| check_glob_patterns | done | [check] accepts more than one `--glob` pattern. Repeat `--glob` for each pattern. A file is in the recursive scan when it matches any glob. One `--glob` selects the same files as one path glob. A reference target that matches no glob is still checked. That target must resolve. [check] does not walk a directory that matches no glob. A positional path can name a file outside the globs. [check] checks that file. A positional path that is a directory outside the globs is not walked. An empty `--glob` value is an error. API: `AnalysisApi.check({ pathGlobs, paths })`. CLI: ["../cli/cli_package.rq".commands]. MCP: ["../extension/agent/skills-and-mcp.rq".mcp_check]. Related: [check] | 0.308 | |
| mcp_check | done | MCP `check` wraps [check] for AI clients ( [mcp_server] ). The tool returns JSON issue rows in [check_order_by_target] order. An empty list means that there are no issues. Optional arguments match the CLI [check] flags: glob, wildcard-zero, wildcard-one, skip-targets, and skip-gitignored-targets. `glob` is one path pattern or a list of path patterns ( [check_glob_patterns] ). A file that matches any pattern is in the scan. Related: [mcp_tools] [check] ["../../core_analysis/check.rq".check_unresolved_imports] | 0.243 | |
| mcp_click_retrieval | done | MCP `click` is the canonical search and retrieval tool ( [click], [mcp_server] ). One tool returns compact unique context, ranked ambiguous matches, or search hits. A second click on the same centre in the session returns connected content ( [agent_advisory] ). This surface maximises the token-to-insight ratio: names, short bodies, and caps — not edge dumps or full-graph lists. Keyword search, file context, local graph, and subtree expansion are click paths, not extra MCP tools. Agents must pass `sessionKey` on the next click. Related: [mcp_keyword_search], [mcp_tree_interrogation], [mcp_tree_summarisation]. | 0.144 | |
| mcp_diff | done | MCP `diff` wraps [diff] for AI clients ( [mcp_server] ). Arguments are optional `from`, optional `to`, and optional `verbosity` ( [diff_verbosity] ). The tool returns the same JSON array as `reqlan diff --json`. An empty array means that no idea changed. A missing revision is a tool error. Related: [mcp_tools] [diff] | 0.074 | |
| mcp_interaction_discovery | done | MCP clients discover tools through the MCP protocol tool list. Do not expose a list_interactions MCP tool. | 0.040 | |
| mcp_keyword_search | done | Keyword search across idea names, bodies, and attributes is a [click] path when no centre matches. Do not expose a separate MCP search tool. | 0.059 | |
| mcp_tools | done | The MCP server ( `@reqlan/mcp`, [mcp_server] ) exposes a small tool set for AI clients. Search and retrieval use [mcp_click_retrieval] only. Reference checks use [mcp_check]. Idea diffs use [mcp_diff]. Do not expose parse, search, list, file context, local graph, summarise subtree, requirement_reference, file_reference, or list_interactions as MCP tools. Those operations stay on AnalysisApi and CLI when they exist. Headless index storage follows [application_memory] ( `<base>/.reqlan` ), shared with the extension and CLI. | 0.097 | |
| mcp_tools_prompt | done | An mcp tool may provide a prompt-oriented entry point for working with the requirement graph. That tool must call [mcp_click_retrieval] for search and retrieval. It must not call the removed tools. | 0.040 | |
| mcp_tree_interrogation | done | File and idea neighbourhoods are a [click] unique result ( outbound, backlinks, siblings ). Do not expose a separate MCP file-context or local-graph tool. | 0.059 | |
| mcp_tree_summarisation | done | Compact subtree context is a [click] revisit: connected content for a centre already clicked in the session. Do not expose a separate MCP summarise-subtree tool. | 0.059 |
Reference labels
"../../../packages/mcp/test/server.test.ts:MCP surface is click, check, diff, completion_status, and prompt", "../../../packages/mcp/test/server.test.ts:a bad revision is a tool error", "../../../packages/mcp/test/server.test.ts:check returns JSON issue rows", "../../../packages/mcp/test/server.test.ts:diff returns created JSON and text bodies", "../../../packages/mcp/test/server.test.ts:omitted targets follow the clean and dirty defaults", "../../packages/mcp/test/server.test.ts:check accepts one glob or a list of globs", "../../packages/mcp/test/server.test.ts:check returns JSON issue rows", "../../packages/mcp/test/server.test.ts:diff returns created JSON and text bodies", "../packages/mcp/test/server.test.ts:MCP surface is click, check, diff, completion_status, and prompt", ../../../packages/mcp/test/server.test.ts, ../../../packages/mcp/test/server.test.ts:MCP surface is click, check, diff, completion_status, and prompt, ../../../packages/mcp/test/server.test.ts:a bad revision is a tool error, ../../../packages/mcp/test/server.test.ts:check returns JSON issue rows, ../../../packages/mcp/test/server.test.ts:diff returns created JSON and text bodies, ../../../packages/mcp/test/server.test.ts:omitted targets follow the clean and dirty defaults, ../../packages/mcp/test/server.test.ts:check accepts one glob or a list of globs, ../../packages/mcp/test/server.test.ts:check returns JSON issue rows, ../../packages/mcp/test/server.test.ts:diff returns created JSON and text bodies, ../packages/mcp/test/server.test.ts:MCP surface is click, check, diff, completion_status, and prompt