Skip to content

Commit 667873e

Browse files
committed
P-037 B1: amend the pre-registration per owner review (no code)
Four corrections the owner required after reviewing 571669e, applied before any implementation and recorded in §G: 1. N5: G-T2a is only the pre-finalization refinement against F_C and never a legacy-comparison justification. - Legacy classification rests on G-T2b. - The summary report and the application report are separate classifications. - G-T2a may be checked as an internal invariant; a violation is a defect, never a class. 2. Population: every first-shadow input is frozen at population_commit 571669e. Later B1 fixtures are acceptance tests only (G14). 3. Hard caps replace the approximate and 2x budgets: own-guarded 900 non-test Rust, own-shadow 200, A14 C# 150, and 2500 in total for everything B1 hand-writes. Reaching a cap unfinished means STOP. 4. A14 side report, measurement only: exact | open plus the observed first-party targets in this compilation. It never claims to be exhaustive, computes no summary class, and never marks open as safe (G15). N2's zero-cut evidence and the §0 architecture are accepted as written. Implementation is authorized from this commit on. Refs #304 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KmiyfrkaG9sJruTcshM2oq
1 parent 571669e commit 667873e

1 file changed

Lines changed: 114 additions & 35 deletions

File tree

‎docs/notes/p037-phase-b1-shadow.md‎

Lines changed: 114 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# P-037 Phase B1: the guarded shadow read (pre-registered)
22

3-
> Status: **PRE-REGISTERED. No Rust code written; stopped for owner review.**
3+
> Status: **PRE-REGISTERED and AMENDED by owner review (§G). Implementation is
4+
> authorized from the amendment commit on; the boundaries do not move after
5+
> it.**
46
>
57
> This contract is committed before any implementation, so the result is
68
> judged against it rather than an impression afterwards.
@@ -116,34 +118,64 @@ B1, and that refusal is correct. The pre-registered evidence instead:
116118
- it must still leave MOS and verdicts unchanged (the inertness script, with a
117119
guarded layer added).
118120

119-
**N5 — every guarded-vs-legacy difference is classified.** Legacy is
120-
`own-bridge`'s MOS, read through `own-shadow`. Every coordinate lands in
121-
exactly one of:
122-
- `EQUAL`;
123-
- `SUMMARY_REFINEMENT` (guarded ⊑ legacy after finalization, G-T2a);
124-
- `LEGACY_HONESTY` (guarded unknown vs legacy may, G-T2b class 3);
125-
- `APPLICATION_REFINEMENT` (call-site selection differs; the collapse agrees);
121+
**N5 — every guarded-vs-legacy difference is classified, at two separate
122+
levels.** Legacy is `own-bridge`'s MOS, read through `own-shadow`.
123+
124+
- **Legacy comparison is justified by G-T2b and nothing else.** G-T2a is the
125+
pre-finalization lax refinement of the guarded lfp against the *collapsed
126+
semantic system* `F_C` (`C(lfp F_G) ≤ lfp F_C`, §7.2). It says nothing
127+
about legacy, which A0.5 established by splitting G-T2.
128+
- G-T2a may be checked as a separate **internal algebraic invariant** of the
129+
shadow run (guarded collapse against the collapsed system, before
130+
finalization). A violation of it is an implementation defect, never a
131+
classification.
132+
133+
**Summary report**, one row per coordinate, each in exactly one class:
134+
- `EQUAL`: the finalized guarded collapse equals the legacy value;
135+
- `SUMMARY_REFINEMENT`: the finalized guarded collapse is strictly below the
136+
legacy value (G-T2b, first disjunct);
137+
- `LEGACY_HONESTY`: guarded `unknown` against legacy `may` (G-T2b class 3);
138+
- `NO_GUARDED_EVIDENCE(reason)`;
139+
- `UNEXPLAINED`: anything else.
140+
141+
**Application report**, one row per relevant call site, each in exactly one
142+
class:
143+
- `EQUAL`: the guarded lowering, through `apply` with the site's selection,
144+
equals the legacy lowering;
145+
- `APPLICATION_REFINEMENT`: the selection at the site gives a different
146+
lowered effect than lowering the collapse, and that effect is within what
147+
G-A1/G-A2 permit;
126148
- `NO_GUARDED_EVIDENCE(reason)`;
127149
- `UNEXPLAINED`.
128150

129-
`UNEXPLAINED > 0` is a KILL (§D).
151+
`UNEXPLAINED > 0` in **either** report is a KILL (§D).
130152

