Skip to main content

Module nats_sync

Module nats_sync 

Source
Expand description

NATS-based code graph synchronization (EX-3184).

When an agent modifies a CodeNode via code_replace, the change is published to nusy.code.graph.updates. Other agents subscribed to that subject receive the update within milliseconds and apply it to their local graph.

This is multi-writer (unlike kanban’s single-writer pattern). Conflicts are detected and logged to nusy.code.graph.conflict for the Captain to review.

Structs§

CodeGraphPublisher
Publishes code graph updates to NATS.
CodeGraphUpdate
A code graph mutation event, published over NATS.
ConflictEvent
A conflict detected during sync (two agents edited the same node).
SyncableGraph
The subset of graph state needed for sync operations.

Enums§

UpdateType
Type of graph mutation.

Constants§

CONFLICT_SUBJECT
Subject for conflict notifications.
UPDATES_SUBJECT
Subject for code graph update events.

Functions§

subscribe_and_apply
Subscribe to code graph updates and apply them locally.

Type Aliases§

SharedGraphState
Shared graph state that the subscriber can update.