Foundry.Context.ProjectContext (foundry v0.1.1)

Copy Markdown

Provides convenient access to project context (nodes, edges) without running mix tasks.

Used by LiveView and other runtime contexts to build or fetch project graphs.

Summary

Functions

Builds the complete project context from a project root directory.

Builds a single node by module ID from a project root.

Functions

build(project_root)

Builds the complete project context from a project root directory.

Returns {:ok, context_map} or {:error, reason}.

The context_map includes:

  • nodes: list of NodeEntry structs
  • edges: list of EdgeEntry structs
  • generated_at: timestamp
  • project, project_type, domain_type: manifest data
  • spec_kit: spec-kit index
  • scenarios: verified executable test traces

build_map(project_root)

build_one(project_root, module_id)

Builds a single node by module ID from a project root.

Returns {:ok, NodeEntry} or {:error, reason}.