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:
- Ship v1 with Django + Celery only, then add Flask / FastAPI / RQ / Dramatiq as peer packages without touching the core
- Test the entire domain layer with no database, no broker, no HTTP
- Evolve the protocol without rewriting the dashboard or the brain
- 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
docs/ARCHITECTURE.md— full system architecture + Protocol signaturesdocs/API.md— REST + WebSocket agent protocoldocs/SECURITY.md— threat model, redaction, HMACdocs/patterns.md— code patterns this package follows
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d913e5f27ff3d83df5e1a9de8a542895458809928422e957d06d2adebb9a09e8
|
|
| MD5 |
fdbd585c55524abda065f1d950737913
|
|
| BLAKE2b-256 |
7cbe9587db3131bdf9b412f15e0a7d8ebd015aa4158ef002a42cd781d210fa93
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3111bf1b1a37e98d50505f632e07df6893344c188b8ee81111a3b4dcdccf4ce
|
|
| MD5 |
7dbfbeec2ea5b1a0854b6689dd66cebf
|
|
| BLAKE2b-256 |
f413c96961e056e5ffae5e8b7a97fbf2d4cd5f377f87dbbae73999a906cd3247
|