Skip to content

chore: reduce installed footprint: exclude dev-only files and directories from target deployments #221

@evereq

Description

@evereq

Problem

When DreamServer is installed on a target PC/Mac, the entire dream-server/ subtree is copied to $HOME/dream-server without any filtering. This includes a significant number of files and directories that are only needed for development, CI, or documentation — not for running DreamServer.

Root Cause

The bootstrap installer (get-dream-server.sh) performs a sparse checkout of the dream-server/ directory and then copies it wholesale:

git sparse-checkout set dream-server
cp -r "$TEMP_DIR/repo/dream-server" "$INSTALL_DIR"

No exclusion or filtering is applied during the copy step. Similarly, the Windows installer (install-windows.ps1) clones or copies the full dream-server/ tree into the WSL environment.

Files/Directories Not Needed at Runtime

Directories

Directory Contents Why it's not needed
tests/ ~34 test scripts (integration, smoke, benchmark, etc.) Testing infrastructure — not needed on end-user machines
docs/ ~34 markdown files (troubleshooting, architecture docs, guides) Developer/contributor documentation — not needed at runtime
examples/ 2 sample files (sample-code.py, sample-doc.txt) Example files for developers
.github/ CI workflows, issue templates, PR templates GitHub-specific CI/CD — irrelevant on installed systems

Root-level files in dream-server/

File Why it's not needed
CHANGELOG.md Release history — not needed at runtime
CODE_OF_CONDUCT.md Community guidelines — not needed at runtime
CONTRIBUTING.md Contributor guide — not needed at runtime
EDGE-QUICKSTART.md Developer quickstart doc
FAQ.md Can be referenced online
QUICKSTART.md Setup guide — useful during install but not after
SECURITY.md Security policy — not needed at runtime
README.md Project description — not needed at runtime
.shellcheckrc Shell linting config — dev-only
PSScriptAnalyzerSettings.psd1 PowerShell linting config — dev-only
test-stack.sh Test harness — dev-only
.gitignore Git config — not needed at runtime

Files That ARE Needed at Runtime

These are the essential files/directories for a functioning DreamServer installation:

  • install.sh / install-core.sh — installer entry points
  • installers/ — platform-specific installers and libraries
  • docker-compose.*.yml — Docker Compose service definitions
  • config/ — runtime configuration
  • lib/ — shared shell libraries
  • scripts/ — operational scripts (preflight, health checks, etc.)
  • agents/ — AI agent templates
  • extensions/ — extension/plugin system
  • migrations/ — database migrations
  • opencode/ — OpenCode systemd service file
  • memory-shepherd/ — memory management service
  • dream-cli — CLI tool
  • dream-backup.sh, dream-restore.sh, dream-update.sh, dream-uninstall.sh, dream-preflight.sh — operational scripts
  • .env / .env.example / .env.schema.json — environment configuration
  • manifest.json — version and compatibility manifest
  • Makefile — operational commands
  • LICENSE — required for compliance

Proposed Solutions

Option A: Add exclusion list to the copy step (quick win)

Modify get-dream-server.sh to exclude dev-only directories and files during the copy:

rsync -a --exclude='tests/' --exclude='docs/' --exclude='examples/' \
  --exclude='.github/' --exclude='CHANGELOG.md' --exclude='CONTRIBUTING.md' \
  --exclude='CODE_OF_CONDUCT.md' --exclude='.shellcheckrc' \
  --exclude='PSScriptAnalyzerSettings.psd1' --exclude='test-stack.sh' \
  --exclude='SECURITY.md' --exclude='FAQ.md' --exclude='QUICKSTART.md' \
  --exclude='EDGE-QUICKSTART.md' --exclude='README.md' --exclude='.gitignore' \
  "$TEMP_DIR/repo/dream-server/" "$INSTALL_DIR/"

Option B: Use a manifest-driven approach (more robust)

Extend manifest.json to include a runtime_files or exclude_patterns section that the installer reads to determine what to copy:

{
  "install": {
    "exclude": [
      "tests/", "docs/", "examples/", ".github/",
      "*.md", ".shellcheckrc", "PSScriptAnalyzerSettings.psd1",
      "test-stack.sh", ".gitignore"
    ],
    "keep_md": ["LICENSE"]
  }
}

Option C: Use .dockerignore-style .installignore file

Create a .installignore file in dream-server/ that lists patterns to exclude during installation, similar to how .dockerignore works.

Impact

  • Reduced disk usage on target machines (~250KB+ of unnecessary files removed)
  • Cleaner installation — end-users won't see developer artifacts
  • Reduced attack surface — test scripts and CI configs are not exposed on production machines
  • Better UX — cleaner directory listing when users explore their installation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions