Concatenate references/*.md, capped per-file, for the eval LLM. The cap keeps token use bounded for large reference sets. Each file contributes its first N bytes (text is markdown so a byte cap is a reasonable proxy for tokens).
(skill_dir: Path)
| 164 | |
| 165 | |
| 166 | def _read_references_preview(skill_dir: Path) -> str: |
| 167 | """Concatenate references/*.md, capped per-file, for the eval LLM. |
| 168 | |
| 169 | The cap keeps token use bounded for large reference sets. Each file |
| 170 | contributes its first N bytes (text is markdown so a byte cap is a |
| 171 | reasonable proxy for tokens). |
| 172 | """ |
| 173 | refs_dir = skill_dir / "references" |
| 174 | if not refs_dir.is_dir(): |
| 175 | return "" |
| 176 | chunks: list[str] = [] |
| 177 | for ref in sorted(refs_dir.rglob("*.md")): |
| 178 | rel = ref.relative_to(skill_dir) |
| 179 | text = ref.read_text(encoding="utf-8", errors="replace") |
| 180 | if len(text) > REFERENCES_PREVIEW_BYTES: |
| 181 | text = text[:REFERENCES_PREVIEW_BYTES] + "\n…[truncated]\n" |
| 182 | chunks.append(f"--- {rel} ---\n{text}") |
| 183 | return "\n\n".join(chunks) |
| 184 | |
| 185 | |
| 186 | def _skill_content_block(skill_dir: Path) -> str: |
no outgoing calls
no test coverage detected