Skip to content

fix: prevent communication transfer source-sidecar overwrite - #172

Merged
lostlight530 merged 2 commits into
mainfrom
fix/2026-10-25-handoff-source-clobber
Oct 25, 2026
Merged

lostlight530 merged 2 commits into
mainfrom
fix/2026-10-25-handoff-source-clobber

Conversation

@lostlight530

Copy link
Copy Markdown
Owner

Current defect / 当前缺陷

  • Existing core/communication_transfer.py accepts --output equal to the input evidence sidecar, overwriting the source after hashing it
  • Its fixed <output>.tmp staging path can also collide with an existing source evidence sidecar and destroy it
  • Independently scoped to this repository and current main on Asia/Shanghai 2026-10-25

Proposed repair

  • Reject output paths that resolve to the source sidecar before creating directories or writing files
  • Use unique exclusive same-directory temporary staging with cleanup, preserving atomic replace for valid distinct outputs
  • Add two targeted subprocess regression tests to tests/test_tool_cli.py, including direct collision and legacy staging collision

Evidence and limitations

  • Before patch: isolated execution of the writer's exact algorithm reproduces destructive overwrite
  • After patch: isolated execution of the revised writer algorithm rejects direct overwrite and preserves colliding .tmp source, while writing a distinct output
  • Repository test suite / native checker / actual on-branch CLI: NOT_EXECUTED locally because authorized machine is offline and local container cannot resolve GitHub
  • GitHub PR workflow, if started, must be checked independently; CI status is not an independent merge approval
  • No historical records, calendar stamps or unrelated documents changed

Delivery contract

  • Base main; proposed head SHA 48378c5b7f85c4d3044b8344a46e59770611b013; prior compare ahead=2, behind=0
  • Draft / READY_FOR_MAINTAINER_REVIEW only
  • No direct main write, auto merge, force push, or producer-initiated merge
  • Independent reviewer must verify the exact PR head, CI results, and current main before authorized merger

Copy link
Copy Markdown
Owner Author

2026-10-25 Asia/Shanghai verification receipt

  • Exact PR head verified: 48378c5b7f85c4d3044b8344a46e59770611b013
  • GitHub Actions run: https://github.com/lostlight530/sci-render-kit/actions/runs/40141658271
  • local-tool-contract: completed / success
  • Job log independently checked: both new CLI tests passed, and make test finished successfully
  • Post-CI remote comparison: ahead=2, behind=0, exactly two changed paths (owning core module + tests/test_tool_cli.py)
  • Local isolated reproduction: EXECUTED, source overwrite reproduced before revision; revised writer algorithm tested separately
  • Full repository checkout in the local environment: NOT_EXECUTED due to unavailable execution host; PR CI is the actual full suite verification surface
  • Independent PR review: NOT_EXECUTED (no submitted review)
  • READY_FOR_MAINTAINER_REVIEW; remain Draft, no producer merge or auto-merge

@lostlight530
lostlight530 marked this pull request as ready for review October 25, 2026 00:19
@lostlight530
lostlight530 merged commit 49f0991 into main Oct 25, 2026
1 check passed
@lostlight530
lostlight530 deleted the fix/2026-10-25-handoff-source-clobber branch October 25, 2026 00:19
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.

1 participant