Skip to content

feat(tlv): add Optional[T] tri-state wrapper for null vs absent - #100

Merged
p0fi merged 1 commit into
mainfrom
feat/98-tlv-optional
Sep 16, 2026
Merged

p0fi merged 1 commit into
mainfrom
feat/98-tlv-optional

Conversation

@p0fi

@p0fi p0fi commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #98

Test plan

  • mise run test (table-driven round-trip tests in internal/tlv/optional_test.go and internal/interaction/path_test.go)
  • mise run lint
  • mise run build

🤖 Generated with Claude Code

Encoding a field as TLV null and leaving it off the wire both meant
the same thing to the codec: a nil Go pointer. AttributePath.ListIndex
needs the distinction (absent = whole list, explicit null = append),
so add a generic tlv.Optional[T] with absent/null/value states and
wire it into Marshal/Unmarshal, then convert ListIndex to use it.

Closes #98

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@p0fi
p0fi added this pull request to stack #102 September 16, 2026 20:40
@p0fi
p0fi merged commit 0f77484 into main Sep 16, 2026
4 checks passed
@p0fi
p0fi deleted the feat/98-tlv-optional branch September 16, 2026 21:07
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.

Add tlv.Optional[T] tri-state wrapper to distinguish TLV null from absent

1 participant