zai-org / zai-org/feedback

[插件mimosa] git-gate 存量全量硬拦且无豁免通道(seal 不改判、worktree 镜像整树误报),请求 diff 级判定与误报基线机制

Open
#613 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

环境
  • 插件:mimosa@zcode-plugins-official 1.0.3
  • 场景:PreToolUse git-gate(commit/push 硬拦)+ security_scan seal 深扫
  • 项目:Python/TypeScript 单仓(含治理 CLI 与测试套件),Windows 11
背景:三次独立实锤的误拦/误报,正规通道全部无效

1. 存量误报清单每次原样复现(2026-09-09 起,报 140 high)

  • 「硬编码凭据」×11:实为某后端服务的字段名→环境变量名映射字典——键是 API 字段名(如 api_password),值全部是 FRESHRSS_API_PASSWORD 这类环境变量的名字字符串,文件里没有任何真实凭据值;
  • 「路径穿越」×7:治理 CLI 的本职路径拼接(CLI 入参 join),属工具正常功能;
  • 其余约 120 项与被拦提交的 diff(仅 2 个 markdown 文档)零关联

2. 已试正规通道均无效

  • 同内容重试 3 次,误报清单原样复现(缓存不衰减、不重判);
  • 用插件自带 security_scan 完成整仓 seal 扫描(seal 哈希已留档)后,git-gate 仍按同一存量清单拦截——seal 完成不改判 git-gate 结论
  • MIMOSA_GIT_GATE_FAILURE_MODE=open|strict 只覆盖门禁自身崩溃/超时等 infra 故障,管不了「扫到发现就拦」的正常判定路径;
  • git-gate 判定逻辑在密封 payload 内(Ed25519 签名 + AES-256-GCM,改一字节即拒启),项目侧无 .mimosa 豁免/白名单/基线文件可写。

3. worktree 镜像目录整树误拦(2026-09-11)

  • git worktree add .worktrees/<name> 之后 push,深层扫描把 .worktrees/** 整树当新文件面重扫,测试用例代码里的假凭据/路径穿越用例全数上报(118 high / 2 mid,全部为主树同路径已在 seal 册的存量测试代码);
  • git worktree remove 拆掉 worktree 后原样重推即放行——内容零变化,纯「路径新增」触发整树重扫;
  • 后果:「多 worktree 并行开发」工作流与 git-gate 结构性互斥(每开一个 worktree,push 必被存量测试代码拦死)。
诉求(按优先级)
  1. 提供 .mimosa 误报豁免/基线机制(与 #300 的 suppression 诉求同源,可合并跟踪):支持按「规则+路径」或「规则+内容哈希」豁免;对 test*/** 测试文件支持全局降档或豁免。
  2. git-gate 改 diff 级判定:只对本次 commit/push 新增发现硬拦;存量发现交由 seal 基线管理(seal 已扫且内容未变的文件不改判、不重复上报)。
  3. 扫描面默认忽略 git worktree 镜像目录(如 .worktrees/**),或 seal 判定按内容哈希去重——同哈希文件继承主树既有判决,不因新路径而整树重扫。
补充
  • 三次现场均留有 seal 哈希与拦截/放行 commit 区间证据,需要可提供;
  • 对插件整体价值认可(对真实风险的拦截有效),本票只针对「存量误报无法收敛」这一通道缺失;目前我们只能绕行(AI 会话提交改走终端),希望上游修复后回归插件内提交。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PreToolUse git-gate entry point and the security_scan seal flow, reproducing the reported behavior with the two markdown-file diff and a .worktrees mirror. Trace how existing findings, seal hashes, and worktree paths affect the decision. Done means diff-level findings, an explicit suppression or baseline mechanism, and no duplicate worktree findings while preserving real-risk blocking.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python, typescript
Domain
developer-experience, security, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.