Repository navigation
fix(entries): guard destructive automation entry points (audit H7/H8) - #315
Merged
Merged
Conversation
审计 2026-09-26 H7:snapshots_prune 的 before 零校验——checkedAt 是
TEXT 按字典序比较,传 "z" 等非 ISO 字符串即删光项目全部快照并静默
返回成功;MCP 场景一次 tools/call 即可触发,无确认、无 dry-run。
- store 层新增 prunePreview(总数 + 命中数预览,未知项目返回 null)
- service 层 prune 加防护:ISO 8601 强校验(封堵字典序陷阱)、未知项目
抛错(不再静默 0)、dryRun 只预览、删除量超存量 50% 需 force:true;
返回 { matched, removed, total }
- MCP 工具与 headless CLI 同步暴露 dry_run/--dry-run 与 force/--force
- 测试:headless 服务级 6 场景 + CLI e2e 扩展 --dry-run 断言
…ment 审计 2026-09-26 H8:sync_release_status 与 appilot_overview 把 token 声明 为工具参数——描述一边劝阻一边接受,模型一旦走此参数,GitHub PAT 会落入 会话转录/持久化存储。与 generate_store_copy 自身「工具参数对模型可见、 防泄漏」的策略矛盾。 - 两个工具删除 token 参数,统一从 ctx.credentials / 环境变量读取 (generate/revise 工具既有标准) - 工具描述同步更新,向调用方明示凭据来源
|
Appilot CLA v1.0 accepted. Thank you for contributing. / Appilot CLA 1.0 已接受,感谢贡献。 |
fix(headless): guard snapshot prune by instant and atomic count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed · 改动内容
落实 docs/code-audit-2026-09-26.md 自动化入口防护批次(High × 2):
fix(entries): guard snapshots_prune against accidental full wipes—before零校验 + TEXT 字典序比较,一个非 ISO 字符串(如 "z")即删光项目全部快照且静默返回成功,MCP 一次调用即可触发。四层修复:store 新增 prunePreview;service 层 ISO 8601 强校验 + 未知项目抛错 + dryRun 预览 + >50% 删除量需 force;MCP 工具暴露 dry_run/force 参数;CLI 暴露 --dry-run/--force。fix(entries): stop exposing GitHub token as a model-visible tool argument— sync_release_status 与 appilot_overview 删除 token 参数,token 统一从 ctx.credentials/环境变量读取(对齐 generate_store_copy 既有防泄漏标准)。Verification · 验证
packages/headless/tests/snapshots-prune-guard.test.ts:6 场景(非法 before/未知项目/dryRun/>50% 拦截/force 放行/ISO 变体兼容)npm run typecheck通过;根npm test全链通过(2026-09-26)Contributor agreement · 贡献者协议