|
| 1 | +# P-014 PROD0 (coverage only) — pre-registration |
| 2 | + |
| 3 | +Written 2026-10-21 12:40 +05, before any gate run and before any production change. Base: `main` `22b29d5b` |
| 4 | +(merge of #422). Owner decision: `GO-P014-PROD0-COVERAGE-ONLY`. PROD1 (diagnostic semantics) stays forbidden. |
| 5 | + |
| 6 | +**Budget.** 0.5 agent-day to the next kill-gate, counted from 12:35. STOP at 16:35, not extended. When the budget |
| 7 | +runs out, I commit what exists and the verdict is `INCONCLUSIVE-P014-PROD0`. |
| 8 | + |
| 9 | +## 1. What will be built (only if G0 and G1 pass) |
| 10 | + |
| 11 | +**Flag.** An opt-in extractor flag `--binding-coverage <file>`, for `.csproj` inputs. It writes the deterministic |
| 12 | +coverage sidecar of the Tiny PoC (#422) into `<file>`: |
| 13 | +- one `CSharpCompilation` **per project**, from the existing `obj/project.assets.json`, local targeting packs and |
| 14 | + the global packages folder, with project references as `CompilationReference`s; |
| 15 | +- binding-site counts, unit status, reasons, reference manifest and conflicts; |
| 16 | +- the foreign-binding guard. |
| 17 | + |
| 18 | +**The mechanism.** It is the #422 instrument's code, moved into the extractor as one new file (types public so |
| 19 | +that the evidence harness can call the same code). Behaviour changes allowed: |
| 20 | +- **Fail closed.** `unit_status = COMPLETE` requires all of the following: reference status `COMPLETE`, **and** no |
| 21 | + source-set reason, **and** no unsupported item. Every other case is `UNSUPPORTED`, `REFERENCE_MISSING` |
| 22 | + (including `CONFLICT_UNRESOLVED`) or `SOURCE_SET_INCOMPLETE`. |
| 23 | +- **No TPA substitution.** The process TPA is never used as a reference in this mode. |
| 24 | +- **Unsupported inputs.** A directory, a `.sln` or a `.cs` input gets a sidecar with a single `UNSUPPORTED` record |
| 25 | + and no measurement. |
| 26 | +- **Separate from facts.** The sidecar is computed **after** the facts document is written, from fresh |
| 27 | + compilations, and it never feeds the existing analysis. |
| 28 | + |
| 29 | +**Unchanged:** |
| 30 | +- the default behaviour, every existing flag, directory mode; |
| 31 | +- OwnIR, OWN001/OWN014/OWN050; |
| 32 | +- SARIF and exit codes; |
| 33 | +- the facts document: byte-identical with and without the flag; |
| 34 | +- the core, the Rust engine, goldens. |
| 35 | + |
| 36 | +A sidecar write failure is reported on stderr and does **not** change the exit code. |
| 37 | + |
| 38 | +## 2. Gates, in order (fixed now) |
| 39 | + |
| 40 | +### G0 — package-vs-package conflict against the SDK oracle (first, before any integration) |
| 41 | + |
| 42 | +**Fixture.** My own synthetic project, `net10.0-windows` with `UseWPF`, referencing `unchihugo.WPF-UI` 4.4.2 and |
| 43 | +`WPF-UI.Tray` 4.3.0. These are the packages that produce P5's `Wpf.Ui.dll` conflict: `unchihugo.WPF-UI` 4.4.2, |
| 44 | +AssemblyVersion 4.4.1.0, against the transitive `WPF-UI` 4.3.0, AssemblyVersion 4.3.0.0. |
| 45 | +- It is restored offline, with the global packages folder as the only source. |
| 46 | +- The oracle is `dotnet msbuild -t:FindReferenceAssembliesForReferences -getItem:ReferencePathWithRefAssemblies`. |
| 47 | + |
| 48 | +**PASS.** The #422 instrument's manifest equals the oracle's, compared by path and assembly version, including |
| 49 | +which `Wpf.Ui.dll` is chosen. |
| 50 | + |
| 51 | +**Outcomes:** |
| 52 | +- **Mismatch.** The resolver is **not** tuned to fit. The supported set is narrowed instead: any package-vs-package |
| 53 | + conflict on the same file name becomes `CONFLICT_UNRESOLVED`, so the unit is not `COMPLETE`. That narrowing is |
| 54 | + then what gets integrated. |
| 55 | +- **The fixture cannot restore offline.** G0 is `INCONCLUSIVE`, and the same narrowing applies. |
| 56 | + |
| 57 | +### G1 — the sidecar does not call P4/P5 fully checked |
| 58 | + |
| 59 | +Run on P4 and P5 with the #422 instrument data (`data/real/P*.exact.sidecar.json`). |
| 60 | + |
| 61 | +**PASS.** Every unit has `unit_status != COMPLETE`. Today's output has every unit at `SOURCE_SET_INCOMPLETE` and |
| 62 | +reference status `COMPLETE`. |
| 63 | + |
| 64 | +**KILL if** any unit is `COMPLETE` while it has a named source-set reason. |
| 65 | + |
| 66 | +### G2 — compatibility (after integration) |
| 67 | + |
| 68 | +1. **Facts.** For P4 and P5 (`.csproj`, `--flow-locals --no-project-refs`), and for the extractor's sample tree |
| 69 | + `frontend/roslyn/samples` (directory mode), the facts document is **byte-identical** with and without |
| 70 | + `--binding-coverage`. It must also equal the extractor built from `main` `22b29d5b` without the flag. |
| 71 | +2. **Controls.** K1, K2, K4, K5, K6, K7, K11, K12, F2.3, F2.4, F2.5 and the guard self-test are run against the |
| 72 | + **production** code: the evidence harness references the built extractor assembly. K3, K8a, K8b, K8c, K9, K10 |
| 73 | + and G0 run through the production flag and are compared with the SDK oracle. |
| 74 | + - All results must equal #422's. |
| 75 | + - G0 must equal the oracle, or the narrowed rule must apply. |
| 76 | +3. **Isolation.** `foreign_binding = 0` in every control and in P4/P5. |
| 77 | +4. **Determinism.** The sidecar is byte-identical across 3 runs for P4 and P5. |
| 78 | +5. **Repository gates.** |
| 79 | + - `ruff check .` passes. |
| 80 | + - The repository's Python test suite passes, as far as it runs on this host. |
| 81 | + - The extractor builds with no new warnings. |
| 82 | + |
| 83 | +### G3 — cost (limits not loosened from the Tiny PoC) |
| 84 | + |
| 85 | +- **Where.** P5 and P4, 3 separate processes each, through the production flag. |
| 86 | +- **Wall time.** Measured with and without the flag. The added time for the flag must be ≤ **3 ×** the #422 |
| 87 | + `legacy-merged` warm median measured in the same session. In practice, the exact-mode warm cost must stay within |
| 88 | + the #422 limit: P5 warm exact ≤ 3 × legacy. |
| 89 | +- **Peak working set.** ≤ **2.0 GB**. |
| 90 | +- **Reported:** the extractor's total wall time with and without the flag. |
| 91 | + |
| 92 | +## 3. Verdict |
| 93 | + |
| 94 | +- **`PASS-P014-PROD0`.** G0 is PASS, or G0 is resolved by the pre-registered narrowing, **and** G1, G2 and G3 hold. |
| 95 | +- **`KILL-P014-PROD0`.** Any of: |
| 96 | + - a facts byte difference; |
| 97 | + - a foreign binding, or a silent false binding; |
| 98 | + - G1 fails; |
| 99 | + - the cost limit is exceeded; |
| 100 | + - a forbidden action is needed. |
| 101 | +- **`INCONCLUSIVE-P014-PROD0`.** The budget runs out, or a gate is undecidable because an input is missing. |
| 102 | + |
| 103 | +A PASS allows **only** the opt-in coverage flag. It does not switch the extractor to the new resolver, and it does |
| 104 | +not feed any new fact to diagnostics. |
| 105 | + |
| 106 | +## 4. Not done |
| 107 | + |
| 108 | +- Restore or build of third-party projects; any network access. |
| 109 | +- MSBuild evaluation of P4/P5. |
| 110 | +- Changes to OwnIR, the core, the Rust engine, goldens or SARIF. |
| 111 | +- Reopening #407. |
| 112 | +- Any change to the lifetime model. |
0 commit comments