Skip to content

📦🔥:report argument and key mismatches truly - #92

Merged
openinf-commit-queue[bot] merged 1 commit into
mainfrom
claude/project-thread-2s9ymn-truthful-checks
Oct 1, 2026
Merged

openinf-commit-queue[bot] merged 1 commit into
mainfrom
claude/project-thread-2s9ymn-truthful-checks

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Requested by DerekNonGeneric

Before: validateArgCount('f', 1, 2, 1.5) blamed maxCount for the non-integer argument count. objectsEqualShallow({ a: undefined }, {}) returned true.

After: the error names argCount. Two objects count as shallowly equal only when they have the same enumerable keys as well as the same values.

How: one wrong string literal is corrected, and objectsEqualShallow now compares the key sets alongside the values. Each fix comes with a test that fails on main.

Summary by CodeRabbit

  • Bug Fixes
    • Shallow object comparisons now distinguish between a missing key and a key with an undefined value.
    • Invalid non-integer argument counts now report the correct field name in the error message.

validateArgCount checked argCount under the name maxCount, so a
non-integer argCount was reported as a bad maxCount.

objectsEqualShallow compared values only, so { a: undefined } and {}
were equal: reading the missing key gives undefined too. It now
compares the enumerable keys of both sides as well.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: e235fdfb-cc08-43b6-8c9e-7ca02012077a

📥 Commits

Reviewing files that changed from the base of the PR and between 45679ff and ba4a962.

📒 Files selected for processing (5)
  • .changeset/truthful-arg-checks.md
  • packages/util-object/src/guards/objects-equal-shallow.ts
  • packages/util-object/test/guards/objects-equal-shallow.ts
  • packages/util/src/validators/validate-arg-count.ts
  • packages/util/test/validators/validate-arg-count.ts

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


📝 Walkthrough

Walkthrough

The PR corrects shallow object equality when a key is missing but has an undefined value on the other object. It also changes the field name in the non-integer argument-count error. Tests cover both fixes, and the changeset marks both packages for patch releases.

Changes

Utility correctness fixes

Layer / File(s) Summary
Shallow equality comparison
packages/util-object/src/guards/objects-equal-shallow.ts, packages/util-object/test/guards/objects-equal-shallow.ts, .changeset/truthful-arg-checks.md
objectsEqualShallow now checks enumerable keys and strictly equal values. Tests cover a key present with an undefined value in only one object, in either argument order. The changeset marks @openinf/util-object for a patch release.
Argument-count error label
packages/util/src/validators/validate-arg-count.ts, packages/util/test/validators/validate-arg-count.ts
validateArgCount now labels its integer assertion as argCount. A test checks the error for the value 1.5. The changeset also marks @openinf/util for a patch release.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to ba4a9

The changes address the described utility edge cases and include regression tests; no actionable merge risk is evident from the supplied context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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. Analyzed 2 functions across 4 files. (1 skipped: 1 …
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies both main changes: reporting argument-count mismatches and detecting key mismatches in shallow object equality. The wording is awkward and includes unnecessary emojis, but it rema…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@DerekNonGeneric DerekNonGeneric self-assigned this Oct 1, 2026
@DerekNonGeneric DerekNonGeneric added the 🚀 Status: Commit Queue Land this pull request when its checks pass label Oct 1, 2026 — with Claude
@openinf-commit-queue
openinf-commit-queue Bot merged commit c85d4d4 into main Oct 1, 2026
9 of 10 checks passed
@openinf-commit-queue openinf-commit-queue Bot removed the 🚀 Status: Commit Queue Land this pull request when its checks pass label Oct 1, 2026
@openinf-commit-queue
openinf-commit-queue Bot deleted the claude/project-thread-2s9ymn-truthful-checks branch October 1, 2026 00:44
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.

1 participant