Skip to content

fix: accept shared objects in boolean object guards - #454

Merged
gjbkz merged 2 commits into
mainfrom
claude/project-thread-g0uou0-449
Oct 11, 2026
Merged

gjbkz merged 2 commits into
mainfrom
claude/project-thread-g0uou0-449

Conversation

@gjbkz

@gjbkz gjbkz commented Oct 10, 2026

Copy link
Copy Markdown
Member

Requested by Kei · project thread

Before: isPair({ left: person, right: person }) threw CircularReference: T.left -> T.right when the same object appeared under two sibling properties, while validate() and validateAll() accepted it.

After: shared, acyclic objects pass the boolean guard, matching structured validation. Real cycles still throw CircularReference.

How: the object guard now removes the object from its reference map in a finally block once the branch is done, so the map only holds the active recursion path, as the diagnosis path already does. Tests cover exact and open object checkers, a shared object checked against two different shapes, nesting, and a real cycle reached through a shared object; the shared-object test fails on main and passes here.

Closes #449

🤖 Generated with Claude Code

https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4


Generated by Claude Code

The boolean object guard now removes each object from its reference map
when the branch finishes, so only the active recursion path is tracked.
An object shared by sibling properties is no longer reported as a
circular reference, matching validate() and validateAll().

Closes #449

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4
@gjbkz gjbkz self-assigned this Oct 10, 2026
@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (9225421) to head (5550cb1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #454   +/-   ##
=======================================
  Coverage   98.45%   98.46%           
=======================================
  Files          52       52           
  Lines        3049     3055    +6     
  Branches      327      327           
=======================================
+ Hits         3002     3008    +6     
  Misses         46       46           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gjbkz
gjbkz marked this pull request as ready for review October 10, 2026 20:33

@gjbkz gjbkz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reviewed commit c06fd0e050765e68a1ef1595f8f27d9cf36f9c26. No actionable issues found in this change.

Removing each object from refs in a finally block restricts tracking to the active recursion path, allowing shared acyclic children while retaining the existing exception for actual cycles. The added coverage exercises exact/open shapes and nested shared references. I also checked a shared object against distinct constraints.

Validation: the complete source unit-test suite passed locally on this reviewed version, and the GitHub Actions test workflow for this commit completed successfully. The latest head is unchanged from the locally tested version.

@gjbkz
gjbkz enabled auto-merge October 11, 2026 07:08
@gjbkz
gjbkz merged commit bcc1d53 into main Oct 11, 2026
7 of 8 checks passed
@gjbkz
gjbkz deleted the claude/project-thread-g0uou0-449 branch October 11, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

bug: distinguish shared object references from circular references in object guards

2 participants