feat(wire): attribute updates carry source_execution_id/trace; PullTraceEvents RPC + site read-by-execution-ids

Flow Debugger (design 2026-09-05 §5.3/§5.4): AttributeValueUpdate fields 7/8 stamped by
StreamRelayActor and parsed by SiteStreamGrpcClient (older frames => null/false). New
PullTraceEvents unary RPC on SiteStreamService (same PSK-gated prefix as PullAuditEvents):
a point read of the site audit SQLite by ExecutionId OR ParentExecutionId
(ISiteAuditQueue.ReadByExecutionIdsAsync, json_extract on the codec's camelCase keys, new
IX_audit_event_occurred index, 64-id / 2000-row caps) that moves no cursor and flips no
ForwardState. Central IPullTraceEventsClient/GrpcPullTraceEventsClient mirror the audit pull
client (endpoint resolution, NodeB failover, fault => empty) and register beside it.

Claude-Session: https://claude.ai/code/session_01GSLkkHKz9JrAtmJjmQK3cP
This commit is contained in:
Joseph Doherty
2026-09-05 23:52:50 -04:00
parent f15d0db0ad
commit 7e61552d82
15 changed files with 1458 additions and 80 deletions
@@ -14,6 +14,10 @@ service SiteStreamService {
rpc IngestAuditEvents(AuditEventBatch) returns (IngestAck);
rpc IngestCachedTelemetry(CachedTelemetryBatch) returns (IngestAck);
rpc PullAuditEvents(PullAuditEventsRequest) returns (PullAuditEventsResponse);
// Flow Debugger (design 2026-09-05 §5.4): point read of a site's ScriptTrace rows for a
// set of execution ids (by ExecutionId OR ParentExecutionId). NOT a reconciliation path —
// moves no cursor, flips no ForwardState. Same PSK interceptor as PullAuditEvents.
rpc PullTraceEvents(PullTraceEventsRequest) returns (PullTraceEventsResponse);
rpc PullSiteCalls(PullSiteCallsRequest) returns (PullSiteCallsResponse);
}
@@ -95,6 +99,11 @@ message AttributeValueUpdate {
string value = 4;
Quality quality = 5;
google.protobuf.Timestamp timestamp = 6;
// Flow Debugger (design 2026-09-05 §5.3/§5.4): the writing execution's id ("D" GUID
// form; empty represents null) and the trace flag, so the debug stream can hand the
// debugger the spawned run's parent. Additive; an older site never sets them.
string source_execution_id = 7;
bool trace = 8;
}
message AlarmStateUpdate {
@@ -218,6 +227,20 @@ message PullAuditEventsResponse {
bool more_available = 2;
}
// Flow Debugger (design 2026-09-05 §5.4): PullTraceEvents request/response. The site
// returns audit rows whose ExecutionId or ParentExecutionId is in execution_ids and whose
// OccurredAtUtc >= since_utc, ordered (OccurredAtUtc, EventId), at most max_events (server
// caps at 2000). Ids capped at 64 per call.
message PullTraceEventsRequest {
repeated string execution_ids = 1; // "D" GUID form
google.protobuf.Timestamp since_utc = 2;
int32 max_events = 3;
}
message PullTraceEventsResponse {
repeated AuditEventDto events = 1;
}
// Site Call Audit (#22) reconciliation pull: central→site request for any
// site-local operation-tracking rows whose UpdatedAtUtc >= since_utc — the
// self-heal feed that backfills the eventually-consistent central SiteCalls