trailmark-review-gate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTrailmark Review Gate
Trailmark审查门
Apply deterministic security gate rules to Trailmark structural diff evidence.
This skill does not replace line-level review. It produces a compact structural
packet reviewers can cite while they inspect the code.
将确定性安全门规则应用于Trailmark结构差异证据。
本skill不会替代逐行审查,而是生成一份简洁的结构数据包,供审查人员在检查代码时参考。
When to Use
使用场景
- Reviewing a branch, pull request, release diff, or fix commit
- Checking whether a change expands attack surface
- Looking for removed validation or authorization on reachable paths
- Comparing before/after taint, privilege-boundary, blast-radius, or complexity signals
- Producing graph evidence for a differential review
- 审查分支、Pull Request、发布差异或修复提交
- 检查变更是否扩大攻击面
- 查找可访问路径上已移除的验证或授权机制
- 对比变更前后的污染、权限边界、影响范围或复杂度信号
- 为差异审查生成图证据
When NOT to Use
不适用场景
- Single-snapshot analysis. Use or
trailmark.trailmark-structural - Text-diff review only. Use .
differential-review - Full vulnerability discovery. Use an audit or bug-finding workflow.
- One static finding. Use .
trailmark-finding-triage - Tooling is unavailable and the user wants manual review only.
- 单一快照分析。请使用或
trailmark。trailmark-structural - 仅文本差异审查。请使用。
differential-review - 完整漏洞发现。请使用审计或漏洞查找工作流。
- 单一静态发现。请使用。
trailmark-finding-triage - 工具不可用且用户仅需手动审查。
Rationalizations to Reject
需驳回的不合理理由
| Rationalization | Why It Is Wrong | Required Action |
|---|---|---|
| "The line diff is small, so no graph gate is needed" | Small changes can create new call paths | Compare before/after graphs |
| "Graph gate passed, so the PR is secure" | The gate only checks structural regressions | Still perform line-level review |
| "Trailmark failed, so pass the gate" | Tool failure is unknown risk, not success | Emit |
| "Tests pass, so removed validation is fine" | Tests may miss affected entrypoint paths | Review the removed path manually |
| "Only new code matters" | Removed auth, validation, and callers can be higher risk than additions | Review removals and path changes |
| 不合理理由 | 错误原因 | 要求操作 |
|---|---|---|
| "代码行差异很小,所以不需要图层面审查门" | 微小变更可能产生新的调用路径 | 对比变更前后的图 |
| "图审查门通过了,所以PR是安全的" | 审查门仅检查结构退化问题 | 仍需执行逐行审查 |
| "Trailmark运行失败,所以审查门通过" | 工具故障属于未知风险,而非成功 | 输出 |
| "测试通过了,所以移除验证机制没问题" | 测试可能遗漏受影响的入口点路径 | 手动审查被移除的路径 |
| "只有新增代码才重要" | 移除的授权、验证机制及调用方可能比新增代码风险更高 | 审查移除内容和路径变更 |
Workflow
工作流
Review Gate Progress:
- [ ] Step 1: Resolve before/after inputs
- [ ] Step 2: Build graph-evolution evidence
- [ ] Step 3: Normalize structural changes
- [ ] Step 4: Apply gate rules
- [ ] Step 5: Emit review packet and actionsReview Gate Progress:
- [ ] Step 1: Resolve before/after inputs
- [ ] Step 2: Build graph-evolution evidence
- [ ] Step 3: Normalize structural changes
- [ ] Step 4: Apply gate rules
- [ ] Step 5: Emit review packet and actionsStep 1: Resolve Inputs
步骤1:解析输入
Accept two refs, a branch name, a commit range, or before/after directories.
Do not check out branches unnecessarily. Prefer , , and
git worktrees, following the snapshot workflow.
git diffgit showgraph-evolution接受两个引用、分支名称、提交范围或前后版本目录。
无需不必要地检出分支。优先使用、和git工作区,遵循快照工作流。
git diffgit showgraph-evolutionStep 2: Build Graph Evidence
步骤2:生成图证据
Run or equivalent Trailmark before/after graph analysis.
Both snapshots must run so taint, privilege-boundary,
blast-radius, complexity, and entrypoint signals are available.
graph-evolutionengine.preanalysis()Record Trailmark version and any feature probes. If graph construction fails,
emit .
UNKNOWN运行或等效的Trailmark前后版本图分析。
两个快照都必须运行,以获取污染、权限边界、影响范围、复杂度和入口点信号。
graph-evolutionengine.preanalysis()记录Trailmark版本及所有功能探针。如果图构建失败,输出。
UNKNOWNStep 3: Normalize Changes
步骤3:标准化变更
Normalize evidence into:
- added, removed, and modified nodes
- added and removed edges
- entrypoint set changes
- taint membership changes
- privilege-boundary membership changes
- blast-radius changes
- complexity changes
- newly reachable sensitive sinks
- unresolved, proxy, or dynamic edge changes
将证据标准化为以下内容:
- 新增、移除和修改的节点
- 新增和移除的边
- 入口点集合变更
- 污染成员变更
- 权限边界成员变更
- 影响范围变更
- 复杂度变更
- 新可访问的敏感目标
- 未解析、代理或动态边变更
Step 4: Apply Gate Rules
步骤4:应用审查门规则
Apply the rules in references/gate-rules.md.
Gate verdicts are:
| Verdict | Meaning |
|---|---|
| A high-risk structural regression needs review before acceptance |
| A meaningful graph change needs reviewer attention |
| No configured structural gate fired |
| Trailmark failed or evidence is too incomplete |
应用references/gate-rules.md中的规则。
审查门 verdict 分为:
| Verdict | 含义 |
|---|---|
| 存在高风险结构退化,需在接受前进行审查 |
| 存在有意义的图变更,需引起审查人员注意 |
| 未触发任何已配置的结构审查门规则 |
| Trailmark运行失败或证据过于不完整 |
Step 5: Emit Packet
步骤5:输出数据包
Write the packet using
references/output-format.md, then hand it to
the branch reviewer. Use
references/review-integration.md when
combining this packet with or another PR review process.
differential-review使用references/output-format.md编写数据包,然后提交给分支审查人员。当将此数据包与或其他PR审查流程结合时,请使用references/review-integration.md。
differential-reviewRequirements
要求
- Never mutate the user's working branch while comparing refs.
- Never report when Trailmark failed.
PASS - Separate graph evidence from manual security judgment.
- Include exact changed nodes or paths for every and
FAIL.WARN - Include limitations when parser, proxy, unresolved-call, or dynamic-dispatch uncertainty affects the verdict.
- 对比引用时,绝不能修改用户的工作分支。
- 当Trailmark运行失败时,绝不能报告。
PASS - 将图证据与手动安全判断分开。
- 对于每个和
FAIL,需包含确切的变更节点或路径。WARN - 当解析器、代理、未解析调用或动态分派的不确定性影响 verdict 时,需注明限制条件。