fix: bound table rendering, glob expansion and e2e server reuse
Merged
DO
5d ago+594+594+012345678901234567890123456789-16-16-01234567890123456789
Summary
Three small hardening fixes, grouped to keep review overhead down.
- Comparison table size cap.
isLosslessTablenow rejects tables overMAX_TABLE_CELLS(2,000 rows x columns), so large or very wide tables fall back to the document view instead of being padded out cell by cell. Fixes #557. analyze_sources.pyglob expansion.glob.glob(..., recursive=True)is replaced byiter_glob, an iterative walk with the same*,?,[...],**, hidden-name, trailing-separator and..rules (symlink loops and unreadable entries are skipped, as glob does) that does not follow directory symlinks under**and stops after 10,000 matches (with a warning on stderr). Applied identically to all three vendored copies (_bmad/core/bmad-distillator,_bmad/core/skills/bmad-distillator,.claude/skills/bmad-distillator). Fixes #558.- Playwright web server. Both configs reuse an already-running dev server only when
CIis unset or empty, so CI (CI=true,CI=1, ...) always starts its own.
Notes
- The distillator files are generated by the BMAD installer. Its update path overwrites locally modified files and keeps the old copy as
.bak, so this fix lasts until the next installer update unless it is also fixed upstream.files-manifest.csvis left unchanged so the installer still sees these files as locally modified. - Local runs still reuse whatever server is already on port 5173.
Testing
| Check | Result |
|---|---|
npm run typecheck, lint, format:check | pass |
npm run test:coverage | 78 files, 776 tests pass; all files 96.56 / 90.64 / 95.86 / 96.99 |
| New render-markdown tests | at the cap: comparison table; one row over: document; wide header with short rows: document |
pytest on each distillator copy (Python 3.9 and 3.12) | 52 passed each, including parity with glob.glob on plain trees, trailing separators, .. segments, symlink loops and the cap |
| Two directory symlinks pointing back at the root | iter_glob: 1 match in 0.06 s. glob.glob: still running when stopped at 8 s |
š¤ Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Tables that exceed the supported size limit or have rows wider than their headers now display as documents rather than comparison tables.
- Tables with at least two headers, rows no wider than the headers, and no more than 2,000 header-and-row cells display as comparison tables. Tables at the maximum supported size remain eligible for comparison-table rendering.
Problem
See the linked issue.
Risk
Low ā 10 file(s) changed; no CI- or runtime-critical paths touched.
Test plan
Tests added/updated: .claude/skills/bmad-distillator/scripts/tests/test_analyze_sources.py,_bmad/core/bmad-distillator/scripts/tests/test_analyze_sources.py _bmad/core/skills/bmad-distillator/scripts/tests/test_analyze_sources.py. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.
Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
This PR's CI checks (Lint + bats) are the success/regression signal.