Skip to content

fix(config): distinguish object and array snapshot identities - #7793

Closed
oocheol wants to merge 2 commits into
lidge-jun:devfrom
oocheol:codex/fix-plain-data-shape-20261026
Closed

oocheol wants to merge 2 commits into
lidge-jun:devfrom
oocheol:codex/fix-plain-data-shape-20261026

Conversation

@oocheol

@oocheol oocheol commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Tag arrays and objects separately when canonicalizing plain data so values such as {} and [] cannot compare equal as configuration snapshot identities.
  • Preserve object key-order independence, array order and primitive distinctions.

Verification

Windows, Bun 1.4.4; head 0575b59362d5f9e645e63e3aa2177c3bf1887861, rebased on dev 42549ba1b00a7fe792f0c1d87771845ca538c472 after dev gained a test-layout roster entry that conflicted; only the roster line in the first commit changed.

  • bun test --no-env-file --isolate tests/lib/fix-plain-data-shape.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts --timeout 60000: 43 passed, 0 failed.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, and git diff --check 42549ba1b00a7fe792f0c1d87771845ca538c472...HEAD: passed.

CodeRabbit review follow-up: documented the canonical rebuild helper sorted; the review reported no actionable findings.

The full suite was not run. Focused subsystem and repository guards were run serially on the shared Windows host; full-suite and cross-platform coverage remain for CI.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.
  • I pushed my PR to the latest dev commit.
  • I resolved all correct Codex and CodeRabbit findings.
  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Canonical data comparisons now distinguish arrays from objects and preserve differences between primitive types, preventing values with different shapes or types from being treated as equivalent.
    • Object key order remains irrelevant at every nesting level, while array order continues to affect comparisons. This makes comparisons consistent for nested data while retaining meaningful differences in its structure and ordering.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between de1d87f and 2e37e97.

Files selected for processing: 1
  • src/lib/plain-data.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

Canonical plain-data output now uses distinct tags for arrays and objects. Tests cover container-shape distinctions, object key ordering, array ordering, and primitive-type distinctions. The runtime description and test-layout mappings were also updated.

Changes: Canonical plain-data shape distinction

Layer / File(s) Summary
Tag containers and verify canonical output
src/lib/plain-data.ts, tests/lib/fix-plain-data-shape.test.ts, structure/runtime.md, scripts/test-layout/layout-clients.json, tests/fixtures/test-layout-expected.json
sorted now prefixes arrays and objects with distinct tags. Tests cover container shapes, object key ordering, array ordering, primitive types, and null-versus-object distinctions. The runtime description and test-layout mappings reflect the update.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: lidge-jun, ingwannu

Merge Risk: Minimal · previous review 2e37e

The change is ready to merge subject to normal CI checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(config): distinguish object and array snapshot identities" matches the main change. The raw summary and PR objectives say the change tags arrays and objects separately during canonicali…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(config): distinguish object and array snapshot identities" matches the main change. The raw summary and PR objectives say the change tags arrays and objects separately during canonicalization in src/lib/plain-data.ts, so that values such as {} and [] no longer compare equal as configuration snapshot identities. The title names the fix, the scope, and the primary behavior change. The title is specific and does not describe unrelated work. Note that the commit message and the file summaries describe the change in terms of the canonical plain-data rebuild helper, which is a supporting detail rather than a conflict with the title.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

Hygiene

✅ Deterministic PR hygiene checks passed.

oocheol commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

1 similar comment
@oocheol

oocheol commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@oocheol

oocheol commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lidge-jun

Copy link
Copy Markdown
Owner

Carried into dev by #7821 (squash merge 504417f), which lands this change together with the other small fixes from this series. The carrier credits the original author with a Co-authored-by trailer. Closing as carried. Thank you for the fix!

@lidge-jun lidge-jun closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants