Skip to main content

z4j domain core - models, protocols, transport, redaction, policy (Apache 2.0)

Project description

z4j-core

License: Apache 2.0 Status: Phase 1 — early implementation

The pure domain core of z4j. Imports nothing framework- or engine-specific — only Pydantic and the Python standard library. This is enforced by import-linter in CI. Any PR that tries to import Django, Celery, Redis, SQLAlchemy, FastAPI, etc. from z4j_core will fail the build.

Why this matters

Every other package in the z4j monorepo depends on z4j-core. The brain uses its domain models and wire protocol; every adapter implements one of its Protocols. Keeping this package free of framework coupling is what lets us:

  1. Ship v1 with Django + Celery only, then add Flask / FastAPI / RQ / Dramatiq as peer packages without touching the core
  2. Test the entire domain layer with no database, no broker, no HTTP
  3. Evolve the protocol without rewriting the dashboard or the brain
  4. Let contributors add a new engine adapter over a weekend without understanding any of the rest of the system

What's in here

Module Purpose
z4j_core.models Pydantic v2 domain models (Project, Agent, Task, Queue, Worker, Schedule, Command, Event, AuditEntry, User, Config, ...)
z4j_core.protocols QueueEngineAdapter, FrameworkAdapter, SchedulerAdapter — the three adapter interfaces adapters implement
z4j_core.errors Exception hierarchy (Z4JError, ValidationError, AuthenticationError, ...)
z4j_core.redaction Secret redaction engine with default patterns and per-field overrides
z4j_core.transport Wire protocol — frame shapes, version negotiation, HMAC signing
z4j_core.policy Permission engine — can(user, action, project)

Documentation

Development

# From the repo root:
uv sync
make lint              # ruff + mypy + import-linter
make test-unit         # pytest packages/z4j-core/tests/unit
make check-imports     # import-linter — core purity check

License

Apache 2.0. See ../../LICENSE-APACHE. This package is deliberately permissively licensed so that proprietary Django / Flask / FastAPI applications can import it without any license concerns.

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

z4j_core-2026.4.0a1.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

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

z4j_core-2026.4.0a1-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file z4j_core-2026.4.0a1.tar.gz.

File metadata

  • Download URL: z4j_core-2026.4.0a1.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for z4j_core-2026.4.0a1.tar.gz
Algorithm Hash digest
SHA256 d913e5f27ff3d83df5e1a9de8a542895458809928422e957d06d2adebb9a09e8
MD5 fdbd585c55524abda065f1d950737913
BLAKE2b-256 7cbe9587db3131bdf9b412f15e0a7d8ebd015aa4158ef002a42cd781d210fa93

See more details on using hashes here.

File details

Details for the file z4j_core-2026.4.0a1-py3-none-any.whl.

File metadata

  • Download URL: z4j_core-2026.4.0a1-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for z4j_core-2026.4.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3111bf1b1a37e98d50505f632e07df6893344c188b8ee81111a3b4dcdccf4ce
MD5 7dbfbeec2ea5b1a0854b6689dd66cebf
BLAKE2b-256 f413c96961e056e5ffae5e8b7a97fbf2d4cd5f377f87dbbae73999a906cd3247

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