fallow-type-aware 3.34.0 → 3.34.1

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.
package/README.md CHANGED
@@ -14,6 +14,9 @@ zero-based UTF-8 byte column, and optional owner. Results keep their semantic
14
14
  assertion separate from `complete`, `partial`, or `unavailable` status. Evidence
15
15
  and every operation-specific array are deterministic and bounded, with totals,
16
16
  omissions, reason codes, actions, and truncation reported explicitly.
17
+ The request `evidence_limit` is at most 40. A `type-coupling` query can set its
18
+ own `evidence_limit` of at most 10,000, because its result is one report for
19
+ the whole project.
17
20
 
18
21
  Structural diagnostics,
19
22
  unknown identities, missing projects, unsupported syntax, dynamic behavior,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fallow-type-aware",
3
- "version": "3.34.0",
3
+ "version": "3.34.1",
4
4
  "description": "Optional TypeScript-Go semantic refinement sidecar for Fallow",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/protocol.mjs CHANGED
@@ -56,7 +56,13 @@ const API_SURFACE_QUERY_KEYS = new Set([
56
56
  "include_cycles",
57
57
  "private_leak_candidates",
58
58
  ]);
59
- const TYPE_COUPLING_QUERY_KEYS = new Set(["id", "operation", "entry_points", "include_cycles"]);
59
+ const TYPE_COUPLING_QUERY_KEYS = new Set([
60
+ "id",
61
+ "operation",
62
+ "entry_points",
63
+ "include_cycles",
64
+ "evidence_limit",
65
+ ]);
60
66
  const PRIVATE_LEAK_CANDIDATE_KEYS = new Set(["id", "path", "export_name", "type_name"]);
61
67
  const SYMBOL_KEYS = new Set([
62
68
  "path",
@@ -77,6 +83,10 @@ const MAX_QUERIES = 25_000;
77
83
  const MAX_GRAPH_QUERIES = 256;
78
84
  const MAX_PRIVATE_LEAK_CANDIDATES = 25_000;
79
85
  const MAX_EVIDENCE_PER_RESULT = 40;
86
+ // A type-coupling result is one project-wide report, so it can carry more
87
+ // evidence than a per-symbol result. This bound keeps the response well below
88
+ // the native client's semantic response byte limit.
89
+ const MAX_TYPE_COUPLING_EVIDENCE = 10_000;
80
90
  const MAX_STRING_CHARS = 4_096;
81
91
 
82
92
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
@@ -257,13 +267,31 @@ const parseFrameworkContracts = (value, field) =>
257
267
  const parseIncludeCycles = (value, field) =>
258
268
  value === undefined ? false : requireBoolean(value, field);
259
269
 
270
+ const parseTypeCouplingEvidenceLimit = (value, field) => {
271
+ const limit = requireInteger(value, field, 1);
272
+ if (limit > MAX_TYPE_COUPLING_EVIDENCE) {
273
+ throw new Error(`${field} exceeds the ${MAX_TYPE_COUPLING_EVIDENCE} item limit`);
274
+ }
275
+ return limit;
276
+ };
277
+
260
278
  const parseGraphQuery = (value, field, root, query) => {
261
279
  const graphQuery = {
262
280
  ...query,
263
281
  entryPoints: parseEntryPoints(value.entry_points, `${field}.entry_points`, root),
264
282
  includeCycles: parseIncludeCycles(value.include_cycles, `${field}.include_cycles`),
265
283
  };
266
- if (query.operation !== "api-surface") return graphQuery;
284
+ if (query.operation === "type-coupling") {
285
+ return value.evidence_limit === undefined
286
+ ? graphQuery
287
+ : {
288
+ ...graphQuery,
289
+ evidenceLimit: parseTypeCouplingEvidenceLimit(
290
+ value.evidence_limit,
291
+ `${field}.evidence_limit`,
292
+ ),
293
+ };
294
+ }
267
295
  return {
268
296
  ...graphQuery,
269
297
  privateLeakCandidates: parsePrivateLeakCandidates(
package/src/semantic.mjs CHANGED
@@ -1891,7 +1891,7 @@ const analyzeGraphSemanticQuery = (root, query, graphStates, evidenceLimit) => {
1891
1891
  return analyzeApiSurface(root, query, graphStates, evidenceLimit);
1892
1892
  }
1893
1893
  return analyzeTypeCoupling(
1894
- { root, query, states: graphStates, evidenceLimit },
1894
+ { root, query, states: graphStates, evidenceLimit: query.evidenceLimit ?? evidenceLimit },
1895
1895
  {
1896
1896
  boundedResult,
1897
1897
  discoverEntryPoints,