Repository navigation
[TS] Support object arrays in symbolic input fields #419
Description
Resolution (2026-10-14)
Audited against usvm main at 19866c959d.
Calls input eligibility is recursive through object/array domains; the shared projector initializes and extracts nested object arrays. The exact items[0].score example is now eligible, reaches its target and replays. Implementation: usvm #473, usvm #418.
Validation: A temporary regression using the issue's exact Calls fixture passed preflight, symbolic search and native source replay. UsvmObjectDomainProjectionTest (8 tests) also passed.
Original report and acceptance context, retained for traceability
Follow-up to #418. That PR supports nested object fields and fields containing boolean/number arrays, and fixes ordinary stored function calls. The object-array input case remains.
Problem: an array field whose elements are objects
Add this test to CurrentTsCallsSymbolicEngineTest (using its existing fixture helper):
@Test
fun `array of objects field is eligible for symbolic search`() {
val fixture = fixture(
source = """
export function accepts(input: { items: { score: number }[] }): boolean {
if (input.items[0].score > 5) return true;
return false;
}
""".trimIndent(),
exportName = "accepts",
inputs = listOf(
PropertyInput(
name = "input",
domain = ObjectDomain(
fields = mapOf(
"items" to ArrayDomain(
element = ObjectDomain(fields = mapOf("score" to NumberDomain())),
minLength = 1,
maxLength = 1,
),
),
),
),
),
targetStatement = "return true;",
)
val preflight = fixture.preflight()
assertEquals(CallsSymbolicPreflightStatus.ELIGIBLE, preflight.status)
val result = fixture.search(modelIds = emptySet())
val inputs = assertNotNull(result.inputs, result.toString())
fixture.assertReplayConfirmed(inputs)
}Observed on the #418 head: the first assertion fails: expected ELIGIBLE, actual UNSUPPORTED (INPUT_DOMAIN_UNSUPPORTED). The array-domain gate accepts only boolean/number elements. An earlier exploratory attempt past that gate reached RUNTIME_LIMITATION: CONDITIONAL_FIELD_RECEIVER at items[0].score. Recursive array initialization/extraction and sound field access through an array-element reference are both needed.
Acceptance criteria
- The object-array example passes preflight, reaches
return true;, and replays with the same result in TypeScript/Node.js. - Recursive array initialization and extraction preserve the object elements and their fields.
- Existing Support plain object inputs and stored callbacks in TS calls #418 tests for primitive arrays and nested objects remain green.
- Unsupported shapes remain explicit failures until implemented.
Activity
[-]Complete object-array symbolic inputs and lexical this for stored arrows[/-][+][TS] Support object arrays in symbolic input fields[/+]