Skip to content

[TS] Track object-literal property presence for in (#425) - #458

Open
CaelmBleidd wants to merge 11 commits into
caelmbleidd/ts-426-delete-propertyfrom
caelmbleidd/ts-425-in-operator
Open

CaelmBleidd wants to merge 11 commits into
caelmbleidd/ts-426-delete-propertyfrom
caelmbleidd/ts-425-in-operator

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Current stacked revision

  • Base: 9ae8975e710240c77127234441291fe11e5717d0 ([TS] Track deletion of allocated object properties #461). Head: a7cf800e3641fcf1144fd1954dd2f35eb9c6244e. This range contains no merge commits. The patch-id outside the Node replay helper is unchanged across the linear rebase.
  • 7 focused InOperator tests, detektTest, and git diff --check passed on this head using JacoDB [TS PBT] Schedule assertion, coverage and hypothesis targets under one budget #399. Five existing InOperator tests remain skipped. detektMain passed on the preceding head.
  • The final test-only commit moves the duplicate Node process runner to shared assertNodeReplay, preserving source assembly and replay assertions. Manual CI run 37101463123 passed all six jobs on this exact head a7cf800e; pinned core correctness and AI code hygiene my-review passes found no actionable defects. Older results below are historical.

Summary

  • Evaluate in for concrete EtsIR object literals from own fields and methods, including an explicitly declared constructor method and fields whose value is undefined.
  • Track writes to concrete fields and combine own-field presence with the deletion marker from [TS] Delete object properties across all value sorts #426. A dynamically added field is present; deletion removes it; a later write restores it. Conditional deletion preserves both outcomes.
  • Allow a normal read of a concrete field written after object-literal allocation. The previous structural type assertion rejected const obj = {}; obj.x = value; if ("x" in obj) return obj.x even though the write and presence check succeeded.
  • Return undefined when a fresh concrete object literal lacks an own field and no later write added it. Reads requiring modeled prototype lookup remain explicit unsupported paths.
  • Route writes to fields of block-scoped named locals in %dflt through the shared field-assignment path. This records new own properties and clears deletion markers for those writes.
  • Report symbolic keys and receivers, arrays, prototype lookup, and object literals whose prototype is set by __proto__ initialization or assignment as explicit unsupported paths through the normal analyzeWithOutcome API. The prototype-key set is shared with [TS] Delete object properties across all value sorts #426, whose delete guard stops a path before a deleted own prototype-key field can be misread.

Verification

  • At head afd2c12ab1b7e9d806c61768a77935773a7c7f2d, CI run 37088724732 passed all six jobs, including TS tests and lint. The preceding production head 53d4bc95 passed the full local :usvm-ts:test suite: 1120 tests, 143 skipped, 0 failures/errors; detektMain and detektTest passed.
  • A focused source-level regression for write → in → read failed before the fix because analysis produced no successful state, and passed after the fix. It checks EXHAUSTED, no unsupported paths, successful return values, and Node.js replay of generated numeric inputs.
  • A second source-level regression uses a top-level block-scoped let obj, writes obj.x, computes "x" in obj during module initialization, and exposes the result through a method. At the prior head, USVM returned 0 while Node returned 7; at e1698e58, symbolic analysis and Node replay both return 7.
  • A third source-level regression reads an absent optional field after a negative in result. At e1698e58, the structural assertion terminated the valid path; Node returned 1. At 6dea3f8e, symbolic analysis and Node replay both return 1 with no unsupported path.
  • An earlier test-only commit extracted replayInOperatorScript; the current test-only commit delegates process management to shared assertNodeReplay. Seven focused tests and detektTest passed on the current head, and git diff --check is clean. Independent pinned my-review core and hygiene passes found no actionable defects on the historical head afd2c12a.
  • On the prior head, the broader :usvm-ts:detekt task reported 216 repository-wide findings. Its only ReadField.kt finding was on unchanged line 28; the configured detektMain and detektTest tasks passed at the previous head afd2c12a.

Scope and dependencies

This PR targets the object-literal part of #425 and is based on #461, which supplies the deletion marker; #461 is based on #455, which supplies explicit unsupported outcomes. Symbolic input objects, array holes, and prototype-chain membership remain outside this supported domain. This PR is ready for review as a stacked change; merge after #461 and #455.

The installed pre-commit hook calls a nonexistent checkLicense Gradle task. After the tests and configured Detekt tasks passed, the final commit bypassed that hook for one command.

@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-425-in-operator branch from ad924e9 to 15babc4 Compare October 2, 2026 22:49
@CaelmBleidd CaelmBleidd changed the title [TS] Evaluate object-literal property presence for in (#425) [TS] Track object-literal property presence for in (#425) Oct 2, 2026
@CaelmBleidd
CaelmBleidd changed the base branch from main to caelmbleidd/ts-426-delete-property October 2, 2026 22:50
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-425-in-operator branch 2 times, most recently from 7d41c41 to f28d30c Compare October 3, 2026 00:02
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-426-delete-property branch from 8add94d to 3a06f16 Compare October 3, 2026 05:28
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-425-in-operator branch from afd2c12 to a69dc98 Compare October 3, 2026 05:28
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-425-in-operator branch from a69dc98 to a7cf800 Compare October 3, 2026 05:54
@CaelmBleidd
CaelmBleidd marked this pull request as ready for review October 3, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TS] Evaluate property presence for the object in operator

1 participant