@descryy/adapter-csharp 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,68 +1,45 @@
1
1
  /**
2
- * D-FIX-3's client-base extractor — DEC-164's contract, and the first adapter
3
- * in this project to build it. `client.ts` already reads a call's own literal
4
- * path; this is the separate, larger row that row's own header named as
5
- * unaddressed: what the receiver's *base* is, so a bare-relative call
6
- * (`client.GetAsync("Users/Me")`, no leading slash) composes against
2
+ * Client-base extractor — DEC-164's contract. `client.ts` already reads a
3
+ * call's own literal path; this resolves the receiver's *base*, so a
4
+ * bare-relative call (`client.GetAsync("Users/Me")`) composes against
7
5
  * something real instead of being refused for want of one.
8
6
  *
9
- * ## Two shapes built, and why not more
7
+ * Two shapes built. The original audit named
8
+ * `services.AddHttpClient<T>(c => c.BaseAddress = new Uri(...))` as the
9
+ * pattern, on the premise that jellyfin and eShopOnWeb both use it — false
10
+ * for both: jellyfin's `AddHttpClient(NamedClient.Default, ...)` never sets
11
+ * `BaseAddress`, and eShopOnWeb has no `AddHttpClient<T>(...)` call at all.
10
12
  *
11
- * §7's original audit named `services.AddHttpClient<T>(c => c.BaseAddress =
12
- * new Uri(...))` as *the* pattern to build, on the strength of "jellyfin and
13
- * eShopOnWeb both confirmed to use exactly this shape." Read against the real
14
- * source, that premise does not hold for either named repository: jellyfin's
15
- * own `AddHttpClient(NamedClient.Default, ...)` registrations
16
- * (`Jellyfin.Server/Startup.cs`) never set `BaseAddress` at all, and
17
- * eShopOnWeb has no `AddHttpClient<T>(...)` call anywhere.
13
+ * What every real `USES_API` edge in both corpora actually goes through is
14
+ * `WebApplicationFactory<TEntryPoint>.CreateClient(...)` — ASP.NET's
15
+ * integration-test client, documented default `BaseAddress` is the app under
16
+ * test. `derivesFromWebApplicationFactory` (in `extract.ts`) is the whole
17
+ * mechanism: does the receiver's class, directly or via one in-repo
18
+ * indirection (`CustomWebApplicationFactory<TProgram> : WebApplicationFactory<TProgram>`,
19
+ * CleanArchitecture's shape), carry `WebApplicationFactory<` in its base
20
+ * list. Measured: 100% of jellyfin's and eShopOnWeb's 27 `USES_API` edges,
21
+ * plus every newly-reached bare-relative call, go through this receiver.
18
22
  *
19
- * **What every one of both corpora's real `USES_API` edges (and several
20
- * previously-silent call sites) actually goes through** is
21
- * `WebApplicationFactory<TEntryPoint>.CreateClient(...)` — ASP.NET's own
22
- * integration-test client, whose documented default `BaseAddress` is the
23
- * application under test itself. `derivesFromWebApplicationFactory` (in
24
- * `extract.ts`, where the type graph lives) is the whole mechanism: does the
25
- * receiver's own class (directly, or through one in-repo indirection —
26
- * `CustomWebApplicationFactory<TProgram> : WebApplicationFactory<TProgram>`
27
- * is `CleanArchitecture`'s own shape) carry `WebApplicationFactory<` in its
28
- * written base list. Measured: **100% of jellyfin's and eShopOnWeb's existing
29
- * 27 `USES_API` edges, plus every previously-silent or previously-refused
30
- * bare-relative call this row newly reaches, go through exactly this
31
- * receiver.**
32
- *
33
- * The named `AddHttpClient<T>(...)` shape is real, just not in the two
34
- * repositories the audit cited — `dotnet/eShop` has it
35
- * (`WebApp/Extensions.cs`, `WebhookClient/Extensions.cs`,
36
- * `HybridApp/MauiProgram.cs`, 4 sites), and every one of those typed clients'
37
- * own call sites builds its path by string interpolation
38
- * (`$"{remoteServiceBaseUrl}items/{id}"`), already and separately refused by
39
- * `client.ts`'s "not a bare string literal" rule — so resolving this base
40
- * moves **zero** measured edges in any corpus this row has on disk.
41
- * {@link typedClientBases} below reads it anyway, narrowly (a literal string
42
- * argument to `new Uri(...)`/`new(...)` only — a field, a config read, or any
43
- * other expression stays `unresolved`, never guessed): the mechanism is real
44
- * corpus evidence, not invented for a fixture, and golden pattern 08a needs a
45
- * *non-empty* composed path to prove `DEC-097`'s composition is real rather
46
- * than coincidentally correct when the prefix is always empty. No other DI
47
- * mechanism — `IHttpClientFactory.CreateClient(name)`'s named-client form
48
- * included — is read here; every such call was invisible before this row and
49
- * stays exactly as invisible after it, a disclosed, unaffected limit rather
50
- * than a claim this file makes and cannot back.
51
- *
52
- * ## The state built but never produced by real corpus evidence
23
+ * `AddHttpClient<T>(...)` is real, just not in those two repos —
24
+ * `dotnet/eShop` has it (4 sites), but every one of those typed clients'
25
+ * call sites builds its path by string interpolation, already refused by
26
+ * `client.ts`'s literal-only rule — so resolving this base moves zero
27
+ * measured edges. {@link typedClientBases} reads it anyway, narrowly (a
28
+ * literal string argument to `new Uri(...)`/`new(...)` only; a field or
29
+ * config read stays `unresolved`): golden pattern 08a needs a non-empty
30
+ * composed path to prove DEC-097's composition is real, not coincidental.
31
+ * No other DI mechanism (`IHttpClientFactory.CreateClient(name)` included) is
32
+ * read here — every such call was invisible before and stays invisible, a
33
+ * disclosed, unaffected limit.
53
34
  *
54
35
  * DEC-164 names four states; three are real here. `unresolved` is reachable
55
- * in code (a `AddHttpClient<T>` registration whose `BaseAddress` is a field
56
- * or a config read rather than a literal) but has zero witnesses in any of
57
- * the six corpora this row measured — kept rather than deleted, the same way
58
- * `efcore.ts`'s rival-ORM exclusion rule stays written down at zero
59
- * witnesses: a real rule with no corpus evidence yet, not a guess.
36
+ * in code but has zero witnesses across all six corpora measured — kept
37
+ * rather than deleted, same as `efcore.ts`'s rival-ORM exclusion rule.
60
38
  */
