Thread context through link policy and symbolic enum expansion
Use machine event type and CodebaseContext for trusted valueOf widen checks and resolveLinkResolution, and apply context-aware enum type matching when expanding symbolic polymorphic placeholders. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -74,6 +74,23 @@ class CallChainLinkPolicyTest {
|
||||
trigger, "com.example.OrderEvent")).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldResolveLinkWhenTrustedWidenPassesUsingMachineEventType() {
|
||||
TriggerPoint trigger = TriggerPoint.builder()
|
||||
.ambiguous(false)
|
||||
.event("OrderEvent.valueOf(eventStr)")
|
||||
.polymorphicEvents(List.of("com.example.OrderEvent.PAY", "com.example.OrderEvent.SHIP"))
|
||||
.build();
|
||||
|
||||
assertThat(CallChainLinkPolicy.resolveLinkResolution(
|
||||
trigger,
|
||||
List.of(),
|
||||
false,
|
||||
"com.example.OrderEvent")).isEqualTo(LinkResolution.NO_MATCH);
|
||||
assertThat(CallChainLinkPolicy.shouldFailClosedOnAmbiguousCallGraphWiden(
|
||||
trigger, "com.example.OrderEvent")).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldNotTrustImportStylePolymorphicWidenWithoutPackage() {
|
||||
TriggerPoint trigger = TriggerPoint.builder()
|
||||
|
||||
Reference in New Issue
Block a user