ingest — AgentTeamsModule¶
Parse project descriptions into a normalized dict.
Accepts JSON files matching project-description.schema.json, Markdown briefs with section headings, and plain Markdown fallback (unstructured). When existing_project_path is set, scans the directory tree to supplement missing fields.
Recent behavior includes conservative retrieval-integration inference. If a description omits retrieval_integration, directory supplementation may infer mode, query/maintenance entrypoints, trigger sources, source-of-truth hints, staleness SLO, and trigger-contract version from repository files.
Source:
agentteams/ingest.py
Pipeline at a glance¶
ingest is stage one of the generate pipeline. The figure traces the whole flow — the brief
through ingest → analyze → render → framework adapter →
emit, with manifest_format and fences as
carve-outs of analyze and emit. Generated deterministically from scripts/gen_api_cluster_figures.py.
Functions¶
load(source, *, scan_project=True)¶
Source:
agentteams/ingest.py
Load and return a normalized project description dict.
Args:
source(str | Path) — Path to a.jsonor.mdproject description file.scan_project(bool, keyword-only) — IfTrueandexisting_project_pathis set in the description, scan the project directory for additional context. Default:True.
Returns: dict[str, Any] — Normalized project description conforming to agentteams/schemas/project-description.schema.json.
Behavior Notes:
- When
scan_project=Trueandexisting_project_pathis present,load()supplements missing fields from repository context (tools, output hints, dependency manifests, retrieval integration). - When it infers
retrieval_integration(the source declared none), it also sets the private provenance key_retrieval_integration_inferred: True. That key is not in the schema, so pop it before validating the dict with a JSON-schema validator.cli/generate.pypops it and uses it to decide whether the retrieval references are brief-authoritative. - Retrieval inference is additive and conservative: inferred retrieval data is only written when
retrieval_integrationis not already explicitly provided.
Raises:
FileNotFoundError— Ifsourcedoes not exist.ValueError— Ifsourcecannot be parsed or fails validation.
parse_dependency_manifests(project_path, *, max_depth=2)¶
Note:
max_depthbounds how far below project_path manifests are discovered.Source:
agentteams/ingest.py
Parse all dependency manifest files found in a project directory.
Recognizes: requirements.txt, pyproject.toml, package.json, Cargo.toml, go.mod.
Args:
project_path(Path) — Root directory of the project to scan.
Returns: list[dict[str, Any]] — List of dependency dicts, each with keys name, version, category.
Parser Coverage Notes:
- Python:
requirements.txt,pyproject.toml - JavaScript/TypeScript:
package.json - Rust:
Cargo.toml - Go:
go.mod
validate(description)¶
Source:
agentteams/ingest.py
Validate a project description dict and return a list of error strings.
Args:
description(dict[str, Any]) — Project description dict (typically fromload()).
Returns: list[str] — List of validation error messages. Empty list means the description is valid.
Retrieval Inference Notes¶
load() supplements retrieval integration using conservative heuristics when scanning a project and when the input brief does not already provide retrieval_integration.
Candidate scan paths¶
services/scripts/.github/workflows/- root files:
README.md,CLAUDE.md,build_team.py
Trigger-source inference¶
workflow:workflow_dispatch(bare match), or colon-suffixedschedule:/cron:cli:argparseor command-style markers such as--serviceenv:os.environ,getenv(...), or env-var cuesscript: shell file suffixes such as.sh/.bash- fallback:
manualwhen no trigger source is inferred
Mode inference cues¶
relational-metadata: retrieval metadata/update/refresh cueslexical-index: query-index strategy cuessparse-vector: sparse-vector/cosine/BM25 cuesembedding-vector: embedding/vector-store cues (faiss,chroma,pinecone,qdrant,weaviate,milvus)
Inference output is normalized to the retrieval contract shape consumed by analyze.build_manifest().