Skip to content

Commit 7053439

Browse files
authored
Merge pull request #385 from PhysShell/feat/ownir-v1-state-protocols
feat(ownir)!: OwnIR v1 (move, borrow_mut) + C# state protocols; T0 Amendment 1
2 parents 7310f78 + 821c459 commit 7053439

521 files changed

Lines changed: 27849 additions & 1057 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,60 @@ jobs:
32793279
fi
32803280
echo "OK: Tier B A/B — external event OWN050 (no ref) -> OWN001 (with --ref-dir)"
32813281
3282+
# P-010 pillar 9, first slice: C# state protocols over OwnIR v1 (`move`,
3283+
# `borrow_mut`). The Layer 2/3 ledgers freeze the FACTS the Roslyn lowering emits,
3284+
# and both engines replay them with zero dotnet — which proves the engines agree
3285+
# on those documents and nothing about where the documents came from. This job is
3286+
# the other half: the real extractor over the real C#, so a frozen fact cannot
3287+
# drift away from the program it claims to describe.
3288+
#
3289+
# It also carries what no frozen fact can: programs the extractor must REFUSE
3290+
# (code with no contract inside a region, a protocol with a public mutator, a
3291+
# token made by hand in the protocol's own assembly), programs the C# compiler
3292+
# must reject, and an ASP.NET Core + EF Core backend driven over real HTTP against
3293+
# a real SQLite file — the transition has to reach the instance EF tracks and the
3294+
# row it saves, not merely type-check.
3295+
#
3296+
# Both platforms: the fixtures carry repo-relative `file` paths, and a path that
3297+
# is only right with one separator is the kind of thing a single runner hides.
3298+
state-protocols:
3299+
name: state protocols (C# -> OwnIR v1, real ASP.NET Core + EF Core backend)
3300+
strategy:
3301+
fail-fast: false
3302+
matrix:
3303+
os: [ubuntu-latest, windows-latest]
3304+
runs-on: ${{ matrix.os }}
3305+
defaults:
3306+
run:
3307+
shell: bash
3308+
steps:
3309+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3310+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
3311+
with:
3312+
python-version: "3.13"
3313+
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
3314+
with:
3315+
dotnet-version: "8.0.x"
3316+
- uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master, 2026-07-10
3317+
with:
3318+
toolchain: stable
3319+
- name: Build own-cli (the second public engine)
3320+
if: matrix.os == 'ubuntu-latest'
3321+
working-directory: rust
3322+
run: cargo build -p own-cli
3323+
# One script, five questions; see its docstring.
3324+
- name: The protocol gate (cases, refusals, compiler rejections, one assembly, EF backend)
3325+
if: matrix.os != 'ubuntu-latest'
3326+
run: python scripts/protocol_gate.py
3327+
# On Linux it also compares the two PUBLIC CLIs on every C#-derived document:
3328+
# exit code, stdout and stderr, byte for byte. Linux only, for the reason
3329+
# #261 recorded: byte parity with the NATIVE-Windows Python reference is not
3330+
# claimed (it writes cp1252/CRLF), so that comparison would measure the
3331+
# console, not the engines.
3332+
- name: The protocol gate + both public CLIs on the C#-derived documents
3333+
if: matrix.os == 'ubuntu-latest'
3334+
run: python scripts/protocol_gate.py --rust "$PWD/rust/target/debug/own-cli"
3335+
32823336
# P-012 slice 1: score the checker against the labeled corpus on REAL C# — not
32833337
# just the .own reduction tests/test_corpus.py checks. Per case: the bug must be
32843338
# CAUGHT in before.cs (recall) and the fix must be SILENT in after.cs

‎audit/static/run_static.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def check(ok: bool, msg: str) -> None: # total derives from the call count
363363

364364
def _fake_own_check(target_, out_dir_, severity_, root=None):
365365
facts = Path(out_dir_) / "own-check.facts.json"
366-
facts.write_text(json.dumps({"ownir_version": 0, "module": "App", "components": [
366+
facts.write_text(json.dumps({"ownir_version": 1, "module": "App", "components": [
367367
{"name": "CustomerView", "file": "Views/CustomerView.xaml.cs", "subscriptions": [
368368
{"event": "_bus.Changed", "handler": "OnChanged", "line": 21,
369369
"released": False}]}]}), encoding="utf-8")
@@ -419,7 +419,7 @@ def _fake_own_check(target_, out_dir_, severity_, root=None):
419419
' x:Class="App.Views.CustomerView" Loaded="OnLoaded" />\n',
420420
encoding="utf-8")
421421
(out5 / "own-check.facts.json").write_text(json.dumps({
422-
"ownir_version": 0, "module": "Stale", "components": [
422+
"ownir_version": 1, "module": "Stale", "components": [
423423
{"name": "CustomerView", "file": "Views/CustomerView.xaml.cs",
424424
"subscriptions": [{"event": "_bus.Changed", "handler": "OnChanged",
425425
"line": 21, "released": False}]}]}), encoding="utf-8")

‎audit/static/tools/xaml_join.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def check(ok: bool, msg: str) -> None:
303303
"event_handlers": [{"event": "Loaded", "handler": "OnLoaded", "line": 4}],
304304
"bindings": [], "named_elements": []},
305305
]}
306-
ownir = {"ownir_version": 0, "module": "App", "components": [
306+
ownir = {"ownir_version": 1, "module": "App", "components": [
307307
{"name": "CustomerView", "file": "Views/CustomerView.xaml.cs", "subscriptions": [
308308
{"event": "_bus.Changed", "handler": "OnChanged", "line": 21, "released": False}]},
309309
{"name": "CleanView", "file": "Views/CleanView.xaml.cs", "subscriptions": [
@@ -363,7 +363,7 @@ def check(ok: bool, msg: str) -> None:
363363
wrong_ns = {"documents": [{"file": "Features/Billing/CustomerView.xaml",
364364
"x_class": "Billing.CustomerView",
365365
"event_handlers": [{"event": "Loaded", "handler": "OnLoaded", "line": 4}]}]}
366-
other = {"ownir_version": 0, "components": [
366+
other = {"ownir_version": 1, "components": [
367367
{"name": "CustomerView", "file": "Legacy/CustomerView.cs", "subscriptions": [
368368
{"event": "_bus.Changed", "handler": "OnChanged", "line": 9, "released": False}]}]}
369369
check(join(wrong_ns, other) == [],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"ownir_version": 0, "module": "M", "orphaned_awaitables": [{"local": "tx", "callee": "T.M/0", "file": "Q.cs", "line": 1, "family": "C_whatever"}]}
1+
{"ownir_version": 1, "module": "M", "orphaned_awaitables": [{"local": "tx", "callee": "T.M/0", "file": "Q.cs", "line": 1, "family": "C_whatever"}]}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"ownir_version": 0, "module": "M", "orphaned_awaitables": [{"local": ["what", "is", "this"], "callee": {"oops": 1}, "file": "Q.cs", "line": 119, "result_type": 12345}]}
1+
{"ownir_version": 1, "module": "M", "orphaned_awaitables": [{"local": ["what", "is", "this"], "callee": {"oops": 1}, "file": "Q.cs", "line": 119, "result_type": 12345}]}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"ownir_version": 0, "module": "M", "orphaned_awaitables": [{"local": "tx", "callee": "T.M/0", "file": "Q.cs", "line": 2147483648}]}
1+
{"ownir_version": 1, "module": "M", "orphaned_awaitables": [{"local": "tx", "callee": "T.M/0", "file": "Q.cs", "line": 2147483648}]}

‎corpus/ownership-lab/h29/promotion/promo-u.facts.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ownir_version": 0,
2+
"ownir_version": 1,
33
"module": "Extracted",
44
"components": [],
55
"services": [],

‎docs/ROADMAP.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ own scan. Label them as estimates wherever they appear.
318318
| [P-007](proposals/P-007-arraypool-span.md) | ArrayPool / Span borrow-view | P1 | in progress (POOL001–003 built; 004/005 first slices) |
319319
| [P-008](proposals/P-008-effects-and-resources.md) | Effects & resources (`Own.Effects`) | P1/P2 | draft |
320320
| [P-009](proposals/P-009-nogc-regions.md) | No-GC / allocation-free regions | horizon | draft |
321-
| [P-010](proposals/P-010-type-disciplines.md) | Richer type disciplines (`Own.Types`) | P2/horizon | draft |
321+
| [P-010](proposals/P-010-type-disciplines.md) | Richer type disciplines (`Own.Types`) | P2/horizon | draft; pillar 9 first slice built |
322322
| [P-011](proposals/P-011-editor-tooling.md) | Editor tooling & syntax highlighting | side-track | draft |
323323
| [P-012](proposals/P-012-bug-corpus-mining.md) | Real-world bug corpus & mining | enabling | in progress (corpus benchmark + real-world cases, CI-gated) |
324324
| [P-013](proposals/P-013-distribution-surface.md) | Distribution surface (CI Action + dotnet tool) | enabling | v0 built |

‎docs/evidence/calibration/p022-263a-design-constants.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"artifact": "p022-263a-calibration-design-constants",
3-
"bound_measurement_harness_digest": "104c384d01bf6060bdec1e7c916053ddb04b97fcbd0b39f8a4fc57b8f139672f",
3+
"bound_measurement_harness_digest": "1a26aa63fd5fbbe06e7ae72dd5e1c8f2d611bff8856af4a5b93ae36d2d23a9b1",
44
"bound_policy_implementation_digest": "c3068ed7fa880a7083866ead25fe8bf65c87889d242d8af1f7eee01582cd5cbf",
55
"constants": {
66
"G": [

‎docs/evidence/calibration/p022-263a-policy-freeze.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"artifact": "p022-263a-calibration-policy-freeze",
3-
"measurement_harness_digest": "104c384d01bf6060bdec1e7c916053ddb04b97fcbd0b39f8a4fc57b8f139672f",
3+
"measurement_harness_digest": "1a26aa63fd5fbbe06e7ae72dd5e1c8f2d611bff8856af4a5b93ae36d2d23a9b1",
44
"policy_implementation_digest": "c3068ed7fa880a7083866ead25fe8bf65c87889d242d8af1f7eee01582cd5cbf",
55
"policy_implementation_digest_framing": "sha256 over the source set ordered by the UTF-8 bytes of each repo-relative POSIX path. Each file contributes, with no header and no separator: its path byte length as an 8-byte big-endian unsigned integer, its path's exact UTF-8 bytes, its blob byte length as an 8-byte big-endian unsigned integer, and its exact git blob bytes.",
66
"policy_source_commit": "b4f657a0abdfdfaae199cbc7eee0c47acd8b0057",

0 commit comments

Comments
 (0)