AI 智能体上下文文件中的架构声明与代码实际情况匹配吗?
Does the Agent's Map Match the Territory? Architectural Claims in AI Agent Context Files and Their Fit with the Code
AI 导读
一项 arXiv 研究核查了 3,346 个开源项目中 3,602 个上下文文件里的 41,090 条路径声明和 184 条依赖规则。约 5% 路径声明指向找不到的路径,估计仅 2.2% 是真实错误;184 条依赖规则中 33 条(18%)在写下当天即被破坏且几乎一直未修复,说明上下文文件是好的地图但不太可靠的规则书。
正文 · 原文
Abstract:AI coding agents start every session without memory of how a system is built. Developers fill this gap with context files, such as this http URL and this http URL. Agents treat these files as true, so it matters whether they match the code. We study two kinds of architectural claims that can be checked against a repository: path claims, which name folders and files, and dependency rules, which say what may import what. We check 41,090 path claims and 184 dependency rules from 3,602 context files in 3,346 open-source projects against the code and its history. About 5% of path claims point to paths we cannot find, but we estimate that only 2.2% are real errors, similar to READMEs (3.5%). When code moves, 61% of claims that became stale are fixed, most in the same commit. Dependency rules behave differently: 33 of 184 (18%) were confirmed broken on the day they were written, usually by older code, and nearly all stayed broken. Context files are good maps but less reliable rulebooks: their rules often describe the architecture a team wants, not the one it has. In an exploratory comparison of 7,480 commits, new rule breaks were rare. Agent-assisted commits broke rules about 1.8 times as often as other commits (0.29% vs. 0.16%), but with only 14 breaks this is not significant: an early signal, not evidence of a difference or of its absence. We used an LLM with human review at each step, and discuss what this offers and risks for mining studies.
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2611.29916 [cs.SE] |
| (or arXiv:2611.29916v1 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2611.29916 arXiv-issued DOI via DataCite |
Submission history
From: Bachan Ghimire [view email]
[v1]
Mon, 23 Nov 2026 02:14:13 UTC (248 KB)
来源:arXiv cs.AI · arxiv.org