syntax = "proto3"; package schematic.v1; import "google/protobuf/timestamp.proto"; service SchematicsService { // Create a new schematic from a file tree rpc CreateSchematic(CreateSchematicRequest) returns (CreateSchematicResponse); // Get a schematic version rpc GetSchematic(GetSchematicRequest) returns (GetSchematicResponse); // List all versions of a schematic rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse); // Update a draft schematic's file tree rpc UpdateSchematic(UpdateSchematicRequest) returns (UpdateSchematicResponse); // Validate a schematic against all validators rpc ValidateSchematic(ValidateSchematicRequest) returns (ValidateSchematicResponse); // Record a stakeholder approval rpc ApproveSchematic(ApproveSchematicRequest) returns (ApproveSchematicResponse); // Get approval status rpc GetApprovalStatus(GetApprovalStatusRequest) returns (GetApprovalStatusResponse); // Publish an approved schematic as an immutable snapshot rpc PublishSchematic(PublishSchematicRequest) returns (PublishSchematicResponse); // Create a new version from a published schematic rpc CreateNextVersion(CreateNextVersionRequest) returns (CreateNextVersionResponse); // Fork a schematic with template operations rpc ForkSchematic(ForkSchematicRequest) returns (ForkSchematicResponse); // Create a deployment binding rpc CreateDeploymentBinding(CreateDeploymentBindingRequest) returns (CreateDeploymentBindingResponse); // Get deployment binding status rpc GetDeploymentBinding(GetDeploymentBindingRequest) returns (GetDeploymentBindingResponse); } // --- Create --- message CreateSchematicRequest { string name = 1; string version = 2; // YAML content of schematic.yaml manifest bytes manifest_yaml = 3; // Files as path:content pairs repeated SchematicFile files = 4; } message SchematicFile { string path = 1; bytes content = 2; } message CreateSchematicResponse { string name = 1; string version = 2; string tree_hash = 3; string status = 4; } // --- Get --- message GetSchematicRequest { string name = 1; string version = 2; } message GetSchematicResponse { string name = 1; string version = 2; string tree_hash = 3; string status = 4; string parent_hash = 5; repeated StakeholderInfo stakeholders = 6; google.protobuf.Timestamp created_at = 7; } message StakeholderInfo { string role = 1; string identity = 2; bool required = 3; } // --- List Versions --- message ListVersionsRequest { string name = 1; } message ListVersionsResponse { repeated VersionInfo versions = 1; } message VersionInfo { string version = 1; string tree_hash = 2; string status = 3; string parent_hash = 4; google.protobuf.Timestamp created_at = 5; } // --- Update --- message UpdateSchematicRequest { string name = 1; string version = 2; repeated SchematicFile files = 3; } message UpdateSchematicResponse { string tree_hash = 1; string status = 2; } // --- Validate --- message ValidateSchematicRequest { string name = 1; string version = 2; } message ValidateSchematicResponse { bool valid = 1; int32 error_count = 2; int32 warning_count = 3; repeated ValidationResultProto results = 4; } message ValidationResultProto { string validator = 1; bool passed = 2; string message = 3; string severity = 4; } // --- Approve --- message ApproveSchematicRequest { string name = 1; string version = 2; string role = 3; string identity = 4; string tree_hash = 5; string comment = 6; } message ApproveSchematicResponse { bool accepted = 1; string approval_status = 2; string message = 3; } // --- Approval Status --- message GetApprovalStatusRequest { string name = 1; string version = 2; } message GetApprovalStatusResponse { string status = 1; repeated string approved_roles = 2; repeated string remaining_roles = 3; repeated ApprovalInfo approvals = 4; } message ApprovalInfo { string role = 1; string identity = 2; google.protobuf.Timestamp approved_at = 3; string comment = 4; } // --- Publish --- message PublishSchematicRequest { string name = 1; string version = 2; } message PublishSchematicResponse { string tree_hash = 1; string status = 2; } // --- Create Next Version --- message CreateNextVersionRequest { string name = 1; string from_version = 2; // "major", "minor", or "patch" string bump = 3; } message CreateNextVersionResponse { string version = 1; string tree_hash = 2; string parent_hash = 3; string status = 4; } // --- Fork --- message ForkSchematicRequest { string source_name = 1; string source_version = 2; string new_name = 3; string new_version = 4; repeated TemplateOperation operations = 5; } message TemplateOperation { // "replace", "add", "remove", "remove_section" string op_type = 1; string path = 2; bytes content = 3; } message ForkSchematicResponse { string name = 1; string version = 2; string tree_hash = 3; string status = 4; } // --- Deployment Binding --- message CreateDeploymentBindingRequest { string schematic_name = 1; string schematic_version = 2; string pipeline_name = 3; string target_env = 4; } message CreateDeploymentBindingResponse { string binding_id = 1; string status = 2; } message GetDeploymentBindingRequest { string binding_id = 1; } message GetDeploymentBindingResponse { string binding_id = 1; string schematic_name = 2; string schematic_version = 3; string tree_hash = 4; string pipeline_name = 5; string target_env = 6; string status = 7; string run_id = 8; google.protobuf.Timestamp created_at = 9; google.protobuf.Timestamp deployed_at = 10; }