Skip to content

fix(evidence): preserve immutable Evidence records - #66

Merged
dhicoc merged 1 commit into
zhaoxuya520:mainfrom
jhuang-tw:fix/evidence-id-collision
Aug 11, 2026
Merged

fix(evidence): preserve immutable Evidence records#66
dhicoc merged 1 commit into
zhaoxuya520:mainfrom
jhuang-tw:fix/evidence-id-collision

Conversation

@jhuang-tw

@jhuang-tw jhuang-tw commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

append-evidence.ps1 currently writes Evidence records with WriteAllText, so reusing an existing Evidence ID overwrites the original record and then appends a second row to INDEX.md. That conflicts with the repository's Evidence contract, which treats Evidence as immutable observations.

This PR keeps the change bounded to that failure boundary:

  • create E-*.md with atomic FileMode.CreateNew semantics instead of overwrite semantics;
  • fail clearly when the normalized Evidence path already exists;
  • extend the existing smoke path with a regression that verifies a duplicate ID fails while both the original Evidence file and INDEX.md remain byte-for-byte unchanged.

Validation

The existing Windows/Linux routing matrix already runs smoke.ps1, so the regression exercises the real append-evidence.ps1 entrypoint under native Windows PowerShell 5.1 and the Linux PowerShell shim without adding or changing workflow permissions.

@jhuang-tw
jhuang-tw force-pushed the fix/evidence-id-collision branch from 1062aba to a89ec4b Compare August 11, 2026 07:37
@dhicoc

dhicoc commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

本地审查通过并合并:

  • 审查结论:Evidence 不可变修复合理(CreateNew + 重复 ID 拒绝 + 字节级回归)
  • 额外改动 case-init.sh 大小写归一化、ci.yml 覆盖大写 network_profile,边界清晰
  • 本地流程:fetch PR → merge 到 main → smoke.ps1 ALL PASS(含 duplicate Evidence ID rejected without mutation)→ push main

已按协作者约定「本地合并 + 测试通过后再上线」处理。

@dhicoc
dhicoc merged commit 4968e6c into zhaoxuya520:main Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants