审核 Skill 目录加入 eslint 忽略,避免 --fix 改写指纹源
- .eslintrc.cjs 的 ignorePatterns 增加 apps/ai-game-creator-shell/src-tauri/resources/agc-skills/** - 审核 Skill 脚本按 SHA-256 定址并用 include_bytes! 编进客户端,eslint --fix 改写会导致 manifest 指纹漂移 - .prettierignore 本已排除该目录,eslint 补齐同一口径 - 更新决策记录
This commit is contained in:
@@ -169,6 +169,9 @@ module.exports = {
|
||||
'apps/ai-game-creator-shell/src/view/project-development/chat/generated/**',
|
||||
'apps/ai-game-creator-shell/src/services/generated/**',
|
||||
'apps/ai-game-creator-shell/src/features/project-workspace/generated/**',
|
||||
// 审核 Skill Pack:内容按 SHA-256 定址并经 include_bytes! 编译进客户端,
|
||||
// 不接受 eslint --fix 改写(.prettierignore 同样忽略该目录,避免指纹漂移)
|
||||
'apps/ai-game-creator-shell/src-tauri/resources/agc-skills/**',
|
||||
'target',
|
||||
'src/main.tsx',
|
||||
'src/App.tsx',
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
- 背景:`resources/agc-skills` 新增两个审核 Skill `platform-abstract` 与 `vite-export-xhs-minitool`。后者自带本地开发辅助文件(`.selective_rule.txt`、`scripts/.pack.test.mjs`、`scripts/.validate.test.mjs`),旧清单工具会走目录把它们当成必须声明的审核文件,指纹、安装与只读读取也无法区分「审核正文」和「本地辅助」。
|
||||
- 决策(新规则):`agc-skill-pack.v1` 引入「`.` 前缀即隐藏、永不进包」的全局约定。JS `isHiddenSkillEntryName` / `isSafeSkillRelativePath` / `collectBundledFiles` 与 Rust `is_hidden_skill_entry_name` / `is_safe_skill_relative_path` 共用同一口径:隐藏文件与目录不写清单、不参与 SHA-256、不安装到隔离 `.agents/skills`,也不能经 `agc_read_skill_resource` / `agc://skills/*` 读取。新增 Skill 只需声明非隐藏文件,无需为 `.selective_rule.txt` 之类补 `include_bytes!`;声明了隐藏路径会直接被拒绝。
|
||||
- 决策(注册):白名单两处同步扩到 10 项——`scripts/skill-pack-manifest.mjs` 的 `EXPECTED_SKILL_NAMES` 与 `src-tauri/src/agent/skill_pack.rs` 的 `AGC_SKILL_PACK_EXPECTED_NAMES`;`AGC_SKILL_PACK_FILES` 增加 13 条 `include_bytes!`(`platform-abstract` 1 + `vite-export-xhs-minitool` 12),数组长度 23 → 36。`agc-skill-pack.v1` manifest 版本 `2026-08-26.37` → `2026-08-26.40`,两个新条目的 `sha256` 由 `npm run agc:skill-pack:sync` 对当前工作树现场重算,不从旧构建复制。`vite-export-xhs-minitool` 的 `pack.mjs` / `validate.mjs` 顺带修掉阻止 pre-commit eslint 的问题(`simple-import-sort` 导入排序、未用参数改名 `_line`、NUL 正则加 `no-control-regex` 行内说明),并去掉 `platform-abstract/SKILL.md` 的行尾空格与两个 references 的多余 EOF 空行以通过 `git diff --check`,指纹随之同步到 .40;隐藏的 `.pack.test.mjs` / `.validate.test.mjs` 被 eslint 按点文件默认忽略,pre-commit 会经 `isPathIgnored` 过滤掉。
|
||||
- 决策(lint 边界):`.eslintrc.cjs` 的 `ignorePatterns` 增加 `apps/ai-game-creator-shell/src-tauri/resources/agc-skills/**`。审核 Skill 脚本按 SHA-256 定址并用 `include_bytes!` 编进客户端,`eslint --fix` 改写会让 manifest 指纹漂移,而 pre-commit 不跑 `skill-pack:check`,只能等 CI 暴露;`.prettierignore` 本已排除该目录,eslint 补齐同一口径。仓库自身的 `scripts/skill-pack-manifest.mjs` / `check-skill-pack.test.mjs` 仍正常 lint。
|
||||
- 决策(测试夹具):`codex_app_server` 里三条 fake app-server 的 `skills/list` 响应补上两个新名字;否则 `validate_direct_project_skill_catalog` 会判定审核 Skill Pack 不完整,让 DirectProject 启动失败关闭。
|
||||
- 影响范围:`apps/ai-game-creator-shell/scripts/{skill-pack-manifest.mjs,check-skill-pack.test.mjs}`、`apps/ai-game-creator-shell/src-tauri/src/agent/skill_pack.rs`、`apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/mod.rs`(仅测试夹具)、`apps/ai-game-creator-shell/src-tauri/resources/agc-skills/manifest.json`;`docs/technical/【技术方案】AI游戏创作智能体App实施计划-2026-06-24.md` 的 2026-08-20 审核 Skill Pack 条目同步。`docs/project-memory/plans/【里程碑】AGC编辑器分支产物归位与症状层补丁清理-2026-09-26.md` 里「`list_agc_skill_catalog` 返回 8 条」是当时实测记录,保留不改。
|
||||
- 验证方式:`npm run agc:skill-pack:check`(version=2026-08-26.40)、`node --test scripts/check-skill-pack.test.mjs`(5 passed,含隐藏路径拒绝与收集器忽略隐藏文件)、`cargo test --bin genarrative-ai-game-creator-shell -- --test-threads=1 agent::skill_pack`(7 passed)、`agent::codex_app_server::tests`(72 passed)、`agent::direct_runtime::tests`(92 passed)、`cargo fmt --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check`、`npx eslint`(两个新 Skill 的非隐藏脚本)通过。
|
||||
- 影响范围:`apps/ai-game-creator-shell/scripts/{skill-pack-manifest.mjs,check-skill-pack.test.mjs}`、`apps/ai-game-creator-shell/src-tauri/src/agent/skill_pack.rs`、`apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/mod.rs`(仅测试夹具)、`apps/ai-game-creator-shell/src-tauri/resources/agc-skills/manifest.json`、`.eslintrc.cjs`(审核 Skill 目录加入 `ignorePatterns`);`docs/technical/【技术方案】AI游戏创作智能体App实施计划-2026-06-24.md` 的 2026-08-20 审核 Skill Pack 条目同步。`docs/project-memory/plans/【里程碑】AGC编辑器分支产物归位与症状层补丁清理-2026-09-26.md` 里「`list_agc_skill_catalog` 返回 8 条」是当时实测记录,保留不改。
|
||||
- 验证方式:`npm run agc:skill-pack:check`(version=2026-08-26.40)、`node --test scripts/check-skill-pack.test.mjs`(5 passed,含隐藏路径拒绝与收集器忽略隐藏文件)、`cargo test --bin genarrative-ai-game-creator-shell -- --test-threads=1 agent::skill_pack`(7 passed)、`agent::codex_app_server::tests`(72 passed)、`agent::direct_runtime::tests`(92 passed)、`cargo fmt --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check` 通过;`npx eslint`(变更的仓库脚本)通过,且 `resources/agc-skills/**` 经 `isPathIgnored` 全部返回 true。
|
||||
- 边界:隐藏文件规则只约束随包审核与只读读取,不改变这些文件在仓库中的存在、权限或本地用途。
|
||||
|
||||
## 2026-10-04 游戏游玩次数修订:关停不强制 flush、flush 失败丢弃剩余分片、客户端 IP 只信 X-Real-IP
|
||||
|
||||
Reference in New Issue
Block a user