Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Feature request: expose owning-manifest lookup (nearest manifest with a name, per file)

未关闭
#1,871 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@LuisAlbertoMK 已经在做这个了。

开始于 2026年10月23日。

  • #2863 来自 @LuisAlbertoMK —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
c
领域
cli, tooling

调研方向

Start by reading the index and nodes schema, then inspect the codegraph files CLI command and the MCP tool entry points. The issue proposes indexing named manifests and resolving ownership via the nearest ancestor manifest, with a deterministic tie-break. Done means the lookup is exposed through CLI and MCP and clearly reports when no owning package exists; manifest formats needing real parsing are explicitly deferred.

由索引模型根据 Issue 内容生成。

描述

Several use cases need "which package owns this file" as a graph query instead of a hand-rolled resolver: sharding a set of changed files by package for parallel review or build agents, or other workspace-aware tooling.

CodeGraph doesn't have this today. Checked against an example project's live index (a PHP codebase, 179 files):

  • Manifest files (e.g. package.json, composer.json) aren't indexed as files at all (no row in files, no file node).
  • There's no package node kind, and no package/manifest concept anywhere in the nodes schema.
  • codegraph files --format grouped groups by language, not by owning package.

Proposed shape, based on a bash implementation we maintain today as a stopgap:

  • Index manifest files (e.g. package.json, composer.json) for at least their name field.
  • Given a file path, resolve its owning package by walking ancestor directories for the nearest manifest with a non-empty name. This also handles monorepos and workspaces without extra config. Each subpackage's own manifest is nearer to its files than the root manifest, so the walk resolves to the right package on its own. When two different manifest types are found at the same distance, pick a deterministic winner (e.g. package.json over composer.json).
  • Expose this as a query, both CLI (e.g. codegraph package-of <file> or a --group-by-package mode on files) and MCP tool, returning the package name or a clear "no owning package" result for files with none above them.

Manifest formats needing real parsing rather than a name-key grep (Cargo.toml, pyproject.toml) can follow later; a naive name = match would mis-group files.

主要语言
C
星标
73.2k
派生
4.7k
平均合并
4 小时 53 分钟
30 天内合并 PR
626

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

colbymchenry/codegraph 的其他 Issue

查看 colbymchenry/codegraph 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。