Skip to main content

Zu core: contracts, ports, registry, loop, event bus

Project description

zu-core

The small, stable core of Zu: the typed contracts, the six ports, the plugin registry, the interpreter loop, and the event bus. It depends only on the standard library and Pydantic — it physically cannot import a model SDK, a browser, or any concrete adapter. It should be readable in an afternoon.

What's inside

Module Responsibility
contracts.py TaskSpec, Result, and the frozen Event envelope (types namespaced harness.* / data.*).
ports.py The six Protocol ports + the capability envelope (CAP_*, EGRESS_OPEN, declared_envelope).
registry.py The one registry the loop reads (entry points, decorators, config).
loop.py The interpreter loop: provider → tool → detectors → finalise → validators, with the escalation ladder and budgets.
bus.py The event bus: append-before-notify, with isolated destinations.
events.py The event taxonomy (the stable set of harness.* / data.* type constants).
sinks.py The in-memory default EventSink.
eventstore.py / codec.py / projections.py Shared filter contract, the encryption-at-rest seam, and rebuildable read-side views.

The six ports

ModelProvider, Tool, Detector, Validator, SandboxBackend, EventSink — each a runtime-checkable structural Protocol. A plugin implements the shape; it never subclasses a framework.

This package registers no plugins — it defines the contracts every other package plugs into.

Tests

uv run pytest packages/zu-core — deterministic, offline.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zu_core-0.6.0.tar.gz (181.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zu_core-0.6.0-py3-none-any.whl (133.6 kB view details)

Uploaded Python 3

File details

Details for the file zu_core-0.6.0.tar.gz.

File metadata

  • Download URL: zu_core-0.6.0.tar.gz
  • Upload date:
  • Size: 181.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_core-0.6.0.tar.gz
Algorithm Hash digest
SHA256 255ab704e9d8fd69d88515d03eaf4e3f5d40684c3077b668bdae65fdc98a8608
MD5 8b9ee67ec8e4bf490a3a8de70b6c8ba1
BLAKE2b-256 b775585bd26be70849d6d62b80761f6e805de5061d826baa05e57befecb8cbb3

See more details on using hashes here.

File details

Details for the file zu_core-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: zu_core-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 133.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_core-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74d5a6425ea18385b9bbf3b86fdde6375fce22d9eae7ce3b90f43877f01bf19f
MD5 dd993a8d2b91e925c1e2e7b39828b182
BLAKE2b-256 b863d0dce6412e325c4bd3826c31a3c2484e11ade7c34f483e30af5d1cff7711

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page