Skip to content

Preserve concurrent edits and workflow state during GitHub sync - #21

Merged
rrnewton merged 7 commits into
rrnewton:mainfrom
unormal:codex/review-github-sync
Sep 7, 2026
Merged

rrnewton merged 7 commits into
rrnewton:mainfrom
unormal:codex/review-github-sync

Conversation

@unormal

@unormal unormal commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

GitHub pull analyzes a local snapshot before a network request and can later overwrite a successful local edit without reporting a conflict. Check the snapshot after fetching, then compare it again under the database lock at the actual write. Stale updates return a conflict, including edits that did not advance their timestamp.

Hold a checked issue lock during destructive comment reconciliation so a rename cannot change ownership between the check and deletion. Merge only changed ancestry entries under the lock and atomically replace the state file, preserving other concurrent syncs. Keep stable comment pairings after renames and avoid marking comments added after export as already sent.

Compare local statuses using GitHub's open/closed representation. Preserve richer local workflow statuses when an open remote issue changes title/body, and recognize compatible legacy status hashes without repeated pushes.

Validation: 66 library tests, 85 CLI unit tests, the existing migration regression, and twenty-one native regressions pass on Windows; the GitHub subset was rerun after the legacy-state compatibility adjustment. Native in-memory mocks exercise edits during fetch, the final write check, all non-closed statuses, legacy ancestry, concurrent state merges, and comment identity. Formatting and all-target/all-feature Clippy pass. No live GitHub issues or comments were used for tests; Unix shell suites were not run locally.

Depends on #20. Merge the series in order; earlier commits remain in the diff until their PRs merge.

Test Results Summary
- 64 library and 76 CLI unit tests passed on Windows.
- Migration regression and native help/version smoke test passed.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
- Unix shell suites were platform-gated; direct Cargo validation used because Make is unavailable.
Test Results Summary
- 64 library and 76 CLI unit tests passed on Windows.
- Existing migration regression and four native regressions passed.
- Hostile create/rename/comment/import/sync cases preserve external files.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
- Unix symlink regression is included for CI; Unix shell suites were platform-gated.
Test Results Summary
- 66 library and 79 CLI unit tests passed on Windows.
- Migration regression and eight native regressions passed.
- Covered swaps, cycles, closed/open grouping, comment identity, ancestry, JSONL IDs, rollback and interrupted-commit recovery.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
- Unix shell suites were platform-gated; no live GitHub issues or comments were changed by tests.
Test Results Summary
- 66 library and 79 CLI unit tests passed on Windows.
- Existing migration regression and ten native regressions passed.
- Close/reopen, missing prerequisites, statistics and query-filter regressions passed.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
Test Results Summary
- 66 library and 79 CLI unit tests passed on Windows.
- Existing migration regression and thirteen native regressions passed.
- Unknown/duplicate sections retain original bytes; CRLF/BOM and delimiter-like titles survive updates.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
Test Results Summary
- 66 library and 79 CLI unit tests passed on Windows.
- Existing migration regression and twenty native regressions passed.
- Held-lock, stale-snapshot, custom-path, conflict, JSON dry-run and write-failure coverage passed.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
Test Results Summary
- 66 library and 85 CLI unit tests passed on Windows.
- Existing migration regression and twenty-one native regressions passed.
- Thirteen native GitHub tests passed after the legacy hash adjustment.
- Covered network/write races, workflow statuses, state merges and comment identity without live GitHub mutations.
- Formatting, all-target/all-feature Clippy, and diff checks passed.
@rrnewton
rrnewton merged commit c9b041f into rrnewton:main Sep 7, 2026
2 of 7 checks passed
@rrnewton

rrnewton commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Reviewed and landed with the full cumulative stack via #24 (merge 19fc71c). Review correction 25b963f returns the persisted canonical issue under the write lock and normalizes open-issue imports before recording ancestry. This fixes false concurrent-edit failures caused by Markdown trailing-newline/header normalization, including the inherited pull-only regression. Two added regressions fail before the correction and pass after it; final full-stack CI is green.

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