Skip to content

Enhance dashboard with .factory/ artifact browser #183

@abhi1092

Description

@abhi1092

Factory experiment 3. Hypothesis: Enhance dashboard to browse .factory/ contents.

What to Build

Add .factory/ artifact browsing to the existing web dashboard in three parts:

1. Two new FastAPI endpoints in factory/dashboard/app.py

  • GET /api/projects/{name}/factory/browse?path=strategy — lists files in a .factory/ subdirectory (strategy, reviews, experiments, archive). Returns file names, sizes, and last-modified timestamps. Directory traversal guarded by allowlisting subdirectories.
  • GET /api/projects/{name}/factory/file?path=strategy/current.md — returns raw file content for rendering. Path restricted to .factory/ subtree with traversal checks.

2. Frontend artifact browser in factory/dashboard/static/index.html

  • Sidebar navigation with sections: Strategy (current.md, research.md, observations.md, backlog.md), Reviews (ceo-verdict-*.md, *-latest.md), Experiments (per-experiment artifacts), Archive (research notes, patterns, sources), Backlog
  • Clicking a file opens a slide-out panel with markdown rendered to HTML (use marked.js via CDN)
  • Collapsible tree structure for experiments/ and archive/ subdirectories
  • JSON files rendered with syntax highlighting using a
     block

3. Tests in tests/test_dashboard.py

  • Test both new endpoints with fixture .factory/ directories
  • Test path traversal rejection (e.g., ../../etc/passwd)
  • Test missing file returns 404

Acceptance Criteria

  • Both browse and file endpoints work correctly
  • Path traversal is properly guarded
  • Frontend renders markdown files and JSON files
  • Sidebar navigation with all sections
  • All existing dashboard tests pass
  • Eval score does not regress

Constraints

  • Read CLAUDE.md before starting
  • Do NOT touch files outside declared scope
  • Do NOT modify eval/score.py or .factory/
  • Use vanilla JS — no React/Vue frameworks
  • Keep existing dashboard completely intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationFactory experiment implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions