最新资讯
computerworld.com Box 发布 Architect:用自然语言构建业务流程工作流 the-decoder.com METR 称 Anthropic 或已在 7 月越过自身 AI 加速预警阈值 towardsdatascience.com 用 Ollama 和 Python 构建你的第一个多工具 AI Agent the-decoder.com Thinking Machines 的 Inkling 2 Small 称霸西方开放权重模型 dev.to 为 CI/CD 构建 AI 质量门禁 dev.to Kakao 发布面向 AI Agent 的决策模型 Kanana-2-v-decide computerworld.com Microsoft 对 Copilot Chat 企业用户扩大未公开的使用限制 pub.towardsai.net Google 发布 Gemini 4 Carbon:主打网络安全能力的前沿模型 gradientflow.com METR 研究:AI 正在加速构建 AI 的团队本身 www.infoq.com GitLab 19.5 将 Agentic 开发纳入 DevOps 平台的治理体系 aiacceleratorinstitute.com 研究:AI Agent 的复杂流程编排可能反而是问题所在 pub.towardsai.net MongoDB 推出 Vercel AI SDK 集成:为 AI 应用提供持久记忆
多元动态
登录 注册
智能体 dev.to · @szp2005

十三个过期文档中有十二个仅靠互相引用维持存活

原文 我的收藏

作者称其编码 Agent 在 36 个仓库中留下约 1200 个 markdown 文件,包括 PLAN.md、SUMMARY.md、HANDOFF.md 等。按时间过滤删除会误伤仍被 README 引用的旧文档,而“有入链引用就保留”的规则也在一天内被推翻:某交易仓库中 reports/E_F_G_RESULTS.md 已 116 天未更新,却仍有 1 条引用。

AI推荐理由 作者以 36 个仓库、约 1200 个 markdown 文件为背景,检验“按时间删除”和“按入链引用保留”两种文档清理规则,并给出具体反例(reports/E_F_G_RESULTS.md 116 天未更新但仍有 1 条引用),对使用编码 Agent 的团队有实践参考;但样本为个人机器,结论普适性有限。

64

正文

My coding agents are prolific note-takers. Every non-trivial session leaves a PLAN.md, a SUMMARY.md, a HANDOFF.md, sometimes a FINAL_REPORT_V2.md. Across 36 repos on this machine there are about 1,200 markdown files, and I could not tell you which ones anybody still opens. The obvious cleanup is a glob and a date filter: find . -name 'PLAN*.md' -o -name 'SUMMARY*.md' -mtime +30 -delete Enter fullscreen mode Exit fullscreen mode I did not run that, because I already knew what it would hit. A PLAN.md from May can still be the file a README points at when it explains why the approach changed. Age alone says nothing about whether a file is load-bearing. The rule that looked right So the next rule: keep anything that something else links to. Count inbound references, and if the count is above zero, the file is still wired into the repo. Old and unreferenced means safe to move. That rule survived about a day. Here is the scan that killed it, from a trading repo with a reports/ folder: reports/E_F_G_RESULTS.md 116d stale refs=1 reports/FINAL_HONEST_PLAN.md 116d stale refs=1 reports/FUNDING_HARVEST_REPORT.md 116d stale refs=2 reports/HONEST_FINDINGS.md 116d stale refs=1 reports/J_SUMMARY.md 114d stale refs=1 reports/FINAL_REPORT.md 114d stale refs=6 ... 13 files, all 114-116 days old, every one with refs > 0 Enter fullscreen mode Exit fullscreen mode Every file passed the "someone links to it" test. Then I traced where the links came from: grep -rl "J_SUMMARY\.md" --exclude-dir=.git . # reports/L1_AUDIT_REPORT.md Enter fullscreen mode Exit fullscreen mode L1_AUDIT_REPORT.md is in the same folder and is just as dead. I walked all thirteen. Twelve of them had every single inbound link coming from another file inside reports/. The folder was citing itself in a circle. Only FINAL_REPORT.md had a reference from outside: mql5/README.md, and a Python script that actually runs. A reference count of 1 was not evidence that anyone used the file. It was evidence that the agent wrote two files in the same session and made one mention the other. Three grades, and only one of them moves I stopped trying to find a rule that decides. The scanner now sorts into three buckets and hands the ambiguous one back to me: h.grade = h.ageDays 0 ? 'stale' // old but linked, I read these by hand : 'orphan'; // old and unlinked, movable Enter fullscreen mode Exit fullscreen mode Across those 36 repos: 687 active, 172 stale, 176 orphan. The 172 in the middle are exactly the files the glob would have eaten, and the ones the reference rule would have blessed. They are not a category the tool can resolve, so it doesn't pretend to. Orphans get moved rather than deleted. fs.renameSync puts them in .mdsweep/trash// next to a manifest that records every original path. mdsweep undo renames them back. Nothing in your tree gets unlinked; the only rmSync in the codebase targets the trash directory itself after a full restore. What I would not put on a slide The same scan flags 1,035 of 1,199 files, which is 86%, and that number is almost meaningless. One of the three detection signals is "untracked by git," so a repo with a messy working tree lights up wholesale. The flag rate measures my hygiene, not the tool's precision. The grading is the part that earns its keep. The stale bucket is also a genuine dead end, not a staging area. The reports folder above proves the tool cannot distinguish a live citation cluster from a dead one, and I do not think heuristics will get there. Thirteen files is a two-minute read for a human. Thirteen hundred would not be, and I have no answer for that yet. It is a single .mjs file, no dependencies, Node 18+. It reads your repo and prints a table; you have to pass --apply before it touches anything. git clone https://github.com/szp2005/mdsweep node mdsweep/bin/mdsweep.mjs scan ~/code/your-repo Enter fullscreen mode Exit fullscreen mode I built it (szp2005/mdsweep) for my own repos, and the reports folder above is why the middle bucket exists at all. If your agents also write more markdown than you read, the scan is read-only, so the worst case is that you find out your repos were fine.

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容