Expand description
Q42 Semantic Blackboard & Constraint Context — plan §7.3 A5.
Observable state channels on Q42 CRDT graphs with pinned hard/soft constraint propagation. The blackboard provides:
- Channels: named observable state channels backed by the Q42 graph.
- Constraints: hard (must-hold) and soft (preferably-hold) constraints that propagate to downstream consumers.
- Pinning: constraints can be pinned to a root context, ensuring downstream DAG nodes inherit and enforce them.
- Subscription: consumers can subscribe to channel updates and receive notifications when state changes.
- CRDT integration: uses the existing
NQuin48-byte structure and Lamport clock for ordering.
§Design
The blackboard is a zero-heap hot-path structure. Channel writes and
constraint checks do not allocate. Subscription notifications use the
existing broadcast channel pattern from daemon_graph.rs.
Constraints are encoded as NQuin entries with specific opcodes:
OP_CONSTRAINT_HARD(0x40): hard constraint — violation aborts.OP_CONSTRAINT_SOFT(0x41): soft constraint — violation warns.OP_CONSTRAINT_PIN(0x42): pinned root constraint — inherited by downstream.
Structs§
- Blackboard
Bus - A bus connecting DAG nodes to a SemanticBlackboard.
- Channel
- A named observable state channel on the blackboard.
- Constraint
- A constraint on a blackboard channel.
- Constraint
Violation - A constraint violation detected during checking.
- Semantic
Blackboard - The semantic blackboard — a collection of observable channels with constraint propagation.
Constants§
- MAX_
CHANNELS - Maximum number of channels per blackboard.
- MAX_
CONSTRAINTS_ PER_ CHANNEL - Maximum number of constraints per channel.
- MAX_
SUBSCRIBERS_ PER_ CHANNEL - Maximum number of subscribers per channel.
- OP_
CONSTRAINT_ HARD - Hard constraint opcode — violation aborts the operation.
- OP_
CONSTRAINT_ PIN - Pinned root constraint opcode — inherited by downstream DAG nodes.
- OP_
CONSTRAINT_ SOFT - Soft constraint opcode — violation produces a warning but continues.