61
39
  /**
62
- * DEC-097: only the origin — scheme, host, port — is stripped from an
63
- * absolute URI; the path is kept. `undefined` when `uri` is not an absolute
64
- * URI this reader can split (no `scheme://`); refused by the caller rather
65
- * than guessed, same as every other shape in this file.
40
+ * DEC-097: only the origin (scheme/host/port) is stripped from an absolute
41
+ * URI; path is kept. `undefined` when not a splittable absolute URI —
42
+ * refused rather than guessed.
66
43
  */
67
44
  function pathPrefixOf(uri) {
68
45
  const match = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/]*(\/.*)?$/.exec(uri.trim());
@@ -73,30 +50,20 @@ function pathPrefixOf(uri) {
73
50
  }
74
51
  /**
75
52
  * `services.AddHttpClient<TClient>(o => o.BaseAddress = <expr>)` —
76
- * `dotnet/eShop`'s own shape (`WebApp/Extensions.cs`,
77
- * `WebhookClient/Extensions.cs`, `HybridApp/MauiProgram.cs`), read textually
78
- * rather than through the AST (the same division of labour `aspnetcore.ts`
79
- * and `efcore.ts` already keep for a fluent registration chain — see
80
- * `extract.ts`'s own header for why). Keyed by `TClient`'s own written name
81
- * (short, unqualified — matched the same way against the enclosing type's own
82
- * simple name, a disclosed limit rather than a full type resolution this
83
- * textual pass cannot do): DI hands the configured client straight to
84
- * `TClient`'s own constructor, so a call inside `TClient` whose receiver
85
- * resolves to a bare, otherwise-untraced `HttpClient` is exactly this base.
53
+ * `dotnet/eShop`'s shape, read textually (same division of labour
54
+ * `aspnetcore.ts`/`efcore.ts` keep for fluent chains — see `extract.ts`).
55
+ * Keyed by `TClient`'s written name, matched against the enclosing type's
56
+ * simple name (disclosed limit, not full type resolution): DI hands the
57
+ * configured client straight to `TClient`'s constructor, so an untraced bare
58
+ * `HttpClient` receiver inside `TClient` is exactly this base.
86
59
  *
87
- * The RHS is matched as `new(...)`/`new Uri(...)`'s own single argument —
88
- * not "everything up to the next `;`", which real `eShop` source would get
89
- * wrong: `AddHttpClient<CatalogService>(o => o.BaseAddress = new(...))` is
90
- * followed by a fluent chain (`.AddApiVersion(2.0).AddAuthToken();`) whose
91
- * terminating `;` is lines away and whose own parentheses would otherwise be
92
- * swallowed into the "expression." Real corpus shapes have no nested parens
93
- * inside the argument itself (a string literal, or a bare field reference),
94
- * so matching up to the first `)` is exact for both, not an approximation.
95
- * A bare string literal (`new Uri("https+http://catalog-api")`,
96
- * `new("http://webhooks-api")`) resolves; anything else (`new(MobileBffHost)`
97
- * — a static field, `eShop`'s own `HybridApp/MauiProgram.cs`) is `unresolved`
98
- * with the argument's own text as `why`. Both are measured, not invented for
99
- * this file.
60
+ * RHS matched as `new(...)`/`new Uri(...)`'s single argument, not
61
+ * "everything to the next `;`" — real `eShop` source follows with a fluent
62
+ * chain (`.AddApiVersion(2.0).AddAuthToken();`) whose own parens would
63
+ * otherwise be swallowed. Real shapes have no nested parens in the argument,
64
+ * so matching to the first `)` is exact. A bare string literal resolves;
65
+ * anything else (`new(MobileBffHost)`, a static field) is `unresolved` with
66
+ * the argument text as `why`. Both measured, not invented.
100
67
  */
