(filePath: string, nodes: readonly Node[])
| 5821 | */ |
| 5822 | const overheadCache = new Map<string, number>(); |
| 5823 | const sectionOverhead = (filePath: string, nodes: readonly Node[]): number => { |
| 5824 | const hit = overheadCache.get(filePath); |
| 5825 | if (hit !== undefined) return hit; |
| 5826 | const names = [...new Set( |
| 5827 | nodes.filter(isListedSymbol) |
| 5828 | .map((n) => `${n.name}(${n.kind})`), |
| 5829 | )].slice(0, budget.maxSymbolsInFileHeader); |
| 5830 | // header + blank, then ```lang / body / ``` / blank around the source. |
| 5831 | const cost = fileSectionHeader(filePath, names.join(', ')).length + 2 |
| 5832 | + (nodes[0]?.language?.length ?? 0) + 11; |
| 5833 | overheadCache.set(filePath, cost); |
| 5834 | return cost; |
| 5835 | }; |
| 5836 | /** |
| 5837 | * How much of what is still owed BELOW `fileIndex` the response can actually |
| 5838 | * still PAY, in render-space chars (CG-31). |
nothing calls this directly
no test coverage detected