Skip to content

Docs under a phase folder named build, dist, target, or venv are permanently invisible in the GUI #20

Description

@anbturki

Summary

write_doc places docs at <status>/<phase>/<slug>.md. Phase validation only checks slug shape, so build, dist, target, and venv are accepted as phase names, but all four are on the scanner skip list and on the watcher skip list. The write succeeds, MCP list_docs shows the doc, and the GUI can never display it. No error is surfaced anywhere. Agents pick phase names like "build" naturally, so this matches the reported "agent wrote it, the app never shows it" cases.

Reproduction (release build of f485396, macOS)

  1. In a scanned workspace, create research/build/invisible-build-phase.md (the layout write_doc produces for phase: "build"), plus a sibling control file research/visible-control.md in the same batch.
  2. Wait for the watcher rescan.
  3. The control file appears; the build/ folder and its doc never do (screenshot: "5 files", no build folder in the tree). Manual refresh does not help, since the scanner itself prunes the directory.

On-disk state during the screenshot:

research/
  build/
    invisible-build-phase.md   <- exists on disk, never listed
  created-while-closed.md
  created-while-running.md
  getting-started.md
  linked-from-outside.md       <- symlink, tracked separately in issue #21
  visible-control.md           <- control, appeared immediately

Root cause

  • Phase becomes a subfolder: src-tauri/core/src/write.rs:122-127; validation accepts any slug: write.rs:156-166.
  • The scanner prunes any directory whose exact name is in SKIP_DIRS (src-tauri/core/src/scan.rs:88-126, applied at 153-166), which includes build, dist, target, venv.
  • The frontend watcher mirror drops events for those paths too (src/hooks/useLibrary.ts:62-108), so no rescan is even attempted.
  • MCP list_docs/find_doc_location walk phase dirs with plain read_dir and no skip list (write.rs:145-154, 168-182), so the agent sees the doc and gets ok: true while the GUI never lists it.

Proposed fix

Reject (or remap) phase names that collide with SKIP_DIRS in validate_phase, and derive all three consumers (scanner, watcher mirror, phase validation) from one shared skip-list definition so they cannot drift. Alternatively scope skip-dir pruning to depths where it makes sense: direct children of a status folder are always workspace content.

Screenshot

Control file visible, research/build/ and its doc absent:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions