(filePath: string, nodes: readonly Node[])
| 5877 | */ |
| 5878 | const overheadCache = new Map<string, number>(); |
| 5879 | const sectionOverhead = (filePath: string, nodes: readonly Node[]): number => { |
| 5880 | const hit = overheadCache.get(filePath); |
| 5881 | if (hit !== undefined) return hit; |
| 5882 | const names = [...new Set( |
| 5883 | nodes.filter(isListedSymbol) |
| 5884 | .map((n) => `${n.name}(${n.kind})`), |
| 5885 | )].slice(0, budget.maxSymbolsInFileHeader); |
| 5886 | // header + blank, then ```lang / body / ``` / blank around the source. |
| 5887 | const cost = fileSectionHeader(filePath, names.join(', ')).length + 2 |
| 5888 | + (nodes[0]?.language?.length ?? 0) + 11; |
| 5889 | overheadCache.set(filePath, cost); |
| 5890 | return cost; |
| 5891 | }; |
| 5892 | /** |
| 5893 | * How much of what is still owed BELOW `fileIndex` the response can actually |
| 5894 | * still PAY, in render-space chars (CG-31). |
nothing calls this directly
no test coverage detected