Skip to content

Add a Nexus serialization context sample - #425

Open
litlep-nibbyt wants to merge 10 commits into
mainfrom
codex/python-nexus-serialization-context
Open

litlep-nibbyt wants to merge 10 commits into
mainfrom
codex/python-nexus-serialization-context

Conversation

@litlep-nibbyt

Copy link
Copy Markdown
Contributor

Add a Nexus serialization context sample with synchronous and workflow-backed asynchronous operations through four endpoints.

Two handler workers each serve two endpoints with distinct AES-GCM keys. One compresses before encrypting; the other encrypts only. The caller uses a separate key for its workflow input and final result. Backing workflow inputs use the handler's key 1, while async results use the endpoint's key and compression.

The README follows the Java walkthrough and shows the expected output. The sample is a standalone uv project because SDK 1.36.0 requires Python 3.11 or newer, while the root project supports Python 3.10.

Validation: 22 sample cases pass; root build/lint pass; the root suite has 240 passes and two skips. The README walkthrough and Java interoperability in both directions pass.

Java counterpart: merged Java sample (PR #815).

@litlep-nibbyt
litlep-nibbyt marked this pull request as ready for review November 20, 2026 00:04
@litlep-nibbyt
litlep-nibbyt requested review from a team as code owners November 20, 2026 00:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the standalone Nexus serialization sample.

No open issues 🎉

What changed in this PR

Adds a standalone Python sample to the Nexus examples, demonstrating endpoint-specific encryption and optional compression for synchronous and workflow-backed asynchronous operations.

Changes:

  • Adds four endpoints served by two handler workers, with separate encryption settings for caller and backing-workflow payloads.
  • Provides a local walkthrough, codec tests, and an end-to-end workflow test.
  • Isolates Python 3.11+ dependencies and integrates the sample into CI without changing root Python support.
File Description
README.md Adds the sample to the Nexus examples index.
pyproject.toml Excludes the standalone sample from root packaging.
nexus_serialization_context/​workflows.py Defines echo and caller workflows for eight concurrent operations.
nexus_serialization_context/​worker.py Configures caller and handler workers by role.
nexus_serialization_context/​uv.lock Locks standalone sample dependencies.
nexus_serialization_context/​tests/​test_workflow.py Checks operation results, propagated context, and workflow encryption metadata.
nexus_serialization_context/​tests/​test_codec.py Tests key selection, compression, context isolation, and ciphertext validation.
nexus_serialization_context/​starter.py Starts the caller workflow and prints endpoint results.
nexus_serialization_context/​service.py Defines endpoints, namespaces, service contracts, and result structure.
nexus_serialization_context/​README.md Documents serialization behavior, local setup, expected output, and testing.
nexus_serialization_context/​pyproject.toml Defines Python requirements, dependencies, and development tasks.
nexus_serialization_context/​handler.py Implements synchronous and workflow-backed asynchronous echo handlers.
nexus_serialization_context/​config.py Configures endpoint and workflow encryption keys and converters.
nexus_serialization_context/​codec.py Implements context-based codec selection, AES-GCM encryption, and optional compression.
.github/​workflows/​ci.yml Includes the standalone sample in CI, excluding Python 3.10.

Review effort: Balanced

@litlep-nibbyt
litlep-nibbyt enabled auto-merge (squash) November 20, 2026 20:41
@litlep-nibbyt
litlep-nibbyt enabled auto-merge (squash) November 20, 2026 20:46
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.

3 participants