131153
**N6 — the first shadow population collects the gate metrics.**
132154
- **A14 exposure** (measurement only; OwnIR is not amended, per §10.7):
133155
- relevant calls, total;
134156
- exact calls (static, non-virtual, or a sealed/struct target);
135157
- virtual / abstract / interface / override dispatch candidates;
136158
- candidates in a guarded summary chain;
137-
- candidates whose admissible first-party implementations (in the
138-
compilation) have **different** guarded summary classes;
139-
- the subset where the static target yields MUST and some admissible target
140-
does not (the A14 hard-KILL witness count).
159+
- candidates whose **observed first-party targets in this compilation**
160+
have different guarded summary classes. The class is computed by the
161+
shadow measurement, never by the side report;
162+
- the subset where the static target yields MUST and some observed target
163+
does not: the A14 hard-KILL witness count.
141164

142165
Dispatch class is not in the facts. The measurement therefore comes from a
143-
**side report** of the extractor: an opt-in flag that writes a separate JSON
144-
keyed by call site. It is not OwnIR, not read by either engine, and facts
145-
are byte-identical when it is off (N2). It is an instrument, not a fact, and
146-
it is reported, not acted upon.
166+
**side report** of the extractor. It is strictly measurement:
167+
- it is opt-in, and writes a separate JSON keyed by call site;
168+
- it is not OwnIR and not read by either engine, and facts are
169+
byte-identical when it is off (N2);
170+
- it emits only Roslyn/source dispatch metadata: `dispatch: exact | open`,
171+
plus the **observed first-party targets in this compilation**;
172+
- it never calls those targets "admissible" or "the implementations". For
173+
an open-world virtual/interface call they are not the exhaustive runtime
174+
set, and the report says so;
175+
- it computes no guarded summary class and decides nothing about safety;
176+
that is the shadow measurement's job;
177+
- no conflicting observed target never turns an `open` call into one proven
178+
safe for phase C. `open` stays `open` in every count.
147179
- **R record-absence:** first-party resolved callees with no `functions[]`
148180
record, how many guarded paths end there, and the share of otherwise-eligible
149181
guarded chains that break on R.
@@ -167,7 +199,9 @@ exactly one of:
167199
| G10 | the contradictory sidecar no longer changes the shadow | the N4 required-read test fails |
168200
| G11 | the report drops `static_dispatch_conditional` or acts on dispatch | the A14 report test fails |
169201
| G12 | an own-bridge / own-cli source change sneaks in | the N2 path guard fails |
170-
| G13 | a synthetic guarded-vs-legacy pair outside the three classes | the classifier reports `UNEXPLAINED` (it is not silently bucketed) |
202+
| G13 | a synthetic guarded-vs-legacy pair outside the classes of its level | the summary or application classifier reports `UNEXPLAINED` (it is not silently bucketed); a pair whose only justification would be G-T2a is `UNEXPLAINED` too |
203+
| G14 | a shadow run over any input not at `population_commit` `571669e` | the report generator refuses; population drift is not a measurement |
204+
| G15 | the side report marks an `open` call as safe, or emits a summary class | the side-report schema test fails |
171205

172206
## D. Hard KILL / PASS
173207

@@ -181,21 +215,23 @@ semantics here, and triggers when:
181215
comment;
182216
4. any positive guarded conclusion (a selected MUST / NO, or borrow) is
183217
produced where §0.9 requires `NO_GUARDED_EVIDENCE`;
184-
5. `UNEXPLAINED > 0` on the population. Each such difference is classified
185-
under §10.1 before anything else happens; case 5 goes to the owner;
218+
5. `UNEXPLAINED > 0` in the summary or the application report. Each such
219+
difference is classified under §10.1 before anything else happens; case 5
220+
goes to the owner;
186221
6. the fail-closed join (A15) cannot be implemented from the A2 facts without
187222
a sidecar/OwnIR change. That is a case-5 STOP, as B0 §E.3 item 3 foresaw;
188223
7. A14 is assumed away or acted on;
189224
8. the kernel is re-implemented rather than reused;
190-
9. the budget below is exceeded.
225+
9. any hard cap in §F is reached with the work unfinished. That is a STOP
226+
and review: no 2x grace and no quiet overrun.
191227

192228
**PASS** gives `RESULT: PASS — GUARDED SHADOW READ ESTABLISHED`, and requires
193229
all of:
194230
- N1–N6 hold;
195-
- G1–G13 fire;
231+
- G1–G15 fire;
196232
- the first shadow report is committed as evidence (population, commit,
197233
toolchain), together with the A14 and R metrics;
198-
- the degradation census, and the classification counts with
234+
- the degradation census, and the classification counts of both reports with
199235
`UNEXPLAINED = 0`.
200236

