Skip to content

Fix brainstorm server serving macOS resource fork dotfiles as content#950

Open
pablobb wants to merge 1 commit intoobra:mainfrom
pablobb:fix/macos-resource-fork-dotfiles
Open

Fix brainstorm server serving macOS resource fork dotfiles as content#950
pablobb wants to merge 1 commit intoobra:mainfrom
pablobb:fix/macos-resource-fork-dotfiles

Conversation

@pablobb
Copy link
Copy Markdown

@pablobb pablobb commented Mar 27, 2026

On macOS, ._*.html resource fork files pass the .endsWith('.html') filter and get served as page content, showing binary metadata instead of the actual brainstorm screen. Filter out dotfiles in all four places where content directory files are listed or served.

What problem are you trying to solve?

On macOS, the brainstorm visual companion serves binary garbage (Mac OS X 2ATTR...com.apple.provenance) instead of HTML content. macOS creates ._filename resource fork files
alongside real files. These ._screen.html files pass the .endsWith('.html') filter in server.cjs and get picked as the newest screen, serving their binary metadata to the browser.

This is a blocker for using visual asistant if project folder is localted on external drives, in my case it's ExFAT

What does this PR change?

Adds !f.startsWith('.') dotfile guards to all four places in server.cjs where content directory files are listed or served. Adds one integration test covering the ._*.html case.

Is this change appropriate for the core library?

Yes — affects any macOS user running the brainstorm visual companion. Not project-specific, not third-party.

What alternatives did you consider?

Filtering only ._ prefix (!f.startsWith('._')). Chose !f.startsWith('.') instead because it covers all hidden/dotfiles per Unix convention (.DS_Store, .hidden.html, etc.) and is the
standard approach.

Does this PR contain multiple unrelated changes?

No. Single bug fix + its test.

Existing PRs

  • I have reviewed all open AND closed PRs for duplicates or prior art

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Claude Code 2.1.85 Claude claude-opus-4-6

Evaluation

  • Initial prompt: "fix the brainstorm visual companion serving macOS resource fork binary data instead of HTML content"
  • Ran the full test suite (node --test tests/brainstorm-server/server.test.js) — 26/26 pass including the new dotfile test
  • Before: ._*.html files pass the .endsWith('.html') filter and binary content is served to the browser
  • After: dotfiles are rejected at all four entry points — getNewestScreen(), /files/ endpoint, knownFiles init, fs.watch handler
  • Manual testing:
SCR-20260327-ideo SCR-20260327-icwf SCR-20260327-icro

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) without extensive evals
    showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

On macOS, ._*.html resource fork files pass the .endsWith('.html')
filter and get served as page content, showing binary metadata instead
of the actual brainstorm screen. Filter out dotfiles in all four places
where content directory files are listed or served.
@obra obra added bug Something isn't working brainstorming Brainstorming skill and visual companion labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

brainstorming Brainstorming skill and visual companion bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants