Skip to content

Repair code-reference patching and apply ID mappings in one pass - #23

Merged
rrnewton merged 9 commits into
rrnewton:mainfrom
unormal:codex/review-code-references
Sep 7, 2026
Merged

rrnewton merged 9 commits into
rrnewton:mainfrom
unormal:codex/review-code-references

Conversation

@unormal

@unormal unormal commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Code-reference search splits Git's filename/line/content output incorrectly and returns no ordinary matches. Parse NUL-delimited filenames and line numbers, use literal Git patterns, resolve files from the repository root, and exclude both metadata directory names at every depth.

Replace the platform-dependent sed command with native Rust replacements that preserve line endings and permissions. Collect accepted migration mappings before writing, so swaps and cycles are applied once rather than replacing freshly generated IDs again. Prepare all file contents first and reject files changed while preparing the patches.

Validation: 66 library tests, 87 CLI unit tests, the migration regression, and 24 native regressions pass on Windows. Disposable Git fixtures exercise paths with spaces, subdirectory invocation, metadata exclusions, regex-like IDs, literal dollar signs, CRLF preservation, ID swaps, and word boundaries. A Unix filename regression covers colons and embedded newlines for CI. Formatting and all-target/all-feature Clippy pass; Unix-only cases were not executed locally.

Depends on #22. 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.
Test Results Summary
66 library, 85 CLI unit, 24 native regression, and 1 migration tests pass on Windows. Formatting and all-target/all-feature Clippy pass. Unix shell suites not executed locally.
Test Results Summary
66 library, 87 CLI unit, 24 native regression, and 1 migration tests pass on Windows. Formatting and all-target/all-feature Clippy pass. Unix-only cases await CI.
@rrnewton
rrnewton merged commit d744268 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 uses half-word regex boundaries to match Git grep -w for punctuation-ended issue IDs. Added coverage for punctuation, multi-file mapping cycles, mixed line endings, and executable permissions. The corrected stack passes 203 debug tests on stable and Rust 1.87 plus all seven CI jobs; original commit order is preserved.

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