201237
A PASS authorizes nothing further by itself. The A14 gate and the R value
@@ -205,7 +241,15 @@ authorization.
205241

206242
## E. Population (the first shadow run)
207243

208-
All of it is at one commit and one toolchain. The legacy side is `own-bridge`'s MOS (the Rust production core); Python/Rust parity is already gated by P-022, and B1 does not re-measure it. The population:
244+
**`population_commit` = `571669e`** (frozen by the owner). Every input is
245+
read from that exact commit, materialized from git as the A2 evidence harness
246+
does, and the run uses one toolchain.
247+
- The legacy side is `own-bridge`'s MOS, the Rust production core. Python/Rust
248+
parity is already gated by P-022, and B1 does not re-measure it.
249+
- Fixtures B1 adds later are **acceptance tests only**; they are never added
250+
to this measurement population (G14).
251+
252+
The population:
209253
- the repository C# tree (`frontend/`, `audit/`);
210254
- the committed corpus (the 137 files of `corpus/real-world`, `wpf`, `di`,
211255
`fixtures`, `p036-bakeoff`);
@@ -219,21 +263,56 @@ evidence, not a gate on verdicts.
219263

220264
## F. Budget and stop point
221265

222-
Budget:
223-
- `own-guarded`: at most ~900 lines of non-test Rust. That covers the join,
224-
the fact-to-system builder, the dynamic full-sweep driver, application
225-
through `apply`, and the classifier.
226-
- `own-shadow`: one report entry point, at most ~200 lines, following owner
227-
decision R-1: stdin is the facts document, stdout is the report, and it
228-
takes no path arguments.
229-
- The extractor side report (A14): at most ~150 lines of C#, opt-in.
230-
- The architecture and reuse guards, plus fixture tests.
231-
- No new framework.
266+
Hard caps (owner amendment; measured as handwritten lines, excluding blank
267+
lines and comments, by the same counter for every file):
232268

233-
Twice the budget is a STOP and a re-plan, not a quiet overrun (the #369 lesson).
269+
| scope | cap |
270+
|---|---|
271+
| `own-guarded`, non-test Rust | **900** |
272+
| `own-shadow`, B1 additions (the report entry point) | **200** |
273+
| extractor A14 side report, C# | **150** |
274+
| **everything B1 hand-writes**: code, tests, guards, fixtures' harness code and scripts | **2500** |
275+
276+
- The report entry point follows owner decision R-1: stdin is the facts
277+
document, stdout is the report, and it takes no path arguments.
278+
- No new framework.
279+
- **Reaching any cap with the work unfinished means STOP and review.** There is
280+
no 2x grace; the #369 overrun is the precedent this rule exists for.
234281

235282
Stop point: the PASS/FAIL result, the committed first shadow report, and the
236283
metrics for the A14 and R gates. **No phase-C wiring, no A14 solution, no R
237284
experiment, no #368 fix.**
238285

239286
Implementation starts only after the owner has reviewed this contract.
287+
288+
## G. Owner amendments (review of `571669e`, recorded 2026-09-28)
289+
290+
The owner reviewed the pre-registration at `571669e` and required four
291+
corrections before any implementation. They are applied above.
292+
293+
1. **N5.** G-T2a is only the pre-finalization refinement against `F_C` and is
294+
never a justification for a legacy comparison. Legacy classification rests
295+
on G-T2b, and summary-level and application-level classification are
296+
separate reports.
297+
2. **Population.** Every first-shadow population input is frozen at exact
298+
commit `571669e`. Later B1 fixtures are tests, never additions to that
299+
measurement population.
300+
3. **Budget.** Hard caps replace the approximate and 2x budgets:
301+
`own-guarded` 900 non-test Rust, `own-shadow` 200, A14 C# 150, total
302+
handwritten code/tests/guards 2500. Reaching any cap unfinished means
303+
STOP.
304+
4. **A14 side report.** It is strictly measurement: `exact | open` plus the
305+
observed first-party targets. It never claims those targets exhaust runtime
306+
dispatch and never computes semantic conclusions.
307+
308+
Also accepted as written:
309+
- The zero-semantic-cut evidence of N2. An identical `own-cli` SHA is the
310+
cheap fast path, not a theorem. A different SHA is not a KILL by itself: it
311+
runs the recorded fallback (before/after MOS and verdicts on the frozen
312+
population), and if the tooling cannot honestly express the instrument
313+
move, the tooling is fixed first.
314+
- The architecture of §0.
315+
316+
Implementation is authorized from the commit that records these amendments.
317+
The draft PR is opened before any Rust code, so this SHA is visible and the
318+
boundaries do not move after it.

0 commit comments

Comments
 (0)