Skip to content

Fix/serialize edit commits, and I have checked the problems. - #102

Open
0x7b1e wants to merge 4 commits into
INK-Q:devfrom
0x7b1e:fix/serialize-edit-commits
Open

0x7b1e wants to merge 4 commits into
INK-Q:devfrom
0x7b1e:fix/serialize-edit-commits

Conversation

@0x7b1e

@0x7b1e 0x7b1e commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Checklist

  • Target branch is dev (only release PRs from dev or urgent hotfix/* PRs target main)
  • Ran npm run typecheck
  • Ran npm run build and committed updated dist/*.mjs bundles (if src/ changed)
  • Ran npm test (and npm run validate if plugin.json / hooks.json / mcp_config.json / rules/ changed)
  • Added or updated unit tests for new behavior or bug fixes

@0x7b1e 0x7b1e closed this Nov 27, 2026
@0x7b1e 0x7b1e reopened this Nov 27, 2026
@0x7b1e
0x7b1e changed the base branch from main to dev November 27, 2026 10:00

@INK-Q INK-Q left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @0x7b1e for adding commit serialization and pre-write snapshot validation to apply_edits! The pendingEditCommit promise queue handles release cleanly via finally (no deadlock or rejection-chain poisoning), and the snapshot checks cover regular files, newly created files, and dangling symlinks well.

A couple of items to clean up before merging:

P1 (Must Fix)

  1. Coordinate / consolidate with sibling PR #103:
    • Both #102 and #103 modify commitPlannedWrites in src/tools/apply-edits.ts and insert tests at the exact same location (test/apply-edits.test.ts:725), so they will merge-conflict if kept independent.
    • Combining them (or stacking #103 on top of #102) also resolves a minor UX quirk in #102 where a pre-write Edit conflict currently gets wrapped by runApplyEdits as Write failed (changes rolled back): Edit conflict: ... even though no files were written.
  2. Complete PR metadata & document concurrency scope:
    • Please update the PR title to conventional commit format (e.g. fix(apply-edits): serialize commits and reject stale snapshots) and fill in the PR Summary & Checklist (currently the blank template).
    • Please briefly note in code comments/PR summary that pendingEditCommit serializes concurrent edits within a single Node/MCP process (separate --cli subprocesses still get pre-write snapshot verification without a cross-process file lock).

Checklist

  • Consolidate with #103 (or rebase sequentially) so pre-write Edit conflict errors don't emit a misleading (changes rolled back) prefix
  • Fill in PR title, summary, and checklist
  • Rebuild dist/mcp-server.mjs via npm run build and verify CI passes

@0x7b1e 0x7b1e changed the title Fix/serialize edit commits Fix/serialize edit commits, and I have checked the problems. Nov 29, 2026
@0x7b1e

0x7b1e commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

the pr issues may be fixed, the developer can double check.

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