Introduce repository-backed capability workspaces
- define and validate the capability and resource-lock languages - provision workspace source repositories through Central Gitea - build package runtimes from pinned standalone sources - replace legacy schema compilation with workspace persistence plans - add stable optimistic registers and Automerge CRDT documents - modernize TypeScript/Nix package builds and runtime activation readiness
This commit is contained in:
+66
-141
@@ -3,75 +3,45 @@ syntax = "proto3";
|
||||
package camino;
|
||||
|
||||
import "camino/schema.proto";
|
||||
import "quixos/refs.proto";
|
||||
|
||||
service CaminoService {
|
||||
rpc RegisterSchema(RegisterSchemaRequest) returns (RegisterSchemaResponse);
|
||||
rpc ListClasses(ListClassesRequest) returns (ListClassesResponse);
|
||||
rpc InstallPersistencePlan(InstallPersistencePlanRequest) returns (InstallPersistencePlanResponse);
|
||||
rpc GetPersistencePlan(GetPersistencePlanRequest) returns (GetPersistencePlanResponse);
|
||||
rpc CreateObject(CreateObjectRequest) returns (CreateObjectResponse);
|
||||
rpc GetObject(GetObjectRequest) returns (GetObjectResponse);
|
||||
rpc ListObjects(ListObjectsRequest) returns (ListObjectsResponse);
|
||||
rpc SetField(SetFieldRequest) returns (SetFieldResponse);
|
||||
rpc AddEdge(AddEdgeRequest) returns (AddEdgeResponse);
|
||||
rpc ListEdges(ListEdgesRequest) returns (ListEdgesResponse);
|
||||
rpc ReadState(ReadStateRequest) returns (ReadStateResponse);
|
||||
rpc WriteState(WriteStateRequest) returns (WriteStateResponse);
|
||||
rpc ConnectEdge(ConnectEdgeRequest) returns (ConnectEdgeResponse);
|
||||
rpc ResolveEdge(ResolveEdgeRequest) returns (ResolveEdgeResponse);
|
||||
rpc RemoveEdge(RemoveEdgeRequest) returns (RemoveEdgeResponse);
|
||||
rpc DisconnectEdge(DisconnectEdgeRequest) returns (DisconnectEdgeResponse);
|
||||
rpc ListOps(ListOpsRequest) returns (ListOpsResponse);
|
||||
rpc WatchObject(WatchObjectRequest) returns (stream WatchObjectEvent);
|
||||
}
|
||||
|
||||
message RegisterSchemaRequest {
|
||||
string source_file = 1;
|
||||
}
|
||||
|
||||
message RegisterSchemaResponse {
|
||||
repeated string class_ids = 1;
|
||||
repeated ClassSchema classes = 2;
|
||||
}
|
||||
|
||||
message ListClassesRequest {}
|
||||
|
||||
message RegisteredClass {
|
||||
string id = 1;
|
||||
ClassSchema schema = 2;
|
||||
}
|
||||
|
||||
message ListClassesResponse {
|
||||
repeated RegisteredClass classes = 1;
|
||||
}
|
||||
|
||||
message NullValue {}
|
||||
|
||||
message ObjectValue {
|
||||
map<string, Value> fields = 1;
|
||||
}
|
||||
|
||||
message ListValue {
|
||||
repeated Value values = 1;
|
||||
}
|
||||
|
||||
message RefValue {
|
||||
string object_id = 1;
|
||||
}
|
||||
|
||||
message ObjectValue { map<string, Value> fields = 1; }
|
||||
message ListValue { repeated Value values = 1; }
|
||||
message RefValue { string object_id = 1; }
|
||||
message CrdtValue {
|
||||
string type = 1;
|
||||
string encoding = 2;
|
||||
bytes payload = 3;
|
||||
}
|
||||
|
||||
message FieldValueSource {
|
||||
message StateValueSource {
|
||||
string object_id = 1;
|
||||
string field_name = 2;
|
||||
string field_type = 3;
|
||||
string field_storage = 4;
|
||||
string conflict_strategy = 5;
|
||||
uint64 revision = 6;
|
||||
string slot_id = 2;
|
||||
string value_type_json = 3;
|
||||
string storage_policy_json = 4;
|
||||
uint64 revision = 5;
|
||||
// CRDT-backed state is still read as its materialized Value. The snapshot
|
||||
// travels with the writable source identity so a client can retain and
|
||||
// advance a local replica without exposing the document to package code.
|
||||
CrdtValue crdt_snapshot = 6;
|
||||
}
|
||||
|
||||
message ValueSource {
|
||||
FieldValueSource field = 1;
|
||||
}
|
||||
message ValueSource { StateValueSource state = 1; }
|
||||
|
||||
message Value {
|
||||
oneof kind {
|
||||
@@ -89,96 +59,62 @@ message Value {
|
||||
ValueSource source = 11;
|
||||
}
|
||||
|
||||
message InstallPersistencePlanRequest { PersistencePlan plan = 1; }
|
||||
message InstallPersistencePlanResponse { PersistencePlan plan = 1; }
|
||||
message GetPersistencePlanRequest {}
|
||||
message GetPersistencePlanResponse { PersistencePlan plan = 1; }
|
||||
|
||||
message CreateObjectRequest {
|
||||
string class_id = 1;
|
||||
map<string, Value> fields = 2;
|
||||
string atom_id = 1;
|
||||
map<string, Value> initial_state = 2;
|
||||
}
|
||||
message CreateObjectResponse { CaminoObject object = 1; }
|
||||
message GetObjectRequest { string object_id = 1; }
|
||||
message GetObjectResponse { CaminoObject object = 1; }
|
||||
message ListObjectsRequest { string atom_id = 1; }
|
||||
message ListObjectsResponse { repeated CaminoObject objects = 1; }
|
||||
|
||||
message CreateObjectResponse {
|
||||
CaminoObject object = 1;
|
||||
}
|
||||
|
||||
message GetObjectRequest {
|
||||
message ReadStateRequest {
|
||||
string object_id = 1;
|
||||
string slot_id = 2;
|
||||
}
|
||||
|
||||
message GetObjectResponse {
|
||||
CaminoObject object = 1;
|
||||
}
|
||||
|
||||
message ListObjectsRequest {
|
||||
string class_id = 1;
|
||||
}
|
||||
|
||||
message ListObjectsResponse {
|
||||
repeated CaminoObject objects = 1;
|
||||
}
|
||||
|
||||
message SetFieldRequest {
|
||||
message ReadStateResponse { Value value = 1; }
|
||||
message WriteStateRequest {
|
||||
string object_id = 1;
|
||||
string field_name = 2;
|
||||
string slot_id = 2;
|
||||
Value value = 3;
|
||||
string client_mutation_id = 4;
|
||||
}
|
||||
|
||||
message SetFieldResponse {
|
||||
CaminoObject object = 1;
|
||||
message WriteStateResponse {
|
||||
Value value = 1;
|
||||
CaminoObject object = 2;
|
||||
}
|
||||
|
||||
message AddEdgeRequest {
|
||||
string from_object_id = 1;
|
||||
string source_field = 2;
|
||||
string to_object_id = 3;
|
||||
map<string, Value> fields = 4;
|
||||
optional int32 source_ordinal = 5;
|
||||
message ConnectEdgeRequest {
|
||||
string edge_type_id = 1;
|
||||
string projection_id = 2;
|
||||
string object_id = 3;
|
||||
string target_object_id = 4;
|
||||
optional int32 ordinal = 5;
|
||||
optional int32 target_ordinal = 6;
|
||||
}
|
||||
|
||||
message AddEdgeResponse {
|
||||
CaminoEdge edge = 1;
|
||||
}
|
||||
|
||||
message ListEdgesRequest {
|
||||
string object_id = 1;
|
||||
}
|
||||
|
||||
message ListEdgesResponse {
|
||||
repeated CaminoEdge edges = 1;
|
||||
}
|
||||
|
||||
message ConnectEdgeResponse { CaminoEdge edge = 1; }
|
||||
message ResolveEdgeRequest {
|
||||
string object_id = 1;
|
||||
string projection = 2;
|
||||
}
|
||||
|
||||
message ResolveEdgeResponse {
|
||||
repeated CaminoEdge edges = 1;
|
||||
CaminoObject materialized_object = 2;
|
||||
bool created = 3;
|
||||
}
|
||||
|
||||
message RemoveEdgeRequest {
|
||||
string edge_id = 1;
|
||||
}
|
||||
|
||||
message RemoveEdgeResponse {
|
||||
string edge_id = 1;
|
||||
}
|
||||
|
||||
message ListOpsRequest {
|
||||
string object_id = 1;
|
||||
}
|
||||
|
||||
message ListOpsResponse {
|
||||
repeated CaminoOp ops = 1;
|
||||
string edge_type_id = 2;
|
||||
string projection_id = 3;
|
||||
}
|
||||
message ResolveEdgeResponse { repeated CaminoEdge edges = 1; }
|
||||
message DisconnectEdgeRequest { string edge_id = 1; }
|
||||
message DisconnectEdgeResponse { string edge_id = 1; }
|
||||
|
||||
message ListOpsRequest { string object_id = 1; }
|
||||
message ListOpsResponse { repeated CaminoOp ops = 1; }
|
||||
message WatchObjectRequest {
|
||||
string object_id = 1;
|
||||
string after_op_id = 2;
|
||||
bool include_snapshot = 3;
|
||||
}
|
||||
|
||||
message WatchObjectEvent {
|
||||
string object_id = 1;
|
||||
CaminoObject snapshot = 2;
|
||||
@@ -187,34 +123,24 @@ message WatchObjectEvent {
|
||||
|
||||
message CaminoObject {
|
||||
string id = 1;
|
||||
string class_id = 2;
|
||||
uint32 schema_version = 3;
|
||||
string atom_id = 2;
|
||||
string workspace_revision_id = 3;
|
||||
string created_at = 4;
|
||||
string updated_at = 5;
|
||||
map<string, Value> fields = 6;
|
||||
map<string, uint64> field_revisions = 7;
|
||||
map<string, string> field_conflicts = 8;
|
||||
map<string, Value> state = 6;
|
||||
map<string, uint64> state_revisions = 7;
|
||||
}
|
||||
|
||||
message CaminoEdge {
|
||||
string id = 1;
|
||||
string edge_type_id = 2;
|
||||
string from_object_id = 3;
|
||||
string to_object_id = 4;
|
||||
// Legacy canonical source-side projection fields. Prefer endpoint fields.
|
||||
string source_field = 5;
|
||||
string cardinality = 6;
|
||||
string inverse = 7;
|
||||
map<string, Value> fields = 8;
|
||||
optional int32 from_ordinal = 9;
|
||||
string created_at = 10;
|
||||
string updated_at = 11;
|
||||
string from_projection = 12;
|
||||
string to_projection = 13;
|
||||
string from_cardinality = 14;
|
||||
string to_cardinality = 15;
|
||||
optional int32 to_ordinal = 16;
|
||||
string directionality = 17;
|
||||
string first_object_id = 3;
|
||||
string second_object_id = 4;
|
||||
string first_projection_id = 5;
|
||||
string second_projection_id = 6;
|
||||
optional int32 first_ordinal = 7;
|
||||
optional int32 second_ordinal = 8;
|
||||
string created_at = 9;
|
||||
}
|
||||
|
||||
message CaminoOp {
|
||||
@@ -223,7 +149,6 @@ message CaminoOp {
|
||||
string op_kind = 3;
|
||||
Value payload = 4;
|
||||
string actor = 5;
|
||||
quixos.FunctionRef function_ref = 6;
|
||||
string created_at = 7;
|
||||
string client_mutation_id = 8;
|
||||
string created_at = 6;
|
||||
string client_mutation_id = 7;
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package camino;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
import "camino/schema.proto";
|
||||
import "quixos/refs.proto";
|
||||
|
||||
extend google.protobuf.FileOptions {
|
||||
string schema_namespace = 51000;
|
||||
string schema_version = 51001;
|
||||
}
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
ClassOptions class = 51010;
|
||||
repeated MethodOptions method = 51011;
|
||||
repeated MigrationOptions migration = 51012;
|
||||
InterfaceOptions interface = 51013;
|
||||
repeated ImplementsOptions implements = 51014;
|
||||
ConstructorOptions constructor = 51015;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
ConflictStrategy conflict = 51020;
|
||||
EdgeOptions edge = 51021;
|
||||
FieldStorage field_storage = 51022;
|
||||
FieldOps field_ops = 51023;
|
||||
InterfaceFieldContract interface_field = 51024;
|
||||
bool display_label = 51025;
|
||||
}
|
||||
|
||||
extend google.protobuf.MethodOptions {
|
||||
quixos.FunctionRef impl = 51030;
|
||||
}
|
||||
|
||||
message ClassOptions {
|
||||
uint32 version = 1;
|
||||
SymbolRef id = 2;
|
||||
}
|
||||
|
||||
message InterfaceOptions {
|
||||
uint32 version = 1;
|
||||
SymbolRef id = 2;
|
||||
repeated string type_parameter = 3;
|
||||
}
|
||||
|
||||
message ImplementsOptions {
|
||||
SymbolRef interface = 1;
|
||||
repeated TypeBinding type_binding = 2;
|
||||
}
|
||||
|
||||
message ConstructorOptions {
|
||||
quixos.FunctionRef function = 1;
|
||||
}
|
||||
|
||||
message EdgeOptions {
|
||||
SymbolRef id = 1;
|
||||
// Shorthand for other_endpoint.class.
|
||||
SymbolRef target = 2;
|
||||
// Shorthand for this_endpoint.cardinality.
|
||||
Cardinality cardinality = 3;
|
||||
// Shorthand for other_endpoint.projection.
|
||||
string inverse = 4;
|
||||
EdgeEndpointOptions this_endpoint = 5;
|
||||
EdgeEndpointOptions other_endpoint = 6;
|
||||
repeated SymbolRef tag = 7;
|
||||
repeated SymbolRef implements = 8;
|
||||
bool undirected = 9;
|
||||
}
|
||||
|
||||
message EdgeEndpointOptions {
|
||||
SymbolRef class = 1;
|
||||
SymbolRef interface = 2;
|
||||
string projection = 3;
|
||||
Cardinality cardinality = 4;
|
||||
bool indexed = 5;
|
||||
EdgeMaterializationOptions materialize = 6;
|
||||
}
|
||||
|
||||
message EdgeMaterializationOptions {
|
||||
SymbolRef class = 1;
|
||||
string connect_projection = 2;
|
||||
}
|
||||
|
||||
message MethodOptions {
|
||||
string name = 1;
|
||||
quixos.FunctionRef function = 2;
|
||||
}
|
||||
|
||||
message MigrationOptions {
|
||||
uint32 from_version = 1;
|
||||
uint32 to_version = 2;
|
||||
quixos.FunctionRef function = 3;
|
||||
}
|
||||
+37
-190
@@ -2,215 +2,62 @@ syntax = "proto3";
|
||||
|
||||
package camino;
|
||||
|
||||
import "quixos/refs.proto";
|
||||
|
||||
message SymbolRef {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string version = 3;
|
||||
string hash = 4;
|
||||
}
|
||||
|
||||
enum ConflictStrategy {
|
||||
CONFLICT_STRATEGY_UNSPECIFIED = 0;
|
||||
REPLACE = 1;
|
||||
PRESERVE_CONFLICTS = 2;
|
||||
CRDT = 3;
|
||||
}
|
||||
|
||||
enum Cardinality {
|
||||
CARDINALITY_UNSPECIFIED = 0;
|
||||
OPTIONAL_ONE = 1;
|
||||
EXACTLY_ONE = 2;
|
||||
MANY = 3;
|
||||
MANY_UNIQUE = 4;
|
||||
MANY_ORDERED = 5;
|
||||
MANY_UNIQUE_ORDERED = 6;
|
||||
}
|
||||
|
||||
enum DocRefStrength {
|
||||
DOC_REF_STRENGTH_UNSPECIFIED = 0;
|
||||
SOFT_REF = 1;
|
||||
PROJECTED_EDGE = 2;
|
||||
message AtomDefinition {
|
||||
string atom_id = 1;
|
||||
string display_name = 2;
|
||||
}
|
||||
|
||||
enum FieldStorageKind {
|
||||
FIELD_STORAGE_KIND_UNSPECIFIED = 0;
|
||||
STORED = 1;
|
||||
DERIVED = 2;
|
||||
LAZY = 3;
|
||||
EXTERNAL = 4;
|
||||
STATIC_FINAL = 5;
|
||||
message AtomConformance {
|
||||
string atom_id = 1;
|
||||
string interface_revision_id = 2;
|
||||
}
|
||||
|
||||
message Ref {
|
||||
string object_id = 1;
|
||||
message StateAttachment {
|
||||
string slot_id = 1;
|
||||
string attached_atom_id = 2;
|
||||
string display_name = 3;
|
||||
string value_type_json = 4;
|
||||
string storage_policy_json = 5;
|
||||
string default_value_json = 6;
|
||||
}
|
||||
|
||||
message CustomField {}
|
||||
|
||||
message WatchStartResult {
|
||||
string watch_id = 1;
|
||||
message EndpointConstraint {
|
||||
oneof kind {
|
||||
string atom_id = 1;
|
||||
string interface_revision_id = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message WatchStopRequest {
|
||||
string watch_id = 1;
|
||||
}
|
||||
|
||||
message WatchStopResult {}
|
||||
|
||||
message CrdtText {
|
||||
bytes payload = 1;
|
||||
}
|
||||
|
||||
message CrdtRichText {
|
||||
bytes payload = 1;
|
||||
}
|
||||
|
||||
message CrdtJson {
|
||||
bytes payload = 1;
|
||||
}
|
||||
|
||||
message ClassSchema {
|
||||
SymbolRef id = 1;
|
||||
uint32 version = 2;
|
||||
repeated FieldSchema fields = 3;
|
||||
repeated EdgeSchema edges = 4;
|
||||
repeated MethodSchema methods = 5;
|
||||
repeated MigrationSpec migrations = 6;
|
||||
string source_file = 7;
|
||||
string proto_message = 8;
|
||||
repeated OperationServiceSchema operation_services = 9;
|
||||
repeated InterfaceImplementationSchema implements = 10;
|
||||
ConstructorSpec constructor = 11;
|
||||
}
|
||||
|
||||
message FieldSchema {
|
||||
string name = 1;
|
||||
uint32 tag = 2;
|
||||
TypeRef type = 3;
|
||||
ConflictStrategy conflict = 4;
|
||||
bool repeated = 5;
|
||||
bool optional = 6;
|
||||
FieldStorage storage = 7;
|
||||
FieldOps ops = 8;
|
||||
InterfaceFieldContract interface_contract = 9;
|
||||
bool is_display_label = 10;
|
||||
}
|
||||
|
||||
message FieldStorage {
|
||||
FieldStorageKind kind = 1;
|
||||
quixos.FunctionRef resolver = 2;
|
||||
bool cache = 3;
|
||||
}
|
||||
|
||||
message TypeRef {
|
||||
string proto_type = 1;
|
||||
SymbolRef symbol = 2;
|
||||
}
|
||||
|
||||
message TypeBinding {
|
||||
string name = 1;
|
||||
TypeRef type = 2;
|
||||
}
|
||||
|
||||
message InterfaceFieldContract {
|
||||
bool required = 1;
|
||||
bool readable = 2;
|
||||
bool writable = 3;
|
||||
bool watchable = 4;
|
||||
string type_param = 5;
|
||||
TypeRef type = 6;
|
||||
string ref_target_type_param = 7;
|
||||
Cardinality edge_cardinality = 8;
|
||||
}
|
||||
|
||||
message InterfaceImplementationSchema {
|
||||
SymbolRef interface = 1;
|
||||
repeated TypeBinding type_bindings = 2;
|
||||
}
|
||||
|
||||
message InterfaceSchema {
|
||||
SymbolRef id = 1;
|
||||
uint32 version = 2;
|
||||
repeated FieldSchema fields = 3;
|
||||
string source_file = 4;
|
||||
string proto_message = 5;
|
||||
repeated string type_parameters = 6;
|
||||
}
|
||||
|
||||
enum FieldImplementation {
|
||||
FIELD_IMPLEMENTATION_UNSPECIFIED = 0;
|
||||
SERVICE = 1;
|
||||
}
|
||||
|
||||
message FieldOps {
|
||||
FieldImplementation implementation = 1;
|
||||
string service = 2;
|
||||
}
|
||||
|
||||
message EdgeSchema {
|
||||
SymbolRef id = 1;
|
||||
// Legacy/source-side projection fields. Prefer from_endpoint/to_endpoint.
|
||||
string source_field = 2;
|
||||
SymbolRef from_class = 3;
|
||||
SymbolRef to_class = 4;
|
||||
Cardinality cardinality = 5;
|
||||
string inverse = 6;
|
||||
repeated FieldSchema fields = 7;
|
||||
EdgeEndpointSchema from_endpoint = 8;
|
||||
EdgeEndpointSchema to_endpoint = 9;
|
||||
SymbolRef declaring_class = 10;
|
||||
repeated SymbolRef tags = 11;
|
||||
repeated SymbolRef implements = 12;
|
||||
bool undirected = 13;
|
||||
}
|
||||
|
||||
message EdgeEndpointSchema {
|
||||
SymbolRef class = 1;
|
||||
SymbolRef interface = 2;
|
||||
string projection = 3;
|
||||
message EdgeEndpoint {
|
||||
string projection_id = 1;
|
||||
string display_name = 2;
|
||||
EndpointConstraint constraint = 3;
|
||||
Cardinality cardinality = 4;
|
||||
bool indexed = 5;
|
||||
EdgeMaterialization materialize = 6;
|
||||
bool ordered = 5;
|
||||
}
|
||||
|
||||
message EdgeMaterialization {
|
||||
SymbolRef class = 1;
|
||||
string connect_projection = 2;
|
||||
message EdgeAttachment {
|
||||
string edge_type_id = 1;
|
||||
string display_name = 2;
|
||||
EdgeEndpoint first = 3;
|
||||
EdgeEndpoint second = 4;
|
||||
}
|
||||
|
||||
message MethodSchema {
|
||||
string name = 1;
|
||||
quixos.FunctionRef function = 2;
|
||||
}
|
||||
|
||||
message MigrationSpec {
|
||||
uint32 from_version = 1;
|
||||
uint32 to_version = 2;
|
||||
quixos.FunctionRef function = 3;
|
||||
}
|
||||
|
||||
message ConstructorSpec {
|
||||
quixos.FunctionRef function = 1;
|
||||
}
|
||||
|
||||
message OperationSchema {
|
||||
string name = 1;
|
||||
TypeRef input_type = 2;
|
||||
TypeRef output_type = 3;
|
||||
quixos.FunctionRef function = 4;
|
||||
}
|
||||
|
||||
message OperationServiceSchema {
|
||||
string name = 1;
|
||||
string full_name = 2;
|
||||
repeated OperationSchema operations = 3;
|
||||
}
|
||||
|
||||
message DocRefDeclaration {
|
||||
string local_name = 1;
|
||||
SymbolRef type = 2;
|
||||
SymbolRef target_class = 3;
|
||||
DocRefStrength strength = 4;
|
||||
// Camino consumes this persistence-only projection of a checked workspace.
|
||||
// Interfaces, operation bindings, packages, and constructors stay in orch.
|
||||
message PersistencePlan {
|
||||
string workspace_id = 1;
|
||||
string workspace_revision_id = 2;
|
||||
repeated AtomDefinition atoms = 3;
|
||||
repeated AtomConformance conformances = 4;
|
||||
repeated StateAttachment states = 5;
|
||||
repeated EdgeAttachment edges = 6;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user