# base URL: /api/debug/base/ Section: debug -------------------------------------------------------------------------------- base - Bengal window.BENGAL_THEME_DEFAULTS = { appearance: 'dark', palette: 'snow-lynx' }; // Progressive Enhancement System Configuration window.Bengal = window.Bengal || {}; window.Bengal.enhanceBaseUrl = '/bengal/assets/js/enhancements'; window.Bengal.watchDom = true; window.Bengal.debug = false; (function () { try { var defaults = window.BENGAL_THEME_DEFAULTS || { appearance: 'system', palette: '' }; var defaultAppearance = defaults.appearance; if (defaultAppearance === 'system') { defaultAppearance = (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light'; } var storedTheme = localStorage.getItem('bengal-theme'); var storedPalette = localStorage.getItem('bengal-palette'); var theme = storedTheme ? (storedTheme === 'system' ? defaultAppearance : storedTheme) : defaultAppearance; var palette = storedPalette ?? defaults.palette; document.documentElement.setAttribute('data-theme', theme); if (palette) { document.documentElement.setAttribute('data-palette', palette); } } catch (e) { document.documentElement.setAttribute('data-theme', 'light'); } })(); Skip to main content Magnifying Glass ESC Recent Clear Magnifying Glass No results for "" Try different keywords or check your spelling Start typing to search... ↑↓ Navigate ↵ Open ESC Close Powered by Lunr ᓚᘏᗢ Documentation Info About Arrow Clockwise Get Started Note Tutorials File Text Content Palette Theming Settings Building Starburst Extending Bookmark Reference Learning Tracks Releases Dev GitHub API Reference bengal CLI Magnifying Glass Search ⌘K Palette Appearance Chevron Down Mode Monitor System Sun Light Moon Dark Palette Snow Lynx Brown Bengal Silver Bengal Charcoal Bengal Blue Bengal List ᓚᘏᗢ Magnifying Glass Search X Close Documentation Info About Arrow Clockwise Get Started Note Tutorials File Text Content Palette Theming Settings Building Starburst Extending Bookmark Reference Learning Tracks Releases Dev GitHub API Reference bengal CLI Palette Appearance Chevron Down Mode Monitor System Sun Light Moon Dark Palette Snow Lynx Brown Bengal Silver Bengal Charcoal Bengal Blue Bengal API Reference __main__ bengal Caret Right Folder Analysis community_detection graph_analysis graph_reporting graph_visualizer knowledge_graph link_suggestions link_types page_rank path_analysis performance_advisor results Caret Right Folder Assets manifest pipeline Caret Right Folder Autodoc base config docstring_parser utils virtual_orchestrator Caret Right Folder Extractors cli openapi python Caret Right Folder Models cli common openapi python Caret Right Folder Cache asset_dependency_map cache_store cacheable compression dependency_tracker page_discovery_cache query_index query_index_registry taxonomy_index utils Caret Right Folder Build Cache autodoc_tracking core file_tracking fingerprint parsed_content_cache rendered_output_cache taxonomy_index_mixin validation_cache Caret Right Folder Indexes author_index category_index date_range_index section_index Caret Right Folder Cli __main__ base site_templates utils Caret Right Folder Commands assets build clean collections config debug explain fix health init perf project serve site skeleton sources theme utils validate Caret Right Folder Graph __main__ bridges communities orphans pagerank report suggest Caret Right Folder New config presets scaffolds site wizard Caret Right Folder Helpers cli_app_loader cli_output config_validation error_handling menu_config metadata progress site_loader traceback validation Caret Right Folder Skeleton hydrator schema Caret Right Folder Templates base registry Caret Right Folder Blog template Caret Right Folder Changelog template Caret Right Folder Default template Caret Right Folder Docs template Caret Right Folder Landing template Caret Right Folder Portfolio template Caret Right Folder Resume template Caret Right Folder Collections errors loader schemas validator Caret Right Folder Config defaults deprecation directory_loader env_overrides environment feature_mappings hash loader merge origin_tracker validators Caret Right Folder Content Layer entry loaders manager source Caret Right Folder Sources github local notion rest Caret Right Folder Content Types base registry strategies Caret Right Folder Core build_context cascade_engine menu section theme Caret Right Folder Asset asset_core css_transforms Caret Right Folder Page computed content metadata navigation operations page_core proxy relationships utils Caret Right Folder Site core data discovery factories page_caches properties section_registry theme Caret Right Folder Debug base config_inspector content_migrator delta_analyzer dependency_visualizer explainer incremental_debugger models reporter shortcode_sandbox Caret Right Folder Discovery asset_discovery content_discovery Caret Right Folder Fonts downloader generator Caret Right Folder Health autofix base health_check report Caret Right Folder Linkcheck async_checker ignore_policy internal_checker models orchestrator Caret Right Folder Validators anchors assets cache config connectivity cross_ref fonts links menu navigation output performance rendering rss sitemap taxonomy tracks Caret Right Folder Directives analysis checkers constants Caret Right Folder Orchestration asset content full_to_incremental incremental menu postprocess related_posts render section static streaming taxonomy Caret Right Folder Postprocess html_output redirects rss sitemap special_pages Caret Right Folder Output Formats index_generator json_generator llm_generator lunr_index_generator txt_generator utils Caret Right Folder Rendering api_doc_enhancer asset_extractor errors jinja_utils link_transformer link_validator pygments_cache renderer template_context template_profiler validator Caret Right Folder Parsers base factory mistune native_html pygments_patch python_markdown Caret Right Folder Pipeline core output thread_local toc transforms Caret Right Folder Plugins badges cross_references inline_icon term variable_substitution Caret Right Folder Directives _icons admonitions badge base button cache cards checklist code_tabs container contracts data_table dropdown embed errors example_label fenced figure glossary icon include list_table literalinclude marimo navigation options rubric steps tabs target term terminal tokens utils validator video Caret Right Folder Template Engine asset_url core environment manifest menu url_helpers Caret Right Folder Template Functions advanced_collections advanced_strings autodoc collections content crossref data dates debug files get_page i18n icons images math_functions navigation pagination_helpers seo strings tables taxonomies theme urls Caret Right Folder Server build_handler component_preview constants dev_server live_reload pid_manager reload_controller request_handler request_logger resource_manager utils Caret Right Folder Services validation Caret Right Folder Themes config Caret Right Folder Utils atomic_write autodoc build_context build_stats build_summary cli_output css_minifier dates dotdict error_handlers file_io file_lock hashing incremental_constants js_bundler live_progress logger metadata observability page_initializer pagination path_resolver paths performance_collector performance_report profile progress retry rich_console sections swizzle text theme_registry theme_resolution thread_local traceback_config traceback_renderer url_normalization url_strategy API Reference Debug ᗢ Caret Down Link Copy URL External Open LLM text Copy Copy LLM text Share with AI Ask Claude Ask ChatGPT Ask Gemini Ask Copilot Module debug.base Base classes and registry for Bengal debug tools. Provides common infrastructure for all debug/diagnostic tools including output formatting, data collection patterns, and tool registration. Key Components: DebugTool: Base class for all debug tools DebugReport: Structured output from debug tools DebugRegistry: Tool discovery and registration Related Modules: bengal.debug.incremental_debugger: Incremental build debugging bengal.debug.delta_analyzer: Build comparison bengal.debug.dependency_visualizer: Dependency graph visualization See Also: bengal/cli/commands/debug.py: CLI integration View source 5 Classes Classes Severity Severity levels for debug findings. 2 Caret Right Severity levels for debug findings. Inherits from Enum Methods 2 Tag emoji property Get emoji for severity level. str Caret Right def emoji(self) -> str Get emoji for severity level. Returns str Tag color property Get Rich color token for severity. str Caret Right def color(self) -> str Get Rich color token for severity. Returns str DebugFinding dataclass A single finding from a debug tool. Represents an observation, issue, or insight discovered during… 2 Caret Right A single finding from a debug tool. Represents an observation, issue, or insight discovered during analysis. Findings can range from informational to critical and include actionable suggestions where applicable. Attributes Name Type Description title str Short title describing the finding description str Detailed explanation of what was found severity Severity Severity level (info, warning, error, critical) category str Category for grouping (e.g., "cache", "dependency", "performance") location str | None Optional file path or identifier related to finding suggestion str | None Optional actionable suggestion for resolution metadata dict[str, Any] Additional context-specific data line int | None Optional line number for file-based findings Methods 2 format_short Format as single line. 0 str Caret Right def format_short(self) -> str Format as single line. Returns str format_full Format with full details. 0 str Caret Right def format_full(self) -> str Format with full details. Returns str DebugReport dataclass Structured output from a debug tool. Aggregates findings, statistics, and recommendations from a d… 8 Caret Right Structured output from a debug tool. Aggregates findings, statistics, and recommendations from a debug analysis. Provides multiple output formats for CLI, JSON, and markdown export. Attributes Name Type Description tool_name str Name of the tool that generated this report timestamp datetime When the report was generated findings list[DebugFinding] List of findings discovered during analysis summary str Brief summary of analysis results statistics dict[str, Any] Numeric statistics from analysis recommendations list[str] High-level recommendations based on findings execution_time_ms float How long the analysis took metadata dict[str, Any] Additional tool-specific data Methods 8 Tag findings_by_severity property Group findings by severity level. dict[Severity, list… Caret Right def findings_by_severity(self) -> dict[Severity, list[DebugFinding]] Group findings by severity level. Returns dict[Severity, list[DebugFinding]] Tag findings_by_category property Group findings by category. dict[str, list[Debu… Caret Right def findings_by_category(self) -> dict[str, list[DebugFinding]] Group findings by category. Returns dict[str, list[DebugFinding]] Tag has_issues property Check if report contains warnings or errors. bool Caret Right def has_issues(self) -> bool Check if report contains warnings or errors. Returns bool Tag error_count property Count of error and critical findings. int Caret Right def error_count(self) -> int Count of error and critical findings. Returns int Tag warning_count property Count of warning findings. int Caret Right def warning_count(self) -> int Count of warning findings. Returns int add_finding Add a finding to the report. 3 DebugFinding Caret Right def add_finding(self, title: str, description: str, severity: Severity = Severity.INFO, **kwargs: Any) -> DebugFinding Add a finding to the report. Parameters 3 title str description str severity Severity Returns DebugFinding to_dict Convert report to dictionary for JSON serialization. 0 dict[str, Any] Caret Right def to_dict(self) -> dict[str, Any] Convert report to dictionary for JSON serialization. Returns dict[str, Any] format_summary Format a brief summary for CLI output. 0 str Caret Right def format_summary(self) -> str Format a brief summary for CLI output. Returns str DebugTool abstract Base class for all Bengal debug tools. Provides common infrastructure for analysis tools including… 4 Caret Right Base class for all Bengal debug tools. Provides common infrastructure for analysis tools including: Standardized report generation Access to site and cache data Consistent output formatting Subclasses implement analyze() to perform their specific analysis. Creation: Subclass and implement analyze() method. Inherits from ABC Attributes Name Type Description name str description str Methods 3 create_report Create a new report for this tool. 0 DebugReport Caret Right def create_report(self) -> DebugReport Create a new report for this tool. Returns DebugReport analyze Perform analysis and return report. Subclasses must implement this method to p… 0 DebugReport Caret Right def analyze(self) -> DebugReport Perform analysis and return report. Subclasses must implement this method to perform their specific analysis and return a DebugReport with findings. Returns DebugReport — DebugReport containing analysis results run Run analysis with timing. Wraps analyze() with timing measurement. 0 DebugReport Caret Right def run(self) -> DebugReport Run analysis with timing. Wraps analyze() with timing measurement. Returns DebugReport — DebugReport with execution time populated Internal Methods 1 Caret Right __init__ Initialize debug tool. 3 None Caret Right def __init__(self, site: Site | None = None, cache: BuildCache | None = None, root_path: Path | None = None) Initialize debug tool. Parameters 3 site Site | None Optional Site instance for analysis cache BuildCache | None Optional BuildCache for cache inspection root_path Path | None Root path of the project (defaults to cwd) DebugRegistry Registry for debug tools. Enables tool discovery and provides CLI integration point. Usage: >… 4 Caret Right Registry for debug tools. Enables tool discovery and provides CLI integration point. Usage: >>> registry = DebugRegistry() >>> registry.register(IncrementalBuildDebugger) >>> tool = registry.get("incremental") Attributes Name Type Description _tools dict[str, type[DebugTool]] Methods 4 register classmethod Register a debug tool class. Can be used as a decorator: @DebugRegistry.r… 1 type[DebugTool] Caret Right def register(cls, tool_class: type[DebugTool]) -> type[DebugTool] Register a debug tool class. Can be used as a decorator: @DebugRegistry.register class MyTool(DebugTool): name = "my-tool" ... Parameters 1 tool_class type[DebugTool] The tool class to register Returns type[DebugTool] — The tool class (for decorator usage) get classmethod Get a tool class by name. 1 type[DebugTool] | None Caret Right def get(cls, name: str) -> type[DebugTool] | None Get a tool class by name. Parameters 1 name str Returns type[DebugTool] | None list_tools classmethod List all registered tools with descriptions. 0 list[tuple[str, str]] Caret Right def list_tools(cls) -> list[tuple[str, str]] List all registered tools with descriptions. Returns list[tuple[str, str]] create classmethod Create a tool instance by name. 3 DebugTool | None Caret Right def create(cls, name: str, site: Site | None = None, cache: BuildCache | None = None, **kwargs: Any) -> DebugTool | None Create a tool instance by name. Parameters 3 name str Tool name site Site | None Optional Site instance cache BuildCache | None Optional BuildCache instance **kwargs: Additional arguments passed to tool Returns DebugTool | None — Tool instance or None if not found Next → config_inspector List © 2025 Bengal ᓚᘏᗢ window.BENGAL_LAZY_ASSETS = { tabulator: '/bengal/assets/js/tabulator.min.js', dataTable: '/bengal/assets/js/data-table.js', mermaidToolbar: '/bengal/assets/js/mermaid-toolbar.9de5abba.js', mermaidTheme: '/bengal/assets/js/mermaid-theme.344822c5.js', graphMinimap: '/bengal/assets/js/graph-minimap.cc7e42e3.js', graphContextual: '/bengal/assets/js/graph-contextual.440e59c6.js' }; window.BENGAL_ICONS = { close: '/bengal/assets/icons/close.911d4fe1.svg', enlarge: '/bengal/assets/icons/enlarge.652035e5.svg', copy: '/bengal/assets/icons/copy.3d56e945.svg', 'download-svg': '/bengal/assets/icons/download.04f07e1b.svg', 'download-png': '/bengal/assets/icons/image.c34dfd40.svg', 'zoom-in': '/bengal/assets/icons/zoom-in.237b4a83.svg', 'zoom-out': '/bengal/assets/icons/zoom-out.38857c77.svg', reset: '/bengal/assets/icons/reset.d26dba29.svg' }; Arrow Up X -------------------------------------------------------------------------------- Metadata: - Author: lbliii - Word Count: 2034 - Reading Time: 10 minutes