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
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
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.pyGET /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.html3. Tests in
tests/test_dashboard.pyAcceptance Criteria
Constraints