Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
969bddb
feat(#74): implement background daemon with gRPC over UDS and auto-sh…
drlucaa Jan 27, 2026
3650ffe
feat(#74): refactor scheduler to request graph and env from daemon
drlucaa Jan 27, 2026
8957662
fix(#74): address code review findings
drlucaa Jan 27, 2026
1dec8b9
refactor(#74): address non-blocking review suggestions
drlucaa Jan 27, 2026
9af4eee
feat(#74): implement proactive input hashing via file-system watching
drlucaa Jan 27, 2026
c662c35
feat(#74): add ExecuteTask streaming RPC to daemon proto
drlucaa Jan 27, 2026
bb3d690
feat(#74): regenerate protobuf code for ExecuteTask RPC
drlucaa Jan 27, 2026
9aa9aca
feat(#74): add ExecuteTask to DaemonClient interface
drlucaa Jan 27, 2026
c7e4254
feat(#74): implement client-side task execution
drlucaa Jan 27, 2026
671fa42
feat(#74): implement server-side task execution
drlucaa Jan 27, 2026
44e68d4
feat(#74): integrate remote task execution into scheduler
drlucaa Jan 27, 2026
eb89501
feat(#74): add --no-daemon flag to run command
drlucaa Jan 27, 2026
dd36159
chore(#74): add buf.lock for googleapis dependency
drlucaa Jan 27, 2026
54ab76a
refactor(#74): improve error handling and robustness
drlucaa Jan 28, 2026
d3106d3
fix(#74): add missing validation and absolute paths
drlucaa Jan 28, 2026
0bb1d74
perf(#74): configure aggressive gRPC backoff for UDS
drlucaa Jan 28, 2026
b365f72
fix(#74): prevent status from resetting timer and auto-starting daemon
drlucaa Jan 28, 2026
478d673
chore(#74): update same vendor hash
drlucaa Jan 28, 2026
b38cdaa
fix(#74): ensure --no-daemon bypasses all daemon communication
drlucaa Jan 28, 2026
3cee89a
feat(#74): anchor .same directory to workspace root instead of cwd
drlucaa Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,166 changes: 1,166 additions & 0 deletions cli/api/daemon/v1/daemon.pb.go

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions cli/api/daemon/v1/daemon.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
syntax = "proto3";

package daemon.v1;

option go_package = "go.trai.ch/same/api/daemon/v1;daemonv1";

service DaemonService {
// Ping checks daemon health and resets the inactivity timer.
rpc Ping(PingRequest) returns (PingResponse);

// Status returns current daemon status information.
rpc Status(StatusRequest) returns (StatusResponse);

// Shutdown initiates graceful daemon termination.
rpc Shutdown(ShutdownRequest) returns (ShutdownResponse);

// GetGraph returns the parsed task graph, using mtime for cache invalidation.
rpc GetGraph(GetGraphRequest) returns (GetGraphResponse);

// GetEnvironment returns resolved Nix environment variables for a toolset.
rpc GetEnvironment(GetEnvironmentRequest) returns (GetEnvironmentResponse);

// GetInputHash returns the cached or pending input hash for a task.
rpc GetInputHash(GetInputHashRequest) returns (GetInputHashResponse);

// ExecuteTask runs a task and streams logs back to the client.
rpc ExecuteTask(ExecuteTaskRequest) returns (stream ExecuteTaskResponse);
}

message PingRequest {}

message PingResponse {
// idle_remaining_seconds is the time remaining before auto-shutdown.
int64 idle_remaining_seconds = 1;
}

message StatusRequest {}

message StatusResponse {
bool running = 1;
int32 pid = 2;
int64 uptime_seconds = 3;
int64 last_activity_unix = 4;
int64 idle_remaining_seconds = 5;
}

message ShutdownRequest {
// graceful indicates whether to wait for in-flight operations.
bool graceful = 1;
}

message ShutdownResponse {
bool success = 1;
}

message ConfigMtime {
string path = 1;
int64 mtime_unix_nano = 2;
}

message GetGraphRequest {
string cwd = 1;
repeated ConfigMtime config_mtimes = 2;
}

message TaskProto {
string name = 1;
repeated string command = 2;
repeated string inputs = 3;
repeated string outputs = 4;
map<string, string> tools = 5;
repeated string dependencies = 6;
map<string, string> environment = 7;
string working_dir = 8;
string rebuild_strategy = 9;
}

message GetGraphResponse {
bool cache_hit = 1;
string root = 2;
repeated TaskProto tasks = 3;
}

message GetEnvironmentRequest {
string env_id = 1;
map<string, string> tools = 2;
}

message GetEnvironmentResponse {
bool cache_hit = 1;
repeated string env_vars = 2;
}

message GetInputHashRequest {
string task_name = 1;
string root = 2;
map<string, string> environment = 3;
}

message GetInputHashResponse {
enum State {
READY = 0;
PENDING = 1;
UNKNOWN = 2;
}
State state = 1;
string hash = 2;
}

message ExecuteTaskRequest {
string task_name = 1;
repeated string command = 2;
string working_dir = 3;
map<string, string> task_environment = 4;
repeated string nix_environment = 5;
int32 pty_rows = 6;
int32 pty_cols = 7;
}

message ExecuteTaskResponse {
bytes data = 1;
}
Loading
Loading