shared-helper-callback-alias.ts 617 B

1234567891011
  1. // The known over-approximation (docs/analysis.md "Open questions"): the callback reaches
  2. // the call through a local alias, not as the bare parameter, so provenance is lost and the
  3. // merged record applies — each call of `viaAlias` inlines BOTH callers' callbacks as an
  4. // exhaustive choice. Sound, and the shape the oracle's syntactic rule does not cover.
  5. async function viaAlias(fn: () => Promise<string>): Promise<string> {
  6. const h = fn;
  7. return await h();
  8. }
  9. const a = await viaAlias(async () => agent("a").ask<string>("a"));
  10. const b = await viaAlias(async () => agent("b").ask<string>("b"));
  11. return [a, b];