101
68
  export function typedClientBases(files) {
102
69
  const bases = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"client-base.js","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAsCH;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,KAAK,GAAG,4CAA4C,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5B,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA6C;IAC5E,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;IAClD,MAAM,OAAO,GACX,wJAAwJ,CAAC;IAC3J,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;YAClC,IAAI,UAAU,KA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AM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;IAClD,MAAM,OAAO,GACX,wJAAwJ,CAAC;IAC3J,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;YAClC,IAAI,UAAU,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;gBAAE,SAAS;YAE1F,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC9D,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5C,IAAI,IAAI,KAAK,SAAS;gBAAE,SAAS,CAAC,6DAA6D;YAC/F,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,92 +1,40 @@
1
1
  /**
2
- * D-FIX-3's C# half: a call through a known HTTP client is disclosed, never
3
- * silent — even though this adapter extracts no `USES_API` edges in C# at
4
- * all yet.
2
+ * C# half: a call through a known HTTP client is disclosed, never silent,
3
+ * and mints a real `USES_API` edge when the shape allows it.
5
4
  *
6
- * ## Why disclosure without extraction is the right first producer here
5
+ * Known-type population, measured before being picked: `bench/client-call-census.mjs csharp`
6
+ * names `HttpClient`, `IHttpClientFactory`, `HttpRequestMessage`, `RestClient`
7
+ * as candidates. `RestClient` (RestSharp) has zero occurrences across all six
8
+ * C# reference corpora (jellyfin, eShop, eShopOnWeb, Ocelot, CleanArchitecture,
9
+ * Dapper). `IHttpClientFactory` only produces an `HttpClient` via
10
+ * `CreateClient()`; all 61 relative-path call sites in the census go through
11
+ * `HttpClient` variables/fields once the factory call has returned. So the
12
+ * known-type set is just `HttpClient`, narrower than the candidate list, on
13
+ * measurement. `HttpRequestMessage` is never a receiver — it's `SendAsync`'s
14
+ * argument — so it doesn't belong in a receiver-type set at all.
7
15
  *
8
- * Java's `client.ts` extracts real edges for Spring's clients and files a
9
- * ledger row for the shapes it cannot read. C# has no extraction path at
10
- * all — `capabilities()` already declares no `USES_API` for this adapter
11
- * (PROGRESS.md), so *every* call through a known client is unclaimed today.
12
- * Building the extractor itself (reading `GetAsync("/orders/{id}")`'s literal
13
- * path, the way `bench/client-call-census.mjs`'s C# census shows is
14
- * structurally the same shape as Spring's `RestTemplate` — the URL is the
15
- * call's own first argument, not a separately built request object) is a
16
- * **separate, larger row**: it needs the DEC-129 counting-first admission
17
- * this project requires before an extractor ships, a golden fixture change,
18
- * and a capability declaration tested against pattern 08 the way DEC-195
19
- * records for Java. That is not built here.
16
+ * Origin check (DEC-260 §3): two adapters disagreeing on the same refusal
17
+ * shape corrupts `refusalClass` (DEC-242) once a consumer trusts it. Not
18
+ * Java's exact predicate: Java's "doesn't start with `/`" rule, tested
19
+ * against real corpora, misfired here — jellyfin and eShopOnWeb both pass a
20
+ * bare relative path with no leading slash (`"Users/New"`) to `HttpClient`
21
+ * calls resolved against `HttpClient.BaseAddress` at runtime, a shape Java's
22
+ * population never contains. Every such site is an integration test through
23
+ * `_factory.CreateClient()` (ASP.NET's in-process test client, pointed at the
24
+ * app under test) — a same-repository call this reader was about to mislabel
25
+ * as another origin. See {@link namesAnotherOrigin}. Carried back into
26
+ * `adapter-java`'s `relativePath` rule, which had the identical latent
27
+ * defect (`adapter-java` `1bfd2ae`) — both adapters now agree by construction.
20
28
  *
21
- * What *is* in scope, and small: recognise the receiver's declared type and
22
- * turn "nothing" into a disclosed refusal, so `0 USES_API edges` stops being
23
- * indistinguishable from "no HTTP calls in this codebase" — the exact
24
- * distinction DEC-113's ledger exists to carry, and the reason a `cf-worker`
25
- * zero and a `sherpa-frontend` zero are different facts.
26
- *
27
- * ## The bounded population, measured before it was picked
28
- *
29
- * `bench/client-call-census.mjs csharp` names `HttpClient`, `IHttpClientFactory`,
30
- * `HttpRequestMessage` and `RestClient` as candidates. Measured directly against
31
- * this row: `RestClient` (RestSharp's type) has **zero** occurrences across all
32
- * six C# reference corpora (`jellyfin`, `eShop`, `eShopOnWeb`, `Ocelot`,
33
- * `CleanArchitecture`, `Dapper`) — counted, not assumed, the same way DEC-129
34
- * counted before admitting a corpus. `IHttpClientFactory` produces an
35
- * `HttpClient` from `CreateClient()`; the client census's 61 relative-path call
36
- * sites are all through `HttpClient` variables and fields once the factory call
37
- * has already returned. So the known-type set here is **just `HttpClient`** —
38
- * narrower than the census's candidate list, on a measurement rather than a
39
- * guess, and it can widen the day a corpus exercises `RestClient` for real.
40
- *
41
- * `HttpRequestMessage` is not a receiver in any of the census's call sites — it
42
- * is the *argument* to `SendAsync`, never the thing a verb method is called on
43
- * — so it does not belong in a receiver-type set at all; including it would
44
- * have been the coarser-than-node-key mistake DEC-165/187 already paid for once.
45
- *
46
- * ## Origin check, added after DEC-260
47
- *
48
- * The first pass of this file filed every candidate as "no extractor," with no
49
- * distinction between a call whose literal path stays inside this repository
50
- * and one that names a different origin outright — a divergence from Java's
51
- * `client.ts`, which has always told the two apart. DEC-260 §3 names the
52
- * consequence directly: two adapters disagreeing on the same refusal shape
53
- * corrupts `refusalClass` (DEC-242) the moment a consumer trusts it, because
54
- * C# would systematically over-report `capability-gap` against Java's
55
- * classifier on the same underlying population.
56
- *
57
- * **Not Java's exact predicate, on purpose — measured, not assumed.** A first
58
- * attempt reused Java's "does not start with `/`" rule verbatim and ran it
59
- * against the real admitted corpora before calling the row done, per this
60
- * project's own discipline. It misfired: `jellyfin` and `eShopOnWeb` both pass
61
- * a **bare relative path with no leading slash** (`"Users/New"`) to `HttpClient`
62
- * calls resolved against `HttpClient.BaseAddress` at run time — a shape Java's
63
- * own population never contains, so Java's rule was never tested against it.
64
- * Every such call site found is an integration test through
65
- * `_factory.CreateClient()`, ASP.NET's in-process test client pointed at the
66
- * application under test — a same-repository call this reader was about to
67
- * mislabel as "another origin." See {@link namesAnotherOrigin}'s own comment
68
- * for the corrected, narrower rule. This origin check was later carried back
69
- * into `adapter-java`'s own `relativePath` rule, which carried the identical
70
- * latent defect (`adapter-java` `1bfd2ae`) — the two adapters now agree on
71
- * this shape by construction, not by two independently-tuned rules.
72
- *
73
- * ## Extraction, built on the shape the origin check already separated out
74
- *
75
- * `DEC-241` §4 named this row: `HttpClient`'s verb methods take the path as
76
- * their **own first argument** — `GetAsync("/orders/{id}")`, never a
77
- * separately built request object the way `OkHttpClient`/`java.net.http.HttpClient`
78
- * require — the same structurally-straightforward shape Java's `RestTemplate`
79
- * already extracts from. `clientCalls` below mints a real `USES_API` edge for
80
- * every call whose receiver is a known client type, whose method names a
81
- * literal verb, and whose path is a repository-relative literal
82
- * (`relativePath`, unchanged from the origin check's own reasoning) — and
83
- * files a ledger row, never silently drops the call, for every other shape:
84
- * an unrecognised verb (`SendAsync`, which takes a pre-built
85
- * `HttpRequestMessage` — verb and path both live inside an object this reader
86
- * does not open), a non-literal path, an origin outside this repository, or a
87
- * bare relative path this reader genuinely cannot place (the same
88
- * `BaseAddress`-resolved shape the origin check exists to disclose rather
89
- * than guess).
29
+ * Extraction (DEC-241 §4): `HttpClient` verb methods take the path as their
30
+ * own first argument — `GetAsync("/orders/{id}")`, never a separately built
31
+ * request object — same shape Java's `RestTemplate` extracts from.
32
+ * `clientCalls` mints a `USES_API` edge for a known client type, a literal
33
+ * verb, and a repository-relative literal path (`relativePath`); everything
34
+ * else files a ledger row rather than dropping silently: an unrecognised verb
35
+ * (`SendAsync`, verb and path live inside an `HttpRequestMessage` this reader
36
+ * doesn't open), a non-literal path, another origin, or an unplaceable bare
37
+ * relative path.
90
38
  */
91
39
  import { type IdentityScope, type IRNode } from "@descryy/ir";
92
40
  import type { CsRef } from "./parse.ts";
@@ -112,27 +60,18 @@ export interface ClientRefusal {
112
60
  readonly blockedBy: string | null;
113
61
  /** DEC-242's `attrs.refusalClass` — `undefined` means unclassified, never askable. */
114
62
  readonly refusalClass: BaseRefusalClass | "out-of-scope" | undefined;
115
- /**
116
- * Diagnostic only, not part of DEC-242 — see `adapter-rust/src/client.ts`'s
117
- * own doc for what this is and why it is not shipped as part of the
118
- * contract. Present only on the generic fallthrough of `diagnoseArgument`.
119
- */
63
+ /** Diagnostic only, not part of DEC-242 — see `adapter-rust/src/client.ts`. */
120
64
  readonly argumentKind?: "field" | "call" | "concatenation" | "other";
121
65
  /**
122
- * Present only when the refusal is DEC-164's own `unresolved` state — a
123
- * base-setting mechanism was found but its value could not be read as a
124
- * literal. Zero witnesses in this row's six corpora; see `client-base.ts`'s
125
- * own header for why the mechanism that would produce this is not built.
66
+ * Present only for DEC-164's `unresolved` state — a base-setting mechanism
67
+ * found but unreadable as a literal. Zero witnesses in the six corpora measured.
126
68
  */
127
69
  readonly clientBase?: ClientBaseResult;
128
70
  }
129
71
  export type BaseRefusalClass = "value-unknown" | "varies-per-call" | "capability-gap";
130
72
  /**
131
- * Every reference {@link clientCalls} will act on — an unbounded receiver
132
- * type still makes it a true silence past this point, exactly as in Java. See
133
- * `client.test.ts` for the reconciliation this makes checkable: every
134
- * candidate whose type resolves lands in either `calls` or `refusals`, with
135
- * nothing else.
73
+ * Every reference {@link clientCalls} will act on. See `client.test.ts`:
74
+ * every candidate whose type resolves lands in either `calls` or `refusals`.
136
75
  */
137
76
  export declare function candidateClientRefs(refs: readonly CsRef[]): readonly (CsRef & {
138
77
  readonly receiver: string;
@@ -141,13 +80,10 @@ export declare function candidateClientRefs(refs: readonly CsRef[]): readonly (C
141
80
  * Read one method's calls for outbound HTTP.
142
81
  *
143
82
  * `typeOfReceiver` is supplied by `extract.ts`, which already has the scope
144
- * tables (`fn.scope.locals`, the enclosing type's members) a second copy of
145
- * here would drift from — the same division of labour as Java's `client.ts`.
146
- *
147
- * `clientBaseOfReceiver` is DEC-164's contract (`client-base.ts`'s own
148
- * header): a per-call determination of what base, if any, this reader traced
149
- * for the receiver. Called only for refs that already passed the known-client-
150
- * type gate below, matching `typeOfReceiver`'s own division of labour.
83
+ * tables a second copy here would drift from — same division of labour as
84
+ * Java's `client.ts`. `clientBaseOfReceiver` is DEC-164's contract
85
+ * (`client-base.ts`): a per-call trace of the receiver's base, called only
86
+ * for refs that already passed the known-client-type gate.
151
87
  */
152
88
  export declare function clientCalls(refs: readonly CsRef[], fromId: string, typeOfReceiver: (ref: CsRef & {
153
89
  readonly receiver: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;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