Add activated workspace reflection and Studio definition watches

Expose bounded snapshot-bound definition reads and latest-only watches from the serving checked bundle. Add checked reflection dependency ports, generated SDK bindings and selector-scoped invocation authority.

Move Studio factory, contract and query discovery to public reflection inventories. Share an active-definition watch across canvas and standalone routes and invalidate/reload on epoch changes instead of polling GetWorkspace.

Document the API and deferred scope; cover compiler/codegen, SDK injection, transport authorization, activation publication, pagination and reconnect behavior. Keep all work local; no deployment or publication.
This commit is contained in:
Timothy J. Aveni
2026-09-19 10:18:47 -07:00
parent 1aa55f7a35
commit 757531bb63
20 changed files with 2870 additions and 2105 deletions
+2
View File
@@ -79,6 +79,8 @@ export const genericImplementationType = (
const requirement = entry.requirement,
scope = rootScope();
switch (requirement.kind) {
case "reflection":
return `QxReflectionPort<${requirement.selectors.map((value) => JSON.stringify(value)).join(" | ")}>`;
case "state":
return object([
...requirement.primitives.map((primitive): [string, string] => {
+6
View File
@@ -144,6 +144,11 @@ export const generateTypeScriptBindings = (
const port = (entry: DependencyPort): { type: string; spec: unknown } => {
const requirement = entry.requirement;
switch (requirement.kind) {
case "reflection":
return {
type: `QxReflectionPort<${requirement.selectors.map((value) => q(value)).join(" | ")}>`,
spec: { kind: "reflection", id: entry.id, selectors: requirement.selectors },
};
case "query": {
const query = schema.packages
.find((candidate) => candidate.revisionId === requirement.packageRevisionId)
@@ -378,6 +383,7 @@ export const generateTypeScriptBindings = (
"RelationshipCollection",
"RelationshipEntry",
"QxQuerySnapshot",
"QxReflectionPort",
"QxQueryDescriptor",
].filter((name) => new RegExp(`\\b${name}\\b`).test(signatures));
return (
File diff suppressed because one or more lines are too long
@@ -3,257 +3,259 @@ RESULT_BYTES=2
RPC_CALLS=3
DEADLINE_MS=4
QUERY=5
SPECIALIZE=6
ROOT=7
DOCUMENT=8
FRAGMENTS=9
VIEW=10
MAX=11
ALLOW=12
POLL=13
QUERYABLE=14
RPC=15
QUERY_REASON=16
TYPE=17
OBJECT=18
STORABLE=19
IMPLEMENTS=20
REF=21
FRAGMENT=22
IMPORT=23
EXTERNAL=24
ATOM=25
INTERFACE=26
INTERFACES=27
PACKAGE=28
VALUE=29
RELATION=30
OPERATION=31
FUNCTION=32
CONSTRUCTOR=33
CONSTRUCTS=34
INPUT=35
CONFORM=36
AS=37
BIND=38
STATIC=39
TO=40
PRIVATE=41
SHARED=42
STATE=43
EDGE=44
PROJECTION=45
WITH=46
USING=47
VIA=48
MATERIALIZE=49
IF=50
ABSENT=51
ON=52
POLICY=53
DEFAULT=54
SOURCE=55
REPOSITORY=56
COMMIT=57
REVISION=58
SEMANTIC_MAJOR=59
ON_DELETE=60
RETAIN_OTHER=61
KEYED=62
PUBLIC_TRAVERSAL=63
ID=64
DOC=65
MODE=66
EMITS=67
RECEIVER=68
REQUIRES=69
ANY=70
GET=71
SET=72
WATCH=73
START=74
STOP=75
READ=76
WRITE=77
RESOLVE=78
CONNECT=79
DISCONNECT=80
CALL=81
WATCH_START=82
WATCH_STOP=83
SUBSCRIBE=84
UNSUBSCRIBE=85
OPTIMISTIC_REGISTER=86
CRDT=87
OPTIONAL_ONE=88
EXACTLY_ONE=89
MANY_UNIQUE=90
MANY=91
ORDERED=92
UNIT=93
WATCH_HANDLE=94
MESSAGE=95
ATOM_REF=96
INTERFACE_REF=97
OPTIONAL=98
LIST=99
RECORD=100
BOOL=101
BYTES=102
DOUBLE=103
INT32=104
INT64=105
STRING=106
UINT32=107
UINT64=108
TRUE=109
FALSE=110
NULL=111
ARROW=112
COLON=113
SEMI=114
COMMA=115
DOT=116
LBRACE=117
RBRACE=118
LBRACK=119
RBRACK=120
LPAREN=121
RPAREN=122
LT=123
GT=124
AMP=125
EQUAL=126
INTEGER=127
JSON_NUMBER=128
IDENTIFIER=129
STRING_LITERAL=130
LINE_COMMENT=131
BLOCK_COMMENT=132
WS=133
REFLECTION=6
SPECIALIZE=7
ROOT=8
DOCUMENT=9
FRAGMENTS=10
VIEW=11
MAX=12
ALLOW=13
POLL=14
QUERYABLE=15
RPC=16
QUERY_REASON=17
TYPE=18
OBJECT=19
STORABLE=20
IMPLEMENTS=21
REF=22
FRAGMENT=23
IMPORT=24
EXTERNAL=25
ATOM=26
INTERFACE=27
INTERFACES=28
PACKAGE=29
VALUE=30
RELATION=31
OPERATION=32
FUNCTION=33
CONSTRUCTOR=34
CONSTRUCTS=35
INPUT=36
CONFORM=37
AS=38
BIND=39
STATIC=40
TO=41
PRIVATE=42
SHARED=43
STATE=44
EDGE=45
PROJECTION=46
WITH=47
USING=48
VIA=49
MATERIALIZE=50
IF=51
ABSENT=52
ON=53
POLICY=54
DEFAULT=55
SOURCE=56
REPOSITORY=57
COMMIT=58
REVISION=59
SEMANTIC_MAJOR=60
ON_DELETE=61
RETAIN_OTHER=62
KEYED=63
PUBLIC_TRAVERSAL=64
ID=65
DOC=66
MODE=67
EMITS=68
RECEIVER=69
REQUIRES=70
ANY=71
GET=72
SET=73
WATCH=74
START=75
STOP=76
READ=77
WRITE=78
RESOLVE=79
CONNECT=80
DISCONNECT=81
CALL=82
WATCH_START=83
WATCH_STOP=84
SUBSCRIBE=85
UNSUBSCRIBE=86
OPTIMISTIC_REGISTER=87
CRDT=88
OPTIONAL_ONE=89
EXACTLY_ONE=90
MANY_UNIQUE=91
MANY=92
ORDERED=93
UNIT=94
WATCH_HANDLE=95
MESSAGE=96
ATOM_REF=97
INTERFACE_REF=98
OPTIONAL=99
LIST=100
RECORD=101
BOOL=102
BYTES=103
DOUBLE=104
INT32=105
INT64=106
STRING=107
UINT32=108
UINT64=109
TRUE=110
FALSE=111
NULL=112
ARROW=113
COLON=114
SEMI=115
COMMA=116
DOT=117
LBRACE=118
RBRACE=119
LBRACK=120
RBRACK=121
LPAREN=122
RPAREN=123
LT=124
GT=125
AMP=126
EQUAL=127
INTEGER=128
JSON_NUMBER=129
IDENTIFIER=130
STRING_LITERAL=131
LINE_COMMENT=132
BLOCK_COMMENT=133
WS=134
'workspace'=1
'result-bytes'=2
'rpc-calls'=3
'deadline-ms'=4
'query'=5
'specialize'=6
'root'=7
'document'=8
'fragments'=9
'view'=10
'max'=11
'allow'=12
'poll'=13
'queryable'=14
'rpc'=15
'query-reason'=16
'type'=17
'object'=18
'storable'=19
'implements'=20
'ref'=21
'fragment'=22
'import'=23
'external'=24
'atom'=25
'interface'=26
'interfaces'=27
'package'=28
'value'=29
'relation'=30
'operation'=31
'function'=32
'constructor'=33
'constructs'=34
'input'=35
'conform'=36
'as'=37
'bind'=38
'static'=39
'to'=40
'private'=41
'shared'=42
'state'=43
'edge'=44
'projection'=45
'with'=46
'using'=47
'via'=48
'materialize'=49
'if'=50
'absent'=51
'on'=52
'policy'=53
'default'=54
'source'=55
'repository'=56
'commit'=57
'revision'=58
'semantic-major'=59
'on-delete'=60
'retain-other'=61
'keyed'=62
'public-traversal'=63
'id'=64
'doc'=65
'mode'=66
'emits'=67
'receiver'=68
'requires'=69
'any'=70
'get'=71
'set'=72
'watch'=73
'start'=74
'stop'=75
'read'=76
'write'=77
'resolve'=78
'connect'=79
'disconnect'=80
'call'=81
'watch-start'=82
'watch-stop'=83
'subscribe'=84
'unsubscribe'=85
'optimistic-register'=86
'crdt'=87
'optional-one'=88
'exactly-one'=89
'many-unique'=90
'many'=91
'ordered'=92
'unit'=93
'watch-handle'=94
'message'=95
'atom-ref'=96
'interface-ref'=97
'optional'=98
'list'=99
'record'=100
'bool'=101
'bytes'=102
'double'=103
'int32'=104
'int64'=105
'string'=106
'uint32'=107
'uint64'=108
'true'=109
'false'=110
'null'=111
'->'=112
':'=113
';'=114
','=115
'.'=116
'{'=117
'}'=118
'['=119
']'=120
'('=121
')'=122
'<'=123
'>'=124
'&'=125
'='=126
'reflection'=6
'specialize'=7
'root'=8
'document'=9
'fragments'=10
'view'=11
'max'=12
'allow'=13
'poll'=14
'queryable'=15
'rpc'=16
'query-reason'=17
'type'=18
'object'=19
'storable'=20
'implements'=21
'ref'=22
'fragment'=23
'import'=24
'external'=25
'atom'=26
'interface'=27
'interfaces'=28
'package'=29
'value'=30
'relation'=31
'operation'=32
'function'=33
'constructor'=34
'constructs'=35
'input'=36
'conform'=37
'as'=38
'bind'=39
'static'=40
'to'=41
'private'=42
'shared'=43
'state'=44
'edge'=45
'projection'=46
'with'=47
'using'=48
'via'=49
'materialize'=50
'if'=51
'absent'=52
'on'=53
'policy'=54
'default'=55
'source'=56
'repository'=57
'commit'=58
'revision'=59
'semantic-major'=60
'on-delete'=61
'retain-other'=62
'keyed'=63
'public-traversal'=64
'id'=65
'doc'=66
'mode'=67
'emits'=68
'receiver'=69
'requires'=70
'any'=71
'get'=72
'set'=73
'watch'=74
'start'=75
'stop'=76
'read'=77
'write'=78
'resolve'=79
'connect'=80
'disconnect'=81
'call'=82
'watch-start'=83
'watch-stop'=84
'subscribe'=85
'unsubscribe'=86
'optimistic-register'=87
'crdt'=88
'optional-one'=89
'exactly-one'=90
'many-unique'=91
'many'=92
'ordered'=93
'unit'=94
'watch-handle'=95
'message'=96
'atom-ref'=97
'interface-ref'=98
'optional'=99
'list'=100
'record'=101
'bool'=102
'bytes'=103
'double'=104
'int32'=105
'int64'=106
'string'=107
'uint32'=108
'uint64'=109
'true'=110
'false'=111
'null'=112
'->'=113
':'=114
';'=115
','=116
'.'=117
'{'=118
'}'=119
'['=120
']'=121
'('=122
')'=123
'<'=124
'>'=125
'&'=126
'='=127
File diff suppressed because one or more lines are too long
@@ -3,257 +3,259 @@ RESULT_BYTES=2
RPC_CALLS=3
DEADLINE_MS=4
QUERY=5
SPECIALIZE=6
ROOT=7
DOCUMENT=8
FRAGMENTS=9
VIEW=10
MAX=11
ALLOW=12
POLL=13
QUERYABLE=14
RPC=15
QUERY_REASON=16
TYPE=17
OBJECT=18
STORABLE=19
IMPLEMENTS=20
REF=21
FRAGMENT=22
IMPORT=23
EXTERNAL=24
ATOM=25
INTERFACE=26
INTERFACES=27
PACKAGE=28
VALUE=29
RELATION=30
OPERATION=31
FUNCTION=32
CONSTRUCTOR=33
CONSTRUCTS=34
INPUT=35
CONFORM=36
AS=37
BIND=38
STATIC=39
TO=40
PRIVATE=41
SHARED=42
STATE=43
EDGE=44
PROJECTION=45
WITH=46
USING=47
VIA=48
MATERIALIZE=49
IF=50
ABSENT=51
ON=52
POLICY=53
DEFAULT=54
SOURCE=55
REPOSITORY=56
COMMIT=57
REVISION=58
SEMANTIC_MAJOR=59
ON_DELETE=60
RETAIN_OTHER=61
KEYED=62
PUBLIC_TRAVERSAL=63
ID=64
DOC=65
MODE=66
EMITS=67
RECEIVER=68
REQUIRES=69
ANY=70
GET=71
SET=72
WATCH=73
START=74
STOP=75
READ=76
WRITE=77
RESOLVE=78
CONNECT=79
DISCONNECT=80
CALL=81
WATCH_START=82
WATCH_STOP=83
SUBSCRIBE=84
UNSUBSCRIBE=85
OPTIMISTIC_REGISTER=86
CRDT=87
OPTIONAL_ONE=88
EXACTLY_ONE=89
MANY_UNIQUE=90
MANY=91
ORDERED=92
UNIT=93
WATCH_HANDLE=94
MESSAGE=95
ATOM_REF=96
INTERFACE_REF=97
OPTIONAL=98
LIST=99
RECORD=100
BOOL=101
BYTES=102
DOUBLE=103
INT32=104
INT64=105
STRING=106
UINT32=107
UINT64=108
TRUE=109
FALSE=110
NULL=111
ARROW=112
COLON=113
SEMI=114
COMMA=115
DOT=116
LBRACE=117
RBRACE=118
LBRACK=119
RBRACK=120
LPAREN=121
RPAREN=122
LT=123
GT=124
AMP=125
EQUAL=126
INTEGER=127
JSON_NUMBER=128
IDENTIFIER=129
STRING_LITERAL=130
LINE_COMMENT=131
BLOCK_COMMENT=132
WS=133
REFLECTION=6
SPECIALIZE=7
ROOT=8
DOCUMENT=9
FRAGMENTS=10
VIEW=11
MAX=12
ALLOW=13
POLL=14
QUERYABLE=15
RPC=16
QUERY_REASON=17
TYPE=18
OBJECT=19
STORABLE=20
IMPLEMENTS=21
REF=22
FRAGMENT=23
IMPORT=24
EXTERNAL=25
ATOM=26
INTERFACE=27
INTERFACES=28
PACKAGE=29
VALUE=30
RELATION=31
OPERATION=32
FUNCTION=33
CONSTRUCTOR=34
CONSTRUCTS=35
INPUT=36
CONFORM=37
AS=38
BIND=39
STATIC=40
TO=41
PRIVATE=42
SHARED=43
STATE=44
EDGE=45
PROJECTION=46
WITH=47
USING=48
VIA=49
MATERIALIZE=50
IF=51
ABSENT=52
ON=53
POLICY=54
DEFAULT=55
SOURCE=56
REPOSITORY=57
COMMIT=58
REVISION=59
SEMANTIC_MAJOR=60
ON_DELETE=61
RETAIN_OTHER=62
KEYED=63
PUBLIC_TRAVERSAL=64
ID=65
DOC=66
MODE=67
EMITS=68
RECEIVER=69
REQUIRES=70
ANY=71
GET=72
SET=73
WATCH=74
START=75
STOP=76
READ=77
WRITE=78
RESOLVE=79
CONNECT=80
DISCONNECT=81
CALL=82
WATCH_START=83
WATCH_STOP=84
SUBSCRIBE=85
UNSUBSCRIBE=86
OPTIMISTIC_REGISTER=87
CRDT=88
OPTIONAL_ONE=89
EXACTLY_ONE=90
MANY_UNIQUE=91
MANY=92
ORDERED=93
UNIT=94
WATCH_HANDLE=95
MESSAGE=96
ATOM_REF=97
INTERFACE_REF=98
OPTIONAL=99
LIST=100
RECORD=101
BOOL=102
BYTES=103
DOUBLE=104
INT32=105
INT64=106
STRING=107
UINT32=108
UINT64=109
TRUE=110
FALSE=111
NULL=112
ARROW=113
COLON=114
SEMI=115
COMMA=116
DOT=117
LBRACE=118
RBRACE=119
LBRACK=120
RBRACK=121
LPAREN=122
RPAREN=123
LT=124
GT=125
AMP=126
EQUAL=127
INTEGER=128
JSON_NUMBER=129
IDENTIFIER=130
STRING_LITERAL=131
LINE_COMMENT=132
BLOCK_COMMENT=133
WS=134
'workspace'=1
'result-bytes'=2
'rpc-calls'=3
'deadline-ms'=4
'query'=5
'specialize'=6
'root'=7
'document'=8
'fragments'=9
'view'=10
'max'=11
'allow'=12
'poll'=13
'queryable'=14
'rpc'=15
'query-reason'=16
'type'=17
'object'=18
'storable'=19
'implements'=20
'ref'=21
'fragment'=22
'import'=23
'external'=24
'atom'=25
'interface'=26
'interfaces'=27
'package'=28
'value'=29
'relation'=30
'operation'=31
'function'=32
'constructor'=33
'constructs'=34
'input'=35
'conform'=36
'as'=37
'bind'=38
'static'=39
'to'=40
'private'=41
'shared'=42
'state'=43
'edge'=44
'projection'=45
'with'=46
'using'=47
'via'=48
'materialize'=49
'if'=50
'absent'=51
'on'=52
'policy'=53
'default'=54
'source'=55
'repository'=56
'commit'=57
'revision'=58
'semantic-major'=59
'on-delete'=60
'retain-other'=61
'keyed'=62
'public-traversal'=63
'id'=64
'doc'=65
'mode'=66
'emits'=67
'receiver'=68
'requires'=69
'any'=70
'get'=71
'set'=72
'watch'=73
'start'=74
'stop'=75
'read'=76
'write'=77
'resolve'=78
'connect'=79
'disconnect'=80
'call'=81
'watch-start'=82
'watch-stop'=83
'subscribe'=84
'unsubscribe'=85
'optimistic-register'=86
'crdt'=87
'optional-one'=88
'exactly-one'=89
'many-unique'=90
'many'=91
'ordered'=92
'unit'=93
'watch-handle'=94
'message'=95
'atom-ref'=96
'interface-ref'=97
'optional'=98
'list'=99
'record'=100
'bool'=101
'bytes'=102
'double'=103
'int32'=104
'int64'=105
'string'=106
'uint32'=107
'uint64'=108
'true'=109
'false'=110
'null'=111
'->'=112
':'=113
';'=114
','=115
'.'=116
'{'=117
'}'=118
'['=119
']'=120
'('=121
')'=122
'<'=123
'>'=124
'&'=125
'='=126
'reflection'=6
'specialize'=7
'root'=8
'document'=9
'fragments'=10
'view'=11
'max'=12
'allow'=13
'poll'=14
'queryable'=15
'rpc'=16
'query-reason'=17
'type'=18
'object'=19
'storable'=20
'implements'=21
'ref'=22
'fragment'=23
'import'=24
'external'=25
'atom'=26
'interface'=27
'interfaces'=28
'package'=29
'value'=30
'relation'=31
'operation'=32
'function'=33
'constructor'=34
'constructs'=35
'input'=36
'conform'=37
'as'=38
'bind'=39
'static'=40
'to'=41
'private'=42
'shared'=43
'state'=44
'edge'=45
'projection'=46
'with'=47
'using'=48
'via'=49
'materialize'=50
'if'=51
'absent'=52
'on'=53
'policy'=54
'default'=55
'source'=56
'repository'=57
'commit'=58
'revision'=59
'semantic-major'=60
'on-delete'=61
'retain-other'=62
'keyed'=63
'public-traversal'=64
'id'=65
'doc'=66
'mode'=67
'emits'=68
'receiver'=69
'requires'=70
'any'=71
'get'=72
'set'=73
'watch'=74
'start'=75
'stop'=76
'read'=77
'write'=78
'resolve'=79
'connect'=80
'disconnect'=81
'call'=82
'watch-start'=83
'watch-stop'=84
'subscribe'=85
'unsubscribe'=86
'optimistic-register'=87
'crdt'=88
'optional-one'=89
'exactly-one'=90
'many-unique'=91
'many'=92
'ordered'=93
'unit'=94
'watch-handle'=95
'message'=96
'atom-ref'=97
'interface-ref'=98
'optional'=99
'list'=100
'record'=101
'bool'=102
'bytes'=103
'double'=104
'int32'=105
'int64'=106
'string'=107
'uint32'=108
'uint64'=109
'true'=110
'false'=111
'null'=112
'->'=113
':'=114
';'=115
','=116
'.'=117
'{'=118
'}'=119
'['=120
']'=121
'('=122
')'=123
'<'=124
'>'=125
'&'=126
'='=127
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+15
View File
@@ -849,6 +849,12 @@ const lowerQueryReference = (
const lowerDependencyPort = (state: LoweringState, context: DependencyPortContext): DependencyPort | undefined => {
const name = identifier(context.identifier(0));
const id = capabilityId.dependencyPort(stringValue(context.stringLiteral()));
if (context.REFLECTION())
return {
id,
displayName: name,
requirement: { kind: "reflection", selectors: context.identifierList()!.identifier().map(identifier) },
};
if (context.QUERY()) {
const query = lowerQueryReference(
state,
@@ -1097,6 +1103,11 @@ const lowerGenericPackageExport = (
.primitiveList()
?.primitive()
.map((item) => text(item)) ?? [];
if (port.REFLECTION())
return {
...base,
requirement: { kind: "reflection", selectors: port.identifierList()!.identifier().map(identifier) },
};
if (port.QUERY()) {
const query = lowerQueryReference(state, identifier(port.identifier(1)), identifier(port.identifier(2)), port);
if (!query)
@@ -1575,6 +1586,10 @@ const lowerBoundDependencies = (
);
return projectionId ? { edgeTypeId: attachment.attachment.id, projectionId } : undefined;
};
if (entry.REFLECTION())
return [
{ portId, binding: { kind: "reflection", selectors: entry.identifierList()!.identifier().map(identifier) } },
];
if (entry.QUERY()) {
const query = lowerQueryReference(state, identifier(entry.identifier(1)), identifier(entry.identifier(2)), entry);
const via = entry.VIA() ? traversal(identifier(entry.identifier(3)), identifier(entry.identifier(4))) : undefined;
+2 -1
View File
@@ -22,7 +22,7 @@ import {
export type GenericDependencyPort = Omit<DependencyPort, "requirement"> & {
requirement:
| Extract<DependencyPort["requirement"], { kind: "query" }>
| Extract<DependencyPort["requirement"], { kind: "query" | "reflection" }>
| {
kind: "state";
valueType: ValueTypeExpression;
@@ -80,6 +80,7 @@ export const specializePackageExport = (
const ports: DependencyPort[] = definition.dependencyPorts.map((port) => {
const requirement = port.requirement;
switch (requirement.kind) {
case "reflection":
case "query":
return { ...port, requirement };
case "state":
+2
View File
@@ -223,6 +223,7 @@ export type PackageReceiverRequirement =
};
export type DependencyPortRequirement =
| { kind: "reflection"; selectors: string[] }
| { kind: "query"; packageRevisionId: PackageRevisionId; queryId: string }
| {
kind: "state";
@@ -292,6 +293,7 @@ export interface PackageRevision {
}
export type DependencyBinding =
| { kind: "reflection"; selectors: string[]; via?: never }
| {
kind: "query";
packageRevisionId: PackageRevisionId;
+24
View File
@@ -998,6 +998,16 @@ const validatePackages = (
for (const [portIndex, port] of entry.dependencyPorts.entries()) {
const portPath = `${exportPath}.dependencyPorts[${portIndex}]`;
switch (port.requirement.kind) {
case "reflection":
if (
!port.requirement.selectors.length ||
new Set(port.requirement.selectors).size !== port.requirement.selectors.length ||
port.requirement.selectors.some(
(kind) => !["active", "atoms", "interfaces", "conformances", "queries", "indexes"].includes(kind),
)
)
issue(issues, "invalid-dependency-binding", portPath, "Reflection requires distinct supported selectors");
break;
case "query":
if (
!indexes.packages
@@ -1162,6 +1172,20 @@ const validateBoundDependencies = (
continue;
}
switch (requirement.kind) {
case "reflection": {
const selected = binding as Extract<DependencyBinding, { kind: "reflection" }>;
if (
selected.via ||
JSON.stringify([...selected.selectors].sort()) !== JSON.stringify([...requirement.selectors].sort())
)
issue(
issues,
"invalid-dependency-binding",
path,
"Reflection requires an explicit workspace binding with exactly the declared selectors",
);
break;
}
case "query": {
const selected = binding as Extract<DependencyBinding, { kind: "query" }>;
const query = params.indexes.packages
+451 -30
View File
File diff suppressed because one or more lines are too long
+37 -4
View File
@@ -10,7 +10,7 @@ import type { Message } from "@bufbuild/protobuf";
* Describes the file quixos/refs.proto.
*/
export const file_quixos_refs: GenFile = /*@__PURE__*/
fileDesc("ChFxdWl4b3MvcmVmcy5wcm90bxIGcXVpeG9zInUKDUNhcGFiaWxpdHlSZWYSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAEgASgJEhQKDG9wZXJhdGlvbl9pZBgCIAEoCRIvCgtjb25mb3JtYW5jZRgDIAEoCzIaLnF1aXhvcy5Db25mb3JtYW5jZVdpdG5lc3Mi0QEKDEZpZWxkRWRpdGluZxIbChNnZXR0ZXJfb3BlcmF0aW9uX2lkGAEgASgJEhsKE3NldHRlcl9vcGVyYXRpb25faWQYAiABKAkSFQoNZG9jdW1lbnRfdHlwZRgDIAEoCRIWCg5iaW5kaW5nX2RpZ2VzdBgEIAEoCRInCgRtb2RlGAUgASgOMhkucXVpeG9zLkZpZWxkRWRpdGluZy5Nb2RlIi8KBE1vZGUSDwoLVU5TUEVDSUZJRUQQABIMCghSRUdJU1RFUhABEggKBENSRFQQAiKWAQoSQ29uZm9ybWFuY2VXaXRuZXNzEhEKCW9iamVjdF9pZBgBIAEoCRIdChVpbnRlcmZhY2VfcmV2aXNpb25faWQYAiABKAkSFgoOY29uZm9ybWFuY2VfaWQYAyABKAkSHQoVd29ya3NwYWNlX3JldmlzaW9uX2lkGAQgASgJEhcKD3dvcmtzcGFjZV9lcG9jaBgFIAEoCSJCChBQYWNrYWdlRXhwb3J0UmVmEhsKE3BhY2thZ2VfcmV2aXNpb25faWQYASABKAkSEQoJZXhwb3J0X2lkGAIgASgJIpUCChJJbmplY3RlZERlc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5U2NvcGUSFAoMd29ya3NwYWNlX2lkGAEgASgJEh0KFXdvcmtzcGFjZV9yZXZpc2lvbl9pZBgCIAEoCRIXCg93b3Jrc3BhY2VfZXBvY2gYAyABKAkSHQoVaW50ZXJmYWNlX3JldmlzaW9uX2lkGAQgASgJEhYKDmJpbmRpbmdfZGlnZXN0GAUgASgJIlgKGFdvcmtzcGFjZVF1ZXJ5RGVwZW5kZW5jeRIQCghxdWVyeV9pZBgBIAEoCRIqCgVzY29wZRgCIAEoCzIbLnF1aXhvcy5Xb3Jrc3BhY2VRdWVyeVNjb3BlIj0KDkVkZ2VEZXBlbmRlbmN5EhQKDGVkZ2VfdHlwZV9pZBgBIAEoCRIVCg1wcm9qZWN0aW9uX2lkGAIgASgJYgZwcm90bzM");
/**
* @generated from message quixos.CapabilityRef
@@ -213,6 +213,12 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
*/
value: WorkspaceQueryDependency;
case: "workspaceQuery";
} | {
/**
* @generated from field: quixos.ReflectionDependency reflection = 9;
*/
value: ReflectionDependency;
case: "reflection";
} | { case: undefined; value?: undefined };
/**
@@ -231,6 +237,33 @@ export type InjectedDependency = Message<"quixos.InjectedDependency"> & {
export const InjectedDependencySchema: GenMessage<InjectedDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 4);
/**
* @generated from message quixos.ReflectionDependency
*/
export type ReflectionDependency = Message<"quixos.ReflectionDependency"> & {
/**
* @generated from field: string workspace_id = 1;
*/
workspaceId: string;
/**
* @generated from field: string workspace_epoch = 2;
*/
workspaceEpoch: string;
/**
* @generated from field: repeated string selectors = 3;
*/
selectors: string[];
};
/**
* Describes the message quixos.ReflectionDependency.
* Use `create(ReflectionDependencySchema)` to create a new message.
*/
export const ReflectionDependencySchema: GenMessage<ReflectionDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 5);
/**
* Scope evidence is not authority by itself. The caller must also hold the
* matching workspace-query grant (or the authenticated workspace user grant).
@@ -269,7 +302,7 @@ export type WorkspaceQueryScope = Message<"quixos.WorkspaceQueryScope"> & {
* Use `create(WorkspaceQueryScopeSchema)` to create a new message.
*/
export const WorkspaceQueryScopeSchema: GenMessage<WorkspaceQueryScope> = /*@__PURE__*/
messageDesc(file_quixos_refs, 5);
messageDesc(file_quixos_refs, 6);
/**
* @generated from message quixos.WorkspaceQueryDependency
@@ -291,7 +324,7 @@ export type WorkspaceQueryDependency = Message<"quixos.WorkspaceQueryDependency"
* Use `create(WorkspaceQueryDependencySchema)` to create a new message.
*/
export const WorkspaceQueryDependencySchema: GenMessage<WorkspaceQueryDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 6);
messageDesc(file_quixos_refs, 7);
/**
* @generated from message quixos.EdgeDependency
@@ -313,5 +346,5 @@ export type EdgeDependency = Message<"quixos.EdgeDependency"> & {
* Use `create(EdgeDependencySchema)` to create a new message.
*/
export const EdgeDependencySchema: GenMessage<EdgeDependency> = /*@__PURE__*/
messageDesc(file_quixos_refs, 7);
messageDesc(file_quixos_refs, 8);