tools.feature_atlas.run_atlas module
Master orchestrator for the Feature Interaction Atlas pipeline.
Runs all steps in order, or a single step via –step.
- Usage:
# Full pipeline python -m tools.feature_atlas.run_atlas
# Individual steps python -m tools.feature_atlas.run_atlas –step extract-symbols python -m tools.feature_atlas.run_atlas –step discover-features python -m tools.feature_atlas.run_atlas –step extract-features python -m tools.feature_atlas.run_atlas –step load-features python -m tools.feature_atlas.run_atlas –step detect-interactions python -m tools.feature_atlas.run_atlas –step generate-prompts python -m tools.feature_atlas.run_atlas –step analyze-top50 python -m tools.feature_atlas.run_atlas –step import-analyses python -m tools.feature_atlas.run_atlas –step export-demo
# Discover features from unknown codebase (no canonical list needed) python -m tools.feature_atlas.run_atlas –discover-features
# Query CLI python -m tools.feature_atlas.run_atlas –step query
# fire skull spider infinity heart – THE FULL BODYGRAPH PIPELINE
- async tools.feature_atlas.run_atlas.step_extract_symbols()[source]
Run pipeline step 1a: AST-based repo symbol extraction.
Prints a progress header to stdout and then delegates to the synchronous
mainoftools.feature_atlas.extract_repo_symbols, which walks the repository with Python’sastmodule and writes the symbol index to disk. This step is offline (no FalkorDB or Gemini) and is the first stage that feeds every downstream feature-mapping step. The module is imported lazily inside the function so a partial run that skips this step never pays its import cost.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch in this module; it is not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_extract_features()[source]
Run pipeline step 1b: the Gemini Flash feature-mapping swarm.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.extract_features_swarm, which fans symbol clusters out to Gemini Flash to map source symbols onto canonical features. This is a Gemini-dependent step (seeGEMINI_STEPS) that requires the extracted symbol index from step 1a; the swarm module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_discover_features()[source]
Run pipeline step 1c: discover features from an unknown codebase.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.discover_features, which runs the “inhale protocol”: instead of mapping symbols onto a known canonical feature list, it lets Gemini propose the feature set directly from the symbol index. This is a Gemini-dependent, offline-eligible step used for fresh repositories where no canonical features exist; the module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAPdispatch (and reachable through the--discover-featuresflag handled inasync_main); it is not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_load_features()[source]
Run pipeline step 2: load Feature nodes into FalkorDB.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.load_features_to_falkor, which reads the extracted feature records and writes them asFeaturenodes into the FalkorDB graph so later steps can attach interactions and analyses to them. This step requires FalkorDB (it is not inOFFLINE_STEPS) and must follow feature extraction; the loader module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_detect_interactions()[source]
Run pipeline step 3: detect code interactions between features.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.detect_code_interactions, which uses the symbol index and the loadedFeaturenodes to find where features touch one another in code and records those interaction edges in FalkorDB. This FalkorDB-dependent step must follow feature loading; the detector module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_generate_prompts()[source]
Run pipeline step 4: generate interaction-analysis prompts.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.generate_interaction_prompts, which reads the detected interaction edges from FalkorDB and renders the per-pair prompt payloads that the later analysis swarm sends to the LLM. This step bridges interaction detection and the top-50 analysis stage; the prompt-builder module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_analyze_top50()[source]
Run pipeline step 5: analyze the top 50 interaction pairs via Gemini.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.run_interaction_analysis_swarm, which sends the generated prompts for the highest-ranked feature pairs out to the Gemini Flash swarm and collects their interaction analyses. This is a Gemini-dependent step (seeGEMINI_STEPS) that consumes the prompts built in step 4; the swarm module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_import_analyses()[source]
Run pipeline step 6: import interaction analyses into FalkorDB.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.import_interaction_analysis, which reads the analysis output produced by the step 5 swarm and writes it back onto the matching interaction edges in the FalkorDB graph. This FalkorDB-dependent step persists the LLM’s findings so the export and query steps can surface them; the importer module is imported lazily on demand.Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_export_demo()[source]
Run pipeline step 8: generate the Sarah demo report.
Prints a progress header and awaits the
async_mainoftools.feature_atlas.export_sarah_demo, which reads the fully populated atlas from FalkorDB and writes out the human-facing “Bodygraph Demo” report of the highest-risk and highest-value feature interactions. This is the final stage of the pipeline order; the exporter module is imported lazily on demand. (Step 7 is the interactive query CLI instep_queryand is not part of the linear pipeline.)Called by
run_pipelinevia theSTEP_MAP/PIPELINE_ORDERdispatch; not invoked directly elsewhere.- Return type:
- async tools.feature_atlas.run_atlas.step_query()[source]
Run pipeline step 7: launch the interactive query CLI.
Awaits the
async_mainoftools.feature_atlas.query_atlas, which opens an interactive command-line session against the populated FalkorDB atlas so an operator can explore features and their interactions. Unlike the other steps it prints no header here (the query CLI manages its own banner) and is excluded fromPIPELINE_ORDERbecause it is an interactive tool rather than a batch stage; the query module is imported lazily on demand.Called by
run_pipelinethrough theSTEP_MAPdispatch, and also invoked directly byasync_mainwhen--step queryis passed.- Return type:
- async tools.feature_atlas.run_atlas.run_pipeline(steps=None)[source]
Run the full Feature Atlas pipeline or a chosen subset of steps.
Prints the banner, then awaits each requested step’s coroutine in order, resolving each name through
STEP_MAPand timing it. Steps are deliberately fault-tolerant: a failure is logged (via the modulelogger) and printed but does not abort the run, so the loop continues with the remaining steps and a completed/failed summary is printed at the end. All real work (FalkorDB writes, Gemini calls, file output) happens inside the individualstep_*coroutines this dispatches to; this function itself only orchestrates and writes progress to stdout.Called by
async_mainin this module with the appropriate step list (the fullPIPELINE_ORDER, a resumed slice, the discover-features pair, or a single--step); it is not invoked from other modules.
- async tools.feature_atlas.run_atlas.async_main()[source]
Async entry point that parses CLI arguments and dispatches the pipeline.
Builds the
argparseparser for the--step,--from-step, and--discover-featuresoptions, then routes accordingly: the discover flag runs the symbol-extraction plus feature-discovery pair,--step querylaunches the interactive CLI directly,--step allruns the fullPIPELINE_ORDER(optionally sliced from--from-step), and any other single step runs just that one. All actual execution is delegated torun_pipeline(orstep_query); this function only readssys.argvand dispatches.Called by
mainin this module viaasyncio.run(async_main()); it is not invoked from other modules.- Return type:
- tools.feature_atlas.run_atlas.main()[source]
Synchronous console entry point for the Feature Atlas orchestrator.
Configures root logging at
INFOwith a timestamped format and then drives the whole CLI by callingasyncio.run(async_main()), which parses arguments and runs the requested pipeline steps. This is the plain command-line surface forpython -m tools.feature_atlas.run_atlas.Called by the module’s
__main__guard at the bottom of this file; it is not invoked from other modules.- Return type: