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
3 changes: 2 additions & 1 deletion compatibility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ compatibility/fixtures/<category>/<name>/

Imported fixtures should also record an immutable `sourceCommit`, a direct
`sourceUrl`, a `licenseUrl`, and whether the source was modified. The corpus
contains 27 fixtures: 14 original WrightKit-authored synthetic/census cases and 13
contains 40 fixtures: 26 WrightKit-authored synthetic cases, one census boundary
fixture, and 13
real-world projects (11 derived from the pinned OverPy `examples/` tree,
GPL-3.0-only, provenance-recorded evidence, plus the independent BSD-2-Clause
projects `real-world/ow1-emulator` and `real-world/6v6-adjustments`, full
Expand Down
6 changes: 6 additions & 0 deletions compatibility/differential-expectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"cases": [
{"fixture": "synthetic/basic-rule", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/basic-rule/oracle.json", "implementation-invariant:frontend-resolves-basic-rule"], "note": "Minimal rule is part of the Workshop-independent frontend contract."},
{"fixture": "synthetic/control-flow", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/control-flow/oracle.json", "implementation-invariant:frontend-resolves-control-flow"], "note": "If/elif/else, for-in-range, while, and pass resolve in the OPY semantic model."},
{"fixture": "synthetic/issue-28-syntax", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/issue-28-syntax/oracle.json", "implementation-invariant:issue-28-pure-syntax-hir"], "note": "Switch, do-while, hexadecimal literals, membership, dict indexing, comprehensions, lambda arguments, and f/w/b/c string modifiers resolve through the OPY HIR."},
{"fixture": "synthetic/issue-28-string-modifiers", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/issue-28-string-modifiers/oracle.json", "implementation-invariant:issue-28-string-modifier-hir"], "note": "The pinned oracle accepts the inventory-backed f/w/b/c modifier forms; l/t remain syntax-carried because translation content is outside this frontend."},
{"fixture": "synthetic/issue-33-switch-break", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/issue-33-switch-break/oracle.json", "implementation-invariant:issue-33-fallthrough-break-hir"], "note": "The pinned oracle accepts source-order switch fallthrough and nested break; native HIR retains the same authored arm order and explicit break statements."},
{"fixture": "synthetic/issue-33-f-string", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/issue-33-f-string/oracle.json", "implementation-invariant:issue-33-format-provenance-and-lambda-slots"], "note": "The pinned oracle accepts semantic f-string interpolation and sorted key lambda syntax; native HIR retains format arguments with source provenance."},
{"fixture": "synthetic/issue-33-lambda-negative", "nativeStatus": "failure", "classification": "match", "ruleNames": false, "evidence": ["oracle:synthetic/issue-33-lambda-negative/oracle.json", "implementation-invariant:issue-33-lambda-context-diagnostic"], "note": "The pinned oracle rejects a standalone lambda argument; native emits the stable lambda-context diagnostic."},
{"fixture": "synthetic/issue-28-invalid-syntax", "nativeStatus": "failure", "classification": "match", "ruleNames": false, "evidence": ["oracle:synthetic/issue-28-invalid-syntax/oracle.json", "implementation-invariant:issue-28-structured-negative-diagnostics"], "note": "Malformed do-while and dictionary syntax remain structured failures rather than silent acceptance."},
{"fixture": "synthetic/declarations-numbers", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/declarations-numbers/oracle.json", "implementation-invariant:frontend-resolves-declarations"], "note": "Numeric literals and variable-index declarations resolve in the OPY semantic model."},
{"fixture": "synthetic/declarations-rules", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/declarations-rules/oracle.json", "implementation-invariant:frontend-resolves-rule-declarations"], "note": "globalvar, playervar, subroutine, def, enum, and rule declarations resolve."},
{"fixture": "synthetic/expressions-values", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/expressions-values/oracle.json", "implementation-invariant:frontend-resolves-expressions"], "note": "Expressions, arrays, strings, vectors, calls, and format expressions resolve."},
Expand Down
10 changes: 7 additions & 3 deletions compatibility/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This directory is the opy-rs compatibility corpus: OPY sources with their
pinned-oracle snapshots (`oracle.json`), ported from the WrightKit project's
evidence base (wright `compatibility/fixtures/`) and re-verified against the
pinned OverPy 9.7.10 oracle on 2026-08-17 (all 27 snapshots match).
pinned OverPy 9.7.10 oracle on 2026-08-17 (all 40 snapshots match).

Corpus policy: every fixture records provenance in its `fixture.json`
(`kind`, `origin`, `license`, `redistributable`, and — for imported
Expand All @@ -27,7 +27,7 @@ fixtures/<category>/<name>/

## Synthetic fixtures (WrightKit-authored)

`fixtures/synthetic/` — 16 fixtures authored for the WrightKit compatibility
`fixtures/synthetic/` — 26 fixtures authored for the WrightKit compatibility
corpus (same organization as opy-rs; AGPL-3.0-or-later, `kind: original`),
ported unchanged:

Expand All @@ -49,6 +49,10 @@ ported unchanged:
| `chase-condition-agentlab` | `chaseOverTime(...)` in rule conditions (agent-lab regression) |
| `chase-keywords` | named/keyword arguments and the `chase`/`ChaseReeval` contextual forms |
| `for-range-agentlab` | `for` with implicit default-variable binder (agent-lab regression, `kind: derived`) |
| `issue-28-*` | pure OPY syntax probes for switch, do-while, hex, membership, modifiers, dicts, comprehensions, lambda, and negative diagnostics |
| `issue-29-*` | directive/include/main-file preprocessing probes |
| `issue-33-*` | switch break/fallthrough, f-string interpolation, and lambda negative probes |
| `receiver-playervar` | bare variable member expression `A = B.C` with preserved receiver/member provenance |

## Real-world fixtures

Expand Down Expand Up @@ -116,7 +120,7 @@ reference diagnostics, exactly like the pinned oracle behaves.

## Not ported / dropped

* **No fixture was dropped for provenance reasons**: all 27 fixtures in the
* **No fixture was dropped for provenance reasons**: all 40 fixtures in the
WrightKit corpus carried complete, reviewed provenance and are ported.
* Upstream `examples/` not ported (candidates for later expansion once a
demonstrated need exists): `lucioball_all_heroes.opy`, `skirmish_elim.opy`,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"id": "synthetic/issue-28-invalid-syntax",
"category": "diagnostics",
"features": ["syntax/do-while", "syntax/string-modifiers", "syntax/dicts"],
"source": "source.opy",
"expectedStatus": "failure",
"provenance": {
"kind": "original",
"origin": "opy-rs Issue #28 minimized reference-rejected syntax probe",
"license": "AGPL-3.0-or-later",
"redistributable": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compile": {
"diagnostics": [
{
"severity": "error",
"text": "Error: Content is empty (missing operand or argument?)\n | line 7, col 5, at source.opy"
}
],
"exitCode": 1,
"status": "failure",
"stdout": "",
"workshop": "",
"workshopExact": "",
"workshopSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"fixture": "synthetic/issue-28-invalid-syntax",
"input": {
"sha256": "4c37a67406cb59376baabd986880ff71999f664456c3d1662cab47e47a371765",
"source": "source.opy"
},
"oracle": {
"gitHead": "1e2688954302a402d076944b46db07efb14d7b61",
"integrity": "sha512-oX17nauJcPTaKIrRFY/rD0Rl8atqFUVv9Hg2TKH+A68/fC8+ZO344Mkd1A/Y0oOVp1hr5tktMBjzMEDDnMEYUw==",
"language": "en-US",
"license": "GPL-3.0-only",
"name": "overpy",
"registryTarball": "https://registry.npmjs.org/overpy/-/overpy-9.7.10.tgz",
"repository": "https://github.com/Zezombye/overpy",
"version": "9.7.10"
},
"schemaVersion": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
globalvar value

rule "issue 28 invalid syntax":
@Event global
do:
value = 1
while
value = {"key"}
value = u"invalid modifier"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"id": "synthetic/issue-28-string-modifiers",
"category": "syntax",
"features": ["syntax/string-modifiers"],
"source": "source.opy",
"expectedStatus": "success",
"provenance": {
"kind": "original",
"origin": "opy-rs Issue #28 minimized pinned-oracle string modifier probe",
"license": "AGPL-3.0-or-later",
"redistributable": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compile": {
"diagnostics": [],
"exitCode": 0,
"status": "success",
"stdout": "",
"workshop": "variables {\n global:\n 0: value\n}\n\nrule (\"issue 28 string modifiers\") {\n event {\n Ongoing - Global;\n }\n actions {\n Set Global Variable(value, Custom String(\"formatted 0\"));\n Set Global Variable(value, Custom String(\"\uff57\uff49\uff44\uff45\"));\n Set Global Variable(value, Custom String(\"\u0392ig\"));\n Set Global Variable(value, Custom String(\"\u0188\u1ea1\u0455\u1eb9-\u0455\u1eb9\u1e47\u0455\u0456\u1e6d\u0456\u03bd\u1eb9\"));\n }\n}\n",
"workshopExact": "variables {\n global:\n 0: value\n}\n\nrule (\"issue 28 string modifiers\") {\n event {\n Ongoing - Global;\n }\n actions {\n Set Global Variable(value, Custom String(\"formatted 0\"));\n Set Global Variable(value, Custom String(\"\uff57\uff49\uff44\uff45\"));\n Set Global Variable(value, Custom String(\"\u0392ig\"));\n Set Global Variable(value, Custom String(\"\u0188\u1ea1\u0455\u1eb9-\u0455\u1eb9\u1e47\u0455\u0456\u1e6d\u0456\u03bd\u1eb9\"));\n }\n}\n\n",
"workshopSha256": "40d3c8c89ed4f8ea181d24a2ef9f639d1e0a394c058b5b8413b9bce32e000005"
},
"fixture": "synthetic/issue-28-string-modifiers",
"input": {
"sha256": "a1067d0f682d3baf415c99b980d9b6a253acad47fff340a7b6e06e7af0843c68",
"source": "source.opy"
},
"oracle": {
"gitHead": "1e2688954302a402d076944b46db07efb14d7b61",
"integrity": "sha512-oX17nauJcPTaKIrRFY/rD0Rl8atqFUVv9Hg2TKH+A68/fC8+ZO344Mkd1A/Y0oOVp1hr5tktMBjzMEDDnMEYUw==",
"language": "en-US",
"license": "GPL-3.0-only",
"name": "overpy",
"registryTarball": "https://registry.npmjs.org/overpy/-/overpy-9.7.10.tgz",
"repository": "https://github.com/Zezombye/overpy",
"version": "9.7.10"
},
"schemaVersion": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
globalvar value

rule "issue 28 string modifiers":
@Event global
value = f"formatted {0}"
value = w"wide"
value = b"big"
value = c"case-sensitive"
23 changes: 23 additions & 0 deletions compatibility/fixtures/synthetic/issue-28-syntax/fixture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"schemaVersion": 1,
"id": "synthetic/issue-28-syntax",
"category": "syntax",
"features": [
"syntax/switch",
"syntax/do-while",
"syntax/hex-literals",
"syntax/membership",
"syntax/string-modifiers",
"syntax/dicts",
"syntax/comprehensions",
"syntax/lambda"
],
"source": "source.opy",
"expectedStatus": "success",
"provenance": {
"kind": "original",
"origin": "opy-rs Issue #28 minimized pure-OPY syntax probe",
"license": "AGPL-3.0-or-later",
"redistributable": true
}
}
27 changes: 27 additions & 0 deletions compatibility/fixtures/synthetic/issue-28-syntax/oracle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compile": {
"diagnostics": [],
"exitCode": 0,
"status": "success",
"stdout": "",
"workshop": "variables {\n global:\n 0: value\n}\n\nrule (\"issue 28 syntax\") {\n event {\n Ongoing - Global;\n }\n actions {\n Set Global Variable(value, 1);\n Loop If(Not(Array Contains(Array(2, 3), Global.value)));\n If(True);\n Skip(Value In Array(Array(2, 0, 1), Add(1, Index Of Array Value(Array(16, 0X20), Global.value))));\n //__label_switch_2_0__:\n Set Global Variable(value, True);\n //__label_switch_2_1__:\n Set Global Variable(value, Mapped Array(Array(1, 2), Multiply(Current Array Element, 2)));\n //__label_switch_2_default__:\n Set Global Variable(value, 1);\n End;\n Set Global Variable(value, Sorted Array(Array(1, 2), Current Array Element));\n Set Global Variable(value, Custom String(\"formatted 0\"));\n Set Global Variable(value, Custom String(\"\uff57\uff49\uff44\uff45\"));\n }\n}\n",
"workshopExact": "variables {\n global:\n 0: value\n}\n\nrule (\"issue 28 syntax\") {\n event {\n Ongoing - Global;\n }\n actions {\n Set Global Variable(value, 1);\n Loop If(Not(Array Contains(Array(2, 3), Global.value)));\n If(True);\n Skip(Value In Array(Array(2, 0, 1), Add(1, Index Of Array Value(Array(16, 0X20), Global.value))));\n //__label_switch_2_0__:\n Set Global Variable(value, True);\n //__label_switch_2_1__:\n Set Global Variable(value, Mapped Array(Array(1, 2), Multiply(Current Array Element, 2)));\n //__label_switch_2_default__:\n Set Global Variable(value, 1);\n End;\n Set Global Variable(value, Sorted Array(Array(1, 2), Current Array Element));\n Set Global Variable(value, Custom String(\"formatted 0\"));\n Set Global Variable(value, Custom String(\"\uff57\uff49\uff44\uff45\"));\n }\n}\n\n",
"workshopSha256": "2fc2a9a5ed812c443dd81962ab6e413e806e343d291a60e9e1d3bfc06362b178"
},
"fixture": "synthetic/issue-28-syntax",
"input": {
"sha256": "edf9128e1aa5b6e2ad8d672e00dad15e58517daec7b1a5ae763d0030a57e5573",
"source": "source.opy"
},
"oracle": {
"gitHead": "1e2688954302a402d076944b46db07efb14d7b61",
"integrity": "sha512-oX17nauJcPTaKIrRFY/rD0Rl8atqFUVv9Hg2TKH+A68/fC8+ZO344Mkd1A/Y0oOVp1hr5tktMBjzMEDDnMEYUw==",
"language": "en-US",
"license": "GPL-3.0-only",
"name": "overpy",
"registryTarball": "https://registry.npmjs.org/overpy/-/overpy-9.7.10.tgz",
"repository": "https://github.com/Zezombye/overpy",
"version": "9.7.10"
},
"schemaVersion": 1
}
17 changes: 17 additions & 0 deletions compatibility/fixtures/synthetic/issue-28-syntax/source.opy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
globalvar value

rule "issue 28 syntax":
@Event global
do:
value = 1
while value not in [2, 3]
switch value:
case 0x10:
value = 1 in [1, 2]
case 0X20:
value = [item * 2 for item in [1, 2]]
default:
value = {"key": 1}["key"]
value = sorted([1, 2], key=lambda item: item)
value = f"formatted {0}"
value = w"wide"
14 changes: 14 additions & 0 deletions compatibility/fixtures/synthetic/issue-33-f-string/fixture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"id": "synthetic/issue-33-f-string",
"category": "syntax",
"features": ["syntax/string-modifiers", "syntax/lambda"],
"source": "source.opy",
"expectedStatus": "success",
"provenance": {
"kind": "original",
"origin": "opy-rs Issue #33 pinned f-string interpolation and lambda-slot probe",
"license": "AGPL-3.0-or-later",
"redistributable": true
}
}
Loading