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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ its frontend, compiler, reconstruction, or Workshop integration internally.

## Status

- Protocol versions: **1.0**, additive **1.1** file-entry loading, additive **1.2** directory targets, and additive **1.3** source identity for entry-based compilation (specified in [`docs/spec/README.md`](docs/spec/README.md)).
- Protocol versions: **1.0**, additive **1.1** file-entry loading, additive **1.2** directory targets, and additive **1.3** source identity for entry-based compilation, and additive **1.4** artifact format negotiation for `lpp/compile` (specified in [`docs/spec/README.md`](docs/spec/README.md)).
- Repository state: initial published contract and conformance suite.
- Wright is a client/consumer of the protocol; LPP is not a dependency from the
language implementation back into Wright tooling internals.
Expand Down
4 changes: 2 additions & 2 deletions conformance/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LPP v1 Conformance Suite

This directory contains the test suite and fixtures for the Language Provider Protocol v1 wire contract, including the LPP 1.1 file-entry, LPP 1.2 directory-target project-loading, and LPP 1.3 source-identity revisions (see [`../docs/spec/README.md`](../spec/lpp-v1.md)).
This directory contains the test suite and fixtures for the Language Provider Protocol v1 wire contract, including the LPP 1.1 file-entry, LPP 1.2 directory-target project-loading, LPP 1.3 source-identity, and LPP 1.4 artifact-format negotiation revisions (see [`../docs/spec/README.md`](../spec/lpp-v1.md)).

## Layout

