Commit 5b48c3d
committed
refactor(gh60): C1d ReachabilityEnricher visitor
Introduce the stateless per-node visitor that the JSON writer will
consult instead of reading reachability state directly. Wires the
visitor into the inline writer's reachability + components paths now
so that C1e's purity-of-writer extraction only needs to move the
emit code without rerouting the data dependencies.
New class:
- presto.android.gui.clients.reach.ReachabilityEnricher
- 4 final instance fields (index, manifestPackage, codePackage,
mainActivity); no mutable state, no caches.
- enrichMethod(SootMethod) returns a fresh 3-key LinkedHashMap
with {reachable, reachesMop, directlyReachesMop}. Keys preserve
the gh57 names; Group 6 (C1f) renames atomically together with
the JSON schema and Pydantic consumer.
- enrichWidget / enrichTransition / enrichComponent return
Collections.emptyMap() — placeholders for C3
(gh<N+2>-agent-enrichment) which will emit per-listener
handlerReachesTarget / externalExit / exitKind without
touching the writer.
- topLevelMetadata returns {manifestPackage, codePackage,
mainActivity}. codePackage included now so C2 G11 dual-package
emission lands without modifying the writer.
- targetSignatures / directTargetSignatures delegate to the
index with stable object identity (no per-call recomputation
in the writer's hot path).
RvsecAnalysisClient.run() now constructs the enricher after the
engine and threads it through writeJson → writeReachability /
writeComponents → writeComponentEntry / writeProviderEntry. The
legacy Set<SootMethod> reachableSet / reachesMopSet / directMopSet
parameters are removed from those helpers — every per-method
reachability lookup routes through the enricher. This is the
precondition C1e's INV-ANA-30 (writer purity) gate enforces; the
diff to move the emit code into JsonReportWriter is now mechanical.
Tests:
- ReachabilityEnricherTest (10/10 pass) — null rejection;
enrichMethod key shape + values; idempotence; topLevelMetadata
insertion order; null-metadata → empty-string coercion;
placeholder enrich* returns; signature-set identity.
- ReachabilityEnricherMemoryTest (2/2 pass) — structural: every
declared field is final (catches future cache regressions);
behavioral: 10 000 enrichMethod calls do not mutate the index,
each returns a fresh map, signature-set identity stable.
Full client suite: 119 / 119 passed (96 pre-existing + 11 from
C1c + 12 new from C1d).
BaselineComparisonIT post-C1d: **8/10 pass** — identical signature
to HEAD (same 2 pre-existing app-class-count drift failures, same
3 MOP reachability tests passing). Zero new regressions from the
enricher wiring.
tasks.md: Group 4 (4.1-4.6) checked off with per-task evidence.
refs #601 parent 7ab5202 commit 5b48c3d
5 files changed
Lines changed: 417 additions & 38 deletions
File tree
- rv-android/openspec/changes/gh60-targets-core
- rvsec/rvsec-android/rvsec-gator/client/src
- main/java/presto/android/gui/clients
- reach
- test/java/presto/android/gui/clients/reach
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
Lines changed: 43 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
148 | 146 | | |
149 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
151 | | - | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | | - | |
| 183 | + | |
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
| |||
1227 | 1233 | | |
1228 | 1234 | | |
1229 | 1235 | | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
| 1236 | + | |
1233 | 1237 | | |
1234 | 1238 | | |
1235 | 1239 | | |
| |||
1243 | 1247 | | |
1244 | 1248 | | |
1245 | 1249 | | |
1246 | | - | |
| 1250 | + | |
1247 | 1251 | | |
1248 | 1252 | | |
1249 | 1253 | | |
| |||
1273 | 1277 | | |
1274 | 1278 | | |
1275 | 1279 | | |
1276 | | - | |
| 1280 | + | |
1277 | 1281 | | |
1278 | 1282 | | |
1279 | 1283 | | |
| |||
1287 | 1291 | | |
1288 | 1292 | | |
1289 | 1293 | | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
| 1294 | + | |
1293 | 1295 | | |
1294 | 1296 | | |
1295 | 1297 | | |
| |||
1329 | 1331 | | |
1330 | 1332 | | |
1331 | 1333 | | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1335 | 1341 | | |
1336 | 1342 | | |
1337 | 1343 | | |
| |||
1406 | 1412 | | |
1407 | 1413 | | |
1408 | 1414 | | |
1409 | | - | |
| 1415 | + | |
| 1416 | + | |
1410 | 1417 | | |
1411 | 1418 | | |
1412 | 1419 | | |
| |||
1419 | 1426 | | |
1420 | 1427 | | |
1421 | 1428 | | |
1422 | | - | |
| 1429 | + | |
1423 | 1430 | | |
1424 | 1431 | | |
1425 | 1432 | | |
| |||
1430 | 1437 | | |
1431 | 1438 | | |
1432 | 1439 | | |
1433 | | - | |
| 1440 | + | |
1434 | 1441 | | |
1435 | 1442 | | |
1436 | 1443 | | |
| |||
1441 | 1448 | | |
1442 | 1449 | | |
1443 | 1450 | | |
1444 | | - | |
| 1451 | + | |
1445 | 1452 | | |
1446 | 1453 | | |
1447 | 1454 | | |
| |||
1452 | 1459 | | |
1453 | 1460 | | |
1454 | 1461 | | |
1455 | | - | |
| 1462 | + | |
1456 | 1463 | | |
1457 | 1464 | | |
1458 | 1465 | | |
| |||
1461 | 1468 | | |
1462 | 1469 | | |
1463 | 1470 | | |
1464 | | - | |
| 1471 | + | |
| 1472 | + | |
1465 | 1473 | | |
1466 | 1474 | | |
1467 | 1475 | | |
| |||
1495 | 1503 | | |
1496 | 1504 | | |
1497 | 1505 | | |
1498 | | - | |
| 1506 | + | |
| 1507 | + | |
1499 | 1508 | | |
1500 | 1509 | | |
1501 | 1510 | | |
1502 | 1511 | | |
1503 | 1512 | | |
1504 | | - | |
| 1513 | + | |
| 1514 | + | |
1505 | 1515 | | |
1506 | 1516 | | |
1507 | 1517 | | |
| |||
1519 | 1529 | | |
1520 | 1530 | | |
1521 | 1531 | | |
1522 | | - | |
1523 | | - | |
| 1532 | + | |
| 1533 | + | |
1524 | 1534 | | |
1525 | 1535 | | |
1526 | 1536 | | |
| |||
1529 | 1539 | | |
1530 | 1540 | | |
1531 | 1541 | | |
1532 | | - | |
| 1542 | + | |
1533 | 1543 | | |
1534 | 1544 | | |
1535 | 1545 | | |
1536 | 1546 | | |
1537 | 1547 | | |
1538 | | - | |
| 1548 | + | |
| 1549 | + | |
1539 | 1550 | | |
1540 | 1551 | | |
1541 | 1552 | | |
| |||
Lines changed: 127 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 | + | |
0 commit comments