Finding
The scripts/sync-org-docs.mjs script (~200 lines) is responsible for aggregating READMEs and documentation from every active repo in the tuna-os GitHub org into the Docusaurus docs site. This script handles:
- Git operations: Cloning repos with
execSync
- Content transformation: Markdown sanitization, relative link rewriting, frontmatter injection
- HTML sanitization: Stripping
<picture> tags, HTML comments, MDX-confusing angle brackets
- Status banner injection: Adding alpha/beta/stable banners based on project metadata
- Selective doc syncing: Per-repo file filters and docs/ subdirectory handling
None of this logic has unit tests. The HTML sanitization and link rewriting are particularly fragile — a regression could silently break the docs site.
Recommendation
Add scripts/__tests__/sync-org-docs.test.mjs (or similar) with unit tests for the pure functions:
sanitizeHtml() — Test all sanitization cases (picture tags, HTML comments, email angles)
fixRelativeLinks() — Test link rewriting for .md, .rst, .png files
frontmatter() / subFrontmatter() — Test frontmatter generation
getStatusBanner() — Test all status levels
slugify() — Test name-to-slug conversion
Priority
- Impact: medium
- Effort: medium
Filed by quality agent (ACMM L4/L6 — full mode)
Finding
The
scripts/sync-org-docs.mjsscript (~200 lines) is responsible for aggregating READMEs and documentation from every active repo in the tuna-os GitHub org into the Docusaurus docs site. This script handles:execSync<picture>tags, HTML comments, MDX-confusing angle bracketsNone of this logic has unit tests. The HTML sanitization and link rewriting are particularly fragile — a regression could silently break the docs site.
Recommendation
Add
scripts/__tests__/sync-org-docs.test.mjs(or similar) with unit tests for the pure functions:sanitizeHtml()— Test all sanitization cases (picture tags, HTML comments, email angles)fixRelativeLinks()— Test link rewriting for .md, .rst, .png filesfrontmatter()/subFrontmatter()— Test frontmatter generationgetStatusBanner()— Test all status levelsslugify()— Test name-to-slug conversionPriority
Filed by quality agent (ACMM L4/L6 — full mode)