Skip to content

feat(P4a): 大规模检索与分层查询 API(search/modules/ego/stats) - #63

Merged
kooksee merged 3 commits into
v2from
feat/p4a-graph-query-apis
Sep 4, 2026
Merged

feat(P4a): 大规模检索与分层查询 API(search/modules/ego/stats)#63
kooksee merged 3 commits into
v2from
feat/p4a-graph-query-apis

Conversation

@kooksee

@kooksee kooksee commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

概要

spec §6 实施服务端检索与分层查询(P4 的数据地基,计划:docs/superpowers/plans/2026-09-04-p4a-graph-query-apis.md):

端点 作用
GET /api/search 服务端检索:关键字(类型/函数名包含)+ kind + module 前缀 + 运行时状态(instantiated/error/slow)+ limit
GET /api/modules 模块级聚合:每 pkg 的类型/provider/对象计数 + 跨模块依赖列表(默认模块级视图的数据源)
GET /api/ego 以任意类型为中心的 N 跳邻域子图(direction=deps/dependents/both,depth 上限 10),缺 center 返回 400
GET /api/stats 概览升级:新增 modules、top_resolved(解析热度 TopN)、slow_providers、error_providers

全部基于 P1 Graph 只读投影 + providerStats,线性扫描(P1 既定决策:倒排索引等 P4b 定义查询形状与规模数据后再升级)。

偏离与边界

  • 跨模块依赖(DependsOn)在单包单测里只能验证"同包不产生依赖";跨模块场景由 dixhttp 多包 demo(example/http)在契约测试中覆盖模块分组本身
  • 100 provider 规模验收将在 P4b(构造大型演示容器 + 前端联调)时一并量化

验证

  • 新增 5 个测试(SearchNodes 过滤/ModuleGraph 聚合/EgoGraph 深度与方向/ResolvedTopN+ProblemProviders/端点契约),全仓 race + example 19 包全绿
  • 覆盖率:dixinternal 84.8%、dixhttp 78.8%(均 ↑);lint 0 issues

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: ea4bf2a6-f60e-4695-a6d5-82222e9f6a77


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kooksee
kooksee merged commit 136b802 into v2 Sep 4, 2026
3 checks passed
@kooksee
kooksee deleted the feat/p4a-graph-query-apis branch September 4, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant