Role: generic
Supprime tous les dossiers pycache et fichiers .pyc dans le projet. Calls:
os.walk, print, os.path.join, shutil.rmtree, dirnames.remove, f.endswith, os.path.join, os.remove
Role: generic
Supprime tous les dossiers pycache et fichiers .pyc dans le projet. Calls:
os.walk, print, os.path.join, shutil.rmtree, dirnames.remove, f.endswith, os.path.join, os.remove
Role: generic
CodeDocAI — Generate documentation from source code using AI. Calls:
click.command, click.option, click.option, click.option, click.option, click.option, click.option, click.option, click.option, click.option
Role: config
Supported LLM providers.
Settings for local Ollama instance.
Settings for OpenAI-compatible API.
Top-level application configuration.
Role: controller
Generate a full API reference from IR signatures. Calls:
sorted, '\n'.join, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append
Calls: ', '.join, parts.append, '\n'.join, parts.append, parts.append, ', '.join
Role: generic
generate_architecture_doc(project: ProjectIR, graph: nx.DiGraph, file_summaries: dict[str, str], entry_points: list[EntryPoint]) → str
Generate ARCHITECTURE.md with dependency diagrams and project topology. Calls:
sorted, '\n'.join, generate_dependency_diagram, file_summaries.get, _role_icon, lines.append, lines.extend, lines.append, len
Calls: icons.get
Role: generic
Render a Mermaid flowchart from the dependency graph. Calls:
lines.append, '\n'.join, node.replace('/', '_').replace, lines.append, u.replace('/', '_').replace, v.replace('/', '_').replace, lines.append, node.replace, u.replace, v.replace
Role: generic
Generate a pure USER-CENTRIC README.md. Calls:
'\n'.join
Role: utility
Clean LLM output from markdown blocks and preambles. Calls:
re.sub, re.sub, re.sub, text.strip
Role: generic
Create a directed graph where edges represent import relationships.
Nodes are file paths (relative). An edge A → B means "A imports B".
Calls: nx.DiGraph, _build_file_lookup, graph.add_node, _resolve_import, graph.add_edge, logger.debug, logger.debug, imp.module.startswith
Map possible module names to their file paths. Calls:
PurePosixPath, str(path.with_suffix('')).replace, str, path.with_suffix
Try to resolve an import string to a known project file. Calls:
lookup.items, key.endswith
Role: generic
Build a global call graph across all project modules. Calls:
CallGraph, cg.nx_graph.add_node, FunctionNode, cg.nx_graph.add_node, FunctionNode, potential_id.endswith, cg.nx_graph.add_edge, cg.edges.append, cg.edges.append, cg.nx_graph.add_edge
Project-wide call graph.
Calls: nx.DiGraph
Calls: nx.betweenness_centrality, len, self.nx_graph.in_degree, self.nx_graph.out_degree, betweenness.get
Role: repository
Detect circular dependencies using NetworkX. Calls:
list, CycleReport, nx.simple_cycles, SingleCycle, CycleReport, len
Role: generic
Export the call graph as a D3-compatible JSON structure. Calls:
(output_dir / 'call_graph.json').write_text, json.dumps
Export flattened IR metrics for easy CSV analysis. Calls:
open, csv.writer, writer.writerow, writer.writerow, len, len, len
Role: generic
Compute V2 Criticality by blending structural file deps with functional execution bounds. Calls:
sorted, graph.in_degree, graph.out_degree, metrics.append, NodeMetrics
Calls: list, nx.topological_sort, sorted, list
Role: generic
All LLM providers (local and external) implement this contract.
Send a prompt and return the LLM's text response.
Check whether the provider is reachable.
Role: generic
Construct a prompt for generating a Python/JS/Rust docstring.
Role: generic
Produce a template-based summary from IR when LLM fails. Calls:
len, len, ' '.join, ', '.join, parts.append, ', '.join, parts.append, ', '.join, parts.append, parts.append
Produce a template-based project summary when LLM fails. Calls:
len
Role: generic
Local LLM via Ollama HTTP API.
Calls: httpx.Client
Calls: range, logger.error, self._client.post, resp.raise_for_status, resp.json().get, logger.error, logger.warning, time.sleep, logger.warning, time.sleep
Check if Ollama is running AND the configured model is present. Calls:
self._client.get, resp.json().get, any, logger.info, resp.json, m.get('name', '').startswith, m.get
Role: generic
External LLM via OpenAI-compatible chat completions API.
Calls: httpx.Client
Calls: range, logger.error, self._client.post, resp.raise_for_status, resp.json, logger.warning, time.sleep
Calls: self._client.get
Role: generic
build_file_summary_prompt(file_ir: FileIR, source_code: str, whitelist: set[str], incoming_calls: list[str], imported_by: list[str], imports_from: list[str]) → str
Build a rich grounded prompt for high-fidelity summary. Calls:
lines.extend, '\n'.join, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append, lines.append
Analyze multiple utility files and return a JSON mapping [path -> summary]. Calls:
files_info.append, len, json.dumps, list
build_project_summary_prompt(project: ProjectIR, file_summaries: dict[str, str], entry_points: list[EntryPoint], metrics: list[NodeMetrics]) → str
Build a high-level architectural overview prompt. Calls:
lines.append, lines.extend, '\n'.join, lines.append, sorted, lines.append, len, file_summaries.get
Role: generic
Inject a docstring into a Python function (stub for now). Calls:
logger.info
Role: generic
Execute the full documentation generation pipeline. Calls:
time.time, config.project_path.resolve, output_dir.mkdir, console.print, load_ir, time.time, list, time.time, ProjectIR, time.time
Calls: OpenAIProvider, OllamaProvider
Role: generic
Factory: return the right parser for a language string. Calls:
_registry.get, PythonParser, JSParser, JSParser, RustParser, ValueError
Parse a source file and return its IR.
Role: generic
Lightweight JS/TS parser using regex patterns.
Calls: file_path.read_text, FileIR, self._extract_imports, self._extract_functions, self._extract_classes
Calls: _IMPORT_RE.finditer, m.group, imports.append, m.group, m.group, m.group, m.group, n.strip, names.insert, ImportIR
Calls: _FUNCTION_RE.finditer, _ARROW_RE.finditer, funcs.append, funcs.append, self._match_to_func, self._match_to_func
Calls: _CLASS_RE.finditer, m.group, m.group, classes.append, ClassIR, source[:m.start()].count, m.start
Calls: FunctionIR, m.group, ParameterIR, raw_params.split, p.strip, m.group, bool, p.split(':')[0].strip, m.group, (m.groupdict().get('ret') or '').strip
Role: generic
Extracts IR from Python source files using the stdlib
astmodule.
Calls: file_path.read_text, FileIR, ast.parse, logger.warning, FileIR, ast.get_docstring, self._extract_imports, self._extract_functions, self._extract_classes, str
Calls: ast.walk, isinstance, isinstance, imports.append, imports.append, ImportIR, ImportIR
Extract top-level functions (not methods inside classes). Calls:
self._build_function_ir, ast.iter_child_nodes, isinstance
Calls: ast.iter_child_nodes, isinstance, classes.append, self._build_function_ir, ClassIR, isinstance, ast.get_docstring, self._unparse_node, self._unparse_node
Calls: self._extract_params, self._extract_calls, FunctionIR, self._unparse_node, ast.get_docstring, isinstance, self._unparse_node
Calls: params.append, ParameterIR, self._unparse_node
Collect names of all function/method calls inside a node. Calls:
ast.walk, isinstance, calls.append, self._unparse_node
Safely convert an AST node back to its source string. Calls:
ast.unparse
Role: generic
Calls: path.read_text, FileIR, re.finditer, re.finditer, re.finditer, re.finditer, re.finditer, file_ir.imports.append, file_ir.imports.append, match.group
Calls: match.group, match.group, params_raw.split, FunctionIR, match.group, match.group(5).strip, match.group, p.split, params.append, match.group
Role: generic
Load .gitignore patterns from the project root. Calls:
gitignore.exists, open, pathspec.PathSpec.from_lines
discover_files(project_root: Path, supported_extensions: list[str], exclude_dirs: list[str]) → Iterator[DiscoveredFile]
Walk the project tree and yield source files, respecting .gitignore. Calls:
project_root.resolve, _load_gitignore, project_root.rglob, d.lower, any, file_path.relative_to(project_root).as_posix, detect_language, logger.debug, file_path.is_file, file_path.suffix.lower
A source file discovered during scanning.
Role: generic
Return the language for a given file path based on its extension. Calls:
_EXT_MAP.get, file_path.suffix.lower
Supported programming languages.
Role: generic
Calls: _detect_role, _enrich_function, _enrich_function
Calls: _enrich_data_flow, _assign_criticality
Calls: file_ir.file_path.lower, _ROLE_PATTERNS.items, pattern.search, cls.name.lower
Calls: ' '.join(func.calls).lower, _SIDE_EFFECT_PATTERNS.items, any, ' '.join, effects.append, kw.lower
Identify data flow properties like reads, writes, and purity. Calls:
_detect_side_effects, any, call.lower, any, any, func.io_operations.append, func.reads.append, func.writes.append, call.split, call.split
Calls: len
Role: generic
Scan the project for executable roots and trace their execution trees. Calls:
nx.descendants, list, EntryPoint, entry_points.append, nx.single_source_shortest_path_length, max, paths.values
An execution root node inside the application.
Role: repository
Calls: terms.add, terms.update, terms.add, terms.update, terms.add, terms.add, terms.add, terms.update, terms.add, len
Calls: HallucinationReport, build_symbol_whitelist, re.findall, len, _check_missing_critical_components, any, len, max, t.lower, report.flagged_terms.append
Calls: summary.lower, report.missing_critical.append, f.name.lower
Role: generic
Save the project IR to a JSON file for caching and analysis. Calls:
project.model_dump, dump_path.write_text, logger.info, json.dumps
Load a previously exported IR from the documentation folder. Calls:
dump_path.exists, json.loads, ProjectIR.model_validate, dump_path.read_text, logger.warning
Compute a SHA256 hash of a file's content for change detection. Calls:
hashlib.sha256, hasher.hexdigest, open, f.read, hasher.update
Role: model
Role: generic
Validate the entire project IR for completeness and consistency. Calls:
ValidationResult, symbol_counts.items, _validate_file, _count_symbol, _count_symbol, result.ambiguous_symbols.append, result.warnings.append, logger.warning
Check a single file IR for issues. Calls:
result.warnings.append, result.warnings.append
Calls: counts.get
Outcome of validating a ProjectIR.
Role: test
Calls: ProjectIR, FileIR, FileIR, build_call_graph, cg.compute_metrics, len, len, FunctionIR, FunctionIR
Role: test
Calls: FunctionIR, _enrich_data_flow, FunctionIR, _enrich_data_flow
Role: test
Calls: ProjectIR, FileIR, build_call_graph, detect_entry_points, len, FunctionIR, FunctionIR
Role: test
Calls: ProjectIR, build_dependency_graph, graph.has_edge, graph.has_edge, graph.has_edge, CallGraph, compute_metrics, next, detect_cycles, graph.number_of_nodes
Calls: ProjectIR, build_dependency_graph, CallGraph, detect_cycles, len, FileIR, FileIR, ImportIR, ImportIR
Role: test
Calls: FileIR, check_summary, len, ImportIR, FunctionIR, ClassIR, ParameterIR, FunctionIR
Calls: FileIR, check_summary, FunctionIR
Role: model
Calls: FileIR, enrich_file_ir, FileIR, enrich_file_ir, FileIR, enrich_file_ir, FileIR, enrich_file_ir
Calls: FileIR, enrich_file_ir, FunctionIR, FunctionIR, FunctionIR, FunctionIR
Role: test
Calls: file_path.write_text, get_parser, parser.parse, len, len, len, len
Calls: file_path.write_text, get_parser, parser.parse, len, len, len
Calls: file_path.write_text, get_parser, parser.parse, len, len, len, len
Role: test
Calls: detect_language, detect_language, detect_language, detect_language, detect_language, detect_language, Path, Path, Path, Path