(filePath: string, nodes: readonly Node[])
| 5899 | */ |
| 5900 | const overheadCache = new Map<string, number>(); |
| 5901 | const sectionOverhead = (filePath: string, nodes: readonly Node[]): number => { |
| 5902 | const hit = overheadCache.get(filePath); |
| 5903 | if (hit !== undefined) return hit; |
| 5904 | const names = [...new Set( |
| 5905 | nodes.filter(isListedSymbol) |
| 5906 | .map((n) => `${n.name}(${n.kind})`), |
| 5907 | )].slice(0, budget.maxSymbolsInFileHeader); |
| 5908 | // header + blank, then ```lang / body / ``` / blank around the source. |
| 5909 | const cost = fileSectionHeader(filePath, names.join(', ')).length + 2 |
| 5910 | + (nodes[0]?.language?.length ?? 0) + 11; |
| 5911 | overheadCache.set(filePath, cost); |
| 5912 | return cost; |
| 5913 | }; |
| 5914 | /** |
| 5915 | * How much of what is still owed BELOW `fileIndex` the response can actually |
| 5916 | * still PAY, in render-space chars (CG-31). |
nothing calls this directly
no test coverage detected