Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules/
**/build/
*.xcuserstate
.DS_Store
docs/superpowers
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "backingLayer",
"sourceNodeID": "node:view:1",
"targetNodeID": "node:layer:1",
"extensions": { "vendor.graph.confidence": 1 }
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"attributePatchDiscovery",
"attributePatching",
"requestCancellation",
"uiGraphRelations",
"vendor.experimentalInspection"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
}
]
}
],
"relations": [
{
"type": "vendor.graph.related",
"sourceNodeID": "node:window:0",
"targetNodeID": "node:label:1",
"extensions": {}
}
]
}
}
6 changes: 6 additions & 0 deletions Contract/v2/Fixtures/valid/node-relation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "vendor.graph.related",
"sourceNodeID": "node:view:1",
"targetNodeID": "node:layer:1",
"extensions": { "vendor.graph.confidence": 1 }
}
17 changes: 15 additions & 2 deletions PROTOCOL-2.0.md → Contract/v2/PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ADB, screenshots, CLI commands, MCP tools, UIKit, Auto Layout, Android View, or
Compose implementation details. A transport only needs to provide a reliable,
ordered byte stream.

`PROTOCOL-2.0.md`, `Schemas/v2`, and `Fixtures/v2/manifest.json` are normative.
`Contract/v2/PROTOCOL.md`, `Contract/v2/Schemas`, and `Contract/v2/manifest.json` are normative.
Swift and Kotlin source code are implementations of this contract, not its
definition.

Expand Down Expand Up @@ -201,6 +201,19 @@ Visibility keeps independent causes instead of overloading one Boolean:
ancestor, has effective opacity greater than `0.01`, intersects the viewport,
and is not fully clipped by an ancestor.

### 8.3 UI graph relations

The `uiGraphRelations` capability advertises that hierarchy snapshots may
contain an optional `relations` member. Each directed relation contains an open
namespaced `type`, a `sourceNodeID`, a `targetNodeID`, and namespaced
`extensions`. Relation types remain producer-owned vocabulary rather than a
closed Protocol enum.

The Runtime reports observed relations between captured nodes. It does not
duplicate hierarchy parent/child edges in `relations`. When either the
`uiGraphRelations` capability or the optional member is absent, the Host must
not infer that any cross-tree relation exists.

## 9. Node details and attributes

Node detail is grouped into sections. Section categories and attribute
Expand Down Expand Up @@ -439,7 +452,7 @@ not reproduce Swift type names or Swift coding behavior.

## 15. Conformance assets

Schemas use JSON Schema Draft 2020-12. `Fixtures/v2/manifest.json` lists every
Schemas use JSON Schema Draft 2020-12. `Contract/v2/manifest.json` lists every
method, Schema reference, valid Fixture, invalid Fixture, expected outcome, and
rejection reason. A conforming implementation must:

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
"$id": "https://astrolabe.dev/schemas/v2/conformance-manifest.schema.json",
"title": "Astrolabe Protocol 2.0 Conformance Manifest",
"type": "object",
"required": ["schemaVersion", "wireProtocolVersion", "methods", "cases"],
"required": ["schemaVersion", "wireProtocolVersion", "fixtureRoots", "methods", "cases"],
"properties": {
"schemaVersion": { "const": 1 },
"schemaVersion": { "const": 2 },
"wireProtocolVersion": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/protocolVersion"
},
"fixtureRoots": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^(?!.*\\/\\.\\.?($|\\/))Contract/v2/Fixtures/(valid|invalid)(?:/[^/]+)*$"
}
},
"methods": {
"type": "array",
"minItems": 1,
Expand All @@ -32,7 +41,7 @@
"required": ["name", "fixture", "schema", "expectation"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"fixture": { "type": "string", "pattern": "^Fixtures/v2/(valid|invalid)/.+\\.json$" },
"fixture": { "type": "string", "pattern": "^Contract/v2/Fixtures/(valid|invalid)/.+\\.json$" },
"schema": { "type": "string", "format": "uri-reference" },
"expectation": { "enum": ["valid", "invalid"] },
"semanticRule": { "enum": ["ascendingProtocolRange", "derivedVisibility"] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,24 @@
}
}
},
"nodeRelation": {
"type": "object",
"required": ["type", "sourceNodeID", "targetNodeID", "extensions"],
"properties": {
"type": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/namespacedIdentifier"
},
"sourceNodeID": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/opaqueIdentifier"
},
"targetNodeID": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/opaqueIdentifier"
},
"extensions": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/extensionMap"
}
}
},
"hierarchySnapshotPayload": {
"type": "object",
"required": [
Expand Down Expand Up @@ -255,6 +273,10 @@
"type": "array",
"items": { "$ref": "#/$defs/node" }
},
"relations": {
"type": "array",
"items": { "$ref": "#/$defs/nodeRelation" }
},
"extensions": {
"$ref": "https://astrolabe.dev/schemas/v2/common.schema.json#/$defs/extensionMap"
}
Expand Down
File renamed without changes.
File renamed without changes.
Loading