Repository navigation
feat(python): add protocol foundation and shared spec-vector tests - #36
Merged
austinchennn merged 1 commit intoOct 16, 2026
Merged
Conversation
This was referenced Oct 17, 2026
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.
Description:
Refs #18 — protocol foundation only; no issue closed.
Adds an installable, standard-library-only Python implementation of the stateless vRT v1 message and audio codecs. It uses the shared specification and vectors as its contract. This is the first part of #18, not a connection/session SDK or a claim of full conformance.
Behaviours Completed
tool.streamphase, and encode validated messages without non-standard JSON numbers.Decimalso rounding cannot turn invalid integer/range values into valid ones. Emit integral values with integer spelling.Files Changed
python/src/vrealtime/protocol.py: pure codecs, structural checks, error/result types and named protocol/local-limit constants.python/src/vrealtime/__init__.py: explicit public exports.python/pyproject.toml,python/LICENSE,python/.gitignore: packaging, development tooling and generated-file exclusions.python/tests/conftest.py,test_spec.py,test_protocol.py,check_install.py: shared fixtures, schema oracle, edge cases and clean-install checks.python/README.md: API, ownership, implementation limits, known contract discrepancies, development and remaining SDK work..github/workflows/python.yml: Python checks when Python/spec/workflow files change.README.md: link to the foundation with its scope stated explicitly.Brief Explanation
The protocol layer has no transport, provider, device or application dependencies. Data-driven field rules and small pure functions keep validation separate from framing without introducing unused SDK abstractions. Schemas are test-time oracles, not runtime dependencies; the installed package does not read checkout files.
Tests consume the existing shared vector IDs and independently check field mutations against draft 2020-12 schemas. Numeric parsing avoids Python bool/int confusion and binary64 underflow/rounding at validation boundaries. Local depth and numeric-token/expansion limits are documented separately from wire constants. The parser allocates before depth validation, so future transports must impose frame-byte limits.
This change leaves shared schemas, vectors and TypeScript implementation unchanged. Session ordering, capability negotiation, ACK/replay, interrupts, tool execution, sockets and device audio remain for later #18 work; #17 black-box conformance is not implemented here.
Testing
npm run check:spec,npm run typecheck,npm test(459),npm run test:e2e(7),npm run build,npm run check:budgets: passed.git diff --check: passed. GitHub-hosted Python matrix results are separate from local results.Unsure About
MALFORMED. The spec prohibits senders from duplicating names but does not assign an explicit receiver classification; this local parser policy needs review.hello.toolsnames, whereas the schema and TypeScript guard do not enforce uniqueness. Python enforces the explicit rule, with a regression documenting the schema discrepancy.tool-stream-v1. This implementation supports message structure without advertising or negotiating that capability.