|
72 | 72 | - name: cargo test |
73 | 73 | run: cargo test |
74 | 74 |
|
| 75 | + # P-022 step 7a (#260) — COMPARE MODE over the committed corpus. Not #260's |
| 76 | + # acceptance: the five-repository sweep and the large-solution controls are |
| 77 | + # separate work, and nothing here may be read as shadow mode having been |
| 78 | + # achieved. |
| 79 | + # |
| 80 | + # What it gates: every committed facts document through BOTH engines on |
| 81 | + # byte-attested same input, failing on any acceptance-`unexplained` |
| 82 | + # observation at any of the three layers, any `renderer-only divergence` on |
| 83 | + # the derived SARIF, or any execution failure. The generated compact and |
| 84 | + # malformed controls run in the same pass, as the driver's own negative |
| 85 | + # controls, so a gate that reported agreement over an empty set would be red. |
| 86 | + shadow-compare: |
| 87 | + name: shadow compare (committed corpus) |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 91 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 92 | + with: |
| 93 | + python-version: "3.13" |
| 94 | + - uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master, 2026-07-10 |
| 95 | + with: |
| 96 | + toolchain: stable |
| 97 | + - name: Build the dev-only engine adapter |
| 98 | + working-directory: rust |
| 99 | + run: cargo build --release -p own-shadow --bin own-shadow-engine |
| 100 | + - name: Compare mode over the committed corpus |
| 101 | + env: |
| 102 | + OWN_SHADOW_ENGINE: ${{ github.workspace }}/rust/target/release/own-shadow-engine |
| 103 | + run: python scripts/shadow_compare.py --engine compare --corpus --quiet --out "$RUNNER_TEMP/shadow" |
| 104 | + # The driver's own controls, REQUIRED here rather than skipped: this is |
| 105 | + # the job that has the adapter, so it is the job that cannot be allowed |
| 106 | + # to pass without exercising it. The raw-variant, negative and |
| 107 | + # execution-failure controls all run in this pass. |
| 108 | + - name: The compare driver's controls (adapter required) |
| 109 | + env: |
| 110 | + OWN_SHADOW_ENGINE: ${{ github.workspace }}/rust/target/release/own-shadow-engine |
| 111 | + OWN_SHADOW_COMPARE_REQUIRED: "1" |
| 112 | + run: python tests/test_shadow_compare.py |
| 113 | + - name: Upload the divergence reports |
| 114 | + if: failure() |
| 115 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 116 | + with: |
| 117 | + name: shadow-compare-reports |
| 118 | + path: ${{ runner.temp }}/shadow |
| 119 | + retention-days: 14 |
| 120 | + if-no-files-found: ignore |
| 121 | + |
| 122 | + # The same gate over the OwnIR the Roslyn extractor already produced. It |
| 123 | + # consumes the artifact `wpf-extractor` published rather than running the |
| 124 | + # extractor again — #260 forbids a second extraction, and this is the |
| 125 | + # packaging that makes the first one reachable. The driver reads the |
| 126 | + # downloaded file ONCE, as bytes. |
| 127 | + shadow-compare-samples: |
| 128 | + name: shadow compare (C# samples) |
| 129 | + runs-on: ubuntu-latest |
| 130 | + needs: wpf-extractor |
| 131 | + steps: |
| 132 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 133 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 134 | + with: |
| 135 | + python-version: "3.13" |
| 136 | + - uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master, 2026-07-10 |
| 137 | + with: |
| 138 | + toolchain: stable |
| 139 | + - name: Build the dev-only engine adapter |
| 140 | + working-directory: rust |
| 141 | + run: cargo build --release -p own-shadow --bin own-shadow-engine |
| 142 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 |
| 143 | + with: |
| 144 | + name: csharp-samples-ownir |
| 145 | + path: ${{ runner.temp }}/samples |
| 146 | + - name: Compare mode over the extracted C# sample facts |
| 147 | + env: |
| 148 | + OWN_SHADOW_ENGINE: ${{ github.workspace }}/rust/target/release/own-shadow-engine |
| 149 | + run: | |
| 150 | + python scripts/shadow_compare.py --engine compare \ |
| 151 | + "$RUNNER_TEMP/samples/facts.json" --quiet --out "$RUNNER_TEMP/shadow" |
| 152 | + - name: Upload the divergence report |
| 153 | + if: failure() |
| 154 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 155 | + with: |
| 156 | + name: shadow-compare-samples-report |
| 157 | + path: ${{ runner.temp }}/shadow |
| 158 | + retention-days: 14 |
| 159 | + if-no-files-found: ignore |
| 160 | + |
75 | 161 | # Own.NET Audit (audit/) — the aggregation layer's selftests, the only thing the |
76 | 162 | # Linux CI gates for the audit (the target itself is analyzed on a local Windows |
77 | 163 | # machine, never in CI; see audit/README.md and Plan.md §3.2). PyYAML is scoped |
@@ -266,6 +352,19 @@ jobs: |
266 | 352 | frontend/roslyn/samples/OwnedCollectionElementSample.cs \ |
267 | 353 | -o "$RUNNER_TEMP/facts.json" |
268 | 354 | cat "$RUNNER_TEMP/facts.json" |
| 355 | + # The extractor runs ONCE in this workflow, and #260 forbids running it |
| 356 | + # twice: frontend nondeterminism would contaminate any comparison taken |
| 357 | + # over its output. Publishing the bytes it already wrote is how the |
| 358 | + # shadow compare gate reaches them without a second extraction — the |
| 359 | + # file crosses the job boundary unchanged, and the driver's own |
| 360 | + # attestation (`input.raw` against each engine's `consumed`) is what |
| 361 | + # proves it did. |
| 362 | + - name: publish the extracted OwnIR for the shadow compare gate (#260) |
| 363 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 364 | + with: |
| 365 | + name: csharp-samples-ownir |
| 366 | + path: ${{ runner.temp }}/facts.json |
| 367 | + retention-days: 7 |
269 | 368 | - name: Extractor source columns (Own.NET#317) |
270 | 369 | # The producer half of #317. Runs the real extractor over a fixture that puts two |
271 | 370 | # anchor sites on ONE line and asserts each record's exact (line, column) - the |
|
0 commit comments