docs: finalize rvbox v1 design and implementation plan

This commit is contained in:
2026-08-24 06:23:17 +00:00
parent 97c2d5cf45
commit a89253be96
13 changed files with 2490 additions and 190 deletions
+47 -21
View File
@@ -2,11 +2,11 @@ syntax = "proto3";
package rvbox.v1;
option go_package = "github.com/rvbox/rvbox/gen/go/rvbox/v1;rvboxv1";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/rvbox/rvbox/gen/go/rvbox/v1;rvboxv1";
// An inclusive protocol-version range advertised during registration.
message ProtocolRange {
uint32 major = 1;
@@ -52,6 +52,8 @@ enum CommandLifecycle {
COMMAND_TERMINATED = 7;
COMMAND_CANCELLED = 8;
COMMAND_INTERRUPTED = 9;
COMMAND_EXPIRED = 10;
COMMAND_REJECTED = 11;
}
enum StreamKind {
@@ -109,16 +111,23 @@ message CommandRecord {
ExecutionSpec spec = 5;
CommandLifecycle lifecycle = 6;
uint64 last_event_seq = 7;
int32 exit_code = 8;
optional int32 exit_code = 8;
google.protobuf.Timestamp terminal_time = 9;
bool output_truncated = 10;
uint64 retained_compressed_bytes = 11;
google.protobuf.Timestamp queue_expiry_time = 12;
bool output_incomplete = 13;
// Present when lifecycle is COMMAND_REJECTED.
ControlError rejection = 14;
uint64 command_revision = 15;
bool late_after_expiry = 16;
}
message LifecycleChange {
CommandLifecycle lifecycle = 1;
int32 exit_code = 2;
optional int32 exit_code = 2;
string detail = 3;
uint64 command_revision = 4;
}
// data is compressed according to compression. uncompressed_size is mandatory
@@ -132,15 +141,16 @@ message OutputChunk {
}
message ResourceSnapshot {
uint64 resident_memory_bytes = 1;
uint64 virtual_memory_bytes = 2;
optional uint64 resident_memory_bytes = 1;
optional uint64 virtual_memory_bytes = 2;
google.protobuf.Duration cpu_time = 3;
uint64 read_bytes = 4;
uint64 write_bytes = 5;
string process_state = 6;
string wait_reason = 7;
optional uint64 read_bytes = 4;
optional uint64 write_bytes = 5;
optional string process_state = 6;
optional string wait_reason = 7;
bool suspected_hung = 8;
string diagnostic_detail = 9;
optional string current_cwd = 10;
}
enum OutputTruncationSource {
@@ -148,19 +158,31 @@ enum OutputTruncationSource {
OUTPUT_TRUNCATION_SOURCE_CLIENT_SPOOL = 1;
OUTPUT_TRUNCATION_SOURCE_SERVER_COMMAND_WINDOW = 2;
OUTPUT_TRUNCATION_SOURCE_SERVER_CLIENT_CAP = 3;
OUTPUT_TRUNCATION_SOURCE_CLIENT_OVERLOAD = 4;
OUTPUT_TRUNCATION_SOURCE_SERVER_GLOBAL_CAP = 5;
}
// Persistent query metadata for a missing contiguous event range. It is not a
// CommandEvent and therefore does not consume an event_seq.
// Metadata for missing output. Server-side retention supplies the optional
// event range. Client output discarded before wire sequence assignment omits
// the range and carries this as a normally sequenced CommandEvent.
message OutputTruncation {
uint64 first_removed_event_seq = 1;
uint64 last_removed_event_seq = 2;
uint64 removed_compressed_bytes = 3;
optional uint64 first_removed_event_seq = 1;
optional uint64 last_removed_event_seq = 2;
// Absent when bytes were discarded before compression.
optional uint64 removed_compressed_bytes = 3;
uint64 removed_uncompressed_bytes = 4;
string reason = 5;
OutputTruncationSource source = 6;
}
// Indicates that capture ended without a provably complete byte stream. It is
// sequenced before the terminal lifecycle event but does not claim an invented
// event or byte range.
message OutputIncomplete {
repeated StreamKind streams = 1;
string reason = 2;
}
message StdinAcknowledgement {
uint64 write_seq = 1;
bool stdin_closed = 2;
@@ -173,6 +195,7 @@ message SignalResult {
bool graceful_delivery_attempted = 3;
bool forced_termination_used = 4;
string detail = 5;
uint64 command_revision = 6;
}
message ScriptUploadStatus {
@@ -188,12 +211,14 @@ message CommandEvent {
uint64 event_seq = 2;
google.protobuf.Timestamp observed_at = 3;
oneof payload {
LifecycleChange lifecycle = 10;
OutputChunk output = 11;
ResourceSnapshot resource = 12;
StdinAcknowledgement stdin_ack = 13;
SignalResult signal_result = 14;
ScriptUploadStatus script_status = 15;
LifecycleChange lifecycle = 4;
OutputChunk output = 5;
ResourceSnapshot resource = 6;
StdinAcknowledgement stdin_ack = 7;
SignalResult signal_result = 8;
ScriptUploadStatus script_status = 9;
OutputTruncation output_truncation = 10;
OutputIncomplete output_incomplete = 11;
}
}
@@ -209,6 +234,7 @@ message ControlError {
PROTOCOL_ERROR = 7;
TRANSIENT = 8;
INTERNAL = 9;
CODE_ALREADY_EXECUTED = 10;
}
Code code = 1;
string message = 2;