Skip to content

fix: preserve shared state on read and replacement failures - #37

Open
imxyanua wants to merge 4 commits into
EvoMap:mainfrom
imxyanua:codex/preserve-shared-state
Open

imxyanua wants to merge 4 commits into
EvoMap:mainfrom
imxyanua:codex/preserve-shared-state

Conversation

@imxyanua

@imxyanua imxyanua commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

State updates now stop before reading or calling the mutator when the lock is unavailable. An unreadable, malformed or wrong-shaped state file is preserved for repair.

acquire token -> validate state -> mutate -> own temporary file -> retry atomic rename -> release
no token / invalid state / failed replacement -> preserve prior state

Temporary files are created exclusively. Cleanup after partial writes or descriptor-close errors only removes files created by this call; a pre-existing file survives a name collision. A failed replacement retries within the existing budget without deleting the original. Hook failures keep their normal JSON response and emit a generic diagnostic on stderr.

State-lock admission and dead-owner recovery remain in #29. That PR includes this head so the two changes can be reviewed and integrated without a release() conflict.

Evidence

  • Before the guard, refused and held locks still ran the mutator; partial writes left temporary files behind.
  • 37 focused Windows tests passed across persistence, driver and hooks. They cover read/shape errors, lock refusal, partial writes, close failures, temporary-name collisions, replacement retries, diagnostics and the unchanged four-process ×25-update workload. All host bundles packed.
  • Official upstream CI passed on b66fdc4: Node 22 and 26 each passed 699/699 tests and packaging. Publication was skipped.

Merge Danger

Door: Two-way
Blast Radius: Shared persistence.

Previously hidden state and lock failures now stop an update instead of using empty data or writing without a token. Data schemas are unchanged.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现需要报告的问题。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=37、head_sha="25a7227eb1af3fc31cb024753b8c5ae12c6c1478",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 25a7227eb1af

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现需要报告的问题。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=37、head_sha="b66fdc4f294b10418ed9c697a590b1ed0a7436c9",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 b66fdc4f294b

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