Skip to content

fix: resolve reordering bugs - #292

Merged
DecimalTurn merged 14 commits into
latestfrom
dev-more-fuzz-fixes
Aug 23, 2026
Merged

fix: resolve reordering bugs#292
DecimalTurn merged 14 commits into
latestfrom
dev-more-fuzz-fixes

Conversation

@DecimalTurn

Copy link
Copy Markdown
Owner

Fixing some issues with reordering with dotted keys discovered while using the fuzzing test harness.

Copilot AI lite review requested due to automatic review settings August 23, 2026 02:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are a few objective correctness/maintainability issues in the changed lines (notably an orphaned/mismatched JSDoc block and a TypeScript any regression) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes updateOrder reordering edge cases involving dotted keys and inline-table scenarios discovered via fuzzing, improving deterministic key placement while preserving CST structure/comments.

Changes:

  • Extend container resolution to support certain implicit dotted-key reorder targets and suppress warnings for newly created inline-item move targets.
  • Add “requested order” anchoring to diff() (orderSource) and use it during patching to insert inline-table members at the correct position.
  • Add regression tests and fuzzing harness/logging updates (plus documentation/bug-note inventory).
File summaries
File Description
src/update-order.ts Adds implicit dotted-container resolution and new-target detection to reduce reordering failures/warnings.
src/patch.ts Threads orderSource into diffing, adds inline-table insertion index logic, and coalesces certain inline-array replacements.
src/diff.ts Introduces Add.before and DiffOptions.orderSource to preserve caller-requested key order around adds/renames.
src/tests/update-order.test.ts Adds regression tests for implicit dotted-table reorder and inline-table rename/add ordering.
src/tests/patch.fuzz.test.ts Adds regression test for nested multiline array replacement stability.
src/tests/diff.test.ts Adds test for orderSource anchoring behavior.
scripts/fuzz-run.ts Prefixes updateOrder warnings with seed to aid fuzz triage.
docs/Fuzz-Testing.md Minor wording update in fuzz-test distillation guidance.
docs/bug-notes/fuzz-sweep-0-3000000-update-order-warnings.md New inventory of updateOrder warning seeds/paths.
docs/bug-notes/fuzz-sweep-0-3000000-RERUN.md New sweep rerun log data.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/patch.ts Outdated
Comment thread scripts/fuzz-run.ts Outdated
Comment thread docs/Fuzz-Testing.md Outdated
@DecimalTurn
DecimalTurn marked this pull request as ready for review August 23, 2026 02:57
@DecimalTurn
DecimalTurn merged commit bcb205a into latest Aug 23, 2026
8 checks passed
@DecimalTurn
DecimalTurn deleted the dev-more-fuzz-fixes branch August 23, 2026 02:59
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