Skip to content

impact: a callback given to one instance reaches callers only through that instance - #1837

Merged
swapnilpaliwal-sd merged 5 commits into
apps/integration-0.1.9from
apps/javascript/per-instance-registration-treated-global
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 5 commits into
apps/integration-0.1.9from
apps/javascript/per-instance-registration-treated-global

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

A callback handed to ONE object (new Bus({ validate }), bus.subscribe(pattern, handler), a constructor-injected dependency) was treated as registered on every instance of the class, so every caller of the dispatch method, and every test that used any instance, reached it.

  • JavaScript engine (resolution/instance-state.dl): a new of a class whose instance code calls a value carries an allocation value beside the instance. New facts name the edges that hold only for instances given the callee, the allocations given it, and the allocation each caller's receiver may be.
  • A callee is not gated when it also reaches the class another way: named inside it, returned to it, written onto it from outside, a client class hierarchy, or an entry whose receiver is unknown.
  • dl/impact.dl (and the SQL port) carries the gate through the class's own code and applies it where a caller leaves it; an unknown receiver keeps every route.
  • New query case per-instance-registration: constructor option, subscription, and injected dependency; controls for a field-held allocation, an argument-passed allocation, a documented @param, a class-written handler, and an in-class default dependency.

Checked: new case 7/7 (3/5 before the fix; controls pass both ways). JS engine suite 88/88. Query cases JS 284, TS 208, Python 278, Java 306, C# 207, all passing. Product: call edges 11,309 = 11,309; impact validateEvent reaches 54 tests instead of 114 (every dropped file checked); probes 57/70 → 57/70 after a same-directory check (one path probe's chain is an id-hash tie-break, same with both engines); warm index 7 s vs 7 s.

…s only through that instance

- JavaScript engine: a new expression of a class whose instance code calls a value carries its allocation beside the instance; instance-state.dl names the edges that hold only for instances given the callee (constructor option, subscription, injected dependency) and the allocations each caller's receiver may be
- a callee that also reaches the class another way (named inside it, returned to it, written onto it from outside, a class hierarchy, an entry with an unknown receiver) is not gated
- impact walks a gated edge through the class's own code and leaves it only for a caller whose receiver may be an allocation given the callee, or is unknown; the SQL port does the same

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor Author

This conflicts only on IMPACT_VERSION: this PR sets 58, and the integration branch is at 61. Rebase onto apps/integration-0.1.9 and take 62 (the highest plus 1). Keep this PR's description, add it as the 62: entry in front of the existing 61 entry, and keep every older entry unchanged. There is no other conflict.

swapnilpaliwal-sd and others added 4 commits September 30, 2026 14:49
…ts after 61

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…cess and the state relations

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 69620fb into apps/integration-0.1.9 Sep 30, 2026
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/javascript/per-instance-registration-treated-global branch September 30, 2026 22:50
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.

1 participant