Skip to content

fix(semantics): preserve direct promise ownership boundaries - #758

Merged
morluto merged 1 commit into
morluto:mainfrom
rudycelekli:fix/promise-direct-ownership-20261006
Oct 6, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
rudycelekli:fix/promise-direct-ownership-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Summary

Preserve the direct value boundary when recovering static Promise ownership. A Promise nested inside consume(Promise.resolve(1)) previously acquired ownership from the enclosing assignment, await, or return, even when consume returns a scalar. That produced resolved owns, awaits, or returns-task relations for the wrong value.

Assignment, await and return now require the Promise operation itself after transparent syntax wrappers. Chaining requires a direct receiver, and aggregation requires a direct array element. Intervening calls remain unknown. This is bounded static syntax recovery, not a claim of complete transitive Promise ownership.

Verification

  • Actual built public analyze-javascript-application over eight local source scenarios: the three indirect ownership cases become unknown; direct assignment, await, return, chaining and aggregation remain correct.
  • Native JavaScript consume(Promise.resolve(1)) fixture returns scalar 7.
  • Upstream regression attempt: 9 fail, 13 pass. Final relevant semantic/graph suites: 63 pass across 5 files, including 14 ownership controls and graph relation assertions.
  • npm run build:cached, npm run check, npm run check:fast pass with 124 lint warnings and zero errors.
  • An initial local build exposed an optional AST return argument type error; it was corrected before these final gates.
  • No real Hopper/Ghidra verification performed: this affects inert JavaScript semantic recovery only. No schema or public signature changes.

Codex assisted on behalf of @rudycelekli. Signed DCO source received independent review before publication. Hosted CI is tracked separately.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Reviewed: requiring the promise node itself as direct operand for assignment/await/return/chaining/aggregation ownership is correct — stops leakage through consume(Promise.resolve(1)) while return-await still hits direct AwaitExpression first. isUnmodeledCall boundary and direct-receiver/aggregate checks match bounded static-recovery scope. 14 domain + 4 graph cases cover transparency and negatives. APPROVE, no comments.

@morluto
morluto merged commit e1ca412 into morluto:main Oct 6, 2026
19 checks passed
@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Thank you! Squash-merged. Acknowledged: tight ownership boundary with strong domain + graph coverage. Appreciate the work.

darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added bug Something isn't working area: domain Domain logic, errors, and pure functions labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants