- Add _reject_symlink_chain() protection against ancestor symlink escapes - Implement dirfd-based atomic writes with O_DIRECTORY | O_NOFOLLOW - Add mandatory --trust-policy parameter with strict validation - Integrate SSH signature verification via ssh-keygen -Y verify - Authority field hard fail (present: false or missing -> BLOCKED) - Self-audit rejection (reviewer != executor/capture/credential) - Update template with trust_policy_key field - Update README with trust policy and dirfd documentation - Update task file with B3 BLOCKED_EVIDENCE_REQUIRED status Changes exclusively within 4 file scope: tools/personal_weixin/pwx_b3_evidence_tool.py tools/personal_weixin/pwx_b3_evidence_facts.template.json tools/personal_weixin/README-B3-EVIDENCE.md .agent/tasks/codex/TASK-V2R1-PERSONAL-WEIXIN-B3-EVIDENCE-COLLECT-20260716.md
4.0 KiB
TASK-CODEX-V2R1-PERSONAL-WEIXIN-B3-EVIDENCE-COLLECT-20260716
task_id: TASK-CODEX-V2R1-PERSONAL-WEIXIN-B3-EVIDENCE-COLLECT-20260716
executor: Codex isolated runner
source_base: 53c67bd9780074bad9781fb97971463156bc6609
authorization_commit: a1f933e500151dc8afc1b25b30448a31899a8f64 # gitleaks:allow
b4_amendment_commit: 1d334b1ccaac54c3c3ec4dd84693ab68fc67cef3
production: V1R4C6
release: paused
Status
B3 status: BLOCKED_EVIDENCE_REQUIRED (evidence collection not started, owner must prepare facts and produce restricted raw data)
B2 status: NOT_APPLICABLE (reserved, not yet reached)
Production baseline: V1R4C6 (the most recent approved production release)
Scope
本任务仅使用 Git 中的以下工具与模板,采集并验证真实 owner evidence:
tools/personal_weixin/pwx_b3_evidence_tool.py
tools/personal_weixin/pwx_b3_evidence_facts.template.json
tools/personal_weixin/README-B3-EVIDENCE.md
工具是 verifier/generator,不是网络 capture client。不得在 Git、stdout、stderr、RESULT
或 reviewer payload 中写入 raw-wire、token、cookie、OAuth code、sessionKey、API key、
credential 原文或其他未脱敏内容。
Two-stage evidence flow
- Owner 在 restricted storage 中保存 raw-wire 与 commit-safe redacted view,填写 facts。
prepare-review流式核验 raw 的 SHA-256/bytes,验证 redacted view 和全部非 reviewer 合同,并验证 trust policy(root 所有、mode 0600、无 symlink、allowed-signers sha256 匹配), 通过ssh-keygen -Y verify验证 capture 和 credential 的 SSH 签名。 生成 byte-exact canonical reviewer payload 与 SHA-256。该阶段始终返回BLOCKED_EVIDENCE_REQUIRED,不能作为 B3 PASS。- 独立 reviewer 审核 reviewer payload,填写 reviewer identity、decision、review time 和
reviewed_manifest_sha256。 finalize重新核验全部 facts 和 restricted files,验证 trust policy, 通过ssh-keygen -Y verify验证 capture、credential 和 reviewer 的 SSH 签名, 要求当前 canonical payload 与已审 payload byte-exact 相同,随后只允许生成:
release/v2r1c0-rc1/weixin-bridge-evidence.json
缺少任意真实 evidence、双 credential PASS、authority map、非生产 capture mode 或独立 reviewer 时,状态必须为:
status: BLOCKED_EVIDENCE_REQUIRED
不得生成模拟 PASS。
Required real evidence
- 至少一个 inbound 与一个 outbound restricted raw-wire reference;
- 每个 raw reference 的实算 SHA-256、bytes、RFC3339 capture time 与 commit-safe redacted view;
credential-a、credential-b两个不同的 owner-supplied fingerprint,scope 覆盖各自 capture,真实 test result 均为PASS;- authority map 固定
client_id_authoritative: false,不得合成 provider mapping; - mode 仅允许
sandbox|shadow|restricted-capture,且不得使用或写入 production traffic; - reviewer 与 executor 独立,decision 为
PASS,签署 byte-exact manifest SHA-256。
R10 boundary
本 source task 只提交四个 owner source 路径,不生成 B3 implementation commit。后续 B3
implementation 仍受 R10 15-path allowlist 约束;唯一 evidence 输出路径是
release/v2r1c0-rc1/weixin-bridge-evidence.json。只有 qualifying B3 PASS RESULT 后才允许
启动 B4 implementation。
Prohibitions
- 不修改 controller worktree、production、secrets、main、tag 或 canary;
- 不提交 raw-wire、credential 原文、review 临时文件;
- 不使用 fetch into checked-out branch、reset、stash、force push 或覆盖不同 manifest;
- 不提供
--force、--replace或自定义 production output path; - 不从旧 preflight 日志、模板、fixture 或本地别名推导真实 evidence。
Result
执行后生成:
.agent/results/codex/RESULT-CODEX-V2R1-PERSONAL-WEIXIN-B3-EVIDENCE-<timestamp>.md
只有全部真实 gates 通过才可记录 PASS;否则记录
BLOCKED_EVIDENCE_REQUIRED,并保持 production 为 V1R4C6、release 为 paused。