Commit 14fba3c
committed
W44: scripts/check_do_not_use_callers.sh — gate against DO-NOT-USE callers
Mechanizes the audit class librarian 19:13:55Z called out as a recurring
gap: header WARNING comments alone are insufficient to prevent direct
production-path callers of factories that bypass C++ Edge::set_to() or
similar invariants. The pattern surfaced twice:
1. 06e2ecb/7d0aff1e42 (pure-C terminator factories) → DominatorAnalysis
null in_edge SEGFAULT at analysis.cpp:524 → fix 61c319c used
C++ bridge variant.
2. 678e990 (W22 cluster) → 3 production-path cond_branch callers in
builder_emit_c.c bypassed Edge::set_to → CFG corruption cascading to
v27-not-live + gen_chain + match-runtime + await crashes.
Header warnings at Python/jit/hir/hir_instr_c.h:1170-1172 + 1184-1185
('DO NOT USE for production') existed in both incidents and were not
enforced.
Script adapts the scripts/caller_grep.sh template (push 92, D-1776930053)
to:
1. Enumerate functions/factories preceded by 'DO NOT USE' in
Python/jit/hir/*.h headers.
2. For each marked symbol, grep production search paths
(Python/jit, Python/cinderx/Jit, Modules, Programs) for callers
of <symbol>(.
3. Filter out legitimate non-production callers via ALLOW_LIST_REGEX
(read-path tests, layout verification, *_verify*.cpp).
4. Report violations + exit 1 in --strict mode for gate use.
Verified at HEAD 678e990:
$ scripts/check_do_not_use_callers.sh
Found 2 DO-NOT-USE-marked factory(s):
Python/jit/hir/hir_instr_c.h:1169 symbol=hir_c_create_branch
Python/jit/hir/hir_instr_c.h:1183 symbol=hir_c_create_cond_branch
[OK] hir_c_create_branch — no production callers
[OK] hir_c_create_cond_branch — no production callers
GATE PASS: 2 marker(s) audited, zero production callers found.
Synthetic violation test confirms --strict exits 1 + reports caller
file:line locations. Ready for integration into gate_phoenix.sh as a
standard pre-push gate item.
Per W44 (D-1776973262, supervisor 19:37:05Z + librarian 19:36:45Z +
shepard 19:39:23Z). Symmetric to scripts/numstat_bundle.sh +
scripts/caller_grep.sh discipline-mechanization pattern.1 parent 678e990 commit 14fba3c
1 file changed
Lines changed: 171 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 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 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 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 | + | |
| 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 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
0 commit comments