syntax = "proto3";

package aerodrome.v1;

// Central registry of NATS subject patterns and KV conventions.
// Not used for wire encoding — exists purely as machine-readable documentation
// that both Rust (prost) and Python (betterproto) code generators can reference.

// NATS JetStream streams and their subject patterns
enum NatsStream {
  NATS_STREAM_UNSPECIFIED = 0;
  ACE_GRAPH_EVENTS = 1;    // subjects: ace.graph.events.>
  ACE_TS_INTERVAL = 2;     // subjects: ace.ts.interval.>
  ACE_GRAPH_CHANGES = 3;   // subjects: ace.graph.changes.>
  ACE_TS_DLQ = 4;          // subjects: ace.ts.dlq.>
  ACE_ALERTS = 5;          // subjects: ace.alert.>
}

// Subject pattern templates — use string interpolation with tenant_id, etc.
// These constants are emitted by prost/betterproto and can be referenced in code.
message SubjectPatterns {
  // ace.graph.events.{tenant_id}.{action}
  string graph_events = 1;
  // ace.ts.interval.{tenant_id}.{timeseries_id}
  string ts_interval = 2;
  // ace.graph.changes.{tenant_id}
  string graph_changes = 3;
  // ace.ts.dlq.{tenant_id}.{timeseries_id}
  string ts_dlq = 4;
  // ace.alert.{tenant_id}.{severity}
  string alerts = 5;
}

// NATS KV bucket conventions
message KvConventions {
  // Bucket name: ace-graph-props
  // Key format: {tenant_id}.{node_id}.{property_name}
  // History: 64 revisions per key
  string bucket = 1;
  string key_format = 2;
}