Expand All @@ -10,7 +10,7 @@ mock-provider/ Reference provider for the "x-demo-lang" equation DSL (Rus
runner/ Conformance runner that replays fixtures against any provider binary
```

* **Fixtures** (`fixtures/v1/`): one JSON file per scenario. Each scenario defines a session with request/response steps, optional CLI flags, and the expected exit code. Responses are compared after JSON parsing so key order does not matter. The directory contains LPP 1.0, LPP 1.1, LPP 1.2, and LPP 1.3 scenarios.
* **Fixtures** (`fixtures/v1/`): one JSON file per scenario. Each scenario defines a session with request/response steps, optional CLI flags, and the expected exit code. Responses are compared after JSON parsing so key order does not matter. The directory contains LPP 1.0, LPP 1.1, LPP 1.2, LPP 1.3, and LPP 1.4 scenarios.
* **Mock provider** (`mock-provider/`): a small Rust binary implementing the full LPP v1 surface for a demonstration language distinct from OPY and OSTW. It runs over stdio so clients (like the Wright LPP client in wrightkit/wright#142) can test against it directly.
* **Runner** (`runner/`): spawns a fresh provider process per scenario, feeds requests over stdin, validates stdout responses against expectations, and checks the process exit code.

Expand Down
105 changes: 105 additions & 0 deletions conformance/fixtures/v1/45-compile-accepted-format-selection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"name": "compile-accepted-format-selection",
"description": "In an LPP 1.4 session, the provider returns the first accepted format it can produce, skipping formats it does not know.",
"scope": "semantics",
"providerArgs": [
"--protocol-version",
"1.4"
],
"steps": [
{
"request": {
"jsonrpc": "2.0",
"id": 1,
"method": "lpp/initialize",
"params": {
"protocolVersion": "1.4"
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "1.4",
"serverInfo": {
"name": "lpp-mock-provider",
"version": "0.1.0"
},
"languages": [
{
"id": "x-demo-lang",
"extensions": [
"xdl"
]
}
],
"capabilities": {
"check": true,
"compile": true,
"reconstruct": true,
"symbols": true,
"definition": true,
"references": true,
"rename": true,
"editValidation": true,
"projectLoading": true,
"sourceIdentity": true
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 2,
"method": "lpp/compile",
"params": {
"documents": {
"file:///project/puzzle.xdl": {
"uri": "file:///project/puzzle.xdl",
"languageId": "x-demo-lang",
"version": 3,
"text": "puzzle clean {\n target = 40\n start = 10\n ops {\n double: x => x * 2\n plus1: x => x + 1\n }\n solution = [ double, double ]\n}"
}
},
"acceptedArtifactFormats": [
"x-demo/unknown-v9",
"x-demo/puzzle-summary-v1",
"x-demo/puzzle-eval-v1"
]
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 2,
"result": {
"diagnostics": [
{
"uri": "file:///project/puzzle.xdl",
"version": 3,
"diagnostics": []
}
],
"artifact": {
"format": "x-demo/puzzle-summary-v1",
"content": "{\"name\":\"clean\",\"value\":40}"
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 3,
"method": "lpp/shutdown",
"params": {}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 3,
"result": null
}
}
],
"expectExitCode": 0
}
100 changes: 100 additions & 0 deletions conformance/fixtures/v1/46-compile-accepted-format-absent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "compile-accepted-format-absent",
"description": "In an LPP 1.4 session, a compile request without acceptedArtifactFormats returns the provider's default format exactly as in LPP 1.3.",
"scope": "semantics",
"providerArgs": [
"--protocol-version",
"1.4"
],
"steps": [
{
"request": {
"jsonrpc": "2.0",
"id": 1,
"method": "lpp/initialize",
"params": {
"protocolVersion": "1.4"
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "1.4",
"serverInfo": {
"name": "lpp-mock-provider",
"version": "0.1.0"
},
"languages": [
{
"id": "x-demo-lang",
"extensions": [
"xdl"
]
}
],
"capabilities": {
"check": true,
"compile": true,
"reconstruct": true,
"symbols": true,
"definition": true,
"references": true,
"rename": true,
"editValidation": true,
"projectLoading": true,
"sourceIdentity": true
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 2,
"method": "lpp/compile",
"params": {
"documents": {
"file:///project/puzzle.xdl": {
"uri": "file:///project/puzzle.xdl",
"languageId": "x-demo-lang",
"version": 3,
"text": "puzzle clean {\n target = 40\n start = 10\n ops {\n double: x => x * 2\n plus1: x => x + 1\n }\n solution = [ double, double ]\n}"
}
}
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 2,
"result": {
"diagnostics": [
{
"uri": "file:///project/puzzle.xdl",
"version": 3,
"diagnostics": []
}
],
"artifact": {
"format": "x-demo/puzzle-eval-v1",
"content": "{\"name\":\"clean\",\"ops\":[{\"arg\":2,\"name\":\"double\",\"op\":\"*\"},{\"arg\":1,\"name\":\"plus1\",\"op\":\"+\"}],\"solution\":[\"double\",\"double\"],\"start\":10,\"target\":40,\"value\":40}"
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 3,
"method": "lpp/shutdown",
"params": {}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 3,
"result": null
}
}
],
"expectExitCode": 0
}
102 changes: 102 additions & 0 deletions conformance/fixtures/v1/47-compile-accepted-format-unsupported.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"name": "compile-accepted-format-unsupported",
"description": "When no accepted format is supported and an artifact would be produced, the provider refuses instead of falling back to another format.",
"scope": "protocol",
"providerArgs": [
"--protocol-version",
"1.4"
],
"steps": [
{
"request": {
"jsonrpc": "2.0",
"id": 1,
"method": "lpp/initialize",
"params": {
"protocolVersion": "1.4"
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "1.4",
"serverInfo": {
"name": "lpp-mock-provider",
"version": "0.1.0"
},
"languages": [
{
"id": "x-demo-lang",
"extensions": [
"xdl"
]
}
],
"capabilities": {
"check": true,
"compile": true,
"reconstruct": true,
"symbols": true,
"definition": true,
"references": true,
"rename": true,
"editValidation": true,
"projectLoading": true,
"sourceIdentity": true
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 2,
"method": "lpp/compile",
"params": {
"documents": {
"file:///project/puzzle.xdl": {
"uri": "file:///project/puzzle.xdl",
"languageId": "x-demo-lang",
"version": 3,
"text": "puzzle clean {\n target = 40\n start = 10\n ops {\n double: x => x * 2\n plus1: x => x + 1\n }\n solution = [ double, double ]\n}"
}
},
"acceptedArtifactFormats": [
"x-demo/unknown-v9"
]
}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 2,
"error": {
"code": -32000,
"message": "none of the accepted artifact formats is supported",
"data": {
"lpp": {
"kind": "refusal",
"details": {
"refusalCode": "compile.artifactFormatUnsupported"
}
}
}
}
}
},
{
"request": {
"jsonrpc": "2.0",
"id": 3,
"method": "lpp/shutdown",
"params": {}
},
"expectResponse": {
"jsonrpc": "2.0",
"id": 3,
"result": null
}
}
],
"expectExitCode": 0
}
Loading
Loading