feat: make serialization options reach the serializer, and add PropertyFilter - #147
Open
ehennestad wants to merge 1 commit into
Open
feat: make serialization options reach the serializer, and add PropertyFilter#147ehennestad wants to merge 1 commit into
ehennestad wants to merge 1 commit into
Conversation
ehennestad
force-pushed
the
serializer-property-filter
branch
2 times, most recently
from
September 4, 2026 21:01
8747285 to
8d27665
Compare
Contributor
Contributor
Test Results (R2026a)803 tests 802 ✅ 3m 10s ⏱️ Results for commit 4ea3ba6. ♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unhide-isreference #147 +/- ##
=====================================================
Coverage ? 80.94%
=====================================================
Files ? 422
Lines ? 4224
Branches ? 0
=====================================================
Hits ? 3419
Misses ? 805
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ehennestad
force-pushed
the
serializer-property-filter
branch
from
September 4, 2026 21:10
8d27665 to
321c3d0
Compare
…tyFilter kg-sync subclasses the JSON-LD serializer to do one thing: keep only a named set of properties in each emitted document, for targeted patch operations. That is a general serialization capability rather than a Knowledge Graph concept, so it belongs in the configuration where any consumer can reach it, and the subclass can go. Add PropertyFilter as a serialization option. Filtering runs before property names are rewritten, while the fields are still plain property names, and the identifier and type keys survive it, so a filtered document still identifies the node it describes and a linked node still serializes as a valid reference. Then let Node.serialize build its serializer from forwarded options, which is what the method's own comment and Todo already said it should do. This fixes a bug rather than only finishing a design: serialize accepted RecursionDepth and IncludeIdentifier and passed neither to the serializer it called, so both were silently ignored. Nothing in the toolbox or its tests relied on them. Passing a Serializer and passing options are now mutually exclusive and say so, since a serializer already carries its own configuration and silently ignoring one or the other is how the previous bug read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ehennestad
force-pushed
the
serializer-property-filter
branch
from
September 5, 2026 05:00
321c3d0 to
4ea3ba6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
kg-sync subclasses the JSON-LD serializer to do one thing: keep only a named set of properties in each emitted document, for targeted patch operations. That is a general serialization capability rather than a Knowledge Graph concept, so it belongs in the configuration where any consumer can reach it, and the subclass can go.
What
Adds
PropertyFilteras a serialization option. Filtering runs before property names are rewritten, while the fields are still plain property names, and the identifier and type keys survive it, so a filtered document still identifies the node it describes and a linked node still serializes as a valid reference.Then lets
Node.serializebuild its serializer from forwarded options, which is what the method's own comment and Todo already said it should do.Bug fixed on the way
serializeacceptedRecursionDepthandIncludeIdentifierand passed neither to the serializer it called, so both were silently ignored. Nothing in the toolbox or its tests relied on them.Passing a
Serializerand passing options are now mutually exclusive and say so, since a serializer already carries its own configuration and silently ignoring one or the other is how the previous bug read.🤖 Generated with Claude Code