generated from link-foundation/js-ai-driven-development-pipeline-template
-
Notifications
You must be signed in to change notification settings - Fork 0
[Phase 9] Design and implement Binary Links Notation protocol #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+6,413
−0
Conversation
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
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #27
This commit implements the Binary Links Notation protocol for high-performance data exchange in Links Queue. Key features: Wire Format: - 11-byte header with magic number (LNKQ), version, flags, and payload length - LEB128 variable-length integer encoding - Compact link encoding with type flags for ID references vs literals - Self-referencing link optimization (stores value once when source == target) JavaScript Implementation: - BinaryNotation class with encode/decode methods - BinaryStreamEncoder/BinaryStreamDecoder for incremental processing - BufferPool for memory-efficient buffer reuse - Protocol negotiation with ProtocolCapabilities, NegotiationResult, ProtocolConnection Rust Implementation: - BinaryNotation struct with encode/decode methods - EncodedLink and EncodedValue types for wire representation - Conversion traits between Link<T> and EncodedLink - Comprehensive error handling with BinaryNotationError Specification: - docs/BINARY-NOTATION-SPEC.md documents the wire format - Supports compression flags (zstd, lz4) for future implementation - Protocol negotiation for client/server capability exchange Tests: - 79 JavaScript tests for binary notation - 51 JavaScript tests for protocol negotiation - 17 Rust tests for binary notation Addresses issue #27 requirements for 5-10x size reduction compared to text notation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix bug in encodeLinkBody/linkBodySize where nested links were incorrectly marked with SOURCE_IS_ID/TARGET_IS_ID flags - Add benchmark tests comparing text vs binary notation sizes - Add performance global to eslint config - Add debug script for nested link troubleshooting The nested link bug caused the decoder to return the LITERAL_LINK marker (0x40 = 64) instead of the actual nested link object because the encoder was incorrectly using getLinkId() on nested links, setting the *_IS_ID flags even though the source/target were full Link objects. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add docs/BINARY-NOTATION-MIGRATION.md with usage examples and best practices - Fix header size from 10 bytes to 11 bytes in spec - Update compression ratio claims to match actual benchmarks (1.2-1.7x) The original claim of 5-10x compression was overly optimistic. Actual benchmarks show 1.2-1.7x savings depending on link content. Strings see minimal savings since they must be stored in full. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add clippy allows for intentional dead_code and cast_possible_truncation - Make string_size, EncodedLink::new, EncodedLink::with_values const fn - Use Self instead of explicit type names where appropriate - Inline format string variables - Fix unused bytes_written variable - Remove unused combined Vec allocation - Update compression ratio claims in docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply prettier formatting to binary-notation.d.ts and negotiation.d.ts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Minor version bump for new Binary Links Notation protocol. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The EncodedLink type doesn't exist in binary-notation.js. The encode/decode functions work with regular Link objects, so use that type instead. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deno requires importing TypeScript types from .d.ts files, not .js files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract tests to binary_notation_tests.rs (218 lines) - Compact main file to 892 lines (under 1000 limit) - Remove verbose doc comments and section separators - All 16 binary notation tests still pass Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename binary_notation_tests module to encoder_decoder_tests to avoid conflict with the file name binary_notation_tests.rs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit e02ae70.
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
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.
Summary
This PR implements the Binary Links Notation (BLN) protocol for efficient link serialization, addressing issue #27.
Key Features
Implementation
JavaScript (
js/src/protocol/)binary-notation.js- Core encoder/decoder (750+ lines)negotiation.js- Protocol negotiation with capability exchangeRust (
rust/src/backends/)binary_notation.rs- Complete encoder/decoder (650+ lines)Documentation (
docs/)BINARY-NOTATION-SPEC.md- Complete wire format specificationBINARY-NOTATION-MIGRATION.md- Migration guide with examplesWire Format Overview
Test Results
-D warningsBenchmark Results
Test Plan
Fixes #27
🤖 Generated with Claude Code