fix: bound table rendering, glob expansion and e2e server reuse

Merged
DO
5d ago
+594-16

Summary

Three small hardening fixes, grouped to keep review overhead down.

  • Comparison table size cap. isLosslessTable now rejects tables over MAX_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.py glob expansion. glob.glob(..., recursive=True) is replaced by iter_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 CI is 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.csv is left unchanged so the installer still sees these files as locally modified.
  • Local runs still reuse whatever server is already on port 5173.

Testing

CheckResult
npm run typecheck, lint, format:checkpass
npm run test:coverage78 files, 776 tests pass; all files 96.56 / 90.64 / 95.86 / 96.99
New render-markdown testsat 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 rootiter_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.