Add local-first execution contracts to the capability language

This commit is contained in:
Timothy J. Aveni
2026-09-19 22:09:40 -07:00
parent 757531bb63
commit 03ac7f8557
24 changed files with 3872 additions and 2760 deletions
+31 -11
View File
@@ -96,7 +96,7 @@ interfaceMember
operationMember
: STATIC? OPERATION identifier ID stringLiteral COLON valueType ARROW valueType
LBRACE CALL ID stringLiteral SEMI RBRACE
LBRACE CALL ID stringLiteral executionClause? SEMI RBRACE
;
valueMember
@@ -105,8 +105,8 @@ valueMember
;
valueMemberOperation
: GET ID stringLiteral SEMI
| SET ID stringLiteral SEMI
: GET ID stringLiteral executionClause? SEMI
| SET ID stringLiteral executionClause? SEMI
| WATCH START ID stringLiteral STOP ID stringLiteral SEMI
;
@@ -116,13 +116,13 @@ relationshipMember
;
queryReadContract
: QUERYABLE RPC?
: QUERYABLE (RPC | PORTABLE)?
;
relationshipOperation
: RESOLVE ID stringLiteral SEMI
| CONNECT ID stringLiteral SEMI
| DISCONNECT ID stringLiteral SEMI
: RESOLVE ID stringLiteral executionClause? SEMI
| CONNECT ID stringLiteral executionClause? SEMI
| DISCONNECT ID stringLiteral executionClause? SEMI
| WATCH START ID stringLiteral STOP ID stringLiteral SEMI
;
@@ -156,7 +156,9 @@ packageQuerySpecialization
;
queryClause
: FRAGMENTS stringLiteral SEMI
: REPLICA SEMI
| LOCAL FROM identifier SEMI
| FRAGMENTS stringLiteral SEMI
| VIEW OBJECT? identifier AS interfaceType SEMI
| MAX identifier INTEGER SEMI
| ALLOW interfaceType DOT identifier identifier stringLiteral SEMI
@@ -166,12 +168,21 @@ queryClause
packageOperationExport
: OPERATION identifier typeParameters? ID stringLiteral COLON valueType ARROW valueType
MODE operationMode eventClause? RECEIVER receiverRequirement dependencyBlock? SEMI
MODE operationMode executionClause? eventClause? RECEIVER receiverRequirement dependencyBlock? SEMI
;
packageFunctionExport
: FUNCTION identifier typeParameters? ID stringLiteral COLON valueType ARROW valueType
dependencyBlock? SEMI
executionClause? dependencyBlock? SEMI
;
executionClause
: EXECUTION REMOTE
| EXECUTION (SNAPSHOT | TRANSACTION) TARGETS LBRACK identifierList RBRACK
;
selectedOperations
: USING LBRACK memberOperationRef (COMMA memberOperationRef)* RBRACK
;
packageConstructorExport
@@ -210,7 +221,7 @@ dependencyPort
: REFLECTION identifier ID stringLiteral LBRACK identifierList RBRACK SEMI
| STATE identifier ID stringLiteral COLON valueType primitiveList SEMI
| EDGE identifier ID stringLiteral COLON cardinality targetConstraint primitiveList SEMI
| INTERFACE identifier ID stringLiteral COLON identifier typeArguments? SEMI
| INTERFACE identifier ID stringLiteral COLON identifier typeArguments? selectedOperations? SEMI
| CONSTRUCTOR identifier ID stringLiteral COLON identifier (INPUT valueType)? SEMI
| QUERY identifier ID stringLiteral COLON identifier DOT identifier SEMI
;
@@ -423,6 +434,15 @@ stringLiteral
;
WORKSPACE: 'workspace';
EXECUTION: 'execution';
SNAPSHOT: 'snapshot';
TRANSACTION: 'transaction';
REMOTE: 'remote';
TARGETS: 'targets';
PORTABLE: 'portable';
REPLICA: 'replica';
LOCAL: 'local';
FROM: 'from';
RESULT_BYTES: 'result-bytes';
RPC_CALLS: 'rpc-calls';
DEADLINE_MS: 'deadline-ms';