(filePath: string, nodes: readonly Node[])
| 4368 | */ |
| 4369 | const overheadCache = new Map<string, number>(); |
| 4370 | const sectionOverhead = (filePath: string, nodes: readonly Node[]): number => { |
| 4371 | const hit = overheadCache.get(filePath); |
| 4372 | if (hit !== undefined) return hit; |
| 4373 | const names = [...new Set( |
| 4374 | nodes.filter((n) => n.kind !== 'import' && n.kind !== 'export') |
| 4375 | .map((n) => `${n.name}(${n.kind})`), |
| 4376 | )].slice(0, budget.maxSymbolsInFileHeader); |
| 4377 | // header + blank, then ```lang / body / ``` / blank around the source. |
| 4378 | const cost = fileSectionHeader(filePath, names.join(', ')).length + 2 |
| 4379 | + (nodes[0]?.language?.length ?? 0) + 11; |
| 4380 | overheadCache.set(filePath, cost); |
| 4381 | return cost; |
| 4382 | }; |
| 4383 | /** |
| 4384 | * How much of what is still owed BELOW `fileIndex` the response can actually |
| 4385 | * still PAY, in render-space chars (CG-31). |
nothing calls this directly
no test coverage detected