z4j-core: one shared core
Every adapter is a thin layer on the same pure-Python core.
z4j-core is the package every other z4j package depends on: the domain models (Task, Worker, Queue, Schedule, Event, Command, Agent), the three adapter protocols (FrameworkAdapter, QueueEngineAdapter, SchedulerAdapter), the wire protocol with its HMAC envelope, the redaction engine, the policy helpers and the shared error hierarchy. It imports no framework, no engine and no database, so it is small enough to live inside every agent process and exact enough to be the contract between those agents and the brain. A framework, engine or scheduler package is one implementation of one protocol; the brain and the dashboard speak to all of them through the same models and the same frames.
Framework adapter implements FrameworkAdapter
Engine adapter implements QueueEngineAdapter
Scheduler adapter implements SchedulerAdapter
z4j the brain
- REST API
- dashboard
- rule engine
- reconciliation
- audit chain
z4j-scheduler companion process
- engine-agnostic schedules
- leader elected on PostgreSQL
- ModelsTask, Worker, Queue, Schedule, Event, Command, Agent
- Adapter protocolsFrameworkAdapter, QueueEngineAdapter, SchedulerAdapter
- Wire protocolframes and the HMAC envelope, v2
- Redactionbuilt-in and operator patterns, applied before an event leaves the process
- Policyrole-based action enums, a pure policy engine
- Errorsone hierarchy shared by agents and brain
Both sides import the same package: the models an agent sends are the models the brain stores, and an adapter is one class implementing one protocol.
Package names as they ship on PyPI. Every box above the core is one implementation of one core protocol; the brain and the dashboard speak to all of them through the same models and frames.
Ships with
- Pydantic models shared by agents and brain: Task, Worker, Queue, Schedule, Event, Command, Agent, and the wire-frame envelope types
- Three adapter protocols: FrameworkAdapter, QueueEngineAdapter, SchedulerAdapter; every adapter package implements one or more
- Wire protocol frames and the HMAC envelope used by the agent to brain WebSocket transport (signed v2 protocol)
- Redaction engine that scrubs built-in and operator-configured patterns from args, kwargs, return values, exceptions, URLs and headers before an event leaves your process
- Policy helpers: role-based action enums and a pure policy engine for direct consumers; the brain enforces its API RBAC in its own domain layer
- Shared error hierarchy, so agents and brain agree on AuthorizationError, NotFoundError and ConflictError
Highlights
- Pure Python with no framework, engine or database imports; it ships as a transitive dependency and is installed directly only to build a custom adapter
- The wire protocol is v2 and its frame models ignore additive fields; the active packages still upgrade together, per the compatibility policy
- One core in every agent and in the brain is why one dashboard drives six engines, four framework paths and seven scheduler sources
Related