Repository navigation
Commit dce26ed
committed
P-037 A2.1: emit the guarded-fact sidecar from the Roslyn extractor, validated and inert
Treatment-only step of the A2 staging (docs/notes/p037-formal-kernel.md §10.3):
the extractor now writes `functions[].guarded_facts`, the raw record of what
flows into each relevant call and what each eligible `if` tests, keyed by
declared parameter ordinal. Neither engine reads it; the legacy `body` stays
authoritative; no path under the A2.0 instrument freeze is touched, so the
after-takes on M1 compare directly against the R baselines with
population_commit = T.
Producer (frontend/roslyn/OwnSharp.Extractor/Program.cs):
- calls[]: one per call a disposable candidate local or an owned parameter
flows into (argument or reduced-extension receiver); site {line, column} of
the invocation plus statement_line as the join identity with the legacy ops;
form statement|initializer|expression; callee/sig or null when unresolved;
first_party; args bound by declared ordinal (named args resolved, extension
receiver = 0, params/ref/out = opaque, unresolved callee = source position).
- arg kinds (raw facts only, §10.2): var{name}, param{source_param[,negated]},
bool_const{value}, null_literal, object_creation, call_result{callee,sig},
opaque. No const-pos/id/neg and no fresh_owned are ever written.
- guards[]: one per eligible `if` on a stable by-value parameter — truth on a
bool, is_null/not_null on a reference or Nullable<T>; G-V4 stability is
whole-body write exposure (assignment, ++/--, ref/out, ref alias, address).
Ineligible guards get no entry: absence is the fail-closed signal.
- Self-check: a sidecar that violates its own vocabulary makes the run refuse
to write facts at all (exit 2), so a producer defect never reaches a door.
Contract (spec/ownir.schema.json, spec/OwnIR.md §5.2, §4.2):
- closed $defs guardedFacts/guardedCall/guardedArg/guardedGuard/sourceSite;
the sidecar is optional and additive, OWNIR_VERSION stays 0.
- sourceSite is deliberately UNBOUND (type only): the doors do not read the
sidecar in A2.1, and §4.2 forbids a schema narrower than the door on a
coordinate the door does not check. tests/test_ownir_defensive_limits.py
classifies it as the one UNBOUND entry; the instrument step that registers
the sidecar at the doors moves it to BOUND.
Controls:
- corpus/p037-shapes: all 11 shapes re-recorded with the sidecar (body ops,
params and both engines' verdicts byte-identical to before), status
pending_a2 -> anchored, and a2_expect contract checks per shape that fail by
name (scripts/p037_fact_shapes.py check).
- tests/test_p037_sidecar.py pins the schema enums against the producer's
vocabularies and the raw-fact boundary.
- scripts/p037_sidecar_inertness.py (CI dogfood step): for every census shape
and the samples tree, the emitted, stripped and contradictory sidecars yield
identical lowered/summaries/verdicts layers on both engines, python == rust,
and the control is non-vacuous (39 sidecars over 12 documents locally).
Known A2.1 boundary, owed by A2.2 (honest emission for every relevant call):
object-creation arguments (`new X(handle, leaveOpen: true)`) are not yet a
call fact; A2.1 covers invocation expressions.
Refs #304
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfeUtLRm6KFRWcTGQZxQQb1 parent 4a8e658 commit dce26ed
20 files changed
Lines changed: 2005 additions & 59 deletions
File tree
- .github/workflows
- corpus/p037-shapes
- call-expression-statement
- extension-receiver
- guard-bool-const-false
- guard-bool-const-true
- guard-forward-bare
- guard-forward-negated
- guard-mutated
- guard-opaque-expression
- guard-ref-alias
- named-arguments-reordered
- return-disposable-parameter
- frontend/roslyn/OwnSharp.Extractor
- scripts
- spec
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3039 | 3039 | | |
3040 | 3040 | | |
3041 | 3041 | | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
3042 | 3048 | | |
3043 | 3049 | | |
3044 | 3050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
7 | 45 | | |
8 | 46 | | |
9 | 47 | | |
| |||
16 | 54 | | |
17 | 55 | | |
18 | 56 | | |
19 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
20 | 73 | | |
21 | 74 | | |
22 | 75 | | |
23 | 76 | | |
24 | 77 | | |
25 | 78 | | |
26 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
27 | 109 | | |
28 | 110 | | |
29 | 111 | | |
30 | 112 | | |
31 | 113 | | |
32 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
33 | 119 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
7 | 35 | | |
8 | 36 | | |
9 | 37 | | |
| |||
16 | 44 | | |
17 | 45 | | |
18 | 46 | | |
19 | | - | |
| 47 | + | |
| 48 | + | |
20 | 49 | | |
21 | 50 | | |
22 | 51 | | |
23 | 52 | | |
24 | 53 | | |
25 | 54 | | |
26 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
27 | 84 | | |
28 | 85 | | |
29 | 86 | | |
| |||
33 | 90 | | |
34 | 91 | | |
35 | 92 | | |
36 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
37 | 98 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
7 | 36 | | |
8 | 37 | | |
9 | 38 | | |
| |||
16 | 45 | | |
17 | 46 | | |
18 | 47 | | |
19 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
20 | 64 | | |
21 | 65 | | |
22 | 66 | | |
23 | 67 | | |
24 | 68 | | |
25 | 69 | | |
26 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
27 | 100 | | |
28 | 101 | | |
29 | 102 | | |
30 | 103 | | |
31 | 104 | | |
32 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
33 | 110 | | |
0 commit comments