Skip to content

Add artifact content API endpoint #297

Description

@williamthorsen

Context

Every visualization vision identified artifact content access as a prerequisite. The server already reads run-index.json and knows artifact filenames from CanonicalRunStatus, but there's no endpoint to serve the actual file content.

Spun out from #295.

Goal

Implement GET /runs/:runId/artifacts/:filename — an Express endpoint that serves actual artifact file content (diffs, findings, plans, summaries).

Details

  • Resolve the artifact's file path on disk from the run directory + filename
  • Return raw content with appropriate content-type (text/markdown for .md files, application/json for .json)
  • Optional: a ?format=html query param that renders markdown to HTML server-side
  • Add to the existing routes in packages/factory/src/server/routes/runs.ts
  • Add tests

Key files

  • packages/factory/src/server/routes/runs.ts (add endpoint here)
  • packages/factory/src/server/services/project-scanner.ts (understands run directory layout)
  • packages/factory/src/server/adapters/status-adapter.ts (parses run-index.json)
  • packages/factory/src/shared/types/canonical.ts (artifact types)

Metadata

Metadata

Labels

featureAdded or improved external functionalityscope:factory

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions