Repository navigation
更新过期 Skill - #37
更新过期 Skill#37
Conversation
PR Summary by Qodo升级 hx-agent-notes 至 2.3,建立严格的决策双向校验
AI Description
Diagram
High-Level Assessment
Files changed (55)
|
Code Review by Qodo
1. 新增归档文件时封存命令崩溃
|
| mkdirSync(dirname(manifestPathFor(loaded)), { recursive: true }) | ||
| writeFileSync(manifestPathFor(loaded), renderManifest(manifest.files)) |
There was a problem hiding this comment.
1. 新增归档文件时封存命令崩溃 🐞 Bug ≡ Correctness
verifyArchive() 在写入清单时调用了未导入的 mkdirSync、dirname 和 writeFileSync。当 seal-archive --write 发现尚未封存且其他检查均通过的归档文件时,该分支抛出 ReferenceError,清单无法更新。
Agent Prompt
## Issue description
`seal-archive --write` 新增归档条目时因未导入的函数而崩溃。
## Fix Focus Areas
- .agents/skills/hx-agent-notes/scripts/lib/seal.ts[6-7]
- .agents/skills/hx-agent-notes/scripts/lib/seal.ts[66-69]
## Recommended Fix
从 `node:fs` 导入 `mkdirSync`、`writeFileSync`,从 `node:path` 导入 `dirname`,并验证新增归档条目的写入路径。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| exit 0 | ||
| set -eu | ||
| # Install uv first; inspect the staged tree, not unstaged repairs | ||
| uv run scripts/redlines/agent_notes.py --staged |
There was a problem hiding this comment.
4. 自定义安装目录使提交钩子失效 🐞 Bug ≡ Correctness
新钩子始终执行 scripts/redlines/agent_notes.py,但安装器会按 --redline-dir 在指定目录生成入口。使用非默认目录后,钩子仍指向不存在的默认路径,暂存区校验无法运行。
Agent Prompt
## Issue description
指定 `--redline-dir` 后,提交钩子仍调用默认目录中的入口。
## Fix Focus Areas
- .agents/skills/hx-agent-notes/assets/hooks/pre-commit[4-4]
- .agents/skills/hx-agent-notes/scripts/setup/install.py[62-75]
## Recommended Fix
安装时按实际入口路径生成钩子,或让钩子从安装配置定位入口;验证非默认目录下的暂存区校验。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if not isinstance(roots, list) or not roots or len(set(roots)) != len(roots): | ||
| raise ValueError('guarded 必须是非空列表, 只含不重复的精确仓库路径') | ||
| if not all(canonical(p) for p in roots): |
There was a problem hiding this comment.
5. 非法配置无法生成门禁诊断报告 🐞 Bug ☼ Reliability
Snapshot.config() 在检查 guarded 元素类型前执行 set(roots),遇到对象或数组元素时会抛出 TypeError。verify.main() 未捕获此异常,因此这类格式错误的配置不会写出请求的 JSON 诊断文件,而是直接产生回溯信息。
Agent Prompt
## Issue description
`guarded` 包含不可哈希的 JSON 值时,校验器在生成门禁诊断前崩溃。
## Fix Focus Areas
- .agents/skills/hx-agent-notes/scripts/redline/snapshot.py[72-76]
- .agents/skills/hx-agent-notes/scripts/redline/verify.py[81-92]
## Recommended Fix
先确认每个元素都是合法路径字符串,再执行去重检查,并测试非法配置仍能生成 JSON 门禁诊断。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| const diff = pr | ||
| ? {files: await github.paginate(github.rest.pulls.listFiles, {...params, pull_number: pr.number}), base: pr.base.sha} | ||
| : await commitFiles(github, params, run.head_sha) |
There was a problem hiding this comment.
6. 多提交推送的部分诊断失去行内位置 🐞 Bug ≡ Correctness
publish() 对推送仅用 run.head_sha 调用 repos.getCommit 获取文件列表,而扫描器比较的是整个推送区间。当某个受检文件只在较早的提交中修改时,locate() 在末次提交的文件列表中找不到它,该诊断只能进入汇总评论。
Agent Prompt
## Issue description
推送扫描覆盖多个提交,但评论定位只查看最后一个提交的文件。
## Fix Focus Areas
- .agents/skills/hx-agent-notes/scripts/github/report.ts[5-22]
- .agents/skills/hx-agent-notes/scripts/github/report.ts[31-48]
## Recommended Fix
取得完整推送区间的改动文件,并为不属于末次提交的诊断选用可定位的提交或评论方式;增加多提交推送用例。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| for row in rows: | ||
| if row.get("usable") and row.get("api_key"): | ||
| return str(row["api_key"]) |
There was a problem hiding this comment.
7. 异常账户数据使辅助分诊崩溃 🐞 Bug ☼ Reliability
load_key() 解析 JSON 后直接对每个元素调用 row.get(),没有确认顶层及元素的数据类型。账户文件含有合法 JSON 但元素为 null 或标量时,调用在 main() 的异常处理之外抛错,无法进入缺少可用密钥时的非阻断跳过路径。
Agent Prompt
## Issue description
可解析但结构异常的账户文件使辅助分诊抛出未处理异常。
## Fix Focus Areas
- .agents/skills/hx-agent-notes/scripts/triage/note-triage.py[153-165]
- .agents/skills/hx-agent-notes/scripts/triage/note-triage.py[214-228]
## Recommended Fix
确认顶层是列表且元素为对象,再读取账户字段;结构无效时返回无可用密钥,使分诊走现有的非阻断跳过路径。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /** | ||
| * Run every Agent Notes gate in order and report one aggregate verdict. | ||
| * Usage: npx tsx scripts/verify-all.ts [--staged | --base <ref>] [--repo <dir>] |
There was a problem hiding this comment.
2. 笔记门禁 ci 和 npm 脚本都找不到入口文件 🐞 Bug ☼ Reliability
本 PR 删除了 scripts/verify-all.ts、scripts/verify-backlinks.ts、scripts/verify-coverage.ts、scripts/new-note.ts 和 scripts/notes-lib.ts,替代入口移到了 scripts/cli/ 和 scripts/authoring/ 下。但 .github/workflows/agent-notes.yml、package.json 里的 verify-notes/verify-notes:staged/verify-notes:coverage/verify-notes:backlinks/notes:new,以及 .agents/notes/AGENTS.md 都没改,仍然指向旧路径,合并后每次 PR/push 的 agent-notes job 都会因为文件不存在而直接失败,本地 hook 和 npm 命令也一样跑不起来。
Agent Prompt
## Issue description
skill 升级时删除了 `scripts/verify-all.ts` 等旧入口,但仓库里的 CI 工作流、package.json 脚本和 notes 文档还在引用这些旧路径,门禁会直接失败。
## Fix Focus Areas
- .github/workflows/agent-notes.yml[28-43]
- package.json[24-32]
- .agents/notes/AGENTS.md[22-22]
- .agents/notes/archived/AGENTS.md[7-7]
- .agents/notes/implemented/AGENTS.md[7-7]
## Recommended Fix
把这些引用改到新路径(`scripts/cli/*.ts`、`scripts/authoring/*.ts`),或者直接调用 `uv run --with-requirements .../scripts/redline/requirements.txt python .../scripts/redline/verify.py`。CI 中要加 `astral-sh/setup-uv`,也可以参考新的 `assets/ci/github-actions.yml` 重写工作流。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| data = json.loads(text) | ||
| if set(data) != {'version', 'guarded'} or data['version'] != 2: | ||
| raise ValueError('须使用 v2 配置, 且只能包含 version 和 guarded; 请显式迁移旧配置') |
There was a problem hiding this comment.
3. 仓库仍是 v1 配置,新门禁一运行就报配置错误 🐞 Bug ≡ Correctness
Snapshot.config() 要求 .agents/notes.config.json 只能包含 version 和 guarded,并且 version == 2,否则抛出 ValueError,门禁以退出码 2 结束。本仓库的配置仍是 v1 结构(root/coverage/backlinks 等字段),本 PR 没有运行 setup/install.py,也没有迁移配置;因此即使把调用改到新入口(包括保留旧命令名的 cli/verify-all.ts、cli/verify-backlinks.ts、cli/verify-coverage.ts 这几个 shim),所有校验也都会以 gate-error 失败。
Agent Prompt
## Issue description
升级到 v2 之后,门禁只接受 `{version: 2, guarded: [...]}` 这种配置,但仓库的 `.agents/notes.config.json` 还是 v1 格式,所有校验入口都会报配置错误。
## Fix Focus Areas
- .agents/notes.config.json[1-63]
- .agents/skills/hx-agent-notes/scripts/redline/snapshot.py[65-77]
## Recommended Fix
在本 PR 中运行 `uv run .agents/skills/hx-agent-notes/scripts/setup/install.py --repo . --guarded src --guarded scripts --guarded bin --guarded dashboard`,或者手动把配置改成 v2 格式,并按 v2 规则检查现有 notes 和源码锚点能否通过;如果暂时不打算迁移,就不要合入这次 skill 升级。
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Qodo FixerFound 7 findings, but none include a fix that can be applied automatically. |
由仓库卫生审阅单执行.
.agents/skills/hx-agent-notes1.0 -> 2.3 (来自HXLoLi.agents/skills/hx-agent-notes)