{ "project_root": ".", "generated_at": "2026-03-16T22:51:05.999999", "modules": [ { "name": "merge_spec", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 54, "tags": { "PURPOSE": "Auto-generated module for merge_spec.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "merge_specs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 6, "end_line": 6, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "generate_semantic_map", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": null, "tags": { "PURPOSE": "Scans the codebase to generate a Semantic Map, Module Map, and Compliance Report based on the System Standard.", "PRE": "Valid directory containing code to scan.", "POST": "Files map.json, .ai/PROJECT_MAP.md, .ai/MODULE_MAP.md, and compliance reports generated.", "TIER": "STANDARD", "SEMANTICS": "semantic_analysis, parser, map_generator, compliance_checker, tier_validation, svelte_props, data_flow, module_map", "LAYER": "DevOps/Tooling", "INVARIANT": "All DEF anchors must have matching closing anchors; TIER determines validation strictness." }, "relations": [ { "type": "READS", "target": "FileSystem" }, { "type": "PRODUCES", "target": "semantics/semantic_map.json" }, { "type": "PRODUCES", "target": ".ai/PROJECT_MAP.md" }, { "type": "PRODUCES", "target": ".ai/MODULE_MAP.md" }, { "type": "PRODUCES", "target": "semantics/reports/semantic_report_*.md" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 35, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Mock init for self-containment.", "PRE": "name is a string.", "POST": "Instance initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__enter__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 44, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Mock enter.", "PRE": "Instance initialized.", "POST": "Returns self." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__exit__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 53, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Mock exit.", "PRE": "Context entered.", "POST": "Context exited." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Tier", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 66, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Legacy tier buckets retained for backward-compatible reporting." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Complexity", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 77, "tags": { "PURPOSE": "Adaptive semantic complexity scale used for validation strictness." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Severity", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 87, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Severity levels for compliance issues." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceIssue", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 174, "end_line": 189, "tags": { "TIER": "TRIVIAL", "PURPOSE": "Represents a single compliance issue with severity." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SemanticEntity", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 192, "end_line": null, "tags": { "TIER": "CRITICAL", "PURPOSE": "Represents a code entity (Module, Function, Component) found during parsing.", "INVARIANT": "start_line is always set; end_line is set upon closure; complexity defaults to 1 unless explicitly raised." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 197, "end_line": 223, "tags": { "TIER": "STANDARD", "PURPOSE": "Initializes a new SemanticEntity instance.", "PRE": "name, type_, start_line, file_path are provided.", "POST": "Instance is initialized with default values." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 197 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 197 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 197 } ], "score": 0.4 } }, { "name": "has_explicit_complexity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 225, "end_line": null, "tags": { "PURPOSE": "Returns whether the entity explicitly declares complexity metadata." }, "relations": [], "children": [ { "name": "get_complexity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 230, "end_line": null, "tags": { "PURPOSE": "Returns effective complexity with backward compatibility for legacy tiers.", "PRE": "tags dictionary is accessible.", "POST": "Returns Complexity enum value." }, "relations": [], "children": [ { "name": "get_tier", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 278, "end_line": 291, "tags": { "TIER": "STANDARD", "PURPOSE": "Returns legacy tier bucket derived from effective complexity.", "PRE": "tags dictionary is accessible.", "POST": "Returns Tier enum value." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 } ], "score": 0.1 } }, { "name": "to_dict", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 293, "end_line": 323, "tags": { "TIER": "STANDARD", "PURPOSE": "Serializes the entity to a dictionary for JSON output.", "PRE": "Entity is fully populated.", "POST": "Returns a dictionary representation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 293 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 293 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 293 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 293 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 293 } ], "score": 0.1 } }, { "name": "validate", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 325, "end_line": 430, "tags": { "TIER": "CRITICAL", "PURPOSE": "Checks for semantic compliance based on complexity requirements.", "PRE": "Entity structure is complete; complexity is determined.", "POST": "Populates self.compliance_issues with severity levels.", "SIDE_EFFECT": "Modifies self.compliance_issues list." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 325 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 325 } ], "score": 0.0 } }, { "name": "get_score", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 432, "end_line": 476, "tags": { "TIER": "STANDARD", "PURPOSE": "Calculates a compliance score (0.0 to 1.0) based on complexity requirements.", "PRE": "validate() has been called.", "POST": "Returns a float score." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 } ], "score": 0.1 } }, { "name": "get_patterns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 480, "end_line": 518, "tags": { "TIER": "STANDARD", "PURPOSE": "Returns regex patterns for a specific language.", "PRE": "lang is either 'python' or 'svelte_js'.", "POST": "Returns a dictionary of compiled regex patterns.", "PARAM": "lang (str) - 'python' or 'svelte_js'" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 } ], "score": 0.1 } }, { "name": "extract_svelte_props", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 521, "end_line": 547, "tags": { "TIER": "STANDARD", "PURPOSE": "Extracts props from Svelte component script section.", "PRE": "lines is a list of file lines, start_idx is the starting line index.", "POST": "Returns list of prop definitions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 521 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 521 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 521 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 521 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 521 } ], "score": 0.1 } }, { "name": "extract_svelte_events", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 550, "end_line": 584, "tags": { "TIER": "STANDARD", "PURPOSE": "Extracts dispatched events from Svelte component.", "PRE": "lines is a list of file lines.", "POST": "Returns list of event names." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 550 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 550 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 550 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 550 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 550 } ], "score": 0.1 } }, { "name": "extract_data_flow", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 587, "end_line": 637, "tags": { "TIER": "STANDARD", "PURPOSE": "Extracts store subscriptions and data flow from Svelte component.", "PRE": "lines is a list of file lines.", "POST": "Returns list of data flow descriptors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 587 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 587 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 587 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 587 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 587 } ], "score": 0.1 } }, { "name": "parse_file", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 640, "end_line": 836, "tags": { "TIER": "CRITICAL", "PURPOSE": "Parses a single file to extract semantic entities with tier awareness and enhanced Svelte analysis.", "PRE": "full_path, rel_path, lang are valid strings.", "POST": "Returns extracted entities and list of issues.", "INVARIANT": "Every opened anchor must have a matching closing anchor for valid compliance.", "PARAM": "lang - Language identifier." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 640 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 640 } ], "score": 0.0 } }, { "name": "SemanticMapGenerator", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 839, "end_line": 1469, "tags": { "TIER": "CRITICAL", "PURPOSE": "Orchestrates the mapping process with tier-based validation.", "INVARIANT": "All entities are validated according to their TIER requirements." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 844, "end_line": 856, "tags": { "TIER": "STANDARD", "PURPOSE": "Initializes the generator with a root directory.", "PRE": "root_dir is a valid path string.", "POST": "Generator instance is ready." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 844 } ], "score": 0.0 } }, { "name": "_load_gitignore", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 858, "end_line": 874, "tags": { "TIER": "STANDARD", "PURPOSE": "Loads patterns from .gitignore file.", "PRE": ".gitignore exists in root_dir.", "POST": "Returns set of ignore patterns." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 858 } ], "score": 0.0 } }, { "name": "_is_ignored", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 876, "end_line": 917, "tags": { "TIER": "STANDARD", "PURPOSE": "Checks if a path should be ignored based on .gitignore or hardcoded defaults.", "PRE": "rel_path is a valid relative path string.", "POST": "Returns True if the path should be ignored." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 876 } ], "score": 0.0 } }, { "name": "run", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 919, "end_line": 932, "tags": { "TIER": "CRITICAL", "PURPOSE": "Main execution flow.", "PRE": "Generator is initialized.", "POST": "Semantic map and reports are generated." }, "relations": [ { "type": "CALLS", "target": "_walk_and_parse" }, { "type": "CALLS", "target": "_generate_artifacts" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 919 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 919 } ], "score": 0.0 } }, { "name": "_walk_and_parse", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 934, "end_line": 963, "tags": { "TIER": "CRITICAL", "PURPOSE": "Recursively walks directories and triggers parsing.", "PRE": "root_dir exists.", "POST": "All files are scanned and entities extracted." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 934 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 934 } ], "score": 0.0 } }, { "name": "_process_file_results", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 965, "end_line": 1007, "tags": { "TIER": "STANDARD", "PURPOSE": "Validates entities and calculates file scores with tier awareness.", "PRE": "Entities have been parsed from the file.", "POST": "File score is calculated and issues collected." }, "relations": [], "children": [ { "name": "validate_recursive", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 976, "end_line": 997, "tags": { "TIER": "STANDARD", "PURPOSE": "Calculate score and determine module's max tier for weighted global score", "PRE": "Entities exist", "POST": "Entities are validated" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 976 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 965 } ], "score": 0.0 } }, { "name": "_generate_artifacts", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 1009, "end_line": 1030, "tags": { "TIER": "CRITICAL", "PURPOSE": "Writes output files with tier-based compliance data.", "PRE": "Parsing and validation are complete.", "POST": "JSON and Markdown artifacts are written to disk." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1009 } ], "score": 0.0 } }, { "name": "_print_agent_report", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1032, "end_line": 1130, "tags": { "TIER": "STANDARD", "PURPOSE": "Prints a JSON report optimized for AI agent orchestration and control.", "PRE": "Validation and artifact generation are complete.", "POST": "JSON report printed to stdout." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1032 } ], "score": 0.0 } }, { "name": "_generate_report", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 1132, "end_line": 1204, "tags": { "TIER": "CRITICAL", "PURPOSE": "Generates the Markdown compliance report with severity levels.", "PRE": "File scores and issues are available.", "POST": "Markdown report is created in reports directory." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1132 } ], "score": 0.0 } }, { "name": "_collect_issues", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1206, "end_line": 1218, "tags": { "TIER": "STANDARD", "PURPOSE": "Helper to collect issues for a specific file from the entity tree.", "PRE": "entities list and file_path are valid.", "POST": "issues list is populated with compliance issues." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1206 } ], "score": 0.0 } }, { "name": "_generate_compressed_map", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 1220, "end_line": 1237, "tags": { "TIER": "CRITICAL", "PURPOSE": "Generates the token-optimized project map with enhanced Svelte details.", "PRE": "Entities have been processed.", "POST": "Markdown project map is written." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1220 } ], "score": 0.0 } }, { "name": "_write_entity_md", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 1239, "end_line": 1308, "tags": { "TIER": "CRITICAL", "PURPOSE": "Recursive helper to write entity tree to Markdown with tier badges and enhanced details.", "PRE": "f is an open file handle, entity is valid.", "POST": "Entity details are written to the file." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1239 } ], "score": 0.0 } }, { "name": "_generate_module_map", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 1310, "end_line": 1467, "tags": { "TIER": "CRITICAL", "PURPOSE": "Generates a module-centric map grouping entities by directory structure.", "PRE": "Entities have been processed.", "POST": "Markdown module map is written to .ai/MODULE_MAP.md." }, "relations": [], "children": [ { "name": "_get_module_path", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1322, "end_line": 1335, "tags": { "TIER": "STANDARD", "PURPOSE": "Extracts the module path from a file path.", "PRE": "file_path is a valid relative path.", "POST": "Returns a module path string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1322 } ], "score": 0.0 } }, { "name": "_collect_all_entities", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1337, "end_line": 1347, "tags": { "TIER": "STANDARD", "PURPOSE": "Flattens entity tree for easier grouping.", "PRE": "entity list is valid.", "POST": "Returns flat list of all entities with their hierarchy." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1337 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1310 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 839 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 839 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:get_complexity:Function] started at line 230", "severity": "ERROR", "line_number": 230 }, { "message": "Unclosed Anchor: [DEF:get_complexity:Function] started at line 230", "severity": "ERROR", "line_number": 230 }, { "message": "Unclosed Anchor: [DEF:get_complexity:Function] started at line 230", "severity": "ERROR", "line_number": 230 }, { "message": "Unclosed Anchor: [DEF:get_complexity:Function] started at line 230", "severity": "ERROR", "line_number": 230 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:has_explicit_complexity:Function] started at line 225", "severity": "ERROR", "line_number": 225 }, { "message": "Unclosed Anchor: [DEF:has_explicit_complexity:Function] started at line 225", "severity": "ERROR", "line_number": 225 }, { "message": "Unclosed Anchor: [DEF:has_explicit_complexity:Function] started at line 225", "severity": "ERROR", "line_number": 225 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:SemanticEntity:Class] started at line 192", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Unclosed Anchor: [DEF:SemanticEntity:Class] started at line 192", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 192 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 192 } ], "score": 0.0 } }, { "name": "to_dict", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "collect_recursive", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1052, "end_line": 1052, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:generate_semantic_map:Module] started at line 1", "severity": "ERROR", "line_number": 1 }, { "message": "Invalid @RELATION predicate: READS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: PRODUCES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: PRODUCES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: PRODUCES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: PRODUCES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.0 } }, { "name": "DashboardTypes", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 67, "tags": { "COMPLEXITY": "1", "PURPOSE": "TypeScript interfaces for Dashboard entities", "LAYER": "Domain" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Counter", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 17, "tags": { "COMPLEXITY": "1", "PURPOSE": "Simple counter demo component", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "state", "type": "WRITES_TO", "line": 8 } ] }, { "name": "stores_module", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 71, "tags": { "COMPLEXITY": "3", "SEMANTICS": "state, stores, svelte, plugins, tasks", "PURPOSE": "Global state management using Svelte stores.", "LAYER": "UI-State" }, "relations": [], "children": [ { "name": "plugins", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 10, "end_line": 13, "tags": { "PURPOSE": "Store for the list of available plugins." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "tasks", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 18, "tags": { "PURPOSE": "Store for the list of tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectedPlugin", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 23, "tags": { "PURPOSE": "Store for the currently selected plugin." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectedTask", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 28, "tags": { "PURPOSE": "Store for the currently selected task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "currentPage", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 33, "tags": { "PURPOSE": "Store for the current page." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "taskLogs", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 38, "tags": { "PURPOSE": "Store for the logs of the currently selected task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchPlugins", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 54, "tags": { "PURPOSE": "Fetches plugins from the API and updates the plugins store.", "PRE": "None.", "POST": "plugins store is updated with data from the API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 70, "tags": { "PURPOSE": "Fetches tasks from the API and updates the tasks store.", "PRE": "None.", "POST": "tasks store is updated with data from the API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "toasts_module", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 60, "tags": { "SEMANTICS": "notification, toast, feedback, state", "PURPOSE": "Manages toast notifications using a Svelte writable store.", "LAYER": "UI-State" }, "relations": [], "children": [ { "name": "toasts", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 8, "end_line": 11, "tags": { "PURPOSE": "Writable store containing the list of active toasts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "addToast", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 48, "tags": { "PURPOSE": "Adds a new toast message.", "PRE": "message string is provided.", "POST": "New toast is added to the store and scheduled for removal.", "PARAM": "duration (number) - Duration in ms before the toast is removed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "removeToast", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 59, "tags": { "PURPOSE": "Removes a toast message by ID.", "PRE": "id is provided.", "POST": "Toast is removed from the store.", "PARAM": "id (string) - The ID of the toast to remove." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildToastKey", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "shouldSkipDuplicateToast", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "api_module", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 383, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, client, fetch, rest", "PURPOSE": "Handles all communication with the backend API.", "LAYER": "Infra-API" }, "relations": [], "children": [ { "name": "buildApiError", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 34, "tags": { "PURPOSE": "Creates a normalized Error object for failed API responses.", "PRE": "response is a failed fetch Response object.", "POST": "Returned error contains message and status fields.", "TYPE": "{any} */ (error).error_code = String(detail.error_code);" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "notifyApiError", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 51, "tags": { "PURPOSE": "Shows toast for API errors with explicit handling of critical statuses.", "PRE": "error is an Error instance.", "POST": "User gets visible toast feedback for request failure." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "shouldSuppressApiErrorToast", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 79, "tags": { "PURPOSE": "Avoid noisy toasts for expected non-critical API failures.", "PRE": "endpoint can be empty; error can be null.", "POST": "Returns true only for explicitly allowed suppressed scenarios." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getWsUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 96, "tags": { "PURPOSE": "Returns the WebSocket URL for a specific task, with fallback logic.", "PRE": "taskId is provided.", "POST": "Returns valid WebSocket URL string.", "PARAM": "taskId (string) - The ID of the task.", "RETURN": "string - The WebSocket URL." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getAuthHeaders", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 112, "tags": { "PURPOSE": "Returns headers with Authorization if token exists." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchApi", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 138, "tags": { "PURPOSE": "Generic GET request wrapper.", "PRE": "endpoint string is provided.", "POST": "Returns Promise resolving to JSON data or throws on error.", "PARAM": "endpoint (string) - API endpoint.", "RETURN": "Promise - JSON response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchApiBlob", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 168, "tags": { "PURPOSE": "Generic GET wrapper for binary payloads.", "PRE": "endpoint string is provided.", "POST": "Returns Blob or throws on error.", "TYPE": "{any} */ (error).status = 202;" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "postApi", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 197, "tags": { "PURPOSE": "Generic POST request wrapper.", "PRE": "endpoint and body are provided.", "POST": "Returns Promise resolving to JSON data or throws on error.", "PARAM": "body (object) - Request payload.", "RETURN": "Promise - JSON response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "requestApi", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 233, "tags": { "PURPOSE": "Generic request wrapper.", "PRE": "endpoint and method are provided.", "POST": "Returns Promise resolving to JSON data or throws on error." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "api", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 235, "end_line": 381, "tags": { "PURPOSE": "API client object with specific methods." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 383 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "Utils", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 14, "tags": { "COMPLEXITY": "1", "PURPOSE": "General utility functions (class merging)", "LAYER": "Infra", "PARAM": "{...(string | undefined | null | false)} inputs", "RETURNS": "{string}" }, "relations": [], "children": [ { "name": "cn", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 11, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "authStore", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 102, "tags": { "COMPLEXITY": "3", "SEMANTICS": "auth, store, svelte, jwt, session", "PURPOSE": "Manages the global authentication state on the frontend.", "LAYER": "Feature" }, "relations": [ { "type": "MODIFIED_BY", "target": "handleLogin, handleLogout" }, { "type": "BINDS_TO", "target": "Navbar, ProtectedRoute" } ], "children": [ { "name": "AuthState", "type": "Interface", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 22, "tags": { "PURPOSE": "Defines the structure of the authentication state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "createAuthStore", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 98, "tags": { "PURPOSE": "Creates and configures the auth store with helper methods.", "PRE": "No preconditions - initialization function.", "POST": "Returns configured auth store with subscribe, setToken, setUser, logout, setLoading methods.", "RETURNS": "{Writable}" }, "relations": [], "children": [ { "name": "setToken", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 57, "tags": { "PURPOSE": "Updates the store with a new JWT token.", "PRE": "token must be a valid JWT string.", "POST": "Store updated with new token, isAuthenticated set to true.", "PARAM": "{string} token - The JWT access token." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 69, "tags": { "PURPOSE": "Sets the current user profile data.", "PRE": "User object must contain valid profile data.", "POST": "Store updated with user, isAuthenticated true, loading false.", "PARAM": "{any} user - The user profile object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "logout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 83, "tags": { "PURPOSE": "Clears authentication state and storage.", "PRE": "User is currently authenticated.", "POST": "Auth token removed from localStorage, store reset to initial state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setLoading", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 95, "tags": { "PURPOSE": "Updates the loading state.", "PRE": "None.", "POST": "Store loading state updated.", "PARAM": "{boolean} loading - Loading status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: MODIFIED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "frontend.src.lib.auth.permissions", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 103, "tags": { "COMPLEXITY": "3", "SEMANTICS": "auth, permissions, rbac, roles", "PURPOSE": "Shared frontend RBAC utilities for route guards and menu visibility.", "LAYER": "Domain", "INVARIANT": "Admin role always bypasses explicit permission checks." }, "relations": [ { "type": "USED_BY", "target": "frontend.src.components.auth.ProtectedRoute" }, { "type": "USED_BY", "target": "frontend.src.lib.components.layout.Sidebar" } ], "children": [ { "name": "normalizePermissionRequirement", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 41, "tags": { "PURPOSE": "Convert permission requirement string to canonical resource/action tuple.", "PRE": "Permission can be \"resource\" or \"resource:ACTION\" where resource itself may contain \":\".", "POST": "Returns normalized object with action in uppercase." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isAdminUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 53, "tags": { "PURPOSE": "Determine whether user has Admin role.", "PRE": "user can be null or partially populated.", "POST": "Returns true when at least one role name equals \"Admin\" (case-insensitive)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hasPermission", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 101, "tags": { "PURPOSE": "Check if user has a required resource/action permission.", "PRE": "user contains roles with permissions from /api/auth/me payload.", "POST": "Returns true when requirement is empty, user is admin, or matching permission exists." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeAction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "frontend.src.lib.auth.__tests__.permissions", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 103, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, auth, permissions, rbac", "PURPOSE": "Verifies frontend RBAC permission parsing and access checks.", "LAYER": "UI (Tests)" }, "relations": [ { "type": "TESTS", "target": "frontend/src/lib/auth/permissions.js" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "Debounce", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 25, "tags": { "COMPLEXITY": "1", "PURPOSE": "Debounce utility for limiting function execution rate", "LAYER": "Infra", "PARAM": "{number} wait - The delay in milliseconds", "RETURNS": "{Function} - The debounced function" }, "relations": [], "children": [ { "name": "debounce", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 14, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "health_store", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 82, "tags": { "COMPLEXITY": "3", "PURPOSE": "Manage dashboard health summary state and failing counts for UI badges.", "LAYER": "UI", "TYPEDEF": "{Object} HealthState", "PROPERTY": "{Date|null} lastUpdated - Last successful fetch timestamp", "PARAM": "{string|null} environmentId - Optional environment filter" }, "relations": [ { "type": "DEPENDS_ON", "target": "api.getHealthSummary" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "health", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 82, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/stores/health.js", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "createHealthStore", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "assistantChat", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 71, "tags": { "COMPLEXITY": "3", "SEMANTICS": "assistant, store, ui-state, conversation", "PURPOSE": "Control assistant chat panel visibility and active conversation binding.", "LAYER": "UI", "INVARIANT": "conversationId persists while panel toggles unless explicitly reset.", "UX_STATE": "Open -> Panel visible and interactive." }, "relations": [ { "type": "BINDS_TO", "target": "AssistantChatPanel" } ], "children": [ { "name": "toggleAssistantChat", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 32, "tags": { "PURPOSE": "Toggle assistant panel visibility.", "PRE": "Store is initialized.", "POST": "isOpen value inverted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openAssistantChat", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 45, "tags": { "PURPOSE": "Open assistant panel.", "PRE": "Store is initialized.", "POST": "isOpen = true." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeAssistantChat", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 58, "tags": { "PURPOSE": "Close assistant panel.", "PRE": "Store is initialized.", "POST": "isOpen = false." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setAssistantConversationId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 70, "tags": { "PURPOSE": "Bind current conversation id in UI state.", "PRE": "conversationId is string-like identifier.", "POST": "store.conversationId updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "taskDrawer", "type": "Store", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 164, "tags": { "COMPLEXITY": "5", "PURPOSE": "Manage Task Drawer visibility and resource-to-task mapping", "LAYER": "UI", "INVARIANT": "resourceTaskMap always reflects current task associations", "UX_STATE": "Closed -> Drawer hidden, no active task", "TEST_CONTRACT": "TaskDrawerStore ->", "TEST_FIXTURE": "valid_store_state -> {\"isOpen\": true, \"activeTaskId\": \"test_1\", \"resourceTaskMap\": {\"res1\": {\"taskId\": \"test_1\", \"status\": \"RUNNING\"}}}", "TEST_INVARIANT": "state_management -> verifies: [valid_store_state]", "PARAM": "{string} resourceId - Resource ID", "RETURNS": "{Object|null} Task info or null if no active task" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "taskDrawer", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 164, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/stores/taskDrawer.js", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "readAutoOpenTaskDrawerPreference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openDrawerForTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 53, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setTaskDrawerAutoOpenPreference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskDrawerAutoOpenPreference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openDrawerForTaskIfPreferred", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openDrawer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeDrawer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 121, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateResourceTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskForResource", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 156, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "sidebar", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 94, "tags": { "COMPLEXITY": "3", "PURPOSE": "Manage sidebar visibility and navigation state", "LAYER": "UI", "INVARIANT": "isExpanded state is always synced with localStorage", "UX_STATE": "Toggling -> Animation plays for 200ms", "PARAM": "{boolean} isOpen - Whether the mobile overlay should be open" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "sidebar", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 94, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/stores/sidebar.js", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "toggleSidebar", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setActiveItem", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 64, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setMobileOpen", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 76, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeMobile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 83, "end_line": 83, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleMobileSidebar", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 90, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "environmentContext", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 143, "tags": { "COMPLEXITY": "3", "PURPOSE": "Global selected environment context for navigation and safety cues.", "LAYER": "UI-State" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "environmentContext", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 143, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/stores/environmentContext.js", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getStoredSelectedEnvId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "persistSelectedEnvId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hasAuthToken", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveSelectedEnvId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "applySelectedEnvId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refreshEnvironmentContext", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 61, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "initializeEnvironmentContext", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setSelectedEnvironment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 124, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "activity", "type": "Store", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 33, "tags": { "COMPLEXITY": "3", "PURPOSE": "Track active task count for navbar indicator", "LAYER": "UI", "UX_STATE": "Active -> Badge shows count of running tasks" }, "relations": [ { "type": "DEPENDS_ON", "target": "WebSocket connection, taskDrawer store" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "frontend.src.lib.stores.__tests__.test_sidebar", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 142, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for sidebar store", "LAYER": "UI" }, "relations": [ { "type": "VERIFIES", "target": "frontend.src.lib.stores.sidebar" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "frontend.src.lib.stores.__tests__.sidebar", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 2, "end_line": 132, "tags": { "COMPLEXITY": "3", "SEMANTICS": "sidebar, store, tests, mobile, navigation", "PURPOSE": "Unit tests for sidebar store", "LAYER": "Domain (Tests)", "INVARIANT": "Sidebar store transitions must be deterministic across desktop/mobile toggles." }, "relations": [], "children": [ { "name": "test_sidebar_initial_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 43, "tags": { "PURPOSE": "Verify initial sidebar store values when no persisted state is available.", "TEST": "Store initializes with default values", "PRE": "No localStorage state", "POST": "Default state is { isExpanded: true, activeCategory: 'dashboards', activeItem: '/dashboards', isMobileOpen: false }" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_toggleSidebar", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 69, "tags": { "PURPOSE": "Verify desktop sidebar expansion toggles deterministically.", "TEST": "toggleSidebar toggles isExpanded state", "PRE": "Store is initialized", "POST": "isExpanded is toggled from previous value" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_setActiveItem", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 92, "tags": { "TEST": "setActiveItem updates activeCategory and activeItem", "PRE": "Store is initialized", "POST": "activeCategory and activeItem are updated" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_mobile_functions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 129, "tags": { "TEST": "Mobile functions correctly update isMobileOpen", "PRE": "Store is initialized", "POST": "isMobileOpen is correctly updated" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 2 } ], "score": 0.775 } }, { "name": "frontend.src.lib.stores.__tests__.test_activity", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 119, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for activity store", "LAYER": "UI" }, "relations": [ { "type": "VERIFIES", "target": "frontend.src.lib.stores.activity" }, { "type": "DEPENDS_ON", "target": "frontend.src.lib.stores.taskDrawer" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "setupTests", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 63, "tags": { "COMPLEXITY": "3", "PURPOSE": "Global test setup with mocks for SvelteKit modules", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "frontend.src.lib.stores.__tests__.test_taskDrawer", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 160, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task-drawer, store, mapping, tests", "PURPOSE": "Unit tests for task drawer store", "LAYER": "UI", "INVARIANT": "Store state transitions remain deterministic for open/close and task-status mapping." }, "relations": [ { "type": "VERIFIES", "target": "frontend.src.lib.stores.taskDrawer" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.lib.stores.__tests__.assistantChat", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 59, "tags": { "COMPLEXITY": "3", "SEMANTICS": "test, store, assistant, toggle, conversation", "PURPOSE": "Validate assistant chat store visibility and conversation binding transitions.", "LAYER": "UI Tests", "INVARIANT": "Each test starts from default closed state." }, "relations": [ { "type": "DEPENDS_ON", "target": "assistantChatStore" } ], "children": [ { "name": "assistantChatStore_tests", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 19, "end_line": 58, "tags": { "COMPLEXITY": "3", "PURPOSE": "Group store unit scenarios for assistant panel behavior.", "PRE": "Store can be reset to baseline state in beforeEach hook.", "POST": "Open/close/toggle/conversation transitions are validated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 19 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 19 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "navigation", "type": "Mock", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 10, "tags": { "PURPOSE": "Mock for $app/navigation in tests" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stores", "type": "Mock", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 23, "tags": { "PURPOSE": "Mock for $app/stores in tests" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "environment", "type": "Mock", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 8, "tags": { "PURPOSE": "Mock for $app/environment in tests" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_env_public", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 6, "tags": { "COMPLEXITY": "3", "PURPOSE": "Mock for $env/static/public SvelteKit module in vitest", "LAYER": "UI (Tests)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "frontend.src.lib.api.reports", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 107, "tags": { "COMPLEXITY": "5", "SEMANTICS": "frontend, api_client, reports, wrapper", "PURPOSE": "Wrapper-based reports API client for list/detail retrieval without direct native fetch usage.", "LAYER": "Infra", "INVARIANT": "Uses existing api wrapper methods and returns structured errors for UI-state mapping." }, "relations": [ { "type": "DEPENDS_ON", "target": "DEF:api_module" } ], "children": [ { "name": "buildReportQueryString", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 37, "tags": { "PURPOSE": "Build query string for reports list endpoint from filter options.", "PRE": "options is an object with optional report query fields.", "POST": "Returns URL query string without leading '?'." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeApiError", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 56, "tags": { "PURPOSE": "Convert unknown API exceptions into deterministic UI-consumable error objects.", "PRE": "error may be Error/string/object.", "POST": "Returns structured error object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getReports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 88, "tags": { "PURPOSE": "Fetch unified report list using existing request wrapper.", "PRE": "valid auth context for protected endpoint.", "POST": "Returns parsed payload or structured error for UI-state mapping.", "TEST_CONTRACT": "GetReportsApi ->", "TEST_FIXTURE": "valid_get_reports -> {\"options\": {\"page\": 1}}", "TEST_EDGE": "api_fetch_failure -> api.fetchApi throws error", "TEST_INVARIANT": "error_normalization -> verifies: [api_fetch_failure]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getReportDetail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 105, "tags": { "PURPOSE": "Fetch one report detail by report_id.", "PRE": "reportId is non-empty string; valid auth context.", "POST": "Returns parsed detail payload or structured error object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "frontend.src.lib.api.assistant", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 88, "tags": { "COMPLEXITY": "3", "SEMANTICS": "assistant, api, client, chat, confirmation", "PURPOSE": "API client wrapper for assistant chat, confirmation actions, and history retrieval.", "LAYER": "Infra-API", "INVARIANT": "All assistant requests must use requestApi wrapper (no native fetch)." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.lib.api.api_module" } ], "children": [ { "name": "sendAssistantMessage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 18, "tags": { "PURPOSE": "Send a user message to assistant orchestrator endpoint.", "PRE": "payload.message is a non-empty string.", "POST": "Returns assistant response object with deterministic state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "confirmAssistantOperation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 27, "tags": { "PURPOSE": "Confirm a pending risky assistant operation.", "PRE": "confirmationId references an existing pending token.", "POST": "Returns execution response (started/success/failed)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "cancelAssistantOperation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 36, "tags": { "PURPOSE": "Cancel a pending risky assistant operation.", "PRE": "confirmationId references an existing pending token.", "POST": "Operation is cancelled and cannot be executed by this token." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getAssistantHistory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 52, "tags": { "PURPOSE": "Retrieve paginated assistant conversation history.", "PRE": "page/pageSize are positive integers.", "POST": "Returns a paginated payload with history items." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getAssistantConversations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 77, "tags": { "PURPOSE": "Retrieve paginated conversation list for assistant sidebar/history switcher.", "PRE": "page/pageSize are positive integers.", "POST": "Returns paginated conversation summaries." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "deleteAssistantConversation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 86, "tags": { "PURPOSE": "Soft-delete or hard-delete a conversation.", "PRE": "conversationId string is provided.", "POST": "Returns success status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "frontend.src.lib.api.__tests__.reports_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 213, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, api-client, query-string, error-normalization", "PURPOSE": "Unit tests for reports API client functions: query string building, error normalization, and fetch wrappers.", "LAYER": "Infra (Tests)", "INVARIANT": "Pure functions produce deterministic output. Async wrappers propagate structured errors." }, "relations": [ { "type": "TESTS", "target": "frontend.src.lib.api.reports" } ], "children": [ { "name": "TestBuildReportQueryString", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 95, "tags": { "PURPOSE": "Validate query string construction from filter options.", "PRE": "Options object with various filter fields.", "POST": "Correct URLSearchParams string produced." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TestNormalizeApiError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 130, "tags": { "PURPOSE": "Validate error normalization for UI-state mapping.", "PRE": "Various error types (Error, string, object).", "POST": "Always returns {message, code, retryable} object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TestGetReportsAsync", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 132, "end_line": 211, "tags": { "PURPOSE": "Validate getReports and getReportDetail with mocked api.fetchApi.", "PRE": "api.fetchApi is mocked via vi.mock.", "POST": "Functions call correct endpoints and propagate results/errors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "Select", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "1", "SEMANTICS": "select, dropdown, form-field, ui-atom", "PURPOSE": "Standardized dropdown selection component.", "LAYER": "Atom" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "bindable", "type": "WRITES_TO", "line": 17 }, { "store": "props", "type": "WRITES_TO", "line": 22 } ] }, { "name": "ui", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 19, "tags": { "COMPLEXITY": "1", "SEMANTICS": "ui, components, library, atomic-design", "PURPOSE": "Central export point for standardized UI components.", "LAYER": "Atom", "INVARIANT": "All components exported here must follow Semantic Protocol." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PageHeader", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 40, "tags": { "COMPLEXITY": "1", "SEMANTICS": "page-header, layout-atom", "PURPOSE": "Standardized page header with title and action area.", "LAYER": "Atom" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "props", "type": "WRITES_TO", "line": 21 } ] }, { "name": "Card", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 51, "tags": { "COMPLEXITY": "1", "SEMANTICS": "card, container, ui-atom", "PURPOSE": "Standardized container with padding and elevation.", "LAYER": "Atom" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "props", "type": "WRITES_TO", "line": 21 } ] }, { "name": "Button", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 68, "tags": { "COMPLEXITY": "1", "SEMANTICS": "button, ui-atom, interactive", "PURPOSE": "Define component interface and default values (Svelte 5 Runes).", "LAYER": "Atom", "INVARIANT": "Supports accessible labels and keyboard navigation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 14 }, { "store": "props", "type": "WRITES_TO", "line": 31 } ] }, { "name": "Input", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 60, "tags": { "COMPLEXITY": "1", "SEMANTICS": "input, form-field, ui-atom", "PURPOSE": "Standardized text input component with label and error handling.", "LAYER": "Atom", "INVARIANT": "Consistent spacing and focus states." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 13 }, { "store": "bindable", "type": "WRITES_TO", "line": 19 }, { "store": "props", "type": "WRITES_TO", "line": 26 } ] }, { "name": "LanguageSwitcher", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 28, "tags": { "COMPLEXITY": "1", "SEMANTICS": "language-switcher, i18n-ui, ui-atom", "PURPOSE": "Dropdown component to switch between supported languages.", "LAYER": "Atom" }, "relations": [ { "type": "BINDS_TO", "target": "i18n.locale" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "locale", "type": "WRITES_TO", "line": 24 } ] }, { "name": "i18n", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 83, "tags": { "COMPLEXITY": "3", "SEMANTICS": "i18n, localization, svelte-store, translation", "PURPOSE": "Determines the starting locale.", "LAYER": "Infra", "INVARIANT": "Persistence is handled via LocalStorage.", "RETURNS": "{Locale}" }, "relations": [ { "type": "DEPENDS_ON", "target": "locales/ru.json" }, { "type": "DEPENDS_ON", "target": "locales/en.json" } ], "children": [ { "name": "locale", "type": "Store", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 44, "tags": { "PURPOSE": "Holds the current active locale string.", "SIDE_EFFECT": "Writes to LocalStorage on change." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "t", "type": "Store", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 55, "tags": { "PURPOSE": "Derived store providing the translation dictionary.", "RELATION": "BINDS_TO -> locale" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 81, "tags": { "PURPOSE": "Get translation by key path.", "PARAM": "key - Translation key path (e.g., 'nav.dashboard')", "RETURNS": "Translation string or key if not found" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "AssistantChatPanel", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 855, "tags": { "COMPLEXITY": "5", "PURPOSE": "Slide-out assistant chat panel for natural language command execution and task tracking.", "LAYER": "UI", "SEMANTICS": "assistant-chat, confirmation, long-running-task, progress-tracking", "INVARIANT": "Risky operations are executed only through explicit confirm action.", "UX_STATE": "Error -> Failed action rendered as assistant failed message.", "UX_FEEDBACK": "Started operation surfaces task_id and quick action to open task drawer.", "UX_RECOVERY": "User can retry command or action from input and action buttons.", "UX_TEST": "NeedsConfirmation -> {click: confirm action, expected: started response with task_id}", "TEST_DATA": "assistant_llm_not_configured -> {\"llmStatus\":{\"configured\":false,\"reason\":\"invalid_api_key\"}}", "TEST_CONTRACT": "Component_AssistantChatPanel ->", "TEST_FIXTURE": "chat_open -> {\"isOpen\": true, \"messages\": [{\"role\": \"assistant\", \"text\": \"Hello\"}]}", "TEST_EDGE": "llm_not_ready -> Renders LLM config warning banner", "TEST_INVARIANT": "action_handling -> verifies: [chat_open]" }, "relations": [ { "type": "BINDS_TO", "target": "assistantChatStore" }, { "type": "CALLS", "target": "frontend.src.lib.api.assistant" }, { "type": "DISPATCHES", "target": "taskDrawerStore" } ], "children": [ { "name": "loadHistory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 140, "tags": { "PURPOSE": "Load current conversation history when panel becomes visible.", "PRE": "Panel is open and history request is not already running.", "POST": "messages are populated from persisted history and conversation id is synchronized.", "SIDE_EFFECT": "Performs API call to assistant history endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadConversations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 142, "end_line": 181, "tags": { "PURPOSE": "Load paginated conversation summaries for quick switching UI.", "PRE": "Panel is open and request not already running.", "POST": "conversations list refreshed or appended based on page." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "removeConversation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 208, "tags": { "PURPOSE": "Removes a conversation from the list and deletes it from the backend.", "PRE": "conversationId string is provided.", "POST": "It is soft-deleted from the API and removed from local UI. If active, reset state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadOlderMessages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 210, "end_line": 252, "tags": { "PURPOSE": "Lazy-load older messages for active conversation when user scrolls to top.", "PRE": "History has next page and active conversation is known.", "POST": "Older messages are prepended while preserving order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "appendLocalUserMessage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 273, "end_line": 292, "tags": { "PURPOSE": "Add optimistic local user message before backend response.", "PRE": "text is non-empty command text.", "POST": "user message appears at the end of messages list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "appendAssistantResponse", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 294, "end_line": 321, "tags": { "PURPOSE": "Normalize and append assistant response payload to chat list.", "PRE": "response follows assistant message response contract.", "POST": "assistant message appended with state/task/actions metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSend", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 346, "end_line": 390, "tags": { "PURPOSE": "Submit user command to assistant orchestration API.", "PRE": "input contains a non-empty command and current request is not loading.", "POST": "assistant response is rendered and conversation id is persisted in store.", "SIDE_EFFECT": "Triggers backend command execution pipeline." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectConversation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 392, "end_line": 411, "tags": { "PURPOSE": "Switch active chat context to selected conversation item.", "PRE": "conversation carries valid conversation_id.", "POST": "conversationId updated and history reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startNewConversation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 413, "end_line": 433, "tags": { "PURPOSE": "Create local empty chat context that will be persisted on first message.", "PRE": "Panel is open.", "POST": "Messages reset and new conversation id bound." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 435, "end_line": 514, "tags": { "PURPOSE": "Execute assistant action button behavior (open task/reports, confirm, cancel).", "PRE": "action object is produced by assistant response contract.", "POST": "UI navigation or follow-up assistant response is appended.", "SIDE_EFFECT": "May navigate routes or call confirm/cancel API endpoints." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleKeydown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 516, "end_line": 529, "tags": { "PURPOSE": "Submit command by Enter while preserving multiline input with Shift+Enter.", "PRE": "Keyboard event received from chat input.", "POST": "handleSend is invoked when Enter is pressed without shift modifier." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stateClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 531, "end_line": 550, "tags": { "PURPOSE": "Map assistant state to visual badge style class.", "PRE": "state is a nullable assistant state string.", "POST": "Tailwind class string returned for badge rendering." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleHistoryScroll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 552, "end_line": 566, "tags": { "PURPOSE": "Trigger lazy history fetch when user scroll reaches top boundary.", "PRE": "Scroll event emitted by history viewport container.", "POST": "loadOlderMessages called when boundary and more pages available." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 44 }, { "store": "lib", "type": "READS_FROM", "line": 46 }, { "store": "lib", "type": "READS_FROM", "line": 47 }, { "store": "lib", "type": "READS_FROM", "line": 48 }, { "store": "lib", "type": "READS_FROM", "line": 53 }, { "store": "lib", "type": "READS_FROM", "line": 61 }, { "store": "lib", "type": "READS_FROM", "line": 62 }, { "store": "state", "type": "WRITES_TO", "line": 68 }, { "store": "state", "type": "WRITES_TO", "line": 69 }, { "store": "state", "type": "WRITES_TO", "line": 70 }, { "store": "state", "type": "WRITES_TO", "line": 71 }, { "store": "state", "type": "WRITES_TO", "line": 72 }, { "store": "state", "type": "WRITES_TO", "line": 73 }, { "store": "state", "type": "WRITES_TO", "line": 74 }, { "store": "state", "type": "WRITES_TO", "line": 75 }, { "store": "state", "type": "WRITES_TO", "line": 76 }, { "store": "state", "type": "WRITES_TO", "line": 77 }, { "store": "state", "type": "WRITES_TO", "line": 78 }, { "store": "state", "type": "WRITES_TO", "line": 79 }, { "store": "state", "type": "WRITES_TO", "line": 80 }, { "store": "state", "type": "WRITES_TO", "line": 81 }, { "store": "state", "type": "WRITES_TO", "line": 82 }, { "store": "state", "type": "WRITES_TO", "line": 83 }, { "store": "state", "type": "WRITES_TO", "line": 84 }, { "store": "state", "type": "WRITES_TO", "line": 85 }, { "store": "state", "type": "WRITES_TO", "line": 86 }, { "store": "derived", "type": "WRITES_TO", "line": 89 }, { "store": "derived", "type": "WRITES_TO", "line": 90 }, { "store": "effect", "type": "READS_FROM", "line": 254 }, { "store": "effect", "type": "READS_FROM", "line": 262 }, { "store": "t", "type": "READS_FROM", "line": 325 }, { "store": "t", "type": "READS_FROM", "line": 326 }, { "store": "t", "type": "READS_FROM", "line": 381 }, { "store": "t", "type": "READS_FROM", "line": 507 }, { "store": "t", "type": "READS_FROM", "line": 600 }, { "store": "t", "type": "WRITES_TO", "line": 606 }, { "store": "t", "type": "READS_FROM", "line": 618 }, { "store": "t", "type": "READS_FROM", "line": 622 }, { "store": "t", "type": "READS_FROM", "line": 625 }, { "store": "t", "type": "READS_FROM", "line": 628 }, { "store": "t", "type": "READS_FROM", "line": 639 }, { "store": "t", "type": "READS_FROM", "line": 645 }, { "store": "t", "type": "READS_FROM", "line": 656 }, { "store": "t", "type": "READS_FROM", "line": 665 }, { "store": "t", "type": "READS_FROM", "line": 707 }, { "store": "t", "type": "READS_FROM", "line": 722 }, { "store": "t", "type": "READS_FROM", "line": 729 }, { "store": "t", "type": "READS_FROM", "line": 735 }, { "store": "t", "type": "READS_FROM", "line": 737 }, { "store": "t", "type": "READS_FROM", "line": 738 }, { "store": "t", "type": "READS_FROM", "line": 739 }, { "store": "t", "type": "READS_FROM", "line": 756 }, { "store": "t", "type": "READS_FROM", "line": 757 }, { "store": "t", "type": "READS_FROM", "line": 765 }, { "store": "t", "type": "READS_FROM", "line": 778 }, { "store": "t", "type": "READS_FROM", "line": 784 }, { "store": "t", "type": "READS_FROM", "line": 817 }, { "store": "t", "type": "READS_FROM", "line": 821 }, { "store": "t", "type": "WRITES_TO", "line": 836 }, { "store": "t", "type": "READS_FROM", "line": 847 } ] }, { "name": "AssistantChatPanel", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 893, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/assistant/AssistantChatPanel.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "buildConversationTitle", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 323, "end_line": 323, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setConversationFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 329, "end_line": 329, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatConversationTime", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 339, "end_line": 339, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadLlmStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 572, "end_line": 572, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 893 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.lib.components.assistant.__tests__.assistant_first_message_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 178, "tags": { "COMPLEXITY": "3", "SEMANTICS": "assistant, integration-test, optimistic-message, conversation-race", "PURPOSE": "Verify first optimistic user message stays visible while a new conversation request is pending.", "LAYER": "UI Tests", "INVARIANT": "Starting a new conversation must not trigger history reload that overwrites the first local user message." }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/lib/components/assistant/AssistantChatPanel.svelte" } ], "children": [ { "name": "assistant_first_message_tests", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 123, "end_line": 177, "tags": { "COMPLEXITY": "3", "PURPOSE": "Guard optimistic first-message UX against history reload race in new conversation flow.", "PRE": "Assistant panel renders with open state and mocked network dependencies.", "POST": "First user message remains visible before pending send request resolves." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 123 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 123 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.assistant.__tests__.assistant_chat_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 103, "tags": { "COMPLEXITY": "3", "SEMANTICS": "assistant, integration-test, ux-contract, i18n", "PURPOSE": "Contract-level integration checks for assistant chat panel implementation and localization wiring.", "LAYER": "UI Tests", "INVARIANT": "Critical assistant UX states and action hooks remain present in component source.", "TEST_CONTRACT": "AssistantChatSourceArtifacts -> ContractAssertions", "TEST_SCENARIO": "assistant_contract_and_i18n_intact -> Component semantic/UX anchors and locale keys stay consistent.", "TEST_FIXTURE": "assistant_locales_en_ru -> file:src/lib/i18n/locales/en.json + file:src/lib/i18n/locales/ru.json", "TEST_EDGE": "missing_locale_key -> Missing assistant locale key in en/ru fails dictionary assertion.", "TEST_INVARIANT": "assistant_ux_contract_visible -> VERIFIED_BY: [assistant_contract_and_i18n_intact]" }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/lib/components/assistant/AssistantChatPanel.svelte" } ], "children": [ { "name": "readJson", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 40, "tags": { "PURPOSE": "Read and parse JSON fixture file from disk.", "PRE": "filePath points to existing UTF-8 JSON file.", "POST": "Returns parsed object representation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "assistant_chat_contract_tests", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 102, "tags": { "PURPOSE": "Validate assistant chat component contract and locale integration without DOM runtime dependency.", "PRE": "Component and locale files exist in expected paths.", "POST": "Contract checks guarantee assistant UI anchors and i18n wiring remain intact.", "UX_STATE": "Error');", "UX_FEEDBACK": "Started operation surfaces task_id');", "UX_RECOVERY": "User can retry command');" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "HealthMatrix", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 81, "tags": { "COMPLEXITY": "3", "PURPOSE": "Visual grid/matrix representing the health status of dashboards.", "LAYER": "UI/Component", "UX_STATE": "Error -> Displays an error message with a retry option.", "UX_REATIVITY": "State: $state, Derived: $derived.", "TYPE": "{{" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.75 }, "data_flow": [ { "store": "state", "type": "READS_FROM", "line": 9 }, { "store": "derived", "type": "READS_FROM", "line": 9 }, { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "props", "type": "WRITES_TO", "line": 29 }, { "store": "derived", "type": "WRITES_TO", "line": 32 }, { "store": "t", "type": "WRITES_TO", "line": 44 }, { "store": "t", "type": "WRITES_TO", "line": 51 }, { "store": "t", "type": "WRITES_TO", "line": 56 }, { "store": "t", "type": "WRITES_TO", "line": 61 }, { "store": "t", "type": "WRITES_TO", "line": 66 }, { "store": "t", "type": "READS_FROM", "line": 72 } ] }, { "name": "PolicyForm", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 195, "tags": { "COMPLEXITY": "3", "PURPOSE": "Form for creating and editing validation policies.", "LAYER": "UI/Component", "UX_STATE": "Submitting -> Disables inputs and shows a loading state.", "UX_FEEDBACK": "Error -> Shows error messages on invalid fields.", "UX_REATIVITY": "State: $state, Derived: $derived.", "TYPE": "{{ policy: any, environments: any[], onSave: (p: any) => void, onCancel: () => void }} */" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.75 }, "data_flow": [ { "store": "state", "type": "READS_FROM", "line": 10 }, { "store": "derived", "type": "READS_FROM", "line": 10 }, { "store": "props", "type": "WRITES_TO", "line": 14 }, { "store": "state", "type": "WRITES_TO", "line": 37 }, { "store": "state", "type": "WRITES_TO", "line": 38 }, { "store": "effect", "type": "READS_FROM", "line": 40 }, { "store": "derived", "type": "WRITES_TO", "line": 60 }, { "store": "derived", "type": "WRITES_TO", "line": 69 } ] }, { "name": "PolicyForm", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 195, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/health/PolicyForm.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getSafePolicy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSafeEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildFormData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSubmit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleDay", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ReportCard", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 101, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, card, type-profile, accessibility, fallback", "PURPOSE": "Render one report with explicit textual type label and profile-driven visual variant.", "LAYER": "UI", "INVARIANT": "Unknown task type always uses fallback profile.", "UX_STATE": "Ready -> Card displays summary/status/type.", "UX_RECOVERY": "Missing fields are rendered with explicit placeholder text.", "TEST_CONTRACT": "Component_ReportCard ->", "TEST_FIXTURE": "valid_report_card -> {\"report\": {\"task_type\": \"migration\", \"status\": \"success\", \"summary\": \"Test\", \"updated_at\": \"2024-01-01\"}}", "TEST_EDGE": "random_status -> {\"report\": {\"status\": \"unknown_status_code\"}}", "TEST_INVARIANT": "render_resilience -> verifies: [valid_report_card, empty_report_object, random_status]" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/components/reports/reportTypeProfiles.js" }, { "type": "DEPENDS_ON", "target": "frontend/src/lib/i18n/index.ts" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 31 }, { "store": "props", "type": "WRITES_TO", "line": 34 }, { "store": "derived", "type": "WRITES_TO", "line": 36 }, { "store": "derived", "type": "WRITES_TO", "line": 37 }, { "store": "t", "type": "WRITES_TO", "line": 54 }, { "store": "t", "type": "WRITES_TO", "line": 55 }, { "store": "t", "type": "WRITES_TO", "line": 56 }, { "store": "t", "type": "WRITES_TO", "line": 57 }, { "store": "t", "type": "READS_FROM", "line": 58 }, { "store": "t", "type": "READS_FROM", "line": 62 }, { "store": "t", "type": "READS_FROM", "line": 64 }, { "store": "t", "type": "WRITES_TO", "line": 78 }, { "store": "t", "type": "WRITES_TO", "line": 78 }, { "store": "t", "type": "WRITES_TO", "line": 78 }, { "store": "t", "type": "READS_FROM", "line": 85 }, { "store": "t", "type": "READS_FROM", "line": 96 } ] }, { "name": "ReportCard", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 101, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/reports/ReportCard.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getStatusClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 53, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 61, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onSelect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 68, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ReportsList", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 49, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, list, card, unified, mixed-types", "PURPOSE": "Render unified list of normalized reports with canonical minimum fields.", "LAYER": "UI", "INVARIANT": "Every rendered row shows task_type label, status, summary, and updated_at.", "UX_STATE": "Ready -> Mixed-type list visible and scannable.", "UX_FEEDBACK": "Click on report emits select event.", "UX_RECOVERY": "Unknown/missing values rendered with explicit placeholders.", "TEST_CONTRACT": "Component_ReportsList ->", "TEST_FIXTURE": "renders_list -> {\"reports\": [{\"report_id\": \"1\", \"task_type\": \"migration\", \"status\": \"success\"}, {\"report_id\": \"2\", \"task_type\": \"backup\", \"status\": \"failed\"}], \"selectedReportId\": \"2\"}", "TEST_EDGE": "empty_list -> {\"reports\": []}", "TEST_INVARIANT": "correct_iteration -> verifies: [renders_list, empty_list]" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/i18n/index.ts" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 32 } ] }, { "name": "ReportsList", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 49, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/reports/ReportsList.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleSelect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.lib.components.reports.reportTypeProfiles", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 73, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, ui, profiles, fallback, mapping", "PURPOSE": "Deterministic mapping from report task_type to visual profile with one fallback.", "LAYER": "UI", "INVARIANT": "Unknown type always resolves to fallback profile." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/i18n/index.ts" } ], "children": [ { "name": "getReportTypeProfile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 71, "tags": { "PURPOSE": "Resolve visual profile by task type with guaranteed fallback.", "PRE": "taskType may be known/unknown/empty.", "POST": "Returns one profile object.", "TEST_CONTRACT": "GetReportTypeProfileModel ->", "TEST_FIXTURE": "valid_type -> {\"taskType\": \"migration\"}", "TEST_EDGE": "invalid_type -> {\"taskType\": \"invalid\"}", "TEST_INVARIANT": "fallbacks_to_unknown -> verifies: [invalid_type]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "ReportDetailPanel", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 107, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, detail, diagnostics, next-actions, placeholders", "PURPOSE": "Display detailed report context with diagnostics and actionable recovery guidance.", "LAYER": "UI", "INVARIANT": "Failed/partial reports surface actionable hints when available.", "UX_STATE": "Ready -> Report detail content visible.", "UX_RECOVERY": "Failed/partial report shows next actions and placeholder-safe diagnostics.", "TEST_CONTRACT": "Component_ReportDetailPanel ->", "TEST_FIXTURE": "valid_detail -> {\"detail\": {\"report\": {\"report_id\": \"1\", \"task_type\": \"migration\", \"status\": \"success\", \"summary\": \"Done\"}, \"diagnostics\": {\"time\": 123}, \"next_actions\": []}}", "TEST_EDGE": "detail_with_error_context -> {\"detail\": {\"report\": {\"error_context\": {\"next_actions\": [\"Retry\"]}}}}", "TEST_INVARIANT": "render_resilience -> verifies: [valid_detail, no_detail_prop, detail_with_error_context]" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/i18n/index.ts" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 30 }, { "store": "props", "type": "WRITES_TO", "line": 32 }, { "store": "t", "type": "READS_FROM", "line": 36 }, { "store": "t", "type": "READS_FROM", "line": 42 }, { "store": "t", "type": "READS_FROM", "line": 44 }, { "store": "t", "type": "READS_FROM", "line": 51 }, { "store": "t", "type": "WRITES_TO", "line": 55 }, { "store": "t", "type": "WRITES_TO", "line": 59 }, { "store": "t", "type": "WRITES_TO", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 67 }, { "store": "t", "type": "WRITES_TO", "line": 71 }, { "store": "t", "type": "WRITES_TO", "line": 75 }, { "store": "t", "type": "READS_FROM", "line": 82 }, { "store": "t", "type": "READS_FROM", "line": 86 }, { "store": "t", "type": "READS_FROM", "line": 95 } ] }, { "name": "ReportDetailPanel", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 107, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/reports/ReportDetailPanel.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "notProvided", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.lib.components.reports.__tests__.reports_filter_performance", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 48, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, performance, filtering", "PURPOSE": "Guard test for report filter responsiveness on moderate in-memory dataset.", "LAYER": "UI (Tests)" }, "relations": [ { "type": "TESTS", "target": "frontend/src/routes/reports/+page.svelte" } ], "children": [ { "name": "applyFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 10, "end_line": 10, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "makeDataset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.reports.__tests__.reports_page.integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 40, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, integration, mixed-types, rendering", "PURPOSE": "Integration-style checks for unified mixed-type reports rendering expectations.", "LAYER": "UI (Tests)", "INVARIANT": "Mixed fixture includes all supported report types in one list." }, "relations": [ { "type": "TESTS", "target": "frontend/src/routes/reports/+page.svelte" }, { "type": "TESTS", "target": "frontend/src/lib/components/reports/ReportsList.svelte" } ], "children": [ { "name": "collectVisibleTypeLabels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 13, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "frontend.src.lib.components.reports.__tests__.report_type_profiles", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, type-profiles, fallback", "PURPOSE": "Validate report type profile mapping and unknown fallback behavior.", "LAYER": "UI (Tests)", "INVARIANT": "Unknown task_type always resolves to the fallback profile." }, "relations": [ { "type": "TESTS", "target": "frontend/src/lib/components/reports/reportTypeProfiles.js" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.reports.__tests__.reports_list.ux", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 4, "end_line": 10, "tags": { "COMPLEXITY": "3", "SEMANTICS": "reports, list, ux-tests, events, iteration", "PURPOSE": "Test ReportsList component iteration and event forwarding.", "LAYER": "UI" }, "relations": [ { "type": "VERIFIES", "target": "../ReportsList.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 4 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.reports.__tests__.report_card.ux", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 4, "end_line": 109, "tags": { "COMPLEXITY": "3", "SEMANTICS": "reports, ux-tests, card, states, recovery", "PURPOSE": "Test UX states and transitions for ReportCard component", "LAYER": "UI", "INVARIANT": "Each test asserts at least one observable UX contract outcome.", "TEST_CONTRACT": "ReportCardInputProps -> ObservableUXOutput", "TEST_SCENARIO": "ready_state_shows_summary_status_type -> Ready state renders summary/status/type labels.", "TEST_FIXTURE": "valid_report_card -> INLINE_JSON", "TEST_EDGE": "missing_optional_fields -> Partial report keeps component interactive and emits select.", "TEST_INVARIANT": "report_card_state_is_observable -> VERIFIED_BY: [ready_state_shows_summary_status_type, empty_report_object, random_status]", "UX_STATE": "Ready -> Card displays summary/status/type.", "UX_FEEDBACK": "Click on report emits select event.", "UX_RECOVERY": "Missing fields are rendered with explicit placeholder text." }, "relations": [ { "type": "VERIFIES", "target": "../ReportCard.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 4 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.reports.__tests__.report_detail.ux", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 4, "end_line": 74, "tags": { "COMPLEXITY": "3", "SEMANTICS": "reports, ux-tests, detail, diagnostics, recovery", "PURPOSE": "Test UX states and recovery for ReportDetailPanel component", "LAYER": "UI", "INVARIANT": "Detail UX tests keep placeholder-safe rendering and recovery visibility verifiable.", "UX_STATE": "Ready -> Report detail content visible.", "UX_RECOVERY": "Failed/partial report shows next actions and placeholder-safe diagnostics." }, "relations": [ { "type": "VERIFIES", "target": "../ReportDetailPanel.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 4 } ], "score": 0.775 } }, { "name": "frontend.src.lib.components.reports.__tests__.report_detail.integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 45, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, detail, recovery-guidance, integration", "PURPOSE": "Validate detail-panel behavior for failed reports and recovery guidance visibility.", "LAYER": "UI (Tests)", "INVARIANT": "Failed report detail exposes actionable next actions when available." }, "relations": [ { "type": "TESTS", "target": "frontend/src/lib/components/reports/ReportDetailPanel.svelte" }, { "type": "TESTS", "target": "frontend/src/routes/reports/+page.svelte" } ], "children": [ { "name": "buildFailedDetailFixture", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 13, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "reports.fixtures", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 90, "tags": { "COMPLEXITY": "3", "SEMANTICS": "reports, fixtures, test-data", "PURPOSE": "Shared frontend fixtures for unified reports states.", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "Sidebar", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 329, "tags": { "COMPLEXITY": "5", "PURPOSE": "Persistent left sidebar with resource categories navigation", "LAYER": "UI", "SEMANTICS": "Navigation", "INVARIANT": "Always shows active category and item", "UX_STATE": "Toggling -> Animation plays for 200ms", "UX_FEEDBACK": "Active item highlighted with different background", "UX_RECOVERY": "Click outside on mobile closes overlay", "TEST_CONTRACT": "Component_Sidebar ->", "TEST_FIXTURE": "idle_state -> {}", "TEST_EDGE": "mobile_open -> shows mobile overlay mask", "TEST_INVARIANT": "navigation -> verifies: [idle_state]" }, "relations": [ { "type": "BINDS_TO", "target": "sidebarStore" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 31 }, { "store": "lib", "type": "READS_FROM", "line": 38 }, { "store": "lib", "type": "READS_FROM", "line": 39 }, { "store": "lib", "type": "READS_FROM", "line": 41 }, { "store": "lib", "type": "READS_FROM", "line": 42 }, { "store": "lib", "type": "READS_FROM", "line": 43 }, { "store": "app", "type": "READS_FROM", "line": 44 }, { "store": "lib", "type": "READS_FROM", "line": 45 }, { "store": "derived", "type": "WRITES_TO", "line": 52 }, { "store": "derived", "type": "WRITES_TO", "line": 59 }, { "store": "derived", "type": "WRITES_TO", "line": 60 }, { "store": "derived", "type": "WRITES_TO", "line": 63 }, { "store": "derived", "type": "WRITES_TO", "line": 64 }, { "store": "derived", "type": "WRITES_TO", "line": 65 }, { "store": "state", "type": "WRITES_TO", "line": 66 }, { "store": "effect", "type": "READS_FROM", "line": 85 }, { "store": "effect", "type": "READS_FROM", "line": 98 }, { "store": "effect", "type": "READS_FROM", "line": 105 }, { "store": "effect", "type": "READS_FROM", "line": 165 } ] }, { "name": "Sidebar", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 329, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/layout/Sidebar.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "withExpandedCategory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 68, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleExpandedCategory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 74, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleItemClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 119, "end_line": 119, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCategoryToggle", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 128, "end_line": 128, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSubItemClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 144, "end_line": 144, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleToggleClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 153, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleOverlayClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 159, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 329 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "TopNavbar", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 569, "tags": { "COMPLEXITY": "5", "PURPOSE": "Unified top navigation bar with Logo, Search, Activity, and User menu", "LAYER": "UI", "SEMANTICS": "Navigation, UserSession", "INVARIANT": "Always visible on non-login pages", "UX_STATE": "SearchFocused -> Search input expands", "UX_FEEDBACK": "Activity badge shows count of running tasks", "UX_RECOVERY": "Click outside closes dropdowns", "UX_TEST": "ActivityClick -> {click: activity button, expected: task drawer opens}", "TEST_CONTRACT": "Component_TopNavbar ->", "TEST_FIXTURE": "logged_in -> {\"user\": {\"username\": \"admin\"}}", "TEST_EDGE": "network_down -> search fetch fails, handles error state", "TEST_INVARIANT": "ui_consistency -> verifies: [logged_in]" }, "relations": [ { "type": "BINDS_TO", "target": "activityStore, authStore" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 34 }, { "store": "app", "type": "READS_FROM", "line": 35 }, { "store": "lib", "type": "READS_FROM", "line": 36 }, { "store": "lib", "type": "READS_FROM", "line": 37 }, { "store": "lib", "type": "READS_FROM", "line": 38 }, { "store": "lib", "type": "READS_FROM", "line": 44 }, { "store": "lib", "type": "READS_FROM", "line": 45 }, { "store": "lib", "type": "READS_FROM", "line": 46 }, { "store": "lib", "type": "READS_FROM", "line": 47 }, { "store": "lib", "type": "READS_FROM", "line": 48 }, { "store": "lib", "type": "READS_FROM", "line": 49 }, { "store": "lib", "type": "READS_FROM", "line": 50 }, { "store": "lib", "type": "READS_FROM", "line": 51 }, { "store": "lib", "type": "READS_FROM", "line": 57 }, { "store": "state", "type": "WRITES_TO", "line": 60 }, { "store": "state", "type": "WRITES_TO", "line": 61 }, { "store": "state", "type": "WRITES_TO", "line": 62 }, { "store": "state", "type": "WRITES_TO", "line": 63 }, { "store": "state", "type": "WRITES_TO", "line": 64 }, { "store": "state", "type": "WRITES_TO", "line": 65 }, { "store": "derived", "type": "WRITES_TO", "line": 78 }, { "store": "derived", "type": "WRITES_TO", "line": 79 }, { "store": "derived", "type": "WRITES_TO", "line": 80 }, { "store": "derived", "type": "WRITES_TO", "line": 81 }, { "store": "derived", "type": "WRITES_TO", "line": 82 }, { "store": "derived", "type": "WRITES_TO", "line": 85 }, { "store": "derived", "type": "WRITES_TO", "line": 88 }, { "store": "derived", "type": "WRITES_TO", "line": 91 }, { "store": "derived", "type": "WRITES_TO", "line": 92 }, { "store": "t", "type": "READS_FROM", "line": 229 }, { "store": "t", "type": "READS_FROM", "line": 236 }, { "store": "t", "type": "READS_FROM", "line": 243 }, { "store": "t", "type": "READS_FROM", "line": 250 }, { "store": "t", "type": "WRITES_TO", "line": 373 }, { "store": "t", "type": "READS_FROM", "line": 388 }, { "store": "t", "type": "WRITES_TO", "line": 400 }, { "store": "t", "type": "READS_FROM", "line": 412 }, { "store": "t", "type": "READS_FROM", "line": 416 }, { "store": "t", "type": "WRITES_TO", "line": 459 }, { "store": "t", "type": "WRITES_TO", "line": 460 }, { "store": "t", "type": "WRITES_TO", "line": 484 }, { "store": "t", "type": "WRITES_TO", "line": 485 }, { "store": "t", "type": "WRITES_TO", "line": 498 }, { "store": "t", "type": "WRITES_TO", "line": 518 }, { "store": "t", "type": "READS_FROM", "line": 536 }, { "store": "t", "type": "READS_FROM", "line": 551 }, { "store": "t", "type": "READS_FROM", "line": 562 } ] }, { "name": "TopNavbar", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 569, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/layout/TopNavbar.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "toggleUserMenu", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 97, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeUserMenu", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleLogout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 106, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleActivityClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 112, "end_line": 112, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAssistantClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 123, "end_line": 123, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hydrateTaskDrawerPreference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 127, "end_line": 127, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearchFocus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 140, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearSearchState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 145, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDocumentClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 151, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleHamburgerClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGlobalEnvironmentChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 166, "end_line": 166, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildSearchResultSections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 173, "end_line": 173, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "triggerSearch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 257, "end_line": 257, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearchInput", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 309, "end_line": 309, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openSearchResult", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 319, "end_line": 319, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearchKeydown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 332, "end_line": 332, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 569 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "Breadcrumbs", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 187, "tags": { "COMPLEXITY": "3", "PURPOSE": "Display page hierarchy navigation", "LAYER": "UI", "INVARIANT": "Always shows current page path", "UX_STATE": "Idle -> Breadcrumbs showing current path", "UX_FEEDBACK": "Hover on breadcrumb shows clickable state", "UX_RECOVERY": "Click breadcrumb to navigate", "PARAM": "{string} segment - URL segment", "RETURNS": "{string} Formatted label" }, "relations": [ { "type": "DEPENDS_ON", "target": "page store" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 15 }, { "store": "lib", "type": "READS_FROM", "line": 17 }, { "store": "lib", "type": "READS_FROM", "line": 18 }, { "store": "props", "type": "WRITES_TO", "line": 20 }, { "store": "derived", "type": "WRITES_TO", "line": 24 } ] }, { "name": "Breadcrumbs", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 187, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/layout/Breadcrumbs.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getBreadcrumbs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatBreadcrumbLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getCrumbMeta", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskDrawer", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 844, "tags": { "COMPLEXITY": "5", "PURPOSE": "Global task drawer for monitoring background operations", "LAYER": "UI", "SEMANTICS": "TaskLogViewer", "INVARIANT": "Drawer shows logs for active task or remains closed", "UX_STATE": "InputRequired -> Interactive form rendered in drawer", "UX_FEEDBACK": "Back button returns to task list", "UX_RECOVERY": "Back button shows task list when viewing task details", "TEST_DATA": "llm_task_success_with_pass_result -> {\"activeTaskDetails\":{\"plugin_id\":\"llm_dashboard_validation\",\"status\":\"SUCCESS\",\"result\":{\"status\":\"PASS\"}}}", "TEST_CONTRACT": "Component_TaskDrawer ->", "TEST_FIXTURE": "init_state -> {}", "TEST_EDGE": "empty_task_list -> displays \\\"No recent tasks\\\"", "TEST_INVARIANT": "default_rendering -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "taskDrawerStore, assistantChatStore, WebSocket" } ], "children": [ { "name": "disconnectWebSocket", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 430, "end_line": 444, "tags": { "PURPOSE": "Disconnects the active WebSocket connection", "PRE": "ws may or may not be initialized", "POST": "ws is closed and set to null", "COMPLEXITY": "3" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 430 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 430 } ], "score": 0.5499999999999999 } }, { "name": "loadRecentTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 446, "end_line": 469, "tags": { "PURPOSE": "Load recent tasks for list mode display", "PRE": "User is on task drawer or api is ready.", "POST": "recentTasks array populated with task list" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 471, "end_line": 484, "tags": { "PURPOSE": "Select a task from list to view details", "PRE": "task is a valid task object", "POST": "drawer state updated to show task details" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goBackToList", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 486, "end_line": 503, "tags": { "PURPOSE": "Return to task list view from task details", "PRE": "Drawer is open and activeTaskId is set", "POST": "Drawer switches to list view and reloads tasks", "COMPLEXITY": "3" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 486 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 486 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 40 }, { "store": "lib", "type": "READS_FROM", "line": 41 }, { "store": "lib", "type": "READS_FROM", "line": 45 }, { "store": "lib", "type": "READS_FROM", "line": 46 }, { "store": "lib", "type": "READS_FROM", "line": 47 }, { "store": "lib", "type": "READS_FROM", "line": 48 }, { "store": "state", "type": "WRITES_TO", "line": 52 }, { "store": "state", "type": "WRITES_TO", "line": 53 }, { "store": "state", "type": "WRITES_TO", "line": 54 }, { "store": "state", "type": "WRITES_TO", "line": 55 }, { "store": "state", "type": "WRITES_TO", "line": 56 }, { "store": "state", "type": "WRITES_TO", "line": 59 }, { "store": "state", "type": "WRITES_TO", "line": 60 }, { "store": "state", "type": "WRITES_TO", "line": 61 }, { "store": "derived", "type": "WRITES_TO", "line": 66 }, { "store": "derived", "type": "WRITES_TO", "line": 67 }, { "store": "derived", "type": "WRITES_TO", "line": 68 }, { "store": "derived", "type": "WRITES_TO", "line": 69 }, { "store": "derived", "type": "WRITES_TO", "line": 74 }, { "store": "t", "type": "READS_FROM", "line": 174 }, { "store": "t", "type": "READS_FROM", "line": 261 }, { "store": "t", "type": "READS_FROM", "line": 261 }, { "store": "t", "type": "READS_FROM", "line": 261 }, { "store": "t", "type": "READS_FROM", "line": 261 }, { "store": "t", "type": "READS_FROM", "line": 273 }, { "store": "t", "type": "READS_FROM", "line": 284 }, { "store": "t", "type": "READS_FROM", "line": 284 }, { "store": "t", "type": "READS_FROM", "line": 284 }, { "store": "t", "type": "READS_FROM", "line": 298 }, { "store": "t", "type": "READS_FROM", "line": 325 }, { "store": "t", "type": "READS_FROM", "line": 336 }, { "store": "t", "type": "READS_FROM", "line": 347 }, { "store": "t", "type": "READS_FROM", "line": 379 }, { "store": "effect", "type": "READS_FROM", "line": 506 }, { "store": "derived", "type": "WRITES_TO", "line": 530 }, { "store": "derived", "type": "WRITES_TO", "line": 531 }, { "store": "t", "type": "WRITES_TO", "line": 550 }, { "store": "t", "type": "WRITES_TO", "line": 567 }, { "store": "t", "type": "READS_FROM", "line": 573 }, { "store": "t", "type": "READS_FROM", "line": 573 }, { "store": "t", "type": "READS_FROM", "line": 607 }, { "store": "t", "type": "WRITES_TO", "line": 612 }, { "store": "t", "type": "READS_FROM", "line": 632 }, { "store": "t", "type": "READS_FROM", "line": 656 }, { "store": "t", "type": "READS_FROM", "line": 674 }, { "store": "t", "type": "READS_FROM", "line": 677 }, { "store": "t", "type": "READS_FROM", "line": 685 }, { "store": "t", "type": "READS_FROM", "line": 692 }, { "store": "t", "type": "READS_FROM", "line": 701 }, { "store": "t", "type": "READS_FROM", "line": 705 }, { "store": "t", "type": "READS_FROM", "line": 712 }, { "store": "t", "type": "READS_FROM", "line": 732 }, { "store": "t", "type": "READS_FROM", "line": 738 }, { "store": "t", "type": "READS_FROM", "line": 768 }, { "store": "t", "type": "READS_FROM", "line": 785 }, { "store": "t", "type": "WRITES_TO", "line": 793 }, { "store": "t", "type": "READS_FROM", "line": 794 }, { "store": "t", "type": "READS_FROM", "line": 829 }, { "store": "t", "type": "READS_FROM", "line": 840 } ] }, { "name": "TaskDrawer", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 845, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/layout/TaskDrawer.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleClose", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goToReportsPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 90, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGlobalKeydown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 95, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeTaskId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isTaskFinished", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 113, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveLlmValidationStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "llmValidationBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 131, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 141, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stopTaskDetailsPolling", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 154, "end_line": 154, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadEnvironmentOptions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveEnvironmentName", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 171, "end_line": 171, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveEnvironmentId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 177, "end_line": 177, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeSupersetBaseUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 187, "end_line": 187, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveSupersetDashboardUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 196, "end_line": 196, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadActiveTaskDetails", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 204, "end_line": 204, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extractPrimaryDashboardId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 219, "end_line": 219, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildTaskSummary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 238, "end_line": 238, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleOpenDashboardDeepLink", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 322, "end_line": 322, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleShowDiff", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 344, "end_line": 344, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleOpenLlmReport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 375, "end_line": 375, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "connectWebSocket", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 392, "end_line": 392, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 845 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.lib.components.layout.sidebarNavigation", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 172, "tags": { "COMPLEXITY": "3", "SEMANTICS": "navigation, sidebar, rbac, menu, filtering", "PURPOSE": "Build sidebar navigation categories filtered by current user permissions.", "LAYER": "UI", "INVARIANT": "Admin role can access all categories and subitems through permission utility." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.lib.auth.permissions.hasPermission" }, { "type": "USED_BY", "target": "frontend.src.lib.components.layout.Sidebar" } ], "children": [ { "name": "isItemAllowed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 24, "tags": { "PURPOSE": "Check whether a single menu node can be shown for a given user.", "PRE": "item can contain optional requiredPermission/requiredAction.", "POST": "Returns true when no permission is required or permission check passes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildSidebarCategories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 170, "tags": { "PURPOSE": "Build translated sidebar categories and filter them by RBAC permissions.", "PRE": "i18nState provides nav labels; user can be null.", "POST": "Returns only categories/subitems available for provided user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_breadcrumbs.svelte", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 105, "tags": { "PURPOSE": "Auto-generated module for frontend/src/lib/components/layout/__tests__/test_breadcrumbs.svelte.js", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getBreadcrumbs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatBreadcrumbLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 47, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.lib.components.layout.__tests__.sidebarNavigation", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 99, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, sidebar, navigation, rbac, permissions", "PURPOSE": "Verifies RBAC-based sidebar category and subitem visibility.", "LAYER": "UI (Tests)" }, "relations": [ { "type": "TESTS", "target": "frontend/src/lib/components/layout/sidebarNavigation.js" } ], "children": [ { "name": "makeUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "ErrorPage", "type": "Page", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 24, "tags": { "COMPLEXITY": "3", "PURPOSE": "Global error page displaying HTTP status and messages", "LAYER": "UI", "UX_STATE": "Error -> Displays error code and message with home link" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RootLayoutConfig", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 9, "tags": { "COMPLEXITY": "1", "PURPOSE": "Root layout configuration (SPA mode)", "LAYER": "Infra" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "HomePage", "type": "Page", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 95, "tags": { "COMPLEXITY": "5", "PURPOSE": "Redirect to preferred start page from profile settings with safe dashboards fallback.", "LAYER": "UI", "INVARIANT": "Redirect target resolves to one of /dashboards, /datasets, /reports.", "UX_STATE": "Loading -> Shows loading indicator", "UX_FEEDBACK": "Redirects to preferred start page", "TEST_CONTRACT": "Page_Home ->", "TEST_FIXTURE": "init_state -> {}", "TEST_INVARIANT": "correct_redirect -> verifies: [init_state]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 95, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "normalizeStartPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveStartPagePath", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "redirectToStartPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "load", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 3, "end_line": 23, "tags": { "PURPOSE": "Loads initial plugin data for the dashboard.", "PRE": "None.", "POST": "Returns an object with plugins or an error message.", "TYPE": "{import('./$types').PageLoad} */" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "layout", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 16, "end_line": 100, "tags": { "COMPLEXITY": "3", "SEMANTICS": "app-layout, auth-gating, navigation-shell", "PURPOSE": "Bind global layout shell and conditional login/full-app rendering.", "LAYER": "UI", "INVARIANT": "Login route bypasses shell; all other routes are wrapped by ProtectedRoute." }, "relations": [ { "type": "BINDS_TO", "target": "frontend.src.lib.components.layout.Sidebar" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "DatasetHub", "type": "Page", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 958, "tags": { "COMPLEXITY": "5", "PURPOSE": "Dataset Hub - Dedicated hub for datasets with mapping progress", "LAYER": "UI", "INVARIANT": "Always shows datasets for the active environment from context store", "UX_STATE": "BulkAction-Modal -> Map Columns or Generate Docs modal open", "UX_FEEDBACK": "Floating panel slides up from bottom when items selected", "UX_RECOVERY": "Refresh button reloads dataset list", "TEST_CONTRACT": "Page_DatasetHub ->", "TEST_FIXTURE": "init_state -> {}", "TEST_EDGE": "multi_selection -> sets `isAllSelected`/`isAllVisibleSelected` properly and shows bottom panel", "TEST_INVARIANT": "dataset_grid_and_selection -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "sidebarStore, taskDrawerStore" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 958, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/datasets/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "loadDatasets", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 109, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePageChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 170, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePageSizeChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 176, "end_line": 176, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateSelectionState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCheckboxChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 193, "end_line": 193, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 204, "end_line": 204, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectVisible", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 228, "end_line": 228, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 239, "end_line": 239, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkMapColumns", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 259, "end_line": 259, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkGenerateDocs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 324, "end_line": 324, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTaskStatusClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 358, "end_line": 358, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskStatusIcon", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 368, "end_line": 368, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getMappingProgressClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 385, "end_line": 385, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 958 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "DatasetDetail", "type": "Page", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 402, "tags": { "COMPLEXITY": "5", "PURPOSE": "Dataset Detail View - Shows detailed dataset information with columns, SQL, and linked dashboards", "LAYER": "UI", "INVARIANT": "Always shows dataset details when loaded", "UX_STATE": "Error -> Shows error banner with retry button", "UX_FEEDBACK": "Clicking linked dashboard navigates to dashboard detail", "UX_RECOVERY": "Refresh button reloads dataset details", "TEST_CONTRACT": "Page_DatasetDetail ->", "TEST_FIXTURE": "init_state -> {\"id\": \"1\"}", "TEST_EDGE": "server_error -> shows error block with the refresh button", "TEST_INVARIANT": "fetching_detail -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "sidebarStore" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 402, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/datasets/[id]/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "loadDatasetDetail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "navigateToDashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goBack", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getColumnTypeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getMappingProgress", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 109, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 402 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "UnifiedReportsPage", "type": "Component", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 223, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, unified, filters, loading, empty, error", "PURPOSE": "Unified reports page with filtering and resilient UX states for mixed task types.", "LAYER": "UI", "INVARIANT": "List state remains deterministic for active filter set.", "UX_STATE": "Error -> Inline error with retry preserving filters.", "UX_FEEDBACK": "Filter change reloads list immediately.", "UX_RECOVERY": "Retry and clear filters actions available.", "TEST_CONTRACT": "Page_Reports ->", "TEST_FIXTURE": "init_state -> {}", "TEST_EDGE": "empty_filtered_list -> displays \\\"No results matching filters\\\"", "TEST_INVARIANT": "pagination_and_filtering -> verifies: [init_state]" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/api/reports.js" }, { "type": "DEPENDS_ON", "target": "frontend/src/lib/components/reports/ReportsList.svelte" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @UX_REACTIVITY (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 37 }, { "store": "lib", "type": "READS_FROM", "line": 38 }, { "store": "lib", "type": "READS_FROM", "line": 39 }, { "store": "lib", "type": "READS_FROM", "line": 40 }, { "store": "lib", "type": "READS_FROM", "line": 41 }, { "store": "t", "type": "READS_FROM", "line": 55 }, { "store": "t", "type": "READS_FROM", "line": 57 }, { "store": "t", "type": "READS_FROM", "line": 58 }, { "store": "t", "type": "READS_FROM", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 130 }, { "store": "t", "type": "READS_FROM", "line": 161 }, { "store": "t", "type": "READS_FROM", "line": 168 }, { "store": "t", "type": "READS_FROM", "line": 177 }, { "store": "t", "type": "READS_FROM", "line": 188 }, { "store": "t", "type": "READS_FROM", "line": 188 }, { "store": "t", "type": "READS_FROM", "line": 195 }, { "store": "t", "type": "READS_FROM", "line": 201 }, { "store": "t", "type": "READS_FROM", "line": 206 } ] }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 223, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/reports/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "buildQuery", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadReports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hasActiveFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 98, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onFilterChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onSelectReport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 118, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 411, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/reports/llm/[taskId]/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatMs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getDashboardCheckResult", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getCheckResultClasses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadReport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backToReports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 99, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openTaskDetails", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 103, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "cleanupScreenshotBlobUrls", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadScreenshotBlobUrls", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openScreenshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 145, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 411 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.routes.reports.llm.taskid.report_page_contract_test", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "3", "SEMANTICS": "llm-report, svelte-effect, screenshot-loading, regression-test", "PURPOSE": "Protect the LLM report page from self-triggering screenshot load effects.", "LAYER": "UI Tests" }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/routes/reports/llm/[taskId" } ], "children": [ { "name": "llm_report_screenshot_effect_contract", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 17, "end_line": 31, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure screenshot loading stays untracked from blob-url mutation state.", "PRE": "Report page source exists.", "POST": "Contract fails if screenshot loading effect can subscribe to screenshotBlobUrls updates." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 17 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 17 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "LoginPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 160, "tags": { "COMPLEXITY": "3", "SEMANTICS": "login, auth, ui, form", "PURPOSE": "Provides the user interface for local and ADFS authentication.", "LAYER": "UI", "INVARIANT": "Shows both local login form and ADFS SSO button." }, "relations": [ { "type": "USES", "target": "authStore" }, { "type": "CALLS", "target": "api.auth.login" } ], "children": [ { "name": "handleLogin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 77, "tags": { "PURPOSE": "Submits the local login form to the backend.", "PRE": "Username and password are not empty.", "POST": "User is authenticated and redirected on success." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleADFSLogin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 86, "tags": { "PURPOSE": "Redirects the user to the ADFS login endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.49999999999999994 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 17 }, { "store": "lib", "type": "READS_FROM", "line": 18 }, { "store": "t", "type": "WRITES_TO", "line": 33 }, { "store": "t", "type": "WRITES_TO", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 68 }, { "store": "t", "type": "WRITES_TO", "line": 71 }, { "store": "auth", "type": "READS_FROM", "line": 89 }, { "store": "t", "type": "WRITES_TO", "line": 97 }, { "store": "t", "type": "WRITES_TO", "line": 107 }, { "store": "t", "type": "WRITES_TO", "line": 118 }, { "store": "t", "type": "READS_FROM", "line": 133 }, { "store": "t", "type": "READS_FROM", "line": 133 }, { "store": "t", "type": "WRITES_TO", "line": 143 }, { "store": "t", "type": "READS_FROM", "line": 152 } ] }, { "name": "StorageIndexPage", "type": "Page", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 16, "tags": { "COMPLEXITY": "1", "PURPOSE": "Redirect to the backups page as the default storage view.", "LAYER": "Page", "INVARIANT": "Always redirects to /storage/backups." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StorageReposPage", "type": "Page", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 183, "tags": { "UX_STATE": "Idle -> Showing dashboard grid with actions.", "UX_FEEDBACK": "Toast -> Error messages on fetch failure.", "UX_RECOVERY": "Environment Selection -> Switch environment to retry loading." }, "relations": [], "children": [ { "name": "fetchEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 61, "tags": { "PURPOSE": "Fetches the list of available environments.", "PRE": "None.", "POST": "environments array is populated, selectedEnvId is set to first env if available." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 98, "tags": { "PURPOSE": "Fetches dashboards for a specific environment.", "PRE": "envId is a valid environment ID.", "POST": "dashboards array is populated with metadata for the selected environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filterDashboardsWithRepositories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 138, "tags": { "PURPOSE": "Keep only dashboards that already have initialized Git repositories.", "PRE": "dashboards list is loaded for selected environment.", "POST": "Returns dashboards with status != NO_REPO." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub", "type": "Page", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 2858, "tags": { "COMPLEXITY": "5", "PURPOSE": "Dashboard Hub - Central hub for managing dashboards with Git status and task actions", "LAYER": "UI", "INVARIANT": "Always shows dashboards for the active environment from context store", "UX_STATE": "BulkAction-Modal -> Migration or Backup modal open", "UX_FEEDBACK": "Floating panel slides up from bottom when items selected", "UX_RECOVERY": "Refresh button reloads dashboard list", "UX_REATIVITY": "State: $state, Derived: $derived. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 export let.", "TEST_CONTRACT": "Page_DashboardHub ->", "TEST_FIXTURE": "init_state -> {}", "TEST_EDGE": "bulk_git_actions -> verifies modal functionality when triggered", "TEST_INVARIANT": "rendering_and_selection -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "sidebarStore, taskDrawerStore" } ], "children": [ { "name": "DashboardHub.normalizeTaskStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 173, "end_line": 186, "tags": { "PURPOSE": "Normalize raw task status to stable lowercase token for UI.", "PRE": "status can be enum-like string or null.", "POST": "returns null or normalized token without enum namespace." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.normalizeValidationStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 188, "end_line": 203, "tags": { "PURPOSE": "Normalize validation status to pass/fail/warn/unknown.", "PRE": "status can be any scalar.", "POST": "returns one of pass|fail|warn|unknown." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getValidationBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 205, "end_line": 219, "tags": { "PURPOSE": "Map validation level to badge class tuple.", "PRE": "level in pass|fail|warn|unknown.", "POST": "returns deterministic tailwind class string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getValidationLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 234, "tags": { "PURPOSE": "Map normalized validation level to compact UI label.", "PRE": "level in pass|fail|warn|unknown.", "POST": "returns uppercase status label." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.normalizeOwners", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 236, "end_line": 272, "tags": { "PURPOSE": "Normalize owners payload to unique non-empty display labels.", "PRE": "owners can be null, list of strings, or list of user objects.", "POST": "Returns owner labels preserving source order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.loadDashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 274, "end_line": 476, "tags": { "PURPOSE": "Load full dashboard dataset for current environment and hydrate grid projection.", "PRE": "selectedEnv is not null.", "POST": "allDashboards, dashboards, pagination and selection state are synchronized.", "UX_STATE": "Error -> `error` populated when request fails." }, "relations": [], "children": [ { "name": "DashboardHub.handleTemporaryShowAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 396, "end_line": 408, "tags": { "PURPOSE": "Temporarily disable profile-default dashboard filter for current page context.", "PRE": "Dashboards list is loaded in dashboards_main context.", "POST": "Next request is sent with override_show_all=true." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.handleRestoreProfileFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 410, "end_line": 422, "tags": { "PURPOSE": "Re-enable persisted profile-default filtering after temporary override.", "PRE": "Current page is in override mode.", "POST": "Next request is sent with override_show_all=false." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 478, "end_line": 491, "tags": { "PURPOSE": "Convert ISO timestamp to locale date string.", "PRE": "value may be null or invalid date string.", "POST": "returns formatted date or \"-\"." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getGitSummaryLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 493, "end_line": 511, "tags": { "PURPOSE": "Compute stable text label for git state column.", "PRE": "dashboard has git projection fields.", "POST": "returns localized summary string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getLlmSummaryLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 513, "end_line": 525, "tags": { "PURPOSE": "Compute normalized LLM validation summary label.", "PRE": "dashboard may have null lastTask.", "POST": "returns UNKNOWN fallback for missing status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getColumnCellValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 527, "end_line": 544, "tags": { "PURPOSE": "Resolve comparable/filterable display value for any grid column.", "PRE": "column belongs to filterable column set.", "POST": "returns non-empty scalar display value." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getFilterOptions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 546, "end_line": 561, "tags": { "PURPOSE": "Build unique sorted value list for a column filter dropdown.", "PRE": "allDashboards is hydrated.", "POST": "returns de-duplicated sorted options." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getVisibleFilterOptions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 563, "end_line": 576, "tags": { "PURPOSE": "Apply in-dropdown search over full filter options.", "PRE": "columnFilterSearch contains search token for column.", "POST": "returns subset for current filter popover list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.toggleFilterDropdown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 578, "end_line": 607, "tags": { "PURPOSE": "Toggle active column filter popover.", "PRE": "column is valid filter key.", "POST": "openFilterColumn updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.toggleFilterValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 609, "end_line": 627, "tags": { "PURPOSE": "Add/remove specific filter value and reapply projection.", "PRE": "value comes from option list of the same column.", "POST": "columnFilters updated and grid reprojected from page 1." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.clearColumnFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 629, "end_line": 641, "tags": { "PURPOSE": "Reset selected values for one column.", "PRE": "column is valid filter key.", "POST": "filter cleared and projection refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.selectAllColumnFilterValues", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 643, "end_line": 658, "tags": { "PURPOSE": "Select all currently visible values in filter popover.", "PRE": "visible options computed for current search token.", "POST": "column filter equals current visible option set." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.updateColumnFilterSearch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 660, "end_line": 670, "tags": { "PURPOSE": "Update local search token for one filter popover.", "PRE": "value is text from input.", "POST": "columnFilterSearch updated immutably." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.hasColumnFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 672, "end_line": 682, "tags": { "PURPOSE": "Determine if column has active selected values.", "PRE": "column is valid filter key.", "POST": "returns boolean activation marker." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.doesDashboardPassColumnFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 684, "end_line": 701, "tags": { "PURPOSE": "Evaluate dashboard row against all active column filters.", "PRE": "dashboard contains projected values for each filterable column.", "POST": "returns true only when row matches every active filter." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getSortValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 703, "end_line": 721, "tags": { "PURPOSE": "Compute stable comparable sort key for chosen column.", "PRE": "column belongs to sortable set.", "POST": "returns string/number key suitable for deterministic comparison." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.handleSort", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 723, "end_line": 740, "tags": { "PURPOSE": "Toggle or switch sort order and reapply grid projection.", "PRE": "column belongs to sortable set.", "POST": "sortColumn/sortDirection updated and page reset to 1." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.getSortIndicator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 742, "end_line": 753, "tags": { "PURPOSE": "Return visual indicator for active/inactive sort header.", "PRE": "column belongs to sortable set.", "POST": "returns one of \u2195 | \u2191 | \u2193." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardHub.applyGridTransforms", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 755, "end_line": 782, "tags": { "PURPOSE": "Apply search + column filters + sort + pagination to grid data.", "PRE": "allDashboards is current source collection.", "POST": "filteredDashboards/dashboards/total/totalPages are synchronized.", "UX_STATE": "Loaded -> visible rows reflect all active controls deterministically." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 2858, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/dashboards/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleDocumentClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 158, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeTaskStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 179, "end_line": 179, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeValidationStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 194, "end_line": 194, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getValidationBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 211, "end_line": 211, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getValidationLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 227, "end_line": 227, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeOwners", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 242, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadDashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 282, "end_line": 282, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 378, "end_line": 378, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePageChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 383, "end_line": 383, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePageSizeChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 390, "end_line": 390, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTemporaryShowAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 402, "end_line": 402, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleRestoreProfileFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 416, "end_line": 416, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateSelectionState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 425, "end_line": 425, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "replaceSelectedIds", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 434, "end_line": 434, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearSelectedIds", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 439, "end_line": 439, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCheckboxChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 444, "end_line": 444, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 455, "end_line": 455, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectVisible", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 466, "end_line": 466, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 484, "end_line": 484, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getGitSummaryLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 499, "end_line": 499, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getLlmSummaryLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 519, "end_line": 519, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getColumnCellValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 533, "end_line": 533, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getFilterOptions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 552, "end_line": 552, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getVisibleFilterOptions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 569, "end_line": 569, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleFilterDropdown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 584, "end_line": 584, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleFilterValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 615, "end_line": 615, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearColumnFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 635, "end_line": 635, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectAllColumnFilterValues", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 649, "end_line": 649, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateColumnFilterSearch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 666, "end_line": 666, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hasColumnFilter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 678, "end_line": 678, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "doesDashboardPassColumnFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 690, "end_line": 690, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSortValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 709, "end_line": 709, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSort", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 729, "end_line": 729, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSortIndicator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 748, "end_line": 748, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "applyGridTransforms", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 762, "end_line": 762, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleActionDropdown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 785, "end_line": 785, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeActionDropdown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 792, "end_line": 792, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 797, "end_line": 797, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleValidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 837, "end_line": 837, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTargetEnvChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 875, "end_line": 875, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadDatabases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 888, "end_line": 888, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleMappingUpdate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 906, "end_line": 906, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadDbMappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 913, "end_line": 913, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "calculateDryRun", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 944, "end_line": 944, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkMigrate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 995, "end_line": 995, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkBackup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1041, "end_line": 1041, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTaskStatusClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1077, "end_line": 1077, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "navigateToDashboardDetail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1086, "end_line": 1086, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1095, "end_line": 1095, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isGitBusy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1107, "end_line": 1107, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setGitBusy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1111, "end_line": 1111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ensureGitConfigs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1120, "end_line": 1120, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateDashboardGitState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1126, "end_line": 1126, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeRepositoryStatusPayload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1139, "end_line": 1139, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDashboardGitStatusesBatch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1176, "end_line": 1176, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refreshDashboardGitState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1232, "end_line": 1232, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hydrateVisibleGitStatusesBatch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1236, "end_line": 1236, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitInit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1249, "end_line": 1249, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitSync", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1285, "end_line": 1285, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitCommit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1298, "end_line": 1298, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitPull", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1326, "end_line": 1326, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitPush", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1340, "end_line": 1340, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskStatusIcon", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1355, "end_line": 1355, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getPaginationRange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1376, "end_line": 1376, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEnvironmentCreated", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1459, "end_line": 1459, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 2858 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.routes.dashboards.__tests__.dashboard_profile_override_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 288, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, dashboards, profile-filter, override, restore", "PURPOSE": "Verifies temporary show-all override and restore-on-return behavior for profile-default dashboard filtering.", "LAYER": "UI (Tests)", "TYPE": "{any} */ (initializeEnvironmentContext);" }, "relations": [ { "type": "TESTS", "target": "frontend/src/routes/dashboards/+page.svelte" } ], "children": [ { "name": "buildFilteredResponse", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildUnfilteredResponse", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 149, "end_line": 149, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "HealthCenterPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 233, "tags": { "COMPLEXITY": "3", "PURPOSE": "Main page for the Dashboard Health Center.", "LAYER": "UI/Page", "UX_STATE": "Error -> Displays an error message.", "UX_REACTIVITY": "State: $state, Derived: $derived." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.lib.components.health.HealthMatrix" }, { "type": "CALLS", "target": "frontend.src.lib.api.api_module" } ], "children": [ { "name": "loadData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 62, "tags": { "PURPOSE": "Load health summary rows and environment options for the current filter.", "PRE": "Page is mounted or environment selection changed.", "POST": "`healthData` and `environments` reflect latest backend response.", "SIDE_EFFECT": "Calls backend API endpoints for health summary and environments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEnvChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 76, "tags": { "PURPOSE": "Apply environment filter and trigger health summary reload.", "PRE": "DOM change event carries target value.", "POST": "selectedEnvId is updated and new data load starts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteReport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 104, "tags": { "PURPOSE": "Delete one health report row with confirmation and optimistic button lock.", "PRE": "item contains `record_id` from health summary payload.", "POST": "Row is removed from backend and page data is reloaded on success.", "SIDE_EFFECT": "Calls DELETE health API and emits toast notifications." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "state", "type": "READS_FROM", "line": 11 }, { "store": "derived", "type": "READS_FROM", "line": 11 }, { "store": "lib", "type": "READS_FROM", "line": 15 }, { "store": "lib", "type": "READS_FROM", "line": 16 }, { "store": "lib", "type": "READS_FROM", "line": 17 }, { "store": "lib", "type": "READS_FROM", "line": 18 }, { "store": "lib", "type": "READS_FROM", "line": 19 }, { "store": "state", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 29 }, { "store": "state", "type": "WRITES_TO", "line": 30 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "t", "type": "READS_FROM", "line": 85 }, { "store": "t", "type": "READS_FROM", "line": 92 }, { "store": "t", "type": "READS_FROM", "line": 96 }, { "store": "t", "type": "READS_FROM", "line": 96 }, { "store": "t", "type": "WRITES_TO", "line": 110 }, { "store": "t", "type": "WRITES_TO", "line": 111 }, { "store": "t", "type": "WRITES_TO", "line": 115 }, { "store": "t", "type": "WRITES_TO", "line": 122 }, { "store": "t", "type": "READS_FROM", "line": 133 }, { "store": "t", "type": "WRITES_TO", "line": 149 }, { "store": "t", "type": "WRITES_TO", "line": 155 }, { "store": "t", "type": "WRITES_TO", "line": 156 }, { "store": "t", "type": "WRITES_TO", "line": 157 }, { "store": "t", "type": "WRITES_TO", "line": 158 }, { "store": "t", "type": "WRITES_TO", "line": 159 }, { "store": "t", "type": "WRITES_TO", "line": 161 }, { "store": "t", "type": "READS_FROM", "line": 180 }, { "store": "t", "type": "WRITES_TO", "line": 214 }, { "store": "t", "type": "READS_FROM", "line": 222 } ] }, { "name": "frontend.src.routes.dashboards.health.__tests__.health_page_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 43, "tags": { "COMPLEXITY": "3", "SEMANTICS": "health-page, integration-test, slug-link, delete-flow", "PURPOSE": "Lock dashboard health page contract for slug navigation and report deletion.", "LAYER": "UI Tests" }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/routes/dashboards/health/+page.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "DashboardDetail", "type": "Page", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 1056, "tags": { "COMPLEXITY": "5", "PURPOSE": "Dashboard Detail View - Overview of charts and datasets linked to a dashboard", "LAYER": "UI", "INVARIANT": "Shows dashboard metadata, charts, and datasets for selected environment", "TEST_DATA": "llm_unconfigured -> {\"llmStatus\":{\"configured\":false,\"reason\":\"invalid_api_key\"}}", "TEST_CONTRACT": "Page_DashboardDetail ->", "TEST_FIXTURE": "init_state -> {\"id\": \"1\", \"env_id\": \"env1\"}", "TEST_INVARIANT": "dashboard_fetching -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "dashboard detail API" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 1056, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/dashboards/[id]/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "loadDashboardPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 91, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadDashboardDetail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadTaskHistory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 121, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "releaseThumbnailUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 138, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadThumbnail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 145, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runBackupTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 170, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runLlmValidationTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 199, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openLlmReport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 238, "end_line": 238, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toTaskTypeLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 247, "end_line": 247, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskStatusClasses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 254, "end_line": 254, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getValidationStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 266, "end_line": 266, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getValidationStatusClasses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 283, "end_line": 283, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goBack", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 293, "end_line": 293, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openDataset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 297, "end_line": 297, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 301, "end_line": 301, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadLlmStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 308, "end_line": 308, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "hasGitRepository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 319, "end_line": 319, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveGitSyncState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 325, "end_line": 325, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "allChangedFiles", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 350, "end_line": 350, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "countChangedByAnyPath", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 358, "end_line": 358, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getGitStatusMeta", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 364, "end_line": 364, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadGitStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 408, "end_line": 408, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadGitDiffPreview", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 436, "end_line": 436, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runGitSyncAndOpenCommit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 458, "end_line": 458, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runGitPull", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 477, "end_line": 477, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runGitPush", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 491, "end_line": 491, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBranchChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 505, "end_line": 505, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 1056 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "AdminRolesPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 238, "tags": { "COMPLEXITY": "3", "SEMANTICS": "admin, role-management, rbac", "PURPOSE": "UI for managing system roles and their permissions.", "LAYER": "Domain", "INVARIANT": "Only accessible by users with Admin role." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.services.adminService" }, { "type": "DEPENDS_ON", "target": "frontend.src.components.auth.ProtectedRoute" } ], "children": [ { "name": "loadData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 57, "tags": { "PURPOSE": "Fetches roles and available permissions.", "PRE": "Component mounted.", "POST": "roles and permissions arrays populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openCreateModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 72, "tags": { "PURPOSE": "Initializes state for creating a new role.", "PRE": "None.", "POST": "showModal is true, roleForm is reset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openEditModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 91, "tags": { "PURPOSE": "Initializes state for editing an existing role.", "PRE": "role object is provided.", "POST": "showModal is true, roleForm is populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSaveRole", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 115, "tags": { "PURPOSE": "Submits role data (create or update).", "PRE": "roleForm contains valid data.", "POST": "Role is saved, modal closed, data reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteRole", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 117, "end_line": 136, "tags": { "PURPOSE": "Deletes a role after confirmation.", "PRE": "role object is provided.", "POST": "Role is deleted if confirmed, data reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 16 }, { "store": "t", "type": "WRITES_TO", "line": 51 }, { "store": "t", "type": "READS_FROM", "line": 111 }, { "store": "t", "type": "READS_FROM", "line": 124 }, { "store": "t", "type": "READS_FROM", "line": 132 }, { "store": "t", "type": "WRITES_TO", "line": 145 }, { "store": "t", "type": "READS_FROM", "line": 150 }, { "store": "t", "type": "READS_FROM", "line": 155 }, { "store": "t", "type": "WRITES_TO", "line": 163 }, { "store": "t", "type": "WRITES_TO", "line": 164 }, { "store": "t", "type": "WRITES_TO", "line": 165 }, { "store": "t", "type": "WRITES_TO", "line": 166 }, { "store": "t", "type": "WRITES_TO", "line": 184 }, { "store": "t", "type": "WRITES_TO", "line": 185 }, { "store": "t", "type": "READS_FROM", "line": 198 }, { "store": "t", "type": "READS_FROM", "line": 198 }, { "store": "t", "type": "WRITES_TO", "line": 205 }, { "store": "t", "type": "WRITES_TO", "line": 209 }, { "store": "t", "type": "WRITES_TO", "line": 213 }, { "store": "t", "type": "WRITES_TO", "line": 215 }, { "store": "t", "type": "WRITES_TO", "line": 223 }, { "store": "t", "type": "WRITES_TO", "line": 226 }, { "store": "t", "type": "WRITES_TO", "line": 227 } ] }, { "name": "AdminUsersPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 285, "tags": { "SEMANTICS": "admin, user-management, rbac", "PURPOSE": "UI for managing system users and their roles.", "LAYER": "Feature", "INVARIANT": "Only accessible by users with \"admin:users\" permission." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.services.adminService" }, { "type": "DEPENDS_ON", "target": "frontend.src.components.auth.ProtectedRoute" } ], "children": [ { "name": "loadData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 59, "tags": { "PURPOSE": "Fetches users and roles from the backend.", "PRE": "Component mounted.", "POST": "users and roles arrays populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openCreateModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 72, "tags": { "PURPOSE": "Prepares the form for creating a new user.", "POST": "showModal is true, isEditing is false, userForm is reset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openEditModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 93, "tags": { "PURPOSE": "Prepares the form for editing an existing user.", "PRE": "user object must be valid.", "POST": "showModal is true, isEditing is true, userForm populated with user data.", "PARAM": "{Object} user - The user object to edit." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSaveUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 122, "tags": { "PURPOSE": "Submits user data to the backend (create or update).", "PRE": "userForm must be valid.", "POST": "User created or updated, modal closed, data reloaded.", "SIDE_EFFECT": "Triggers API call to adminService.", "RELATION": "CALLS -> adminService.updateUser" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 150, "tags": { "PURPOSE": "Deletes a user after confirmation.", "PRE": "user object must be valid.", "POST": "User deleted if confirmed, data reloaded.", "SIDE_EFFECT": "Triggers API call to adminService.", "RELATION": "CALLS -> adminService.deleteUser", "PARAM": "{Object} user - The user to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 15 }, { "store": "t", "type": "WRITES_TO", "line": 53 }, { "store": "t", "type": "READS_FROM", "line": 118 }, { "store": "t", "type": "READS_FROM", "line": 135 }, { "store": "t", "type": "READS_FROM", "line": 144 }, { "store": "t", "type": "WRITES_TO", "line": 159 }, { "store": "t", "type": "READS_FROM", "line": 164 }, { "store": "t", "type": "WRITES_TO", "line": 170 }, { "store": "t", "type": "WRITES_TO", "line": 174 }, { "store": "t", "type": "WRITES_TO", "line": 182 }, { "store": "t", "type": "WRITES_TO", "line": 183 }, { "store": "t", "type": "WRITES_TO", "line": 184 }, { "store": "t", "type": "WRITES_TO", "line": 185 }, { "store": "t", "type": "WRITES_TO", "line": 186 }, { "store": "t", "type": "WRITES_TO", "line": 187 }, { "store": "t", "type": "READS_FROM", "line": 211 }, { "store": "t", "type": "READS_FROM", "line": 211 }, { "store": "t", "type": "WRITES_TO", "line": 216 }, { "store": "t", "type": "WRITES_TO", "line": 222 }, { "store": "t", "type": "WRITES_TO", "line": 222 }, { "store": "t", "type": "READS_FROM", "line": 236 }, { "store": "t", "type": "READS_FROM", "line": 236 }, { "store": "t", "type": "WRITES_TO", "line": 243 }, { "store": "t", "type": "WRITES_TO", "line": 247 }, { "store": "t", "type": "WRITES_TO", "line": 251 }, { "store": "t", "type": "WRITES_TO", "line": 254 }, { "store": "t", "type": "WRITES_TO", "line": 260 }, { "store": "t", "type": "WRITES_TO", "line": 264 }, { "store": "t", "type": "WRITES_TO", "line": 270 }, { "store": "t", "type": "WRITES_TO", "line": 273 }, { "store": "t", "type": "WRITES_TO", "line": 274 } ] }, { "name": "AdminSettingsPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 363, "tags": { "COMPLEXITY": "3", "SEMANTICS": "admin, adfs, mappings, configuration, logging", "PURPOSE": "UI for configuring Active Directory Group to local Role mappings for ADFS SSO and logging settings.", "LAYER": "Feature", "INVARIANT": "Only accessible by users with \"admin:settings\" permission." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.services.adminService" }, { "type": "DEPENDS_ON", "target": "frontend.src.components.auth.ProtectedRoute" } ], "children": [ { "name": "loadData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 76, "tags": { "PURPOSE": "Fetches AD mappings and roles from the backend to populate the UI.", "PRE": "Component is mounted and user has active session.", "POST": "mappings and roles variables are updated with backend data.", "RETURNS": "{Promise}", "SIDE_EFFECT": "Updates local 'mappings', 'roles', 'loading', and 'error' states.", "RELATION": "CALLS -> adminService.getADGroupMappings" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreateMapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 111, "tags": { "PURPOSE": "Submits a new AD Group to Role mapping to the backend.", "PRE": "'newMapping' object contains valid 'ad_group' and 'role_id'.", "POST": "A new mapping is created in the database and the table is refreshed.", "RETURNS": "{Promise}", "SIDE_EFFECT": "Closes the modal on success, shows alert on failure.", "RELATION": "CALLS -> adminService.createADGroupMapping" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadLoggingConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 138, "tags": { "PURPOSE": "Fetches current logging configuration from the backend.", "PRE": "Component is mounted and user has active session.", "POST": "loggingConfig variable is updated with backend data.", "RETURNS": "{Promise}", "RELATION": "CALLS -> adminService.getLoggingConfig" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "saveLoggingConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 168, "tags": { "PURPOSE": "Saves logging configuration to the backend.", "PRE": "loggingConfig contains valid values.", "POST": "Configuration is saved and feedback is shown.", "RETURNS": "{Promise}", "RELATION": "CALLS -> adminService.updateLoggingConfig" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 16 }, { "store": "t", "type": "WRITES_TO", "line": 70 }, { "store": "t", "type": "READS_FROM", "line": 92 }, { "store": "t", "type": "READS_FROM", "line": 105 }, { "store": "t", "type": "READS_FROM", "line": 106 }, { "store": "t", "type": "READS_FROM", "line": 160 }, { "store": "t", "type": "READS_FROM", "line": 161 }, { "store": "t", "type": "WRITES_TO", "line": 180 }, { "store": "t", "type": "READS_FROM", "line": 185 }, { "store": "t", "type": "WRITES_TO", "line": 191 }, { "store": "t", "type": "WRITES_TO", "line": 195 }, { "store": "t", "type": "WRITES_TO", "line": 203 }, { "store": "t", "type": "WRITES_TO", "line": 204 }, { "store": "t", "type": "READS_FROM", "line": 225 }, { "store": "t", "type": "WRITES_TO", "line": 237 }, { "store": "t", "type": "WRITES_TO", "line": 241 }, { "store": "t", "type": "WRITES_TO", "line": 247 }, { "store": "t", "type": "WRITES_TO", "line": 257 }, { "store": "t", "type": "WRITES_TO", "line": 261 }, { "store": "t", "type": "WRITES_TO", "line": 271 }, { "store": "t", "type": "READS_FROM", "line": 283 }, { "store": "t", "type": "WRITES_TO", "line": 286 }, { "store": "t", "type": "READS_FROM", "line": 294 }, { "store": "t", "type": "READS_FROM", "line": 294 }, { "store": "t", "type": "WRITES_TO", "line": 297 }, { "store": "t", "type": "WRITES_TO", "line": 308 }, { "store": "t", "type": "WRITES_TO", "line": 314 }, { "store": "t", "type": "WRITES_TO", "line": 320 }, { "store": "t", "type": "WRITES_TO", "line": 323 }, { "store": "t", "type": "WRITES_TO", "line": 326 }, { "store": "t", "type": "WRITES_TO", "line": 333 }, { "store": "t", "type": "READS_FROM", "line": 345 }, { "store": "t", "type": "READS_FROM", "line": 351 } ] }, { "name": "LLMSettingsPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 315, "tags": { "COMPLEXITY": "3", "SEMANTICS": "admin, llm, settings, provider, configuration", "PURPOSE": "Admin settings page for LLM provider configuration.", "LAYER": "UI" }, "relations": [ { "type": "CALLS", "target": "frontend/src/components/llm/ProviderConfig.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "t", "type": "READS_FROM", "line": 112 }, { "store": "t", "type": "READS_FROM", "line": 115 }, { "store": "t", "type": "WRITES_TO", "line": 126 }, { "store": "t", "type": "READS_FROM", "line": 128 }, { "store": "t", "type": "READS_FROM", "line": 142 }, { "store": "t", "type": "READS_FROM", "line": 145 }, { "store": "t", "type": "READS_FROM", "line": 152 }, { "store": "t", "type": "WRITES_TO", "line": 159 }, { "store": "t", "type": "READS_FROM", "line": 170 }, { "store": "t", "type": "WRITES_TO", "line": 176 }, { "store": "t", "type": "READS_FROM", "line": 185 }, { "store": "t", "type": "READS_FROM", "line": 188 }, { "store": "t", "type": "READS_FROM", "line": 195 }, { "store": "t", "type": "WRITES_TO", "line": 202 }, { "store": "t", "type": "READS_FROM", "line": 211 }, { "store": "t", "type": "READS_FROM", "line": 219 }, { "store": "t", "type": "WRITES_TO", "line": 226 }, { "store": "t", "type": "READS_FROM", "line": 237 }, { "store": "t", "type": "WRITES_TO", "line": 244 }, { "store": "t", "type": "READS_FROM", "line": 257 }, { "store": "t", "type": "READS_FROM", "line": 260 }, { "store": "t", "type": "READS_FROM", "line": 267 }, { "store": "t", "type": "READS_FROM", "line": 279 }, { "store": "t", "type": "READS_FROM", "line": 291 }, { "store": "t", "type": "READS_FROM", "line": 308 } ] }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 315, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/admin/settings/llm/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "isMultimodalModel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 47, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getProviderById", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 61, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchProviders", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "saveSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 91, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 315 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "MigrationDashboard", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 456, "tags": { "PURPOSE": "Orchestrate migration UI workflow and route user actions to backend APIs and task store.", "PRE": "API client and component dependencies are available; i18n store is initialized.", "POST": "User can progress through selection, dry-run, migration start, and task resume flows.", "SIDE_EFFECT": "Performs HTTP requests, mutates local UI state, updates selectedTask store.", "DATA_CONTRACT": "DashboardSelection -> MigrationDryRunResult | Task DTO (from /tasks endpoints)" }, "relations": [], "children": [ { "name": "fetchEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 120, "tags": { "PURPOSE": "Fetches the list of environments from the API.", "PRE": "None.", "POST": "environments state is updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 143, "tags": { "PURPOSE": "Fetches dashboards for the selected source environment.", "PRE": "envId is a valid environment ID.", "PARAM": "envId The environment ID.", "POST": "dashboards state is updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ReactiveDashboardFetch", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 159, "tags": { "PURPOSE": "Automatically fetch dashboards when the source environment is changed.", "PRE": "sourceEnvId is not empty.", "POST": "fetchDashboards is called with the new sourceEnvId.", "UX_STATE": "[Loading] -> Triggered when sourceEnvId changes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDatabases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 207, "tags": { "PURPOSE": "Fetches databases from both environments and gets suggestions.", "PRE": "sourceEnvId and targetEnvId must be set.", "POST": "sourceDatabases, targetDatabases, mappings, and suggestions are updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleMappingUpdate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 209, "end_line": 248, "tags": { "PURPOSE": "Saves a mapping to the backend.", "PRE": "event.detail contains sourceUuid and targetUuid.", "POST": "Mapping is saved and local mappings list is updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleViewLogs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 250, "end_line": 262, "tags": { "PURPOSE": "Opens the log viewer for a specific task.", "PRE": "event.detail contains task object.", "POST": "logViewer state updated and showLogViewer set to true." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePasswordPrompt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 264, "end_line": 298, "tags": { "PURPOSE": "Reactive logic to show password prompt when a task is awaiting input.", "PRE": "selectedTask status is AWAITING_INPUT.", "POST": "showPasswordPrompt set to true with request data." }, "relations": [], "children": [ { "name": "ReactivePasswordPrompt", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 273, "end_line": 297, "tags": { "PURPOSE": "Monitor selected task for input requests and trigger password prompt.", "PRE": "$selectedTask is not null and status is AWAITING_INPUT.", "POST": "showPasswordPrompt is set to true if input_request is database_password.", "UX_STATE": "[AwaitingInput] -> Password prompt modal is displayed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleResumeMigration", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 300, "end_line": 321, "tags": { "PURPOSE": "Resumes a migration task with provided passwords.", "PRE": "event.detail contains passwords.", "POST": "resumeTask is called and showPasswordPrompt is hidden on success." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startMigration", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 323, "end_line": 398, "tags": { "PURPOSE": "Initiates the migration process by sending the selection to the backend.", "PRE": "sourceEnvId and targetEnvId are set and different; at least one dashboard is selected.", "POST": "A migration task is created and selectedTask store is updated.", "SIDE_EFFECT": "Resets dryRunResult; updates error state on failure.", "UX_STATE": "[Loading] -> [Success] or [Error]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startDryRun", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 400, "end_line": 455, "tags": { "PURPOSE": "Performs a dry-run migration to identify potential risks and changes.", "PRE": "source/target environments and selected dashboards are valid.", "POST": "dryRunResult is populated with the pre-flight analysis.", "UX_STATE": "[Loading] -> [Success] or [Error]", "UX_FEEDBACK": "User sees summary cards + risk block + JSON details after success.", "UX_RECOVERY": "User can adjust selection and press Dry Run again." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 64 }, { "store": "lib", "type": "READS_FROM", "line": 65 }, { "store": "state", "type": "WRITES_TO", "line": 69 }, { "store": "state", "type": "WRITES_TO", "line": 70 }, { "store": "state", "type": "WRITES_TO", "line": 71 }, { "store": "state", "type": "WRITES_TO", "line": 72 }, { "store": "state", "type": "WRITES_TO", "line": 73 }, { "store": "state", "type": "WRITES_TO", "line": 74 }, { "store": "state", "type": "WRITES_TO", "line": 75 }, { "store": "state", "type": "WRITES_TO", "line": 76 }, { "store": "state", "type": "WRITES_TO", "line": 77 }, { "store": "state", "type": "WRITES_TO", "line": 78 }, { "store": "state", "type": "WRITES_TO", "line": 79 }, { "store": "state", "type": "WRITES_TO", "line": 80 }, { "store": "state", "type": "WRITES_TO", "line": 81 }, { "store": "state", "type": "WRITES_TO", "line": 82 }, { "store": "state", "type": "WRITES_TO", "line": 83 }, { "store": "state", "type": "WRITES_TO", "line": 84 }, { "store": "state", "type": "WRITES_TO", "line": 87 }, { "store": "state", "type": "WRITES_TO", "line": 88 }, { "store": "state", "type": "WRITES_TO", "line": 89 }, { "store": "state", "type": "WRITES_TO", "line": 91 }, { "store": "state", "type": "WRITES_TO", "line": 92 }, { "store": "state", "type": "WRITES_TO", "line": 93 }, { "store": "effect", "type": "READS_FROM", "line": 154 }, { "store": "effect", "type": "READS_FROM", "line": 280 }, { "store": "t", "type": "READS_FROM", "line": 316 }, { "store": "t", "type": "READS_FROM", "line": 336 }, { "store": "t", "type": "READS_FROM", "line": 343 }, { "store": "t", "type": "READS_FROM", "line": 350 }, { "store": "t", "type": "READS_FROM", "line": 414 }, { "store": "t", "type": "READS_FROM", "line": 421 }, { "store": "t", "type": "READS_FROM", "line": 428 }, { "store": "t", "type": "WRITES_TO", "line": 472 }, { "store": "selectedTask", "type": "READS_FROM", "line": 480 }, { "store": "t", "type": "READS_FROM", "line": 488 }, { "store": "t", "type": "READS_FROM", "line": 495 }, { "store": "t", "type": "WRITES_TO", "line": 507 }, { "store": "t", "type": "WRITES_TO", "line": 512 }, { "store": "t", "type": "READS_FROM", "line": 522 }, { "store": "t", "type": "READS_FROM", "line": 533 }, { "store": "t", "type": "READS_FROM", "line": 550 }, { "store": "t", "type": "READS_FROM", "line": 567 }, { "store": "t", "type": "READS_FROM", "line": 576 }, { "store": "t", "type": "READS_FROM", "line": 580 }, { "store": "t", "type": "READS_FROM", "line": 596 }, { "store": "t", "type": "READS_FROM", "line": 622 } ] }, { "name": "MigrationDashboardView", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 459, "end_line": 700, "tags": { "PURPOSE": "Render migration configuration controls, action CTAs, dry-run results, and modal entry points.", "UX_STATE": "Success -> Dry-run details or TaskRunner content is presented.", "UX_FEEDBACK": "Buttons, banners, cards, and dialogs provide immediate operation feedback.", "UX_RECOVERY": "User can retry operations from the same page state." }, "relations": [], "children": [ { "name": "MigrationHeader", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 471, "end_line": 473, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskHistorySection", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 475, "end_line": 477, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ActiveTaskSection", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 479, "end_line": 493, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "EnvironmentSelectionSection", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 504, "end_line": 517, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardSelectionSection", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 519, "end_line": 538, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MigrationOptionsSection", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 540, "end_line": 571, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DryRunResultsSection", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 626, "end_line": 667, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MigrationModals", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 671, "end_line": 697, "tags": { "PURPOSE": "Render overlay components for log viewing and password entry.", "UX_STATE": "[AwaitingInput] -> PasswordPrompt is visible." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MappingsPageScript", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 169, "tags": { "PURPOSE": "Define imports, state, and handlers that drive migration mappings page FSM." }, "relations": [ { "type": "CALLS", "target": "fetchEnvironments" }, { "type": "CALLS", "target": "fetchDatabases" }, { "type": "CALLS", "target": "handleUpdate" } ], "children": [ { "name": "Imports", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 49, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "UiState", "type": "Store", "complexity": 5, "tier": "CRITICAL", "start_line": 51, "end_line": 64, "tags": { "PURPOSE": "Maintain local page state for environments, fetched databases, mappings, suggestions, and UX messages." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 51 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 51 } ], "score": 0.0 } }, { "name": "belief_scope", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 80, "tags": { "PURPOSE": "Frontend semantic scope wrapper for CRITICAL trace boundaries without changing business behavior.", "PRE": "scopeId is non-empty and run is callable.", "POST": "Executes run exactly once and returns/rejects with the same outcome.", "SIDE_EFFECT": "Emits trace logs for semantic scope entrance/exit.", "DATA_CONTRACT": "Input(scopeId:string, run:() => Promise) -> Output(Promise)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 99, "tags": { "PURPOSE": "Load environment options for source/target selectors on initial mount.", "PRE": "API client is initialized and route has mounted.", "POST": "loading=false and environments populated on success or error message set on failure.", "SIDE_EFFECT": "Network I/O to environments endpoint; mutates environments/error/loading.", "DATA_CONTRACT": "Input(void) -> Output(EnvironmentSummary[])" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDatabases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 135, "tags": { "PURPOSE": "Fetch both environment database catalogs, existing mappings, and suggested matches.", "PRE": "sourceEnvId and targetEnvId are both selected and non-empty.", "POST": "fetchingDbs=false and sourceDatabases/targetDatabases/mappings/suggestions updated or error set.", "SIDE_EFFECT": "Concurrent network I/O to environments, mappings, and suggestion endpoints; clears transient messages.", "DATA_CONTRACT": "Input({sourceEnvId,targetEnvId}) -> Output({sourceDatabases,targetDatabases,mappings,suggestions})" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleUpdate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 137, "end_line": 168, "tags": { "PURPOSE": "Persist a selected mapping pair and reconcile local mapping list by source database UUID.", "PRE": "event.detail includes sourceUuid/targetUuid and matching source/target database records exist.", "POST": "mapping persisted; local mappings replaced for same source UUID; success or error feedback shown.", "SIDE_EFFECT": "POST /mappings network I/O; mutates mappings/success/error.", "DATA_CONTRACT": "Input(CustomEvent<{sourceUuid:string,targetUuid:string}>) -> Output(MappingRecord persisted + UI feedback)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MappingsPageTemplate", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 172, "end_line": 229, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ProfilePage", "type": "Component", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 879, "tags": { "COMPLEXITY": "5", "PURPOSE": "Manage user profile sections for read-only security access, Git identity/token configuration, and UI preferences with resilient save/cancel UX.", "LAYER": "UI", "PRE": "Authenticated profile APIs and environment context endpoints are reachable when the page mounts.", "POST": "Persisted profile preferences are hydrated into editable UI state, and saves submit only the current user's preference payload.", "SIDE_EFFECT": "Reads and updates profile preferences via API, refreshes environment lookup candidates, writes UI cache values to localStorage, and emits toast feedback.", "DATA_CONTRACT": "Input[{preference, security}, {superset_username, show_only_my_dashboards, show_only_slug_dashboards, git_username, git_email, git_personal_access_token, start_page, auto_open_task_drawer, dashboards_table_density, telegram_id, email_address, notify_on_fail}, {items, status, warning}] -> UIState[{selectedEnvironmentId, supersetUsername, validationErrors, lookupItems, securitySummary}]", "INVARIANT": "Save operations mutate only current user's preference payload via profile API.", "UX_STATE": "SaveError -> Inline validation and/or toast error feedback is shown.", "UX_FEEDBACK": "Inline warning and validation messages guide user actions without navigation loss.", "UX_RECOVERY": "Cancel restores last saved values and rehydrates lookup context.", "UX_REACTIVITY": "State: $state, Derived: $derived, Effects: $effect." }, "relations": [ { "type": "BINDS_TO", "target": "i18n" }, { "type": "BINDS_TO", "target": "api_module" }, { "type": "BINDS_TO", "target": "environmentContext" }, { "type": "BINDS_TO", "target": "taskDrawer" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9666666666666667 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 29 }, { "store": "lib", "type": "READS_FROM", "line": 30 }, { "store": "lib", "type": "READS_FROM", "line": 31 }, { "store": "lib", "type": "READS_FROM", "line": 35 }, { "store": "lib", "type": "READS_FROM", "line": 36 }, { "store": "state", "type": "WRITES_TO", "line": 68 }, { "store": "state", "type": "WRITES_TO", "line": 69 }, { "store": "state", "type": "WRITES_TO", "line": 71 }, { "store": "state", "type": "WRITES_TO", "line": 72 }, { "store": "state", "type": "WRITES_TO", "line": 73 }, { "store": "state", "type": "WRITES_TO", "line": 74 }, { "store": "state", "type": "WRITES_TO", "line": 76 }, { "store": "state", "type": "WRITES_TO", "line": 77 }, { "store": "state", "type": "WRITES_TO", "line": 78 }, { "store": "state", "type": "WRITES_TO", "line": 79 }, { "store": "state", "type": "WRITES_TO", "line": 80 }, { "store": "state", "type": "WRITES_TO", "line": 81 }, { "store": "state", "type": "WRITES_TO", "line": 83 }, { "store": "state", "type": "WRITES_TO", "line": 84 }, { "store": "state", "type": "WRITES_TO", "line": 85 }, { "store": "state", "type": "WRITES_TO", "line": 87 }, { "store": "state", "type": "WRITES_TO", "line": 88 }, { "store": "state", "type": "WRITES_TO", "line": 89 }, { "store": "state", "type": "WRITES_TO", "line": 91 }, { "store": "state", "type": "WRITES_TO", "line": 93 }, { "store": "state", "type": "WRITES_TO", "line": 94 }, { "store": "state", "type": "WRITES_TO", "line": 95 }, { "store": "state", "type": "WRITES_TO", "line": 96 }, { "store": "state", "type": "WRITES_TO", "line": 98 }, { "store": "state", "type": "WRITES_TO", "line": 99 }, { "store": "derived", "type": "WRITES_TO", "line": 115 }, { "store": "environmentContextStore", "type": "WRITES_TO", "line": 115 }, { "store": "derived", "type": "WRITES_TO", "line": 116 }, { "store": "derived", "type": "WRITES_TO", "line": 117 }, { "store": "derived", "type": "WRITES_TO", "line": 118 }, { "store": "derived", "type": "WRITES_TO", "line": 119 }, { "store": "derived", "type": "WRITES_TO", "line": 123 }, { "store": "t", "type": "READS_FROM", "line": 127 }, { "store": "t", "type": "READS_FROM", "line": 133 }, { "store": "t", "type": "READS_FROM", "line": 146 }, { "store": "t", "type": "READS_FROM", "line": 160 }, { "store": "derived", "type": "WRITES_TO", "line": 169 }, { "store": "derived", "type": "WRITES_TO", "line": 179 }, { "store": "t", "type": "READS_FROM", "line": 315 }, { "store": "t", "type": "READS_FROM", "line": 383 }, { "store": "t", "type": "READS_FROM", "line": 391 }, { "store": "effect", "type": "READS_FROM", "line": 426 }, { "store": "effect", "type": "READS_FROM", "line": 435 }, { "store": "environmentContextStore", "type": "WRITES_TO", "line": 436 }, { "store": "environmentContextStore", "type": "READS_FROM", "line": 450 }, { "store": "t", "type": "READS_FROM", "line": 459 }, { "store": "t", "type": "READS_FROM", "line": 472 }, { "store": "t", "type": "READS_FROM", "line": 475 }, { "store": "t", "type": "READS_FROM", "line": 490 }, { "store": "t", "type": "READS_FROM", "line": 493 }, { "store": "t", "type": "READS_FROM", "line": 498 }, { "store": "t", "type": "READS_FROM", "line": 505 }, { "store": "t", "type": "READS_FROM", "line": 509 }, { "store": "t", "type": "READS_FROM", "line": 516 }, { "store": "t", "type": "READS_FROM", "line": 521 }, { "store": "t", "type": "READS_FROM", "line": 529 }, { "store": "t", "type": "READS_FROM", "line": 546 }, { "store": "t", "type": "READS_FROM", "line": 554 }, { "store": "t", "type": "READS_FROM", "line": 560 }, { "store": "t", "type": "WRITES_TO", "line": 565 }, { "store": "t", "type": "READS_FROM", "line": 573 }, { "store": "t", "type": "WRITES_TO", "line": 578 }, { "store": "t", "type": "READS_FROM", "line": 588 }, { "store": "t", "type": "READS_FROM", "line": 596 }, { "store": "t", "type": "WRITES_TO", "line": 603 }, { "store": "t", "type": "READS_FROM", "line": 610 }, { "store": "t", "type": "READS_FROM", "line": 616 }, { "store": "t", "type": "READS_FROM", "line": 623 }, { "store": "t", "type": "READS_FROM", "line": 631 }, { "store": "t", "type": "READS_FROM", "line": 637 }, { "store": "t", "type": "READS_FROM", "line": 644 }, { "store": "t", "type": "READS_FROM", "line": 647 }, { "store": "t", "type": "READS_FROM", "line": 650 }, { "store": "t", "type": "READS_FROM", "line": 657 }, { "store": "t", "type": "READS_FROM", "line": 664 }, { "store": "t", "type": "READS_FROM", "line": 667 }, { "store": "t", "type": "READS_FROM", "line": 680 }, { "store": "t", "type": "READS_FROM", "line": 687 }, { "store": "t", "type": "READS_FROM", "line": 690 }, { "store": "t", "type": "READS_FROM", "line": 696 }, { "store": "t", "type": "WRITES_TO", "line": 701 }, { "store": "t", "type": "READS_FROM", "line": 708 }, { "store": "t", "type": "WRITES_TO", "line": 713 }, { "store": "t", "type": "READS_FROM", "line": 726 }, { "store": "t", "type": "READS_FROM", "line": 734 }, { "store": "t", "type": "READS_FROM", "line": 742 }, { "store": "t", "type": "READS_FROM", "line": 753 }, { "store": "t", "type": "READS_FROM", "line": 761 }, { "store": "t", "type": "WRITES_TO", "line": 768 }, { "store": "t", "type": "READS_FROM", "line": 775 }, { "store": "t", "type": "READS_FROM", "line": 802 }, { "store": "t", "type": "READS_FROM", "line": 809 }, { "store": "t", "type": "WRITES_TO", "line": 814 }, { "store": "t", "type": "READS_FROM", "line": 827 }, { "store": "t", "type": "READS_FROM", "line": 839 }, { "store": "t", "type": "READS_FROM", "line": 862 }, { "store": "t", "type": "READS_FROM", "line": 864 }, { "store": "t", "type": "READS_FROM", "line": 873 } ] }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 879, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/profile/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "createSecuritySummaryDefault", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeStartPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 53, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeDensity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "parseValidationErrorsFromError", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 199, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setSavedSnapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 213, "end_line": 213, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "syncLocalUiPreferenceCaches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 231, "end_line": 231, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "applyPreferenceResponse", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 242, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadPreference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 282, "end_line": 282, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadLookupCandidates", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 287, "end_line": 287, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectCandidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 322, "end_line": 322, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGitTokenInput", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 327, "end_line": 327, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleClearGitToken", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 334, "end_line": 334, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEnvironmentChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 342, "end_line": 342, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 349, "end_line": 349, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCancel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 401, "end_line": 401, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 879 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.routes.profile.__tests__.profile_settings_state_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 269, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, profile, integration, preload, cancel, reload", "PURPOSE": "Verifies profile settings preload, cancel without persistence, and saved-state reload behavior.", "LAYER": "UI (Tests)", "TYPE": "{HTMLInputElement} */ (" }, "relations": [ { "type": "TESTS", "target": "frontend/src/routes/profile/+page.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.routes.profile.__tests__.profile_preferences_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 273, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, profile, integration, lookup, persistence, fallback", "PURPOSE": "Verifies profile binding happy path and degraded lookup manual fallback save flow.", "LAYER": "UI (Tests)", "TYPE": "{HTMLInputElement} */ (" }, "relations": [ { "type": "TESTS", "target": "frontend/src/routes/profile/+page.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "frontend.src.routes.profile.__tests__.fixtures.profile_fixtures", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 23, "tags": { "COMPLEXITY": "1", "PURPOSE": "Shared fixture placeholders for profile page integration tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StoragePage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 225, "tags": { "COMPLEXITY": "3", "SEMANTICS": "storage, files, management", "PURPOSE": "Main page for unified file storage management.", "LAYER": "UI", "INVARIANT": "Always displays a unified storage view without category tabs." }, "relations": [ { "type": "DEPENDS_ON", "target": "storageService" }, { "type": "CONTAINS", "target": "FileList" }, { "type": "CONTAINS", "target": "FileUpload" } ], "children": [ { "name": "loadFiles", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 70, "tags": { "PURPOSE": "Fetches the list of files from the server.", "PRE": "currentPath is a valid storage path or empty for root.", "POST": "Updates the `files` array with the latest data." }, "relations": [], "children": [ { "name": "resolveStorageQueryFromPath", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 54, "tags": { "PURPOSE": "Splits UI path into storage API category and category-local subpath.", "PRE": "uiPath may be empty or start with backups/repositorys.", "POST": "Returns {category, subpath} compatible with /api/storage/files." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 98, "tags": { "PURPOSE": "Handles the file deletion process.", "PRE": "The event contains valid category and path.", "POST": "File is deleted and file list is refreshed.", "PARAM": "{CustomEvent} event - The delete event containing category and path." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleNavigate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 116, "tags": { "PURPOSE": "Updates the current path and reloads files when navigating into a directory.", "PRE": "The event contains a valid path string.", "POST": "currentPath is updated and files are reloaded.", "PARAM": "{CustomEvent} event - The navigation event containing the new path." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "navigateUp", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 131, "tags": { "PURPOSE": "Navigates one level up in the directory structure.", "PRE": "currentPath is not root.", "POST": "currentPath is moved up one directory level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateUploadCategory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 150, "tags": { "PURPOSE": "Keeps upload category aligned with the currently viewed top-level folder.", "PRE": "currentPath can be empty or a slash-delimited path.", "POST": "uploadCategory is either backups or repositorys." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: CONTAINS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: CONTAINS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.35000000000000003 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 17 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "t", "type": "READS_FROM", "line": 65 }, { "store": "t", "type": "READS_FROM", "line": 86 }, { "store": "t", "type": "READS_FROM", "line": 91 }, { "store": "t", "type": "READS_FROM", "line": 95 }, { "store": "derived", "type": "WRITES_TO", "line": 139 }, { "store": "derived", "type": "WRITES_TO", "line": 144 }, { "store": "t", "type": "WRITES_TO", "line": 164 }, { "store": "t", "type": "WRITES_TO", "line": 166 }, { "store": "t", "type": "READS_FROM", "line": 188 }, { "store": "t", "type": "READS_FROM", "line": 188 }, { "store": "t", "type": "READS_FROM", "line": 204 } ] }, { "name": "MapperPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 27, "tags": { "COMPLEXITY": "1", "SEMANTICS": "mapper, page, tool", "PURPOSE": "Page for the dataset column mapper tool.", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "t", "type": "WRITES_TO", "line": 16 } ] }, { "name": "DebugPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 27, "tags": { "COMPLEXITY": "1", "SEMANTICS": "debug, page, tool", "PURPOSE": "Page for system diagnostics and debugging.", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "t", "type": "WRITES_TO", "line": 16 } ] }, { "name": "SettingsPage", "type": "Page", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 1899, "tags": { "COMPLEXITY": "5", "PURPOSE": "Consolidated Settings Page - All settings in one place with tabbed navigation", "LAYER": "UI", "INVARIANT": "Always shows tabbed interface with all settings categories", "UX_STATE": "Error -> Shows error banner with retry button", "UX_FEEDBACK": "Toast notifications on save success/failure", "UX_RECOVERY": "Refresh button reloads settings data", "TEST_DATA": "load_settings_success -> {\"environments\":[{\"id\":\"env1\",\"name\":\"Dev\",\"url\":\"http://dev\"}],\"llm\":{\"default_provider\":\"openai\"}}", "TEST_EDGE": "load_failed -> shows error banner with retry button", "TEST_CONTRACT": "Page_Settings ->", "TEST_FIXTURE": "init_state -> {\"tab\": \"environments\"}", "TEST_INVARIANT": "rendering_and_tabs -> verifies: [init_state]" }, "relations": [ { "type": "BINDS_TO", "target": "sidebarStore" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 1899, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/settings/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "createEmptyConnectionDraft", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 87, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeTab", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 106, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "readTabFromUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 121, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "writeTabToUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 131, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeLlmSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 180, "end_line": 180, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isMultimodalModel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 204, "end_line": 204, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getProviderById", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 218, "end_line": 218, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isDashboardValidationBindingValid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 225, "end_line": 225, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTabChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 233, "end_line": 233, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadConnections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 245, "end_line": 245, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetConnectionForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 263, "end_line": 263, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openConnectionForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 267, "end_line": 267, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeConnectionForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 271, "end_line": 271, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreateConnection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 276, "end_line": 276, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteConnection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 305, "end_line": 305, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadMigrationSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 339, "end_line": 339, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadMappingsPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 352, "end_line": 352, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onMappingsSearchInput", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 370, "end_line": 370, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onMappingsFilterChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 378, "end_line": 378, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goToMappingsPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 383, "end_line": 383, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "saveMigrationSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 389, "end_line": 389, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "triggerSyncNow", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 401, "end_line": 401, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleRefresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 418, "end_line": 418, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 429, "end_line": 429, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTestEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 445, "end_line": 445, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "editEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 470, "end_line": 470, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetEnvForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 490, "end_line": 490, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAddOrUpdateEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 507, "end_line": 507, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 547, "end_line": 547, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveEnvStage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 564, "end_line": 564, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeSupersetBaseUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 568, "end_line": 568, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 1899 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "load", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 3, "end_line": 34, "tags": { "PURPOSE": "Loads application settings and environment list.", "PRE": "API must be reachable.", "POST": "Returns settings object or default values on error.", "TYPE": "{import('./$types').PageLoad} */" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "NotificationSettingsPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 128, "tags": { "COMPLEXITY": "3", "PURPOSE": "Manage global notification provider configurations (SMTP, Telegram, Slack).", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.49999999999999994 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 9 }, { "store": "lib", "type": "READS_FROM", "line": 10 }, { "store": "lib", "type": "READS_FROM", "line": 11 }, { "store": "state", "type": "WRITES_TO", "line": 13 }, { "store": "state", "type": "WRITES_TO", "line": 14 }, { "store": "state", "type": "WRITES_TO", "line": 15 }, { "store": "t", "type": "READS_FROM", "line": 40 }, { "store": "t", "type": "READS_FROM", "line": 42 }, { "store": "t", "type": "READS_FROM", "line": 54 }, { "store": "t", "type": "READS_FROM", "line": 57 } ] }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 128, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/settings/notifications/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "loadConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ConnectionsSettingsPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 41, "tags": { "SEMANTICS": "settings, connections, page", "PURPOSE": "Page for managing database connection configurations.", "LAYER": "UI" }, "relations": [], "children": [ { "name": "handleSuccess", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 24, "tags": { "PURPOSE": "Refreshes the connection list after a successful creation.", "PRE": "listComponent must be bound.", "POST": "Triggers the fetchConnections method on the list component." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 10 }, { "store": "t", "type": "WRITES_TO", "line": 29 } ] }, { "name": "GitSettingsPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 532, "tags": { "SEMANTICS": "git, settings, configuration, integration", "PURPOSE": "Manage Git server configurations for dashboard versioning.", "LAYER": "Page", "INVARIANT": "All configurations must be validated via connection test." }, "relations": [ { "type": "USES", "target": "gitService" }, { "type": "USES", "target": "Button, Input, Card, PageHeader, Select" } ], "children": [ { "name": "loadConfigs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 61, "tags": { "PURPOSE": "Fetches existing git configurations.", "PRE": "Component is mounted.", "POST": "configs state is populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 93, "tags": { "PURPOSE": "Tests connection to a git server with current form data.", "PRE": "newConfig contains valid provider, url, and pat.", "POST": "testing state is managed; toast shown with result." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 129, "tags": { "PURPOSE": "Saves a new git configuration.", "PRE": "newConfig is valid and tested.", "POST": "New config is saved to DB and added to configs list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEdit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 151, "tags": { "PURPOSE": "Populates the form with an existing config to edit.", "PARAM": "{Object} config - Configuration object to edit.", "POST": "Form is populated and isEditing state is set." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 169, "tags": { "PURPOSE": "Resets the configuration form." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 191, "tags": { "PURPOSE": "Deletes a git configuration by ID.", "PARAM": "{string} id - Configuration ID.", "PRE": "id is valid; user confirmed deletion.", "POST": "Configuration is removed from DB and local state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadGiteaRepos", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 193, "end_line": 216, "tags": { "PURPOSE": "Loads repositories from selected Gitea config.", "PRE": "selectedGiteaConfigId is set.", "POST": "giteaRepos state updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreateGiteaRepo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 218, "end_line": 247, "tags": { "PURPOSE": "Creates new repository on selected Gitea server.", "PRE": "selectedGiteaConfigId and newGiteaRepo.name are set.", "POST": "Repository created and repos list reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteGiteaRepo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 249, "end_line": 282, "tags": { "PURPOSE": "Deletes repository from selected Gitea server.", "PRE": "selectedGiteaConfigId is set.", "POST": "Repository deleted and repos list reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 17 }, { "store": "lib", "type": "READS_FROM", "line": 18 }, { "store": "state", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 23 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "state", "type": "WRITES_TO", "line": 34 }, { "store": "state", "type": "WRITES_TO", "line": 35 }, { "store": "state", "type": "WRITES_TO", "line": 36 }, { "store": "state", "type": "WRITES_TO", "line": 37 }, { "store": "state", "type": "WRITES_TO", "line": 38 }, { "store": "state", "type": "WRITES_TO", "line": 39 }, { "store": "t", "type": "READS_FROM", "line": 80 }, { "store": "t", "type": "READS_FROM", "line": 83 }, { "store": "t", "type": "READS_FROM", "line": 88 }, { "store": "t", "type": "READS_FROM", "line": 112 }, { "store": "t", "type": "READS_FROM", "line": 120 }, { "store": "t", "type": "READS_FROM", "line": 178 }, { "store": "t", "type": "READS_FROM", "line": 182 }, { "store": "effect", "type": "READS_FROM", "line": 284 }, { "store": "t", "type": "WRITES_TO", "line": 293 }, { "store": "t", "type": "WRITES_TO", "line": 297 }, { "store": "t", "type": "WRITES_TO", "line": 299 }, { "store": "t", "type": "WRITES_TO", "line": 330 }, { "store": "t", "type": "WRITES_TO", "line": 346 }, { "store": "t", "type": "READS_FROM", "line": 371 }, { "store": "t", "type": "READS_FROM", "line": 372 }, { "store": "t", "type": "WRITES_TO", "line": 376 }, { "store": "t", "type": "WRITES_TO", "line": 378 }, { "store": "t", "type": "WRITES_TO", "line": 381 }, { "store": "t", "type": "WRITES_TO", "line": 390 }, { "store": "t", "type": "WRITES_TO", "line": 394 }, { "store": "t", "type": "WRITES_TO", "line": 399 }, { "store": "t", "type": "WRITES_TO", "line": 404 }, { "store": "t", "type": "READS_FROM", "line": 416 }, { "store": "t", "type": "READS_FROM", "line": 420 }, { "store": "t", "type": "READS_FROM", "line": 422 }, { "store": "t", "type": "READS_FROM", "line": 426 } ] }, { "name": "frontend.src.routes.settings.git.__tests__.git_settings_page_ux_test", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 209, "tags": { "PURPOSE": "Test UX states and transitions for the Git Settings page", "UX_STATE": "Editing form state", "UX_FEEDBACK": "Save configuration" }, "relations": [ { "type": "VERIFIES", "target": "../+page.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "AutomationSettingsPage", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 282, "tags": { "COMPLEXITY": "3", "PURPOSE": "Settings page for managing validation policies.", "LAYER": "UI/Page", "UX_STATE": "Loading -> Shows a loading spinner while fetching policies.", "UX_REATIVITY": "State: $state, Derived: $derived." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.75 }, "data_flow": [ { "store": "state", "type": "READS_FROM", "line": 8 }, { "store": "derived", "type": "READS_FROM", "line": 8 }, { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "lib", "type": "READS_FROM", "line": 19 }, { "store": "lib", "type": "READS_FROM", "line": 20 }, { "store": "state", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 23 }, { "store": "state", "type": "WRITES_TO", "line": 24 }, { "store": "state", "type": "WRITES_TO", "line": 25 }, { "store": "state", "type": "WRITES_TO", "line": 26 }, { "store": "effect", "type": "READS_FROM", "line": 154 } ] }, { "name": "+page", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 282, "tags": { "PURPOSE": "Auto-generated module for frontend/src/routes/settings/automation/+page.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "loadData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 32, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAdd", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEdit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 109, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 125, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getEnvName", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitDashboardPage", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 126, "tags": { "PURPOSE": "Dashboard management page for Git integration.", "LAYER": "Page", "SEMANTICS": "git, dashboard, management, ui" }, "relations": [], "children": [ { "name": "fetchEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 46, "tags": { "PURPOSE": "Fetches the list of deployment environments from the API.", "PRE": "Component is mounted.", "POST": "`environments` array is populated with data from /api/environments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchDashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 81, "tags": { "PURPOSE": "Fetches dashboards for a specific environment.", "PRE": "`envId` is a valid environment ID.", "POST": "`dashboards` array is updated with results from the environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 14 }, { "store": "lib", "type": "READS_FROM", "line": 15 }, { "store": "lib", "type": "READS_FROM", "line": 20 }, { "store": "state", "type": "WRITES_TO", "line": 24 }, { "store": "state", "type": "WRITES_TO", "line": 25 }, { "store": "state", "type": "WRITES_TO", "line": 26 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "derived", "type": "WRITES_TO", "line": 28 }, { "store": "effect", "type": "READS_FROM", "line": 85 }, { "store": "effect", "type": "READS_FROM", "line": 92 }, { "store": "t", "type": "WRITES_TO", "line": 100 }, { "store": "t", "type": "WRITES_TO", "line": 103 }, { "store": "t", "type": "WRITES_TO", "line": 115 }, { "store": "t", "type": "WRITES_TO", "line": 117 }, { "store": "t", "type": "WRITES_TO", "line": 121 } ] }, { "name": "Dashboard", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 64, "tags": { "SEMANTICS": "dashboard, plugins, tools, list", "PURPOSE": "Displays the list of available plugins and allows selecting one.", "LAYER": "UI", "PROPS": "None", "EVENTS": "None" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/stores.js" } ], "children": [ { "name": "onMount", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 27, "tags": { "PURPOSE": "Fetch plugins when the component mounts.", "PRE": "Component is mounting.", "POST": "plugins store is populated with available tools." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectPlugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 40, "tags": { "PURPOSE": "Selects a plugin to display its form.", "PRE": "plugin object is provided.", "POST": "selectedPlugin store is updated.", "PARAM": "{Object} plugin - The plugin object to select." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "plugins", "type": "READS_FROM", "line": 47 } ] }, { "name": "Settings", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 341, "tags": { "SEMANTICS": "settings, ui, configuration", "PURPOSE": "The main settings page for the application, allowing management of environments and global settings.", "LAYER": "UI", "PROPS": "None", "EVENTS": "None", "INVARIANT": "Settings changes must be saved to the backend." }, "relations": [ { "type": "CALLS", "target": "api.js" }, { "type": "USES", "target": "stores.js" } ], "children": [ { "name": "loadSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 67, "tags": { "PURPOSE": "Loads settings from the backend.", "PRE": "Component mounted or refresh requested.", "POST": "settings object is populated with backend data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSaveGlobal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 86, "tags": { "PURPOSE": "Saves global settings to the backend.", "PRE": "settings.settings contains valid configuration.", "POST": "Backend global settings are updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAddOrUpdateEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 88, "end_line": 112, "tags": { "PURPOSE": "Adds or updates an environment.", "PRE": "newEnv contains valid environment details.", "POST": "Environment list is updated on backend and reloaded locally." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeleteEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 135, "tags": { "PURPOSE": "Deletes an environment.", "PRE": "id of environment to delete is provided.", "POST": "Environment is removed from backend and list is reloaded.", "PARAM": "{string} id - The ID of the environment to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTestEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 137, "end_line": 160, "tags": { "PURPOSE": "Tests the connection to an environment.", "PRE": "Environment ID is valid.", "POST": "Connection test result is displayed via toast.", "PARAM": "{string} id - The ID of the environment to test." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "editEnv", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 162, "end_line": 173, "tags": { "PURPOSE": "Sets the form to edit an existing environment.", "PRE": "env object is provided.", "POST": "newEnv is populated with env data and editingEnvId is set.", "PARAM": "{Object} env - The environment object to edit." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetEnvForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 175, "end_line": 196, "tags": { "PURPOSE": "Resets the environment form.", "PRE": "None.", "POST": "newEnv is reset to initial state and editingEnvId is cleared." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "t", "type": "READS_FROM", "line": 64 }, { "store": "t", "type": "READS_FROM", "line": 79 }, { "store": "t", "type": "READS_FROM", "line": 83 }, { "store": "t", "type": "READS_FROM", "line": 99 }, { "store": "t", "type": "READS_FROM", "line": 102 }, { "store": "t", "type": "READS_FROM", "line": 109 }, { "store": "t", "type": "READS_FROM", "line": 122 }, { "store": "t", "type": "READS_FROM", "line": 126 }, { "store": "t", "type": "READS_FROM", "line": 131 }, { "store": "t", "type": "READS_FROM", "line": 149 }, { "store": "t", "type": "READS_FROM", "line": 152 }, { "store": "t", "type": "READS_FROM", "line": 157 }, { "store": "t", "type": "WRITES_TO", "line": 203 }, { "store": "t", "type": "WRITES_TO", "line": 206 }, { "store": "t", "type": "WRITES_TO", "line": 208 }, { "store": "t", "type": "WRITES_TO", "line": 211 }, { "store": "t", "type": "WRITES_TO", "line": 221 }, { "store": "t", "type": "WRITES_TO", "line": 222 }, { "store": "t", "type": "WRITES_TO", "line": 225 }, { "store": "t", "type": "WRITES_TO", "line": 229 }, { "store": "t", "type": "WRITES_TO", "line": 235 }, { "store": "t", "type": "READS_FROM", "line": 241 }, { "store": "t", "type": "WRITES_TO", "line": 246 }, { "store": "t", "type": "WRITES_TO", "line": 250 }, { "store": "t", "type": "READS_FROM", "line": 251 }, { "store": "t", "type": "WRITES_TO", "line": 259 }, { "store": "t", "type": "WRITES_TO", "line": 260 }, { "store": "t", "type": "WRITES_TO", "line": 261 }, { "store": "t", "type": "WRITES_TO", "line": 262 }, { "store": "t", "type": "WRITES_TO", "line": 263 }, { "store": "t", "type": "WRITES_TO", "line": 272 }, { "store": "t", "type": "WRITES_TO", "line": 272 }, { "store": "t", "type": "WRITES_TO", "line": 274 }, { "store": "t", "type": "WRITES_TO", "line": 275 }, { "store": "t", "type": "WRITES_TO", "line": 276 }, { "store": "t", "type": "WRITES_TO", "line": 285 }, { "store": "t", "type": "WRITES_TO", "line": 285 }, { "store": "t", "type": "WRITES_TO", "line": 288 }, { "store": "t", "type": "WRITES_TO", "line": 292 }, { "store": "t", "type": "WRITES_TO", "line": 296 }, { "store": "t", "type": "WRITES_TO", "line": 300 }, { "store": "t", "type": "WRITES_TO", "line": 304 }, { "store": "t", "type": "WRITES_TO", "line": 309 }, { "store": "t", "type": "WRITES_TO", "line": 313 }, { "store": "t", "type": "WRITES_TO", "line": 317 }, { "store": "t", "type": "WRITES_TO", "line": 320 }, { "store": "t", "type": "WRITES_TO", "line": 321 }, { "store": "t", "type": "WRITES_TO", "line": 322 }, { "store": "t", "type": "READS_FROM", "line": 328 }, { "store": "t", "type": "READS_FROM", "line": 328 }, { "store": "t", "type": "READS_FROM", "line": 332 } ] }, { "name": "getConnections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 9, "end_line": 21, "tags": { "PURPOSE": "Fetch a list of saved connections.", "PRE": "None.", "POST": "Returns a promise resolving to an array of connections.", "RETURNS": "{Promise} List of connections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "createConnection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 36, "tags": { "PURPOSE": "Create a new connection configuration.", "PRE": "connectionData must be a valid object.", "POST": "Returns a promise resolving to the created connection.", "PARAM": "{Object} connectionData - The connection data.", "RETURNS": "{Promise} The created connection instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "deleteConnection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 50, "tags": { "PURPOSE": "Delete a connection configuration.", "PRE": "connectionId must be a valid string.", "POST": "Returns a promise that resolves when deletion is complete.", "PARAM": "{string} connectionId - The ID of the connection to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitServiceClient", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 468, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git, service, api, client", "PURPOSE": "API client for Git operations, managing the communication between frontend and backend.", "LAYER": "Service" }, "relations": [ { "type": "DEPENDS_ON", "target": "specs/011-git-integration-dashboard/contracts/api.md" } ], "children": [ { "name": "gitService", "type": "Action", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 466, "tags": { "PURPOSE": "Promotes changes between branches via MR or direct merge.", "PRE": "Dashboard repository must be initialized.", "POST": "Returns promotion metadata (MR URL or direct merge status).", "RETURNS": "{Promise} Promotion result.", "PARAM": "{string|null} envId - Environment id for slug resolution." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildDashboardRepoEndpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 14, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 468 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "runTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 9, "end_line": 23, "tags": { "PURPOSE": "Start a new task for a given plugin.", "PRE": "pluginId and params must be provided.", "POST": "Returns a promise resolving to the task instance.", "PARAM": "{Object} params - Parameters for the plugin.", "RETURNS": "{Promise} The created task instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 38, "tags": { "PURPOSE": "Fetch details for a specific task (to poll status or get result).", "PRE": "taskId must be provided.", "POST": "Returns a promise resolving to task details.", "PARAM": "{string} taskId - The ID of the task.", "RETURNS": "{Promise} Task details." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "adminService", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 294, "tags": { "COMPLEXITY": "3", "SEMANTICS": "admin, users, roles, ad-mappings, api", "PURPOSE": "Service for Admin-related API calls (User and Role management).", "LAYER": "Service", "INVARIANT": "All requests must include valid Admin JWT token (handled by api client)." }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend.src.lib.api" } ], "children": [ { "name": "getUsers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 34, "tags": { "PURPOSE": "Fetches all registered users from the backend.", "PRE": "User must be authenticated with Admin privileges.", "POST": "Returns an array of user objects.", "RETURNS": "{Promise}", "RELATION": "CALLS -> backend.src.api.routes.admin.list_users" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "createUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 56, "tags": { "PURPOSE": "Creates a new local user.", "PRE": "User must be authenticated with Admin privileges.", "PARAM": "{Object} userData - User details (username, email, password, roles, is_active).", "POST": "New user record created in auth.db.", "RETURNS": "{Promise}", "RELATION": "CALLS -> backend.src.api.routes.admin.create_user" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getRoles", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 77, "tags": { "PURPOSE": "Fetches all available system roles.", "PRE": "User must be authenticated with Admin privileges.", "POST": "Returns an array of role objects.", "RETURNS": "{Promise}", "RELATION": "CALLS -> backend.src.api.routes.admin.list_roles" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getADGroupMappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 97, "tags": { "PURPOSE": "Fetches mappings between AD groups and local roles.", "PRE": "User must be authenticated with Admin privileges.", "POST": "Returns an array of AD group mapping objects.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "createADGroupMapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 118, "tags": { "PURPOSE": "Creates or updates an AD group to Role mapping.", "PRE": "User must be authenticated with Admin privileges.", "POST": "New or updated mapping created in auth.db.", "PARAM": "{Object} mappingData - Mapping details (ad_group, role_id).", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 140, "tags": { "PURPOSE": "Updates an existing user.", "PRE": "User must be authenticated with Admin privileges.", "POST": "User record updated in auth.db.", "PARAM": "{Object} userData - Updated user data.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "deleteUser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 142, "end_line": 160, "tags": { "PURPOSE": "Deletes a user.", "PRE": "User must be authenticated with Admin privileges.", "POST": "User record removed from auth.db.", "PARAM": "{string} userId - Target user ID.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "createRole", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 162, "end_line": 181, "tags": { "PURPOSE": "Creates a new role.", "PRE": "User must be authenticated with Admin privileges.", "POST": "New role created in auth.db.", "PARAM": "{Object} roleData - Role details (name, description, permissions).", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateRole", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 201, "tags": { "PURPOSE": "Updates an existing role.", "PARAM": "{Object} roleData - Updated role data.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "deleteRole", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 203, "end_line": 219, "tags": { "PURPOSE": "Deletes a role.", "PARAM": "{string} roleId - Target role ID.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getPermissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 237, "tags": { "PURPOSE": "Fetches all available permissions.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getLoggingConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 239, "end_line": 256, "tags": { "PURPOSE": "Fetches current logging configuration.", "RETURNS": "{Promise} - Logging config with level, task_log_level, enable_belief_state.", "RELATION": "CALLS -> backend.src.api.routes.settings.get_logging_config" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "updateLoggingConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 258, "end_line": 276, "tags": { "PURPOSE": "Updates logging configuration.", "PARAM": "{Object} configData - Logging config (level, task_log_level, enable_belief_state).", "RETURNS": "{Promise}", "RELATION": "CALLS -> backend.src.api.routes.settings.update_logging_config" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "getTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 9, "end_line": 32, "tags": { "PURPOSE": "Fetch a list of tasks with pagination and optional status filter.", "PRE": "limit and offset are numbers.", "POST": "Returns a promise resolving to a list of tasks.", "PARAM": "{string|null} status - Filter by task status (optional).", "RETURNS": "{Promise} List of tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 47, "tags": { "PURPOSE": "Fetch details for a specific task.", "PRE": "taskId must be provided.", "POST": "Returns a promise resolving to task details.", "PARAM": "{string} taskId - The ID of the task.", "RETURNS": "{Promise} Task details." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getTaskLogs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 69, "tags": { "PURPOSE": "Fetch logs for a specific task.", "PRE": "taskId must be provided.", "POST": "Returns a promise resolving to a list of log entries.", "PARAM": "{string} taskId - The ID of the task.", "RETURNS": "{Promise} List of log entries." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resumeTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 85, "tags": { "PURPOSE": "Resume a task that is awaiting input (e.g., passwords).", "PRE": "taskId and passwords must be provided.", "POST": "Returns a promise resolving to the updated task object.", "PARAM": "{Object} passwords - Map of database names to passwords.", "RETURNS": "{Promise} Updated task object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 101, "tags": { "PURPOSE": "Resolve a task that is awaiting mapping.", "PRE": "taskId and resolutionParams must be provided.", "POST": "Returns a promise resolving to the updated task object.", "PARAM": "{Object} resolutionParams - Resolution parameters.", "RETURNS": "{Promise} Updated task object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 120, "tags": { "PURPOSE": "Clear tasks based on status.", "PRE": "status is a string or null.", "POST": "Returns a promise that resolves when tasks are cleared.", "PARAM": "{string|null} status - Filter by task status (optional)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "storageService", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 185, "tags": { "COMPLEXITY": "3", "PURPOSE": "Frontend API client for file storage management.", "LAYER": "Service", "RELATION": "DEPENDS_ON -> backend.api.storage", "SEMANTICS": "storage, api, client" }, "relations": [], "children": [ { "name": "getStorageAuthHeaders", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 29, "tags": { "PURPOSE": "Returns headers with Authorization for storage API calls.", "RETURNS": "{Object} Headers object with Authorization if token exists.", "NOTE": "Unlike api.js getAuthHeaders, this doesn't set Content-Type" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "encodeStoragePath", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 44, "tags": { "PURPOSE": "Encodes a storage-relative path preserving slash separators.", "PARAM": "{string} path - Relative storage path.", "RETURNS": "{string} Encoded path safe for URL segments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "listFiles", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 71, "tags": { "PURPOSE": "Fetches the list of files for a given category and subpath.", "PARAM": "{string} [path] - Optional subpath filter.", "RETURNS": "{Promise}", "PRE": "category and path should be valid strings if provided.", "POST": "Returns a promise resolving to an array of StoredFile objects." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "uploadFile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 103, "tags": { "PURPOSE": "Uploads a file to the storage system.", "PARAM": "{string} [path] - Target subpath.", "RETURNS": "{Promise}", "PRE": "file must be a valid File object; category must be specified.", "POST": "Returns a promise resolving to the metadata of the uploaded file." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "deleteFile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 125, "tags": { "PURPOSE": "Deletes a file or directory from storage.", "PARAM": "{string} path - Relative path of the item.", "RETURNS": "{Promise}", "PRE": "category and path must identify an existing file or directory.", "POST": "The specified file or directory is removed from storage." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "downloadFileUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 127, "end_line": 143, "tags": { "PURPOSE": "Returns the URL for downloading a file.", "PARAM": "{string} path - Relative path of the file.", "RETURNS": "{string}", "PRE": "category and path must identify an existing file.", "POST": "Returns a valid API URL for file download.", "NOTE": "Downloads use browser navigation, so auth is handled via cookies" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "downloadFile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 175, "tags": { "PURPOSE": "Downloads a file using authenticated fetch and saves it in browser.", "PARAM": "{string} [filename] - Optional preferred filename.", "RETURNS": "{Promise}", "PRE": "category/path identify an existing file and user has READ permission.", "POST": "Browser download is triggered or an Error is thrown." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.services.__tests__.gitService_test", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 245, "tags": { "PURPOSE": "API client tests ensuring correct endpoints are called per contract" }, "relations": [ { "type": "VERIFIES", "target": "../gitService.js" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "DashboardGrid", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 699, "tags": { "COMPLEXITY": "3", "SEMANTICS": "dashboard, grid, selection, pagination", "PURPOSE": "Displays a grid of dashboards with selection and pagination.", "LAYER": "Component", "INVARIANT": "Selected IDs must be a subset of available dashboards." }, "relations": [ { "type": "USED_BY", "target": "frontend/src/routes/migration/+page.svelte" } ], "children": [ { "name": "handleSort", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 111, "tags": { "PURPOSE": "Toggles sort direction or changes sort column.", "PRE": "column name is provided.", "POST": "sortColumn and sortDirection state updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectionChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 126, "tags": { "PURPOSE": "Handles individual checkbox changes.", "PRE": "dashboard ID and checked status provided.", "POST": "selectedIds array updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 128, "end_line": 145, "tags": { "PURPOSE": "Handles select all checkbox.", "PRE": "checked status provided.", "POST": "selectedIds array updated for all paginated items." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goToPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 156, "tags": { "PURPOSE": "Changes current page.", "PRE": "page index is provided.", "POST": "currentPage state updated if within valid range." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getRepositoryStatusToken", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 167, "tags": { "PURPOSE": "Returns normalized repository status token for a dashboard.", "PRE": "Dashboard exists.", "POST": "Returns one of loading|no_repo|synced|changes|behind_remote|ahead_remote|diverged|error." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isRepositoryReady", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 175, "tags": { "PURPOSE": "Determines whether git actions can run for a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "invalidateRepositoryStatuses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 177, "end_line": 187, "tags": { "PURPOSE": "Marks dashboard statuses as loading so they are refetched." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveRepositoryStatusToken", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 189, "end_line": 221, "tags": { "PURPOSE": "Converts git status payload into a stable UI status token." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadRepositoryStatuses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 223, "end_line": 282, "tags": { "PURPOSE": "Hydrates repository status map for dashboards in repository mode." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "runBulkGitAction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 284, "end_line": 336, "tags": { "PURPOSE": "Executes git action for selected dashboards with limited parallelism." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkSync", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 338, "end_line": 342, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkCommit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 344, "end_line": 352, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkPull", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 354, "end_line": 358, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkPush", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 360, "end_line": 364, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBulkDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 366, "end_line": 377, "tags": { "PURPOSE": "Removes selected repositories from storage and binding table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleManageSelected", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 379, "end_line": 393, "tags": { "PURPOSE": "Opens Git manager for exactly one selected dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveDashboardRef", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 395, "end_line": 414, "tags": { "PURPOSE": "Resolves dashboard slug from payload fields.", "PRE": "Dashboard metadata is provided.", "POST": "Returns slug string or null if unavailable." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openGitManagerForDashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 416, "end_line": 429, "tags": { "PURPOSE": "Opens Git manager for provided dashboard metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleInitializeRepositories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 431, "end_line": 442, "tags": { "PURPOSE": "Opens Git manager from bulk actions to initialize selected repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSortStatusValue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 444, "end_line": 454, "tags": { "PURPOSE": "Returns sort value for status column based on mode." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 456, "end_line": 467, "tags": { "PURPOSE": "Returns localized label for status column." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 469, "end_line": 490, "tags": { "PURPOSE": "Returns badge style for status column." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.49999999999999994 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 30 }, { "store": "state", "type": "WRITES_TO", "line": 35 }, { "store": "state", "type": "WRITES_TO", "line": 36 }, { "store": "state", "type": "WRITES_TO", "line": 37 }, { "store": "state", "type": "WRITES_TO", "line": 38 }, { "store": "state", "type": "WRITES_TO", "line": 39 }, { "store": "state", "type": "WRITES_TO", "line": 43 }, { "store": "state", "type": "WRITES_TO", "line": 44 }, { "store": "state", "type": "WRITES_TO", "line": 45 }, { "store": "state", "type": "WRITES_TO", "line": 46 }, { "store": "state", "type": "WRITES_TO", "line": 47 }, { "store": "state", "type": "WRITES_TO", "line": 48 }, { "store": "derived", "type": "WRITES_TO", "line": 52 }, { "store": "derived", "type": "WRITES_TO", "line": 61 }, { "store": "derived", "type": "WRITES_TO", "line": 81 }, { "store": "derived", "type": "WRITES_TO", "line": 88 }, { "store": "derived", "type": "WRITES_TO", "line": 90 }, { "store": "derived", "type": "WRITES_TO", "line": 94 }, { "store": "t", "type": "READS_FROM", "line": 296 }, { "store": "t", "type": "WRITES_TO", "line": 324 }, { "store": "t", "type": "READS_FROM", "line": 326 }, { "store": "t", "type": "WRITES_TO", "line": 346 }, { "store": "t", "type": "READS_FROM", "line": 369 }, { "store": "t", "type": "READS_FROM", "line": 383 }, { "store": "t", "type": "READS_FROM", "line": 422 }, { "store": "t", "type": "READS_FROM", "line": 435 }, { "store": "t", "type": "READS_FROM", "line": 465 }, { "store": "effect", "type": "READS_FROM", "line": 492 }, { "store": "t", "type": "WRITES_TO", "line": 510 }, { "store": "t", "type": "READS_FROM", "line": 523 }, { "store": "t", "type": "READS_FROM", "line": 532 }, { "store": "t", "type": "READS_FROM", "line": 536 }, { "store": "t", "type": "READS_FROM", "line": 540 }, { "store": "t", "type": "READS_FROM", "line": 544 }, { "store": "t", "type": "READS_FROM", "line": 547 }, { "store": "t", "type": "READS_FROM", "line": 551 }, { "store": "t", "type": "READS_FROM", "line": 555 }, { "store": "t", "type": "READS_FROM", "line": 582 }, { "store": "t", "type": "READS_FROM", "line": 593 }, { "store": "t", "type": "READS_FROM", "line": 604 }, { "store": "t", "type": "READS_FROM", "line": 656 }, { "store": "t", "type": "READS_FROM", "line": 674 }, { "store": "t", "type": "READS_FROM", "line": 682 } ] }, { "name": "PasswordPrompt", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 182, "tags": { "SEMANTICS": "password, prompt, modal, input, security", "PURPOSE": "A modal component to prompt the user for database passwords when a migration task is paused.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/lib/api.js (inferred)" }, { "type": "BINDS_TO", "target": "onresume" }, { "type": "BINDS_TO", "target": "oncancel" } ], "children": [ { "name": "handleSubmit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 40, "tags": { "PURPOSE": "Validates and forwards passwords to resume the task.", "PRE": "All database passwords must be entered.", "POST": "Parent resume callback receives passwords payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCancel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 50, "tags": { "PURPOSE": "Cancels the password prompt.", "PRE": "Modal is open.", "POST": "Parent cancel callback is invoked and show is set to false." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 17 }, { "store": "state", "type": "WRITES_TO", "line": 19 }, { "store": "state", "type": "WRITES_TO", "line": 20 }, { "store": "effect", "type": "READS_FROM", "line": 53 } ] }, { "name": "MappingTable", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 106, "tags": { "SEMANTICS": "mapping, table, database, editor", "PURPOSE": "Displays and allows editing of database mappings.", "LAYER": "Feature", "INVARIANT": "Each source database can be mapped to one target database." }, "relations": [ { "type": "BINDS_TO", "target": "mappings state" } ], "children": [ { "name": "updateMapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 45, "tags": { "PURPOSE": "Updates a mapping for a specific source database.", "PRE": "sourceUuid and targetUuid are provided.", "POST": "Parent callback receives normalized mapping payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSuggestion", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 56, "tags": { "PURPOSE": "Finds a suggestion for a source database.", "PRE": "sourceUuid is provided.", "POST": "Returns matching suggestion object or undefined." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "lib", "type": "READS_FROM", "line": 13 }, { "store": "props", "type": "WRITES_TO", "line": 23 }, { "store": "t", "type": "WRITES_TO", "line": 64 }, { "store": "t", "type": "WRITES_TO", "line": 65 }, { "store": "t", "type": "WRITES_TO", "line": 66 }, { "store": "t", "type": "WRITES_TO", "line": 83 }, { "store": "t", "type": "WRITES_TO", "line": 91 }, { "store": "t", "type": "WRITES_TO", "line": 93 }, { "store": "t", "type": "WRITES_TO", "line": 95 } ] }, { "name": "TaskLogViewer", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 296, "tags": { "COMPLEXITY": "5", "SEMANTICS": "task, log, viewer, inline, realtime", "PURPOSE": "Displays detailed logs for a specific task inline or in a modal using TaskLogPanel.", "LAYER": "UI", "INVARIANT": "Real-time logs are always appended without duplicates.", "TIER": "CRITICAL", "PRE": "Needs a valid taskId to fetch logs for.", "POST": "task logs are displayed and updated in real time.", "UX_STATE": "Error -> Shows error message with recovery option", "UX_FEEDBACK": "Auto-scroll keeps newest logs visible", "UX_RECOVERY": "Refresh button re-fetches logs from API", "TEST_CONTRACT": "Component_TaskLogViewer ->", "TEST_FIXTURE": "valid_viewer -> {taskId: \"123\", show: true}", "TEST_EDGE": "api_error -> transitions to Error state and displays retry button", "TEST_INVARIANT": "displays_logs -> verifies: [valid_viewer]" }, "relations": [ { "type": "USES", "target": "frontend/src/services/taskService.js" }, { "type": "USES", "target": "frontend/src/components/tasks/TaskLogPanel.svelte" } ], "children": [ { "name": "handleRealTimeLogs", "type": "Action", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 78, "tags": { "PURPOSE": "Sync real-time logs to the current log list", "PRE": "None", "POST": "logs are updated with new real-time log entries" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchLogs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 100, "tags": { "PURPOSE": "Fetches logs for a given task ID", "PRE": "taskId is set", "POST": "logs are populated with API response" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleFilterChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 110, "tags": { "PURPOSE": "Updates filter conditions for the log viewer", "PRE": "event contains source and level fields", "POST": "Log viewer filters updated" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleRefresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 112, "end_line": 120, "tags": { "PURPOSE": "Refreshes the logs by polling the API", "PRE": "None", "POST": "Logs refetched" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "showInline", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 186, "tags": { "PURPOSE": "Shows inline logs -->", "LAYER": "UI -->", "SEMANTICS": "logs, inline -->", "COMPLEXITY": "3 -->" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "showModal", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 188, "end_line": 294, "tags": { "PURPOSE": "Shows modal logs -->", "LAYER": "UI -->", "SEMANTICS": "logs, modal -->", "COMPLEXITY": "3 -->" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.6 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 45 }, { "store": "props", "type": "WRITES_TO", "line": 51 }, { "store": "state", "type": "WRITES_TO", "line": 53 }, { "store": "state", "type": "WRITES_TO", "line": 54 }, { "store": "state", "type": "WRITES_TO", "line": 55 }, { "store": "state", "type": "WRITES_TO", "line": 57 }, { "store": "derived", "type": "WRITES_TO", "line": 59 }, { "store": "effect", "type": "READS_FROM", "line": 65 }, { "store": "effect", "type": "READS_FROM", "line": 122 }, { "store": "t", "type": "WRITES_TO", "line": 162 }, { "store": "t", "type": "WRITES_TO", "line": 174 }, { "store": "t", "type": "READS_FROM", "line": 235 }, { "store": "t", "type": "WRITES_TO", "line": 243 }, { "store": "t", "type": "READS_FROM", "line": 257 }, { "store": "t", "type": "READS_FROM", "line": 276 } ] }, { "name": "Footer", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 11, "tags": { "COMPLEXITY": "1", "SEMANTICS": "footer, layout, copyright", "PURPOSE": "Displays the application footer with copyright information.", "LAYER": "UI" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MissingMappingModal", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 116, "tags": { "SEMANTICS": "modal, mapping, prompt, migration", "PURPOSE": "Prompts the user to provide a database mapping when one is missing during migration.", "LAYER": "Feature", "INVARIANT": "Modal blocks migration progress until resolved or cancelled." }, "relations": [ { "type": "BINDS_TO", "target": "onresolve" }, { "type": "BINDS_TO", "target": "oncancel" } ], "children": [ { "name": "resolve", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 40, "tags": { "PURPOSE": "Resolves the missing mapping via callback prop.", "PRE": "selectedTargetUuid must be set.", "POST": "Parent callback receives mapping payload and modal closes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "cancel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 50, "tags": { "PURPOSE": "Cancels the mapping resolution modal.", "PRE": "Modal is open.", "POST": "Parent cancel callback is invoked and modal is hidden." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 21 }, { "store": "state", "type": "WRITES_TO", "line": 25 } ] }, { "name": "DashboardGrid", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 350, "tags": { "COMPLEXITY": "3", "SEMANTICS": "dashboard, grid, selection, pagination", "PURPOSE": "Displays a grid of dashboards with selection and pagination.", "LAYER": "Component", "INVARIANT": "Selected IDs must be a subset of available dashboards." }, "relations": [ { "type": "USED_BY", "target": "frontend/src/routes/migration/+page.svelte" } ], "children": [ { "name": "handleValidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 69, "tags": { "PURPOSE": "Triggers dashboard validation task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSort", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 122, "tags": { "PURPOSE": "Toggles sort direction or changes sort column.", "PRE": "column name is provided.", "POST": "sortColumn and sortDirection state updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectionChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 137, "tags": { "PURPOSE": "Handles individual checkbox changes.", "PRE": "dashboard ID and checked status provided.", "POST": "selectedIds array updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelectAll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 139, "end_line": 156, "tags": { "PURPOSE": "Handles select all checkbox.", "PRE": "checked status provided.", "POST": "selectedIds array updated for all paginated items." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goToPage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 167, "tags": { "PURPOSE": "Changes current page.", "PRE": "page index is provided.", "POST": "currentPage state updated if within valid range." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openGit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 178, "tags": { "PURPOSE": "Opens the Git management modal for a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.49999999999999994 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 23 }, { "store": "state", "type": "WRITES_TO", "line": 28 }, { "store": "state", "type": "WRITES_TO", "line": 29 }, { "store": "state", "type": "WRITES_TO", "line": 30 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 36 }, { "store": "state", "type": "WRITES_TO", "line": 37 }, { "store": "state", "type": "WRITES_TO", "line": 38 }, { "store": "state", "type": "WRITES_TO", "line": 39 }, { "store": "derived", "type": "WRITES_TO", "line": 72 }, { "store": "derived", "type": "WRITES_TO", "line": 78 }, { "store": "derived", "type": "WRITES_TO", "line": 92 }, { "store": "derived", "type": "WRITES_TO", "line": 99 }, { "store": "derived", "type": "WRITES_TO", "line": 101 }, { "store": "derived", "type": "WRITES_TO", "line": 105 }, { "store": "t", "type": "WRITES_TO", "line": 185 }, { "store": "t", "type": "READS_FROM", "line": 207 }, { "store": "t", "type": "READS_FROM", "line": 218 }, { "store": "t", "type": "READS_FROM", "line": 229 }, { "store": "t", "type": "READS_FROM", "line": 238 }, { "store": "t", "type": "READS_FROM", "line": 242 }, { "store": "t", "type": "READS_FROM", "line": 296 }, { "store": "t", "type": "READS_FROM", "line": 308 }, { "store": "t", "type": "READS_FROM", "line": 326 }, { "store": "t", "type": "READS_FROM", "line": 334 } ] }, { "name": "Navbar", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 84, "tags": { "COMPLEXITY": "3", "SEMANTICS": "navbar, navigation, header, layout", "PURPOSE": "Main navigation bar for the application.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "$app/state" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.49999999999999994 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 7 }, { "store": "app", "type": "READS_FROM", "line": 10 }, { "store": "lib", "type": "READS_FROM", "line": 12 }, { "store": "lib", "type": "READS_FROM", "line": 13 }, { "store": "lib", "type": "READS_FROM", "line": 14 }, { "store": "app", "type": "READS_FROM", "line": 15 }, { "store": "t", "type": "READS_FROM", "line": 37 }, { "store": "t", "type": "READS_FROM", "line": 43 }, { "store": "t", "type": "READS_FROM", "line": 47 }, { "store": "t", "type": "WRITES_TO", "line": 50 }, { "store": "t", "type": "WRITES_TO", "line": 51 }, { "store": "t", "type": "WRITES_TO", "line": 52 }, { "store": "t", "type": "READS_FROM", "line": 59 }, { "store": "t", "type": "WRITES_TO", "line": 62 }, { "store": "t", "type": "WRITES_TO", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 64 }, { "store": "t", "type": "WRITES_TO", "line": 65 } ] }, { "name": "Navbar", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 84, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/Navbar.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleLogout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 19, "end_line": 19, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskHistory", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 200, "tags": { "SEMANTICS": "task, history, list, status, monitoring", "PURPOSE": "Displays a list of recent tasks with their status and allows selecting them for viewing logs.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/lib/stores.js" }, { "type": "USES", "target": "frontend/src/lib/api.js (inferred)" } ], "children": [ { "name": "fetchTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 48, "tags": { "PURPOSE": "Fetches the list of recent tasks from the API.", "PRE": "None.", "POST": "tasks array is updated and selectedTask status synchronized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearTasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 66, "tags": { "PURPOSE": "Clears tasks from the history, optionally filtered by status.", "PRE": "User confirms deletion via prompt.", "POST": "Tasks are deleted from backend and list is re-fetched." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "selectTask", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 82, "tags": { "PURPOSE": "Selects a task and fetches its full details.", "PRE": "task object is provided.", "POST": "selectedTask store is updated with full task details." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getStatusColor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 98, "tags": { "PURPOSE": "Returns the CSS color class for a given task status.", "PRE": "status string is provided.", "POST": "Returns tailwind color class string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onMount", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 108, "tags": { "PURPOSE": "Initializes the component by fetching tasks and starting polling.", "PRE": "Component is mounting.", "POST": "Tasks are fetched and 5s polling interval is started." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onDestroy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 117, "tags": { "PURPOSE": "Cleans up the polling interval when the component is destroyed.", "PRE": "Component is being destroyed.", "POST": "Polling interval is cleared." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 }, "data_flow": [ { "store": "selectedTask", "type": "READS_FROM", "line": 36 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 37 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 38 }, { "store": "t", "type": "READS_FROM", "line": 55 }, { "store": "t", "type": "READS_FROM", "line": 78 }, { "store": "t", "type": "READS_FROM", "line": 123 }, { "store": "t", "type": "READS_FROM", "line": 128 }, { "store": "t", "type": "WRITES_TO", "line": 135 }, { "store": "t", "type": "WRITES_TO", "line": 136 }, { "store": "t", "type": "WRITES_TO", "line": 137 }, { "store": "t", "type": "READS_FROM", "line": 145 }, { "store": "t", "type": "WRITES_TO", "line": 151 }, { "store": "t", "type": "WRITES_TO", "line": 155 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 162 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 162 }, { "store": "t", "type": "READS_FROM", "line": 183 }, { "store": "t", "type": "READS_FROM", "line": 183 }, { "store": "t", "type": "READS_FROM", "line": 189 } ] }, { "name": "Toast", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "1", "SEMANTICS": "toast, notification, feedback, ui", "PURPOSE": "Displays transient notifications (toasts) in the bottom-right corner.", "LAYER": "UI", "PROPS": "None", "EVENTS": "None" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/toasts.js" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "toasts", "type": "READS_FROM", "line": 20 } ] }, { "name": "TaskRunner", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 409, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task, runner, logs, websocket", "PURPOSE": "Connects to a WebSocket to display real-time logs for a running task with filtering support.", "LAYER": "UI" }, "relations": [ { "type": "DEPENDS_ON", "target": "frontend/src/lib/stores.js, frontend/src/components/tasks/TaskLogPanel.svelte" } ], "children": [ { "name": "connect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 143, "tags": { "PURPOSE": "Establishes WebSocket connection with exponential backoff and filter parameters.", "PRE": "selectedTask must be set in the store.", "POST": "WebSocket instance created and listeners attached." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleFilterChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 169, "tags": { "PURPOSE": "Handles filter changes and reconnects WebSocket with new parameters.", "PRE": "event.detail contains source and level filter values.", "POST": "WebSocket reconnected with new filter parameters, logs cleared." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetchTargetDatabases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 171, "end_line": 192, "tags": { "PURPOSE": "Fetches available databases from target environment for mapping.", "PRE": "selectedTask must have to_env parameter set.", "POST": "targetDatabases array populated with available databases." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleMappingResolve", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 194, "end_line": 228, "tags": { "PURPOSE": "Resolves missing database mapping and continues migration.", "PRE": "event.detail contains sourceDbUuid, targetDbUuid, targetDbName.", "POST": "Mapping created in backend, task resumed with resolution params." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePasswordResume", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 230, "end_line": 250, "tags": { "PURPOSE": "Submits passwords and resumes paused migration task.", "PRE": "event.detail contains passwords object.", "POST": "Task resumed with passwords, connection status restored to connected." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startDataTimeout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 266, "tags": { "PURPOSE": "Starts timeout timer to detect idle connection.", "PRE": "connectionStatus is 'connected'.", "POST": "waitingForData set to true after 5 seconds if no data received." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetDataTimeout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 268, "end_line": 279, "tags": { "PURPOSE": "Resets data timeout timer when new data arrives.", "PRE": "dataTimeout must be set.", "POST": "waitingForData reset to false, new timeout started." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onMount", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 281, "end_line": 308, "tags": { "PURPOSE": "Initializes WebSocket connection when component mounts.", "PRE": "Component must be mounted in DOM.", "POST": "WebSocket connection established, subscription to selectedTask active." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "onDestroy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 310, "end_line": 319, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "t", "type": "READS_FROM", "line": 139 }, { "store": "t", "type": "READS_FROM", "line": 223 }, { "store": "t", "type": "READS_FROM", "line": 225 }, { "store": "t", "type": "READS_FROM", "line": 245 }, { "store": "t", "type": "READS_FROM", "line": 247 }, { "store": "selectedTask", "type": "READS_FROM", "line": 324 }, { "store": "t", "type": "WRITES_TO", "line": 326 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 326 }, { "store": "t", "type": "WRITES_TO", "line": 333 }, { "store": "t", "type": "WRITES_TO", "line": 336 }, { "store": "t", "type": "WRITES_TO", "line": 339 }, { "store": "t", "type": "WRITES_TO", "line": 342 }, { "store": "t", "type": "WRITES_TO", "line": 345 }, { "store": "t", "type": "WRITES_TO", "line": 348 }, { "store": "t", "type": "WRITES_TO", "line": 356 }, { "store": "t", "type": "WRITES_TO", "line": 359 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 359 }, { "store": "t", "type": "WRITES_TO", "line": 360 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 360 }, { "store": "t", "type": "WRITES_TO", "line": 361 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 361 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 361 }, { "store": "t", "type": "WRITES_TO", "line": 362 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 362 }, { "store": "t", "type": "WRITES_TO", "line": 365 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 366 }, { "store": "selectedTask", "type": "WRITES_TO", "line": 374 }, { "store": "taskLogs", "type": "WRITES_TO", "line": 375 }, { "store": "t", "type": "READS_FROM", "line": 382 }, { "store": "t", "type": "READS_FROM", "line": 387 } ] }, { "name": "TaskList", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 111, "tags": { "SEMANTICS": "tasks, list, status, history", "PURPOSE": "Displays a list of tasks with their status and execution details.", "LAYER": "Component" }, "relations": [ { "type": "USES", "target": "api.js" } ], "children": [ { "name": "getStatusColor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 35, "tags": { "PURPOSE": "Returns the CSS color class for a given task status.", "PRE": "status string is provided.", "POST": "Returns tailwind color class string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatTime", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 49, "tags": { "PURPOSE": "Formats a date string using date-fns.", "PRE": "dateStr is a valid date string or null.", "POST": "Returns human-readable relative time string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleTaskClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 58, "tags": { "PURPOSE": "Forwards the selected task through a callback prop.", "PRE": "taskId is provided.", "POST": "Parent callback receives task id and task payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 18 }, { "store": "t", "type": "WRITES_TO", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 65 }, { "store": "t", "type": "READS_FROM", "line": 99 } ] }, { "name": "DynamicForm", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 90, "tags": { "SEMANTICS": "form, schema, dynamic, json-schema", "PURPOSE": "Generates a form dynamically based on a JSON schema.", "LAYER": "UI", "PROPS": "", "EVENTS": "" }, "relations": [ { "type": "BINDS_TO", "target": "onsubmit callback" } ], "children": [ { "name": "handleSubmit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 31, "tags": { "PURPOSE": "Emits submitted form data via callback prop.", "PRE": "formData contains user input.", "POST": "Parent callback receives formData snapshot." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "initializeForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 46, "tags": { "PURPOSE": "Initialize form data with default values from the schema.", "PRE": "schema is provided and contains properties.", "POST": "formData is initialized with default values or empty strings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 17 } ] }, { "name": "EnvSelector", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 59, "tags": { "SEMANTICS": "environment, selector, dropdown, migration", "PURPOSE": "Provides a UI component for selecting source and target environments.", "LAYER": "Feature", "INVARIANT": "Source and target environments must be selectable from the list of configured environments." }, "relations": [ { "type": "BINDS_TO", "target": "environments store" } ], "children": [ { "name": "handleSelect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 38, "tags": { "PURPOSE": "Propagates the selection change through a callback prop.", "PRE": "event.target must be an HTMLSelectElement.", "POST": "selectedId is updated and parent callback receives the selected environment id.", "PARAM": "{Event} event - The change event from the select element." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 22 }, { "store": "t", "type": "WRITES_TO", "line": 50 } ] }, { "name": "StartupEnvironmentWizard", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 210, "tags": { "COMPLEXITY": "3", "PURPOSE": "Blocking startup wizard for creating the first Superset environment from zero-state screens.", "LAYER": "UI", "INVARIANT": "When open, wizard keeps user on an actionable setup path until the first environment exists.", "UX_STATE": "Error -> Shows validation or backend error inline.", "UX_FEEDBACK": "Toast on success, inline banner on failure.", "UX_RECOVERY": "User can switch to advanced settings or retry save with corrected data." }, "relations": [ { "type": "CALLS", "target": "api.addEnvironment" }, { "type": "CALLS", "target": "environmentContext.refreshEnvironmentContext" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.9 }, "data_flow": [ { "store": "app", "type": "READS_FROM", "line": 18 }, { "store": "lib", "type": "READS_FROM", "line": 19 }, { "store": "lib", "type": "READS_FROM", "line": 20 }, { "store": "lib", "type": "READS_FROM", "line": 21 }, { "store": "lib", "type": "READS_FROM", "line": 22 }, { "store": "props", "type": "WRITES_TO", "line": 24 }, { "store": "state", "type": "WRITES_TO", "line": 25 }, { "store": "state", "type": "WRITES_TO", "line": 26 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "state", "type": "WRITES_TO", "line": 28 }, { "store": "state", "type": "WRITES_TO", "line": 29 }, { "store": "t", "type": "WRITES_TO", "line": 84 }, { "store": "t", "type": "READS_FROM", "line": 93 }, { "store": "t", "type": "WRITES_TO", "line": 97 }, { "store": "effect", "type": "READS_FROM", "line": 103 }, { "store": "t", "type": "WRITES_TO", "line": 114 }, { "store": "t", "type": "WRITES_TO", "line": 115 }, { "store": "t", "type": "WRITES_TO", "line": 116 }, { "store": "t", "type": "READS_FROM", "line": 119 }, { "store": "t", "type": "WRITES_TO", "line": 128 }, { "store": "t", "type": "WRITES_TO", "line": 129 }, { "store": "t", "type": "WRITES_TO", "line": 132 }, { "store": "t", "type": "READS_FROM", "line": 134 }, { "store": "t", "type": "READS_FROM", "line": 135 }, { "store": "t", "type": "READS_FROM", "line": 136 }, { "store": "t", "type": "WRITES_TO", "line": 142 }, { "store": "t", "type": "READS_FROM", "line": 144 }, { "store": "t", "type": "READS_FROM", "line": 145 }, { "store": "t", "type": "READS_FROM", "line": 146 }, { "store": "t", "type": "READS_FROM", "line": 149 }, { "store": "t", "type": "WRITES_TO", "line": 157 }, { "store": "t", "type": "WRITES_TO", "line": 161 }, { "store": "t", "type": "WRITES_TO", "line": 165 }, { "store": "t", "type": "WRITES_TO", "line": 169 }, { "store": "t", "type": "WRITES_TO", "line": 173 }, { "store": "t", "type": "READS_FROM", "line": 184 }, { "store": "t", "type": "READS_FROM", "line": 194 }, { "store": "t", "type": "READS_FROM", "line": 198 }, { "store": "t", "type": "READS_FROM", "line": 201 }, { "store": "t", "type": "READS_FROM", "line": 201 } ] }, { "name": "StartupEnvironmentWizard", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 210, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/StartupEnvironmentWizard.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "createInitialForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "slugifyEnvironmentId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeSupersetBaseUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetWizard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleNameInput", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleIdInput", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 63, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openAdvancedSettings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreateEnvironment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ProtectedRoute.svelte", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 144, "tags": { "COMPLEXITY": "5", "SEMANTICS": "auth, route-guard, permission, redirect, session-validation", "PURPOSE": "Enforces authenticated and authorized access before protected route content is rendered.", "LAYER": "UI", "INVARIANT": "Unauthenticated users are redirected to /login, unauthorized users are redirected to fallbackPath, and protected slot renders only when access is verified.", "UX_STATE": "Success -> Protected slot content is rendered for authenticated users with valid access.", "UX_FEEDBACK": "Spinner feedback during Loading and navigation redirect feedback on Error/Unauthorized outcomes.", "UX_RECOVERY": "Re-authenticate via /login after logout; retry occurs automatically on next protected navigation.", "UX_REACTIVITY": "Props are bound via $props; local mutable UI flags use $state; auth store is consumed through Svelte store subscription ($auth).", "TEST_CONTRACT": "[token:user:requiredPermission] -> [redirect:/login | redirect:fallbackPath | render:slot]", "TEST_SCENARIO": "AuthorizedRender -> Renders slot when authenticated and permission passes.", "TEST_FIXTURE": "AuthGuardStateMatrix -> INLINE_JSON", "TEST_EDGE": "external_fail -> /auth/me network/API failure triggers logout and /login redirect.", "TEST_INVARIANT": "ProtectedRenderGate -> VERIFIED_BY: [AuthorizedRender]" }, "relations": [ { "type": "BINDS_TO", "target": "frontend.src.lib.auth.store.auth" }, { "type": "CALLS", "target": "$app/navigation.goto" }, { "type": "DEPENDS_ON", "target": "$lib/auth/permissions.hasPermission" }, { "type": "CALLS", "target": "frontend.src.lib.api.api.fetchApi" } ], "children": [ { "name": "ProtectedRoute", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 143, "tags": { "PURPOSE": "Wraps protected slot content with session and permission verification guards.", "PRE": "auth store and navigation API are available in runtime; component is mounted in a browser context.", "POST": "Slot renders only when $auth.isAuthenticated and hasRouteAccess are both true.", "SIDE_EFFECT": "Performs /auth/me request, mutates auth store state, emits console instrumentation logs, and executes navigation redirects.", "DATA_CONTRACT": "Input[$props.requiredPermission?: string|null, $props.fallbackPath?: string] -> Output[UIState{isCheckingAccess:boolean, hasRouteAccess:boolean}]" }, "relations": [], "children": [ { "name": "verifySessionAndAccess", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 128, "tags": { "PURPOSE": "Validates session and optional permission gate before allowing protected content render.", "PRE": "auth store is initialized and can provide token/user state; navigation is available.", "POST": "hasRouteAccess=true only when user identity is valid and permission check (if provided) passes.", "SIDE_EFFECT": "Mutates auth loading/user state, performs API I/O to /auth/me, and may redirect.", "DATA_CONTRACT": "Input[AuthState, requiredPermission, fallbackPath] -> Output[RouteDecision{login_redirect|fallback_redirect|grant}]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "TaskLogPanel", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 151, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task, log, panel, filter, list", "PURPOSE": "Combines log filtering and display into a single cohesive dark-themed panel.", "LAYER": "UI", "INVARIANT": "Must always display logs in chronological order and respect auto-scroll preference.", "UX_STATE": "AutoScroll -> Automatically scrolls to bottom on new logs" }, "relations": [ { "type": "USES", "target": "frontend/src/components/tasks/LogFilterBar.svelte" }, { "type": "USES", "target": "frontend/src/components/tasks/LogEntryRow.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.6 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 21 }, { "store": "props", "type": "WRITES_TO", "line": 23 }, { "store": "state", "type": "WRITES_TO", "line": 25 }, { "store": "state", "type": "WRITES_TO", "line": 26 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "derived", "type": "WRITES_TO", "line": 29 }, { "store": "derived", "type": "WRITES_TO", "line": 53 }, { "store": "effect", "type": "READS_FROM", "line": 77 } ] }, { "name": "TaskLogPanel", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 151, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/tasks/TaskLogPanel.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "filterLogs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleFilterChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "scrollToBottom", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 65, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleAutoScroll", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LogFilterBar", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 140, "tags": { "COMPLEXITY": "3", "SEMANTICS": "log, filter, ui", "PURPOSE": "Compact filter toolbar for logs \u2014 level, source, and text search in a single dense row.", "LAYER": "UI", "UX_STATE": "Active -> Filters applied, clear button visible" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.75 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 13 }, { "store": "bindable", "type": "WRITES_TO", "line": 14 }, { "store": "bindable", "type": "WRITES_TO", "line": 15 }, { "store": "props", "type": "WRITES_TO", "line": 17 }, { "store": "derived", "type": "WRITES_TO", "line": 61 } ] }, { "name": "LogFilterBar", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 140, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/tasks/LogFilterBar.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleLevelChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 27, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSourceChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSearchChange", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clearFilters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LogEntryRow", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 100, "tags": { "COMPLEXITY": "3", "SEMANTICS": "log, entry, row, ui", "PURPOSE": "Renders a single log entry with stacked layout optimized for narrow drawer panels.", "LAYER": "UI", "UX_STATE": "Idle -> Displays log entry with color-coded level and source badges.", "TYPE": "{Object} log - The log entry object */" }, "relations": [], "children": [ { "name": "formatTime", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 25, "tags": { "PURPOSE": "Format ISO timestamp to HH:MM:SS */" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.75 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 11 }, { "store": "derived", "type": "WRITES_TO", "line": 27 }, { "store": "derived", "type": "WRITES_TO", "line": 44 }, { "store": "derived", "type": "WRITES_TO", "line": 47 }, { "store": "derived", "type": "WRITES_TO", "line": 52 }, { "store": "derived", "type": "WRITES_TO", "line": 53 } ] }, { "name": "TaskResultPanel", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 115, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/tasks/TaskResultPanel.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "statusColor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 8, "end_line": 8, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.components.__tests__.task_log_viewer", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 170, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, task-log, viewer, mount, components", "PURPOSE": "Unit tests for TaskLogViewer component by mounting it and observing the DOM.", "LAYER": "UI (Tests)", "INVARIANT": "Duplicate logs are never appended. Polling only active for in-progress tasks.", "TEST_CONTRACT": "TaskLogViewerPropsAndLogStream -> RenderedLogTimeline", "TEST_SCENARIO": "historical_and_realtime_merge -> Historical logs render and realtime logs append without duplication.", "TEST_FIXTURE": "valid_viewer -> INLINE_JSON", "TEST_EDGE": "duplicate_realtime_entry -> Existing log is not duplicated when repeated in realtime stream.", "TEST_INVARIANT": "no_duplicate_log_rows -> VERIFIED_BY: [historical_and_realtime_merge, duplicate_realtime_entry]" }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/components/TaskLogViewer.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "FileList", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 159, "tags": { "COMPLEXITY": "3", "SEMANTICS": "storage, files, list, table", "PURPOSE": "Displays a table of files with metadata and actions.", "LAYER": "UI", "PROPS": "files (Array) - List of StoredFile objects.", "EVENTS": "ondelete/onnavigate callback props - Raised when a file is deleted or navigation is requested." }, "relations": [ { "type": "DEPENDS_ON", "target": "storageService" } ], "children": [ { "name": "isDirectory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 38, "tags": { "PURPOSE": "Checks if a file object represents a directory.", "PRE": "file object has mime_type property.", "POST": "Returns boolean.", "PARAM": "{Object} file - The file object to check.", "RETURN": "{boolean} True if it's a directory, false otherwise." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatSize", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 56, "tags": { "PURPOSE": "Formats file size in bytes into a human-readable string.", "PRE": "bytes is a number.", "POST": "Returns formatted string.", "PARAM": "{number} bytes - The size in bytes.", "RETURN": "{string} Formatted size (e.g., \"1.2 MB\")." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "formatDate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 70, "tags": { "PURPOSE": "Formats an ISO date string into a localized readable format.", "PRE": "dateStr is a valid date string.", "POST": "Returns localized string.", "PARAM": "{string} dateStr - The date string to format.", "RETURN": "{string} Localized date and time." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDownload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 85, "tags": { "PURPOSE": "Downloads selected file through authenticated API request.", "PRE": "file is a non-directory storage entry with category/path.", "POST": "Browser download starts or user sees toast on failure." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 24 }, { "store": "t", "type": "WRITES_TO", "line": 93 }, { "store": "t", "type": "WRITES_TO", "line": 94 }, { "store": "t", "type": "WRITES_TO", "line": 95 }, { "store": "t", "type": "WRITES_TO", "line": 96 }, { "store": "t", "type": "WRITES_TO", "line": 97 }, { "store": "t", "type": "READS_FROM", "line": 135 }, { "store": "t", "type": "READS_FROM", "line": 142 }, { "store": "t", "type": "READS_FROM", "line": 149 } ] }, { "name": "FileUpload", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 137, "tags": { "COMPLEXITY": "3", "SEMANTICS": "storage, upload, files", "PURPOSE": "Provides a form for uploading files to a specific category.", "LAYER": "UI", "PROPS": "None", "EVENTS": "onuploaded callback prop - Invoked when a file is successfully uploaded." }, "relations": [ { "type": "DEPENDS_ON", "target": "storageService" } ], "children": [ { "name": "handleUpload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 58, "tags": { "PURPOSE": "Handles the file upload process.", "PRE": "A file must be selected in the file input.", "POST": "The file is uploaded to the server and a success toast is shown." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDrop", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 74, "tags": { "PURPOSE": "Handles the file drop event for drag-and-drop.", "PARAM": "{DragEvent} event - The drop event." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "state", "type": "WRITES_TO", "line": 34 }, { "store": "t", "type": "READS_FROM", "line": 49 }, { "store": "t", "type": "READS_FROM", "line": 53 }, { "store": "t", "type": "WRITES_TO", "line": 79 }, { "store": "t", "type": "WRITES_TO", "line": 83 }, { "store": "t", "type": "WRITES_TO", "line": 89 }, { "store": "t", "type": "WRITES_TO", "line": 90 }, { "store": "t", "type": "WRITES_TO", "line": 98 }, { "store": "t", "type": "READS_FROM", "line": 109 }, { "store": "t", "type": "WRITES_TO", "line": 120 }, { "store": "t", "type": "WRITES_TO", "line": 122 }, { "store": "t", "type": "WRITES_TO", "line": 129 } ] }, { "name": "ConnectionForm", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 93, "tags": { "SEMANTICS": "connection, form, settings", "PURPOSE": "UI component for creating a new database connection configuration.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/services/connectionService.js" } ], "children": [ { "name": "handleSubmit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 50, "tags": { "PURPOSE": "Submits the connection form to the backend.", "PRE": "All required fields (name, host, database, username, password) must be filled.", "POST": "A new connection is created via the connection service and the parent success callback is invoked." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 65, "tags": { "PURPOSE": "Resets the connection form fields to their default values.", "PRE": "None.", "POST": "All form input variables are reset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 15 }, { "store": "state", "type": "WRITES_TO", "line": 17 }, { "store": "state", "type": "WRITES_TO", "line": 18 }, { "store": "state", "type": "WRITES_TO", "line": 19 }, { "store": "state", "type": "WRITES_TO", "line": 20 }, { "store": "state", "type": "WRITES_TO", "line": 21 }, { "store": "state", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 23 }, { "store": "state", "type": "WRITES_TO", "line": 24 }, { "store": "t", "type": "READS_FROM", "line": 32 }, { "store": "t", "type": "READS_FROM", "line": 41 }, { "store": "t", "type": "WRITES_TO", "line": 69 }, { "store": "t", "type": "WRITES_TO", "line": 71 }, { "store": "t", "type": "WRITES_TO", "line": 71 }, { "store": "t", "type": "WRITES_TO", "line": 74 }, { "store": "t", "type": "WRITES_TO", "line": 74 }, { "store": "t", "type": "WRITES_TO", "line": 75 }, { "store": "t", "type": "WRITES_TO", "line": 78 }, { "store": "t", "type": "WRITES_TO", "line": 81 }, { "store": "t", "type": "WRITES_TO", "line": 82 }, { "store": "t", "type": "READS_FROM", "line": 87 } ] }, { "name": "ConnectionList", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 86, "tags": { "SEMANTICS": "connection, list, settings", "PURPOSE": "UI component for listing and deleting saved database connection configurations.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/services/connectionService.js" } ], "children": [ { "name": "fetchConnections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 34, "tags": { "PURPOSE": "Fetches the list of connections from the backend.", "PRE": "None.", "POST": "connections array is populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 51, "tags": { "PURPOSE": "Deletes a connection configuration.", "PRE": "id is provided and user confirms deletion.", "POST": "Connection is deleted from backend and list is reloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "state", "type": "WRITES_TO", "line": 17 }, { "store": "state", "type": "WRITES_TO", "line": 18 }, { "store": "t", "type": "READS_FROM", "line": 29 }, { "store": "t", "type": "READS_FROM", "line": 41 }, { "store": "t", "type": "READS_FROM", "line": 45 }, { "store": "t", "type": "WRITES_TO", "line": 60 }, { "store": "t", "type": "WRITES_TO", "line": 63 }, { "store": "t", "type": "WRITES_TO", "line": 65 }, { "store": "t", "type": "READS_FROM", "line": 78 } ] }, { "name": "MapperTool", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 250, "tags": { "SEMANTICS": "mapper, tool, dataset, postgresql, excel", "PURPOSE": "UI component for mapping dataset column verbose names using the MapperPlugin.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/services/toolsService.js" }, { "type": "USES", "target": "frontend/src/services/connectionService.js" } ], "children": [ { "name": "fetchData", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 47, "tags": { "PURPOSE": "Fetches environments and saved connections.", "PRE": "None.", "POST": "envs and connections arrays are populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleRunMapper", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 90, "tags": { "PURPOSE": "Triggers the MapperPlugin task.", "PRE": "selectedEnv and datasetId are set; source-specific fields are valid.", "POST": "Mapper task is started and selectedTask is updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGenerateDocs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 92, "end_line": 127, "tags": { "PURPOSE": "Triggers the LLM Documentation task.", "PRE": "selectedEnv and datasetId are set.", "POST": "Documentation task is started." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 }, "data_flow": [ { "store": "t", "type": "READS_FROM", "line": 44 }, { "store": "t", "type": "READS_FROM", "line": 55 }, { "store": "t", "type": "READS_FROM", "line": 60 }, { "store": "t", "type": "READS_FROM", "line": 65 }, { "store": "t", "type": "READS_FROM", "line": 83 }, { "store": "t", "type": "READS_FROM", "line": 98 }, { "store": "t", "type": "READS_FROM", "line": 109 }, { "store": "t", "type": "READS_FROM", "line": 120 }, { "store": "t", "type": "READS_FROM", "line": 122 }, { "store": "t", "type": "READS_FROM", "line": 133 }, { "store": "t", "type": "READS_FROM", "line": 135 }, { "store": "t", "type": "WRITES_TO", "line": 144 }, { "store": "t", "type": "WRITES_TO", "line": 149 }, { "store": "t", "type": "READS_FROM", "line": 152 }, { "store": "t", "type": "WRITES_TO", "line": 159 }, { "store": "t", "type": "WRITES_TO", "line": 167 }, { "store": "t", "type": "WRITES_TO", "line": 171 }, { "store": "t", "type": "WRITES_TO", "line": 175 }, { "store": "t", "type": "WRITES_TO", "line": 184 }, { "store": "t", "type": "READS_FROM", "line": 187 }, { "store": "t", "type": "WRITES_TO", "line": 195 }, { "store": "t", "type": "WRITES_TO", "line": 202 }, { "store": "t", "type": "WRITES_TO", "line": 212 }, { "store": "t", "type": "WRITES_TO", "line": 215 }, { "store": "t", "type": "WRITES_TO", "line": 227 }, { "store": "t", "type": "WRITES_TO", "line": 229 }, { "store": "t", "type": "READS_FROM", "line": 237 }, { "store": "t", "type": "READS_FROM", "line": 237 } ] }, { "name": "MapperTool", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 250, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/tools/MapperTool.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleApplyDoc", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DebugTool", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 191, "tags": { "SEMANTICS": "debug, tool, api, structure", "PURPOSE": "UI component for system diagnostics and debugging API responses.", "LAYER": "UI" }, "relations": [ { "type": "USES", "target": "frontend/src/services/toolsService.js" } ], "children": [ { "name": "fetchEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 42, "tags": { "PURPOSE": "Fetches available environments.", "PRE": "API is available.", "POST": "envs variable is populated.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleRunDebug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 85, "tags": { "PURPOSE": "Triggers the debug task.", "PRE": "Required fields are selected.", "POST": "Task is started and polling begins.", "RETURNS": "{Promise}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startPolling", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 117, "tags": { "PURPOSE": "Polls for task completion.", "PRE": "Task ID is valid.", "POST": "Polls until success/failure.", "PARAM": "{string} taskId - ID of the task.", "RETURNS": "{void}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 }, "data_flow": [ { "store": "t", "type": "READS_FROM", "line": 39 }, { "store": "t", "type": "READS_FROM", "line": 58 }, { "store": "t", "type": "READS_FROM", "line": 68 }, { "store": "t", "type": "READS_FROM", "line": 105 }, { "store": "t", "type": "READS_FROM", "line": 109 }, { "store": "t", "type": "WRITES_TO", "line": 124 }, { "store": "t", "type": "WRITES_TO", "line": 127 }, { "store": "t", "type": "WRITES_TO", "line": 129 }, { "store": "t", "type": "WRITES_TO", "line": 130 }, { "store": "t", "type": "WRITES_TO", "line": 137 }, { "store": "t", "type": "WRITES_TO", "line": 139 }, { "store": "t", "type": "WRITES_TO", "line": 146 }, { "store": "t", "type": "WRITES_TO", "line": 148 }, { "store": "t", "type": "WRITES_TO", "line": 158 }, { "store": "t", "type": "WRITES_TO", "line": 160 }, { "store": "t", "type": "WRITES_TO", "line": 167 }, { "store": "t", "type": "READS_FROM", "line": 175 }, { "store": "t", "type": "READS_FROM", "line": 175 }, { "store": "t", "type": "WRITES_TO", "line": 183 } ] }, { "name": "CommitHistory", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 99, "tags": { "SEMANTICS": "git, history, commits, audit", "PURPOSE": "Displays the commit history for a specific dashboard.", "LAYER": "Component" }, "relations": [ { "type": "CALLS", "target": "gitService.getHistory" } ], "children": [ { "name": "onMount", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 40, "tags": { "PURPOSE": "Load history when component is mounted.", "PRE": "Component is initialized with dashboardId.", "POST": "loadHistory is called." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadHistory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 61, "tags": { "PURPOSE": "Fetch commit history from the backend.", "PRE": "dashboardId is valid.", "POST": "history state is updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "state", "type": "WRITES_TO", "line": 28 }, { "store": "t", "type": "READS_FROM", "line": 68 }, { "store": "t", "type": "READS_FROM", "line": 71 }, { "store": "t", "type": "WRITES_TO", "line": 80 } ] }, { "name": "DeploymentModal", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 238, "tags": { "SEMANTICS": "deployment, git, environment, modal", "PURPOSE": "Modal for deploying a dashboard to a target environment.", "LAYER": "Component", "INVARIANT": "Cannot deploy without a selected environment." }, "relations": [ { "type": "CALLS", "target": "frontend/src/services/gitService.js" }, { "type": "DISPATCHES", "target": "deploy" } ], "children": [ { "name": "loadStatus", "type": "Watcher", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 51, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalizeEnvStage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 64, "tags": { "PURPOSE": "Normalize environment stage with legacy production fallback.", "POST": "Returns DEV/PREPROD/PROD." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveEnvUrl", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 74, "tags": { "PURPOSE": "Resolve environment URL from consolidated or git-specific payload shape.", "POST": "Returns stable URL string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadEnvironments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 104, "tags": { "PURPOSE": "Fetch available environments from API.", "POST": "environments state is populated.", "SIDE_EFFECT": "Updates environments state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDeploy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 140, "tags": { "PURPOSE": "Trigger deployment to selected environment.", "PRE": "selectedEnv must be set.", "POST": "Deploy request finishes and modal closes on success.", "SIDE_EFFECT": "Triggers API call, closes modal, shows toast." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 21 }, { "store": "props", "type": "WRITES_TO", "line": 21 }, { "store": "state", "type": "WRITES_TO", "line": 26 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "state", "type": "WRITES_TO", "line": 28 }, { "store": "state", "type": "WRITES_TO", "line": 29 }, { "store": "derived", "type": "WRITES_TO", "line": 32 }, { "store": "derived", "type": "WRITES_TO", "line": 33 }, { "store": "derived", "type": "WRITES_TO", "line": 39 }, { "store": "derived", "type": "WRITES_TO", "line": 42 }, { "store": "derived", "type": "WRITES_TO", "line": 45 }, { "store": "effect", "type": "READS_FROM", "line": 48 }, { "store": "t", "type": "READS_FROM", "line": 99 }, { "store": "t", "type": "READS_FROM", "line": 128 }, { "store": "t", "type": "WRITES_TO", "line": 149 }, { "store": "t", "type": "WRITES_TO", "line": 152 }, { "store": "t", "type": "READS_FROM", "line": 155 }, { "store": "t", "type": "READS_FROM", "line": 162 }, { "store": "t", "type": "READS_FROM", "line": 173 }, { "store": "t", "type": "READS_FROM", "line": 198 }, { "store": "t", "type": "READS_FROM", "line": 226 }, { "store": "t", "type": "READS_FROM", "line": 228 } ] }, { "name": "ConflictResolver", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 179, "tags": { "SEMANTICS": "git, conflict, resolution, merge", "PURPOSE": "UI for resolving merge conflicts (Keep Mine / Keep Theirs).", "LAYER": "Component", "INVARIANT": "User must resolve all conflicts before saving.", "TYPE": "{Object.} */" }, "relations": [ { "type": "BINDS_TO", "target": "onresolve" } ], "children": [ { "name": "resolve", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 46, "tags": { "PURPOSE": "Set resolution strategy for a file.", "PRE": "file path must exist in conflicts array.", "POST": "resolutions state is updated for the given file.", "PARAM": "{'mine'|'theirs'} strategy - Resolution strategy.", "SIDE_EFFECT": "Updates resolutions state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 74, "tags": { "PURPOSE": "Validate and submit resolutions.", "PRE": "All conflicts must have a resolution.", "POST": "Parent callback receives resolutions if valid.", "SIDE_EFFECT": "Dispatches event and closes modal." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 19 }, { "store": "props", "type": "WRITES_TO", "line": 21 }, { "store": "state", "type": "WRITES_TO", "line": 27 } ] }, { "name": "CommitModal", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 267, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git, commit, modal, version_control, diff", "PURPOSE": "\u041c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0441 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (diff).", "LAYER": "Component" }, "relations": [ { "type": "CALLS", "target": "gitService.commit" }, { "type": "CALLS", "target": "gitService.getStatus" }, { "type": "CALLS", "target": "gitService.getDiff" }, { "type": "DISPATCHES", "target": "commit" } ], "children": [ { "name": "handleGenerateMessage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 58, "tags": { "PURPOSE": "Generates a commit message using LLM." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 101, "tags": { "PURPOSE": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 diff.", "PRE": "dashboardId \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCommit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 128, "tags": { "PURPOSE": "\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043c\u043c\u0438\u0442 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c.", "PRE": "message \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c.", "POST": "\u041a\u043e\u043c\u043c\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u043e." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 27 }, { "store": "state", "type": "WRITES_TO", "line": 28 }, { "store": "state", "type": "WRITES_TO", "line": 29 }, { "store": "state", "type": "WRITES_TO", "line": 30 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "t", "type": "READS_FROM", "line": 50 }, { "store": "t", "type": "READS_FROM", "line": 53 }, { "store": "t", "type": "READS_FROM", "line": 96 }, { "store": "t", "type": "READS_FROM", "line": 117 }, { "store": "effect", "type": "READS_FROM", "line": 130 }, { "store": "t", "type": "WRITES_TO", "line": 143 }, { "store": "t", "type": "READS_FROM", "line": 152 }, { "store": "t", "type": "WRITES_TO", "line": 160 }, { "store": "t", "type": "WRITES_TO", "line": 162 }, { "store": "t", "type": "WRITES_TO", "line": 169 }, { "store": "t", "type": "READS_FROM", "line": 178 }, { "store": "t", "type": "WRITES_TO", "line": 184 }, { "store": "t", "type": "WRITES_TO", "line": 193 }, { "store": "t", "type": "WRITES_TO", "line": 202 }, { "store": "t", "type": "READS_FROM", "line": 220 }, { "store": "t", "type": "READS_FROM", "line": 227 }, { "store": "t", "type": "READS_FROM", "line": 236 }, { "store": "t", "type": "READS_FROM", "line": 248 }, { "store": "t", "type": "READS_FROM", "line": 259 }, { "store": "t", "type": "READS_FROM", "line": 259 } ] }, { "name": "BranchSelector", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 180, "tags": { "SEMANTICS": "git, branch, selection, checkout", "PURPOSE": "UI \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0442\u043e\u043a Git.", "LAYER": "Component" }, "relations": [ { "type": "CALLS", "target": "gitService.getBranches" }, { "type": "CALLS", "target": "gitService.checkoutBranch" }, { "type": "CALLS", "target": "gitService.createBranch" }, { "type": "BINDS_TO", "target": "onchange" } ], "children": [ { "name": "onMount", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 46, "tags": { "PURPOSE": "Load branches when component is mounted.", "PRE": "Component is initialized.", "POST": "loadBranches is called." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadBranches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 67, "tags": { "PURPOSE": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u0442\u043e\u043a \u0434\u043b\u044f \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430.", "PRE": "dashboardId is provided.", "POST": "branches \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSelect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 78, "tags": { "PURPOSE": "Handles branch selection from dropdown.", "PRE": "event contains branch name.", "POST": "handleCheckout is called with selected branch." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCheckout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 99, "tags": { "PURPOSE": "\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0442\u043a\u0443.", "PARAM": "{string} branchName - \u0418\u043c\u044f \u0432\u0435\u0442\u043a\u0438.", "POST": "currentBranch \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d, \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 callback \u0432\u044b\u0437\u0432\u0430\u043d." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 122, "tags": { "PURPOSE": "\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443.", "PRE": "newBranchName is not empty.", "POST": "\u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430; showCreate reset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 25 }, { "store": "props", "type": "WRITES_TO", "line": 27 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "state", "type": "WRITES_TO", "line": 34 }, { "store": "state", "type": "WRITES_TO", "line": 35 }, { "store": "t", "type": "READS_FROM", "line": 62 }, { "store": "t", "type": "READS_FROM", "line": 92 }, { "store": "t", "type": "READS_FROM", "line": 112 }, { "store": "t", "type": "READS_FROM", "line": 144 }, { "store": "t", "type": "WRITES_TO", "line": 153 }, { "store": "t", "type": "READS_FROM", "line": 165 }, { "store": "t", "type": "READS_FROM", "line": 173 } ] }, { "name": "GitManager", "type": "Component", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 1212, "tags": { "SEMANTICS": "git, manager, dashboard, version_control, tabs, workflow", "PURPOSE": "\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 UI \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Git \u0441 \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 (commit -> promote -> deploy).", "LAYER": "Component" }, "relations": [ { "type": "USES", "target": "BranchSelector" }, { "type": "USES", "target": "DeploymentModal" }, { "type": "CALLS", "target": "gitService" } ], "children": [ { "name": "normalizeEnvStage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 108, "tags": { "PURPOSE": "Normalize environment stage with legacy fallback.", "POST": "Returns DEV/PREPROD/PROD." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stageBadgeClass", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 120, "tags": { "PURPOSE": "Return visual class for environment stage badges.", "POST": "Stage badge is color-coded by risk level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveCurrentEnvironmentId", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 132, "tags": { "PURPOSE": "Resolve active environment id for current dashboard session.", "POST": "Returns env id from prop or selected_env_id in localStorage." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "applyGitflowStageDefaults", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 157, "tags": { "PURPOSE": "Apply GitFlow defaults by current environment stage.", "POST": "Promote branches and preferred deploy target stage are set." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadCurrentEnvironmentStage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 177, "tags": { "PURPOSE": "Detect current environment stage and bind GitFlow defaults.", "POST": "currentEnvStage and promote/deploy defaults are refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "isNumericDashboardRef", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 179, "end_line": 187, "tags": { "PURPOSE": "Checks whether current dashboard reference is numeric ID.", "POST": "Returns true when dashboardId is digits-only." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "checkStatus", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 189, "end_line": 215, "tags": { "PURPOSE": "Verify repository initialization for dashboard slug.", "POST": "initialized status and config list are updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadWorkspace", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 217, "end_line": 237, "tags": { "PURPOSE": "Load current git status and combined diff for workspace tab.", "POST": "workspace status/diff are refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSync", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 239, "end_line": 261, "tags": { "PURPOSE": "Sync latest dashboard config from Superset to git workspace.", "POST": "Workspace status is refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleGenerateMessage", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 263, "end_line": 282, "tags": { "PURPOSE": "Generate commit message from diff using LLM.", "POST": "commitMessage gets generated content." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCommit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 284, "end_line": 308, "tags": { "PURPOSE": "Commit current workspace changes with provided message.", "POST": "Changes are committed and workspace is refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePull", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 310, "end_line": 507, "tags": { "PURPOSE": "Pull remote changes for current branch.", "POST": "Workspace status is refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePush", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 509, "end_line": 526, "tags": { "PURPOSE": "Push local commits to remote repository.", "POST": "Workspace status is refreshed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handlePromote", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 528, "end_line": 576, "tags": { "PURPOSE": "Promote branch to the next stage via MR or unsafe direct mode.", "POST": "Promotion result is shown to user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openDeployModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 578, "end_line": 594, "tags": { "PURPOSE": "Open deploy modal with extra confirmation for PROD context.", "POST": "Deploy modal is shown when confirmation passes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getSelectedConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 596, "end_line": 604, "tags": { "PURPOSE": "Return currently selected git server config.", "POST": "Config object or null." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolveDefaultConfig", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 606, "end_line": 620, "tags": { "PURPOSE": "Resolve default git config for current session.", "POST": "Returns config by selected -> is_default -> CONNECTED -> first." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolvePushProviderLabel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 622, "end_line": 634, "tags": { "PURPOSE": "Resolve lower-case provider label for auto-push checkbox.", "POST": "Returns provider label, fallback \"git\"." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extractHttpHost", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 636, "end_line": 652, "tags": { "PURPOSE": "Extract comparable host[:port] from URL string.", "POST": "Returns lowercase host token or empty string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "buildSuggestedRepoName", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 654, "end_line": 667, "tags": { "PURPOSE": "Build deterministic repository name from dashboard title/id.", "POST": "Returns kebab-case repository name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCreateRemoteRepo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 669, "end_line": 707, "tags": { "PURPOSE": "Create remote repository on selected Git provider.", "POST": "remoteUrl is filled from provider response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleInit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 709, "end_line": 733, "tags": { "PURPOSE": "Initialize git repository for dashboard.", "POST": "Repository is linked and workspace is loaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeModal", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 735, "end_line": 743, "tags": { "PURPOSE": "Close git manager modal.", "POST": "show=false." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleBackdropClick", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 745, "end_line": 755, "tags": { "PURPOSE": "Close modal on backdrop click.", "POST": "show=false if clicked on overlay." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 }, "data_flow": [ { "store": "bindable", "type": "WRITES_TO", "line": 29 }, { "store": "props", "type": "WRITES_TO", "line": 30 }, { "store": "state", "type": "WRITES_TO", "line": 34 }, { "store": "state", "type": "WRITES_TO", "line": 35 }, { "store": "state", "type": "WRITES_TO", "line": 36 }, { "store": "state", "type": "WRITES_TO", "line": 37 }, { "store": "state", "type": "WRITES_TO", "line": 38 }, { "store": "state", "type": "WRITES_TO", "line": 40 }, { "store": "state", "type": "WRITES_TO", "line": 41 }, { "store": "state", "type": "WRITES_TO", "line": 42 }, { "store": "state", "type": "WRITES_TO", "line": 43 }, { "store": "state", "type": "WRITES_TO", "line": 45 }, { "store": "state", "type": "WRITES_TO", "line": 46 }, { "store": "state", "type": "WRITES_TO", "line": 47 }, { "store": "state", "type": "WRITES_TO", "line": 48 }, { "store": "state", "type": "WRITES_TO", "line": 49 }, { "store": "state", "type": "WRITES_TO", "line": 50 }, { "store": "state", "type": "WRITES_TO", "line": 51 }, { "store": "state", "type": "WRITES_TO", "line": 52 }, { "store": "state", "type": "WRITES_TO", "line": 53 }, { "store": "state", "type": "WRITES_TO", "line": 55 }, { "store": "state", "type": "WRITES_TO", "line": 56 }, { "store": "state", "type": "WRITES_TO", "line": 57 }, { "store": "state", "type": "WRITES_TO", "line": 58 }, { "store": "state", "type": "WRITES_TO", "line": 59 }, { "store": "state", "type": "WRITES_TO", "line": 60 }, { "store": "state", "type": "WRITES_TO", "line": 61 }, { "store": "state", "type": "WRITES_TO", "line": 62 }, { "store": "state", "type": "WRITES_TO", "line": 63 }, { "store": "state", "type": "WRITES_TO", "line": 64 }, { "store": "state", "type": "WRITES_TO", "line": 65 }, { "store": "state", "type": "WRITES_TO", "line": 66 }, { "store": "state", "type": "WRITES_TO", "line": 67 }, { "store": "state", "type": "WRITES_TO", "line": 68 }, { "store": "state", "type": "WRITES_TO", "line": 69 }, { "store": "state", "type": "WRITES_TO", "line": 70 }, { "store": "state", "type": "WRITES_TO", "line": 71 }, { "store": "state", "type": "WRITES_TO", "line": 72 }, { "store": "state", "type": "WRITES_TO", "line": 73 }, { "store": "state", "type": "WRITES_TO", "line": 74 }, { "store": "state", "type": "WRITES_TO", "line": 75 }, { "store": "derived", "type": "WRITES_TO", "line": 78 }, { "store": "derived", "type": "WRITES_TO", "line": 88 }, { "store": "t", "type": "READS_FROM", "line": 253 }, { "store": "t", "type": "READS_FROM", "line": 275 }, { "store": "t", "type": "READS_FROM", "line": 277 }, { "store": "t", "type": "READS_FROM", "line": 296 }, { "store": "t", "type": "READS_FROM", "line": 298 }, { "store": "t", "type": "READS_FROM", "line": 371 }, { "store": "t", "type": "READS_FROM", "line": 382 }, { "store": "t", "type": "READS_FROM", "line": 400 }, { "store": "t", "type": "READS_FROM", "line": 405 }, { "store": "t", "type": "READS_FROM", "line": 418 }, { "store": "t", "type": "READS_FROM", "line": 425 }, { "store": "t", "type": "READS_FROM", "line": 430 }, { "store": "t", "type": "READS_FROM", "line": 440 }, { "store": "t", "type": "READS_FROM", "line": 444 }, { "store": "t", "type": "READS_FROM", "line": 454 }, { "store": "t", "type": "READS_FROM", "line": 458 }, { "store": "t", "type": "READS_FROM", "line": 473 }, { "store": "t", "type": "READS_FROM", "line": 482 }, { "store": "t", "type": "READS_FROM", "line": 484 }, { "store": "t", "type": "READS_FROM", "line": 494 }, { "store": "t", "type": "READS_FROM", "line": 518 }, { "store": "t", "type": "READS_FROM", "line": 677 }, { "store": "t", "type": "READS_FROM", "line": 716 }, { "store": "t", "type": "READS_FROM", "line": 722 }, { "store": "derived", "type": "WRITES_TO", "line": 757 }, { "store": "derived", "type": "WRITES_TO", "line": 758 }, { "store": "derived", "type": "WRITES_TO", "line": 759 }, { "store": "effect", "type": "READS_FROM", "line": 764 }, { "store": "t", "type": "WRITES_TO", "line": 804 }, { "store": "t", "type": "WRITES_TO", "line": 810 }, { "store": "t", "type": "WRITES_TO", "line": 816 }, { "store": "t", "type": "WRITES_TO", "line": 823 }, { "store": "t", "type": "READS_FROM", "line": 835 }, { "store": "t", "type": "WRITES_TO", "line": 840 }, { "store": "t", "type": "WRITES_TO", "line": 845 }, { "store": "t", "type": "WRITES_TO", "line": 849 }, { "store": "t", "type": "WRITES_TO", "line": 851 }, { "store": "t", "type": "READS_FROM", "line": 869 }, { "store": "t", "type": "READS_FROM", "line": 963 }, { "store": "t", "type": "WRITES_TO", "line": 1098 }, { "store": "t", "type": "READS_FROM", "line": 1102 }, { "store": "t", "type": "READS_FROM", "line": 1105 }, { "store": "t", "type": "WRITES_TO", "line": 1110 }, { "store": "t", "type": "WRITES_TO", "line": 1114 }, { "store": "t", "type": "READS_FROM", "line": 1128 }, { "store": "t", "type": "READS_FROM", "line": 1141 }, { "store": "t", "type": "READS_FROM", "line": 1154 }, { "store": "t", "type": "READS_FROM", "line": 1162 }, { "store": "t", "type": "READS_FROM", "line": 1170 }, { "store": "t", "type": "READS_FROM", "line": 1179 }, { "store": "t", "type": "READS_FROM", "line": 1186 }, { "store": "t", "type": "READS_FROM", "line": 1189 } ] }, { "name": "GitManager", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 1212, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/git/GitManager.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "tryParseJsonObject", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 315, "end_line": 315, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extractUnfinishedMergeContext", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 326, "end_line": 326, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "openUnfinishedMergeDialogFromError", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 353, "end_line": 353, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loadMergeRecoveryState", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 361, "end_line": 361, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "closeUnfinishedMergeDialog", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 388, "end_line": 388, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleOpenConflictResolver", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 395, "end_line": 395, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleResolveConflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 411, "end_line": 411, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleAbortUnfinishedMerge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 436, "end_line": 436, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleContinueUnfinishedMerge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 450, "end_line": 450, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "getUnfinishedMergeCommandsText", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 465, "end_line": 465, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleCopyUnfinishedMergeCommands", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 470, "end_line": 470, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 1212 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "frontend.src.components.git.__tests__.git_manager_unfinished_merge_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 43, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git-manager, unfinished-merge, dialog, integration-test", "PURPOSE": "Protect unresolved-merge dialog contract in GitManager pull flow.", "LAYER": "UI Tests" }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/components/git/GitManager.svelte" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "DocPreview", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 86, "tags": { "COMPLEXITY": "3", "PURPOSE": "UI component for previewing generated dataset documentation before saving.", "LAYER": "UI", "TYPE": "{Object} */" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend/src/plugins/llm_analysis/plugin.py" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 20 }, { "store": "derived", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 24 }, { "store": "t", "type": "WRITES_TO", "line": 41 }, { "store": "t", "type": "WRITES_TO", "line": 44 }, { "store": "t", "type": "WRITES_TO", "line": 47 }, { "store": "t", "type": "READS_FROM", "line": 72 }, { "store": "t", "type": "READS_FROM", "line": 79 }, { "store": "t", "type": "READS_FROM", "line": 79 } ] }, { "name": "DocPreview", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 86, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/llm/DocPreview.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "handleSave", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ProviderConfig", "type": "Component", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 422, "tags": { "COMPLEXITY": "3", "PURPOSE": "UI form for managing LLM provider configurations.", "LAYER": "UI" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend/src/api/routes/llm.py" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @UX_STATE (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.6499999999999999 }, "data_flow": [ { "store": "props", "type": "WRITES_TO", "line": 17 }, { "store": "state", "type": "WRITES_TO", "line": 19 }, { "store": "state", "type": "WRITES_TO", "line": 20 }, { "store": "state", "type": "WRITES_TO", "line": 22 }, { "store": "state", "type": "WRITES_TO", "line": 31 }, { "store": "state", "type": "WRITES_TO", "line": 32 }, { "store": "state", "type": "WRITES_TO", "line": 33 }, { "store": "state", "type": "WRITES_TO", "line": 34 }, { "store": "t", "type": "WRITES_TO", "line": 82 }, { "store": "t", "type": "WRITES_TO", "line": 91 }, { "store": "t", "type": "READS_FROM", "line": 95 }, { "store": "t", "type": "READS_FROM", "line": 104 }, { "store": "t", "type": "READS_FROM", "line": 169 }, { "store": "t", "type": "READS_FROM", "line": 181 }, { "store": "t", "type": "READS_FROM", "line": 185 }, { "store": "t", "type": "READS_FROM", "line": 187 }, { "store": "t", "type": "WRITES_TO", "line": 200 }, { "store": "t", "type": "READS_FROM", "line": 209 }, { "store": "t", "type": "READS_FROM", "line": 221 }, { "store": "t", "type": "READS_FROM", "line": 221 }, { "store": "t", "type": "READS_FROM", "line": 229 }, { "store": "t", "type": "READS_FROM", "line": 244 }, { "store": "t", "type": "READS_FROM", "line": 261 }, { "store": "t", "type": "READS_FROM", "line": 275 }, { "store": "t", "type": "READS_FROM", "line": 290 }, { "store": "t", "type": "WRITES_TO", "line": 310 }, { "store": "t", "type": "READS_FROM", "line": 331 }, { "store": "t", "type": "READS_FROM", "line": 339 }, { "store": "t", "type": "READS_FROM", "line": 339 }, { "store": "t", "type": "READS_FROM", "line": 346 }, { "store": "t", "type": "READS_FROM", "line": 364 }, { "store": "t", "type": "READS_FROM", "line": 370 }, { "store": "t", "type": "READS_FROM", "line": 371 }, { "store": "t", "type": "READS_FROM", "line": 384 }, { "store": "t", "type": "READS_FROM", "line": 395 }, { "store": "t", "type": "READS_FROM", "line": 416 } ] }, { "name": "ProviderConfig", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 422, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/llm/ProviderConfig.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "isMultimodalModel", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resetForm", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 50, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleEdit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 63, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "testConnection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 79, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleSubmit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "toggleActive", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "handleDelete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 422 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "ValidationReport", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 79, "tags": { "PURPOSE": "Auto-generated module for frontend/src/components/llm/ValidationReport.svelte", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "getStatusColor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "frontend.src.components.llm.__tests__.provider_config_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 60, "tags": { "COMPLEXITY": "3", "SEMANTICS": "llm, provider-config, integration-test, edit-flow, delete-flow", "PURPOSE": "Protect edit and delete interaction contracts in LLM provider settings UI.", "LAYER": "UI Tests", "INVARIANT": "Edit action keeps explicit click handler and opens normalized edit form." }, "relations": [ { "type": "VERIFIES", "target": "frontend/src/components/llm/ProviderConfig.svelte" } ], "children": [ { "name": "provider_config_edit_contract_tests", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 18, "end_line": 59, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validate edit and delete handler wiring plus normalized edit form state mapping.", "PRE": "ProviderConfig component source exists in expected path.", "POST": "Contract checks ensure edit click cannot degrade into no-op flow." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 18 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 18 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "DeleteRunningTasksUtil", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 2, "end_line": 46, "tags": { "PURPOSE": "Script to delete tasks with RUNNING status from the database.", "LAYER": "Utility", "SEMANTICS": "maintenance, database, cleanup" }, "relations": [ { "type": "DEPENDS_ON", "target": "TasksSessionLocal" }, { "type": "DEPENDS_ON", "target": "TaskRecord" } ], "children": [ { "name": "delete_running_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 42, "tags": { "PURPOSE": "Delete all tasks with RUNNING status from the database.", "PRE": "Database is accessible and TaskRecord model is defined.", "POST": "All tasks with status 'RUNNING' are removed from the database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AppModule", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 328, "tags": { "COMPLEXITY": "5", "SEMANTICS": "app, main, entrypoint, fastapi", "PURPOSE": "The main entry point for the FastAPI application. It initializes the app, configures CORS, sets up dependencies, includes API routers, and defines the WebSocket endpoint for log streaming.", "LAYER": "UI (API)", "INVARIANT": "All WebSocket connections must be properly cleaned up on disconnect.", "PRE": "Python environment and dependencies installed; configuration database available.", "POST": "FastAPI app instance is created, middleware configured, and routes registered.", "SIDE_EFFECT": "Starts background scheduler and binds network ports for HTTP/WS traffic.", "DATA_CONTRACT": "[HTTP Request | WS Message] -> [HTTP Response | JSON Log Stream]" }, "relations": [ { "type": "DEPENDS_ON", "target": "AppDependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.api.routes" } ], "children": [ { "name": "App", "type": "Global", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 43, "tags": { "COMPLEXITY": "1", "SEMANTICS": "app, fastapi, instance", "PURPOSE": "The global FastAPI application instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "startup_event", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 45, "end_line": 57, "tags": { "COMPLEXITY": "3", "PURPOSE": "Handles application startup tasks, such as starting the scheduler.", "PRE": "None.", "POST": "Scheduler is started." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 45 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 45 } ], "score": 0.5499999999999999 } }, { "name": "shutdown_event", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 59, "end_line": 70, "tags": { "COMPLEXITY": "3", "PURPOSE": "Handles application shutdown tasks, such as stopping the scheduler.", "PRE": "None.", "POST": "Scheduler is stopped." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 59 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 59 } ], "score": 0.5499999999999999 } }, { "name": "app_middleware", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 86, "tags": { "PURPOSE": "Configure application-wide middleware (Session, CORS)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "network_error_handler", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 104, "tags": { "COMPLEXITY": "1", "PURPOSE": "Global exception handler for NetworkError.", "PRE": "request is a FastAPI Request object.", "POST": "Returns 503 HTTP Exception.", "PARAM": "exc (NetworkError) - The exception instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "log_requests", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 106, "end_line": 133, "tags": { "COMPLEXITY": "3", "PURPOSE": "Middleware to log incoming HTTP requests and their response status.", "PRE": "request is a FastAPI Request object.", "POST": "Logs request and response details.", "PARAM": "call_next (Callable) - The next middleware or route handler." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 106 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 106 } ], "score": 0.5499999999999999 } }, { "name": "api_routes", "type": "Block", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 158, "tags": { "PURPOSE": "Register all application API routers." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "api.include_routers", "type": "Action", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 166, "tags": { "COMPLEXITY": "1", "PURPOSE": "Registers all API routers with the FastAPI application.", "LAYER": "API", "SEMANTICS": "routes, registration, api" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "websocket_endpoint", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 168, "end_line": 286, "tags": { "COMPLEXITY": "5", "PURPOSE": "Provides a WebSocket endpoint for real-time log streaming of a task with server-side filtering.", "PRE": "task_id must be a valid task ID.", "POST": "WebSocket connection is managed and logs are streamed until disconnect.", "SIDE_EFFECT": "Subscribes to TaskManager log queue and broadcasts messages over network.", "DATA_CONTRACT": "[task_id: str, source: str, level: str] -> [JSON log entry objects]", "UX_STATE": "Connecting -> Streaming -> (Disconnected)", "TEST_CONTRACT": "WebSocketLogStreamApi ->", "TEST_FIXTURE": "valid_ws_connection -> {\"task_id\": \"test_1\", \"source\": \"plugin\"}", "TEST_EDGE": "empty_task_logs -> waits for new logs", "TEST_INVARIANT": "consistent_streaming -> verifies: [valid_ws_connection]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 168 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 168 } ], "score": 0.0 } }, { "name": "StaticFiles", "type": "Mount", "complexity": 1, "tier": "TRIVIAL", "start_line": 288, "end_line": 327, "tags": { "COMPLEXITY": "1", "SEMANTICS": "static, frontend, spa", "PURPOSE": "Mounts the frontend build directory to serve static assets." }, "relations": [], "children": [ { "name": "serve_spa", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 296, "end_line": 315, "tags": { "COMPLEXITY": "1", "PURPOSE": "Serves the SPA frontend for any path not matched by API routes.", "PRE": "frontend_path exists.", "POST": "Returns the requested file or index.html." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "read_root", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 317, "end_line": 326, "tags": { "COMPLEXITY": "1", "PURPOSE": "A simple root endpoint to confirm that the API is running when frontend is missing.", "PRE": "None.", "POST": "Returns a JSON message indicating API status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "matches_filters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 220, "end_line": 220, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 328 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.8166666666666667 } }, { "name": "AppDependencies", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 246, "tags": { "COMPLEXITY": "3", "SEMANTICS": "dependency, injection, singleton, factory, auth, jwt", "PURPOSE": "Manages creation and provision of shared application dependencies, such as PluginLoader and TaskManager, to avoid circular imports.", "LAYER": "Core", "RELATION": "Used by main app and API routers to get access to shared instances." }, "relations": [ { "type": "CALLS", "target": "CleanReleaseRepository" }, { "type": "CALLS", "target": "ConfigManager" }, { "type": "CALLS", "target": "PluginLoader" }, { "type": "CALLS", "target": "SchedulerService" }, { "type": "CALLS", "target": "TaskManager" }, { "type": "CALLS", "target": "get_all_plugin_configs" }, { "type": "CALLS", "target": "get_db" }, { "type": "CALLS", "target": "info" }, { "type": "CALLS", "target": "init_db" } ], "children": [ { "name": "get_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 60, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for ConfigManager.", "PRE": "Global config_manager must be initialized.", "POST": "Returns shared ConfigManager instance.", "RETURN": "ConfigManager - The shared config manager instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_plugin_loader", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 91, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for PluginLoader.", "PRE": "Global plugin_loader must be initialized.", "POST": "Returns shared PluginLoader instance.", "RETURN": "PluginLoader - The shared plugin loader instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_task_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 102, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for TaskManager.", "PRE": "Global task_manager must be initialized.", "POST": "Returns shared TaskManager instance.", "RETURN": "TaskManager - The shared task manager instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_scheduler_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 113, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for SchedulerService.", "PRE": "Global scheduler_service must be initialized.", "POST": "Returns shared SchedulerService instance.", "RETURN": "SchedulerService - The shared scheduler service instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_resource_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 124, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for ResourceService.", "PRE": "Global resource_service must be initialized.", "POST": "Returns shared ResourceService instance.", "RETURN": "ResourceService - The shared resource service instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_mapping_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 126, "end_line": 135, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for MappingService.", "PRE": "Global config_manager must be initialized.", "POST": "Returns new MappingService instance.", "RETURN": "MappingService - A new mapping service instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_clean_release_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 147, "tags": { "COMPLEXITY": "1", "PURPOSE": "Legacy compatibility shim for CleanReleaseRepository.", "POST": "Returns a shared CleanReleaseRepository instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_clean_release_facade", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 177, "tags": { "COMPLEXITY": "1", "PURPOSE": "Dependency injector for CleanReleaseFacade.", "POST": "Returns a facade instance with a fresh DB session." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "oauth2_scheme", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 179, "end_line": 183, "tags": { "COMPLEXITY": "1", "PURPOSE": "OAuth2 password bearer scheme for token extraction." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_current_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 185, "end_line": 213, "tags": { "COMPLEXITY": "3", "PURPOSE": "Dependency for retrieving currently authenticated user from a JWT.", "PRE": "JWT token provided in Authorization header.", "POST": "Returns User object if token is valid.", "THROW": "HTTPException 401 if token is invalid or user not found.", "PARAM": "db (Session) - Auth database session.", "RETURN": "User - The authenticated user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 185 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 185 } ], "score": 0.5499999999999999 } }, { "name": "has_permission", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 215, "end_line": 244, "tags": { "COMPLEXITY": "3", "PURPOSE": "Dependency for checking if the current user has a specific permission.", "PRE": "User is authenticated.", "POST": "Returns True if user has permission.", "THROW": "HTTPException 403 if permission is denied.", "PARAM": "action (str) - The action identifier (READ, EXECUTE, WRITE).", "RETURN": "User - The authenticated user if permission granted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 215 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 215 } ], "score": 0.5499999999999999 } }, { "name": "permission_checker", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 225, "end_line": 225, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "SrcRoot", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Canonical backend package root for application, scripts, and tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.scripts.seed_superset_load_test", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 300, "tags": { "COMPLEXITY": "3", "SEMANTICS": "superset, load-test, charts, dashboards, seed, stress", "PURPOSE": "Creates randomized load-test data in Superset by cloning chart configurations and creating dashboards in target environments.", "LAYER": "Scripts", "INVARIANT": "Created chart and dashboard names are globally unique for one script run." }, "relations": [ { "type": "USES", "target": "backend.src.core.config_manager.ConfigManager" }, { "type": "USES", "target": "backend.src.core.superset_client.SupersetClient" } ], "children": [ { "name": "_parse_args", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 43, "tags": { "PURPOSE": "Parses CLI arguments for load-test data generation.", "PRE": "Script is called from CLI.", "POST": "Returns validated argument namespace." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_result_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 55, "tags": { "PURPOSE": "Normalizes Superset API payloads that may be wrapped in `result`.", "PRE": "payload is a JSON-decoded API response.", "POST": "Returns the unwrapped object when present." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_created_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 70, "tags": { "PURPOSE": "Extracts object ID from create/update API response.", "PRE": "payload is a JSON-decoded API response.", "POST": "Returns integer object ID or None if missing." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_generate_unique_name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 86, "tags": { "PURPOSE": "Generates globally unique random names for charts/dashboards.", "PRE": "used_names is mutable set for collision tracking.", "POST": "Returns a unique string and stores it in used_names." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_target_envs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 118, "tags": { "PURPOSE": "Resolves requested environment IDs from configuration.", "PRE": "env_ids is non-empty.", "POST": "Returns mapping env_id -> configured environment object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_chart_template_pool", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 175, "tags": { "PURPOSE": "Builds a pool of source chart templates to clone in one environment.", "PRE": "Client is authenticated.", "POST": "Returns non-empty list of chart payload templates." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "seed_superset_load_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 280, "tags": { "PURPOSE": "Creates dashboards and cloned charts for load testing across target environments.", "PRE": "Target environments must be reachable and authenticated.", "POST": "Returns execution statistics dictionary.", "SIDE_EFFECT": "Creates objects in Superset environments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "main", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 283, "end_line": 294, "tags": { "PURPOSE": "CLI entrypoint for Superset load-test data seeding.", "PRE": "Command line arguments are valid.", "POST": "Prints summary and exits with non-zero status on failure." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 300 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "test_dataset_dashboard_relations", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 166, "tags": { "PURPOSE": "Auto-generated module for backend/src/scripts/test_dataset_dashboard_relations.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "test_dashboard_dataset_relations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.scripts.clean_release_tui", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 600, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, tui, ncurses, interactive-validator", "PURPOSE": "Interactive terminal interface for Enterprise Clean Release compliance validation.", "LAYER": "UI", "INVARIANT": "TUI refuses startup in non-TTY environments; headless flow is CLI/API only." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.compliance_orchestrator" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" } ], "children": [ { "name": "TuiFacadeAdapter", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 142, "tags": { "PURPOSE": "Thin TUI adapter that routes business mutations through application services.", "PRE": "repository contains candidate and trusted policy/registry snapshots for execution.", "POST": "Business actions return service results/errors without direct TUI-owned mutations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanReleaseTUI", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 573, "tags": { "PURPOSE": "Curses-based application for compliance monitoring.", "UX_STATE": "BLOCKED -> Violations detected, release forbidden.", "UX_FEEDBACK": "Red alerts for BLOCKED status, Green for COMPLIANT." }, "relations": [], "children": [ { "name": "run_checks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 436, "end_line": 475, "tags": { "PURPOSE": "Execute compliance run via facade adapter and update UI state.", "PRE": "Candidate and policy snapshots are present in repository.", "POST": "UI reflects final run/report/violation state from service result." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_compliance", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "approve_latest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "publish_latest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 90, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_overview", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 153, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 175, "end_line": 175, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_bootstrap_demo_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_bootstrap_real_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 256, "end_line": 256, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_candidate_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 325, "end_line": 325, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "draw_header", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 335, "end_line": 335, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "draw_checks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 353, "end_line": 353, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "draw_sources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 386, "end_line": 386, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "draw_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 397, "end_line": 397, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "draw_footer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 430, "end_line": 430, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 477, "end_line": 477, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clear_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 490, "end_line": 490, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "approve_latest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 499, "end_line": 499, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "publish_latest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 512, "end_line": 512, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh_overview", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 525, "end_line": 525, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh_overview", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 538, "end_line": 538, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh_screen", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 544, "end_line": 544, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "loop", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 557, "end_line": 557, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "tui_main", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 576, "end_line": 576, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "main", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 582, "end_line": 582, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 600 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.scripts.migrate_sqlite_to_postgres", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 361, "tags": { "COMPLEXITY": "3", "SEMANTICS": "migration, sqlite, postgresql, config, task_logs, task_records", "PURPOSE": "Migrates legacy config and task history from SQLite/file storage to PostgreSQL.", "LAYER": "Scripts", "INVARIANT": "Script is idempotent for task_records and app_configurations." }, "relations": [ { "type": "READS_FROM", "target": "backend/tasks.db" }, { "type": "READS_FROM", "target": "backend/config.json" }, { "type": "WRITES_TO", "target": "postgresql.task_records" }, { "type": "WRITES_TO", "target": "postgresql.task_logs" }, { "type": "WRITES_TO", "target": "postgresql.app_configurations" } ], "children": [ { "name": "Constants", "type": "Section", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 35, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_json_load_if_needed", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 38, "end_line": 59, "tags": { "COMPLEXITY": "3", "PURPOSE": "Parses JSON-like values from SQLite TEXT/JSON columns to Python objects.", "PRE": "value is scalar JSON/text/list/dict or None.", "POST": "Returns normalized Python object or original scalar value." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 38 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 38 } ], "score": 0.5499999999999999 } }, { "name": "_find_legacy_config_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 78, "tags": { "PURPOSE": "Resolves the existing legacy config.json path from candidates." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_connect_sqlite", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 88, "tags": { "PURPOSE": "Opens a SQLite connection with row factory." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_ensure_target_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 153, "tags": { "PURPOSE": "Ensures required PostgreSQL tables exist before migration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_migrate_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 179, "tags": { "PURPOSE": "Migrates legacy config.json into app_configurations(global)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_migrate_tasks_and_logs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 182, "end_line": 295, "tags": { "PURPOSE": "Migrates task_records and task_logs from SQLite into PostgreSQL." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_migration", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 298, "end_line": 316, "tags": { "PURPOSE": "Orchestrates migration from SQLite/file to PostgreSQL." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "main", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 319, "end_line": 359, "tags": { "PURPOSE": "CLI entrypoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: READS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: READS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: WRITES_TO. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: WRITES_TO. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: WRITES_TO. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 361 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.02500000000000009 } }, { "name": "backend.src.scripts.clean_release_cli", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 444, "tags": { "COMPLEXITY": "3", "SEMANTICS": "cli, clean-release, candidate, artifacts, manifest", "PURPOSE": "Provide headless CLI commands for candidate registration, artifact import and manifest build.", "LAYER": "Scripts" }, "relations": [], "children": [ { "name": "build_parser", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 91, "tags": { "PURPOSE": "Build argparse parser for clean release CLI." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_candidate_register", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 117, "tags": { "PURPOSE": "Register candidate in repository via CLI command.", "PRE": "Candidate ID must be unique.", "POST": "Candidate is persisted in DRAFT status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_artifact_import", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 147, "tags": { "PURPOSE": "Import single artifact for existing candidate.", "PRE": "Candidate must exist.", "POST": "Artifact is persisted for candidate." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_manifest_build", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 171, "tags": { "PURPOSE": "Build immutable manifest snapshot for candidate.", "PRE": "Candidate must exist.", "POST": "New manifest version is persisted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_compliance_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 174, "end_line": 206, "tags": { "PURPOSE": "Execute compliance run for candidate with optional manifest fallback.", "PRE": "Candidate exists and trusted snapshots are configured.", "POST": "Returns run payload and exit code 0 on success." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_compliance_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 209, "end_line": 234, "tags": { "PURPOSE": "Read run status by run id.", "PRE": "Run exists.", "POST": "Returns run status payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_to_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 237, "end_line": 262, "tags": { "PURPOSE": "Serialize domain models for CLI JSON output across SQLAlchemy/Pydantic variants.", "PRE": "value is serializable model or primitive object.", "POST": "Returns dictionary payload without mutating value." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_compliance_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 265, "end_line": 285, "tags": { "PURPOSE": "Read immutable report by run id.", "PRE": "Run and report exist.", "POST": "Returns report payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_compliance_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 288, "end_line": 304, "tags": { "PURPOSE": "Read run violations by run id.", "PRE": "Run exists.", "POST": "Returns violations payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_approve", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 307, "end_line": 329, "tags": { "PURPOSE": "Approve candidate based on immutable PASSED report.", "PRE": "Candidate and report exist; report is PASSED.", "POST": "Persists APPROVED decision and returns success payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_reject", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 332, "end_line": 354, "tags": { "PURPOSE": "Reject candidate without mutating compliance evidence.", "PRE": "Candidate and report exist.", "POST": "Persists REJECTED decision and returns success payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_publish", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 357, "end_line": 380, "tags": { "PURPOSE": "Publish approved candidate to target channel.", "PRE": "Candidate is approved and report belongs to candidate.", "POST": "Appends ACTIVE publication record and returns payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_revoke", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 383, "end_line": 404, "tags": { "PURPOSE": "Revoke active publication record.", "PRE": "Publication id exists and is ACTIVE.", "POST": "Publication record status becomes REVOKED." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "main", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 407, "end_line": 438, "tags": { "PURPOSE": "CLI entrypoint for clean release commands." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 242, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 444 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "backend.src.scripts.seed_permissions", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 118, "tags": { "SEMANTICS": "setup, database, auth, permissions, seeding", "PURPOSE": "Populates the auth database with initial system permissions.", "LAYER": "Scripts", "INVARIANT": "Safe to run multiple times (idempotent)." }, "relations": [ { "type": "USES", "target": "backend.src.core.database.get_auth_db" }, { "type": "USES", "target": "backend.src.models.auth.Permission" } ], "children": [ { "name": "INITIAL_PERMISSIONS", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 50, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "seed_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 113, "tags": { "PURPOSE": "Inserts missing permissions into the database.", "POST": "All INITIAL_PERMISSIONS exist in the DB." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "backend.src.scripts.init_auth_db", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 45, "tags": { "SEMANTICS": "setup, database, auth, migration", "PURPOSE": "Initializes the auth database and creates the necessary tables.", "LAYER": "Scripts", "INVARIANT": "Safe to run multiple times (idempotent)." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.database.init_db" } ], "children": [ { "name": "run_init", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 40, "tags": { "PURPOSE": "Main entry point for the initialization script.", "POST": "auth.db is initialized with the correct schema and seeded permissions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.scripts.create_admin", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 94, "tags": { "COMPLEXITY": "3", "SEMANTICS": "admin, setup, user, auth, cli", "PURPOSE": "CLI tool for creating the initial admin user.", "LAYER": "Scripts", "INVARIANT": "Admin user must have the \"Admin\" role." }, "relations": [ { "type": "USES", "target": "backend.src.core.auth.security" }, { "type": "USES", "target": "backend.src.core.database" }, { "type": "USES", "target": "backend.src.models.auth" } ], "children": [ { "name": "create_admin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 77, "tags": { "PURPOSE": "Creates an admin user and necessary roles/permissions.", "PRE": "username and password provided via CLI.", "POST": "Admin user exists in auth.db.", "PARAM": "email (str | None) - Optional admin email." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "src.scripts", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Script entrypoint package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.schemas.health", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 35, "tags": { "COMPLEXITY": "3", "SEMANTICS": "health, schemas, pydantic", "PURPOSE": "Pydantic schemas for dashboard health summary.", "LAYER": "Domain" }, "relations": [], "children": [ { "name": "DashboardHealthItem", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 23, "tags": { "PURPOSE": "Represents the latest health status of a single dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "HealthSummaryResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 33, "tags": { "PURPOSE": "Aggregated health summary for all dashboards." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.schemas.settings", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 68, "tags": { "COMPLEXITY": "3", "SEMANTICS": "settings, schemas, pydantic, validation", "PURPOSE": "Pydantic schemas for application settings and automation policies.", "LAYER": "Domain" }, "relations": [], "children": [ { "name": "NotificationChannel", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 16, "tags": { "PURPOSE": "Structured notification channel definition for policy-level custom routing." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationPolicyBase", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 34, "tags": { "PURPOSE": "Base schema for validation policy data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationPolicyCreate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 40, "tags": { "PURPOSE": "Schema for creating a new validation policy." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationPolicyUpdate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 55, "tags": { "PURPOSE": "Schema for updating an existing validation policy." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationPolicyResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 66, "tags": { "PURPOSE": "Schema for validation policy response data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.schemas.auth", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 128, "tags": { "COMPLEXITY": "3", "SEMANTICS": "auth, schemas, pydantic, user, token", "PURPOSE": "Pydantic schemas for authentication requests and responses.", "LAYER": "API", "INVARIANT": "Sensitive fields like password must not be included in response schemas." }, "relations": [ { "type": "DEPENDS_ON", "target": "pydantic" } ], "children": [ { "name": "Token", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 23, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents a JWT access token response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TokenData", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 31, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents the data encoded in a JWT token." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PermissionSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 43, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents a permission in API responses." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RoleSchema", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 45, "end_line": 55, "tags": { "PURPOSE": "Represents a role in API responses." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 45 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 45 } ], "score": 0.0 } }, { "name": "RoleCreate", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 57, "end_line": 63, "tags": { "PURPOSE": "Schema for creating a new role." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 57 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 57 } ], "score": 0.0 } }, { "name": "RoleUpdate", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 65, "end_line": 71, "tags": { "PURPOSE": "Schema for updating an existing role." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 65 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 65 } ], "score": 0.0 } }, { "name": "ADGroupMappingSchema", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 73, "end_line": 82, "tags": { "PURPOSE": "Represents an AD Group to Role mapping in API responses." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 73 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 73 } ], "score": 0.0 } }, { "name": "ADGroupMappingCreate", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 84, "end_line": 89, "tags": { "PURPOSE": "Schema for creating an AD Group mapping." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 84 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 84 } ], "score": 0.0 } }, { "name": "UserBase", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 91, "end_line": 97, "tags": { "PURPOSE": "Base schema for user data." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 91 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 91 } ], "score": 0.0 } }, { "name": "UserCreate", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 99, "end_line": 104, "tags": { "PURPOSE": "Schema for creating a new user." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 99 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 99 } ], "score": 0.0 } }, { "name": "UserUpdate", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 106, "end_line": 113, "tags": { "PURPOSE": "Schema for updating an existing user." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 106 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 106 } ], "score": 0.0 } }, { "name": "User", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 115, "end_line": 126, "tags": { "PURPOSE": "Schema for user data in API responses." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 115 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 115 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.schemas.profile", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 180, "tags": { "COMPLEXITY": "3", "SEMANTICS": "profile, schemas, pydantic, preferences, superset, lookup, security, git, ux", "PURPOSE": "Defines API schemas for profile preference persistence, security read-only snapshot, and Superset account lookup.", "LAYER": "API", "INVARIANT": "Schema shapes stay stable for profile UI states and backend preference contracts." }, "relations": [ { "type": "DEPENDS_ON", "target": "pydantic" } ], "children": [ { "name": "ProfilePermissionState", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 18, "end_line": 24, "tags": { "COMPLEXITY": "3", "PURPOSE": "Represents one permission badge state for profile read-only security view." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 18 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 18 } ], "score": 0.5499999999999999 } }, { "name": "ProfileSecuritySummary", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 27, "end_line": 37, "tags": { "COMPLEXITY": "3", "PURPOSE": "Read-only security and access snapshot for current user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 27 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 27 } ], "score": 0.5499999999999999 } }, { "name": "ProfilePreference", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 40, "end_line": 68, "tags": { "COMPLEXITY": "3", "PURPOSE": "Represents persisted profile preference for a single authenticated user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 40 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 40 } ], "score": 0.5499999999999999 } }, { "name": "ProfilePreferenceUpdateRequest", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 71, "end_line": 127, "tags": { "COMPLEXITY": "3", "PURPOSE": "Request payload for updating current user's profile settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 } ], "score": 0.5499999999999999 } }, { "name": "ProfilePreferenceResponse", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 130, "end_line": 139, "tags": { "COMPLEXITY": "3", "PURPOSE": "Response envelope for profile preference read/update endpoints." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 130 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 130 } ], "score": 0.5499999999999999 } }, { "name": "SupersetAccountLookupRequest", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 142, "end_line": 152, "tags": { "COMPLEXITY": "3", "PURPOSE": "Query contract for Superset account lookup by selected environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 142 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 142 } ], "score": 0.5499999999999999 } }, { "name": "SupersetAccountCandidate", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 155, "end_line": 164, "tags": { "COMPLEXITY": "3", "PURPOSE": "Canonical account candidate projected from Superset users payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 } ], "score": 0.5499999999999999 } }, { "name": "SupersetAccountLookupResponse", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 167, "end_line": 178, "tags": { "COMPLEXITY": "3", "PURPOSE": "Response envelope for Superset account lookup (success or degraded mode)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 167 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 167 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "src.schemas", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "API schema package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.schemas.__tests__.test_settings_and_health_schemas", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 84, "tags": { "COMPLEXITY": "3", "PURPOSE": "Regression tests for settings and health schema contracts updated in 026 fix batch." }, "relations": [], "children": [ { "name": "test_validation_policy_create_accepts_structured_custom_channels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 33, "tags": { "PURPOSE": "Ensure policy schema accepts structured custom channel objects with type/target fields." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_validation_policy_create_rejects_legacy_string_custom_channels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 52, "tags": { "PURPOSE": "Ensure legacy list[str] custom channel payload is rejected by typed channel contract." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dashboard_health_item_status_accepts_only_whitelisted_values", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 81, "tags": { "PURPOSE": "Verify strict grouped regex only accepts PASS/WARN/FAIL/UNKNOWN exact statuses." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.core.superset_profile_lookup", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 238, "tags": { "COMPLEXITY": "3", "SEMANTICS": "superset, users, lookup, profile, pagination, normalization", "PURPOSE": "Provides environment-scoped Superset account lookup adapter with stable normalized output.", "LAYER": "Core", "INVARIANT": "Adapter never leaks raw upstream payload shape to API consumers." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.utils.network.APIClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.logger" } ], "children": [ { "name": "SupersetAccountLookupAdapter", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 21, "end_line": 236, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lookup Superset users and normalize candidates for profile binding." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 32, "tags": { "PURPOSE": "Initializes lookup adapter with authenticated API client and environment context.", "PRE": "network_client supports request(method, endpoint, params=...).", "POST": "Adapter is ready to perform users lookup requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_users_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 136, "tags": { "PURPOSE": "Fetch one users page from Superset with passthrough search/sort parameters.", "PRE": "page_index >= 0 and page_size >= 1.", "POST": "Returns deterministic payload with normalized items and total count.", "RETURN": "Dict[str, Any]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_lookup_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 197, "tags": { "PURPOSE": "Convert Superset users response variants into stable candidates payload.", "PRE": "response can be dict/list in any supported upstream shape.", "POST": "Output contains canonical keys: status, environment_id, page_index, page_size, total, items.", "RETURN": "Dict[str, Any]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalize_user_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 235, "tags": { "PURPOSE": "Project raw Superset user object to canonical candidate shape.", "PRE": "raw_user may have heterogenous key names between Superset versions.", "POST": "Returns normalized candidate keys (environment_id, username, display_name, email, is_active).", "RETURN": "Dict[str, Any]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 21 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 21 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.core.superset_client", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 1186, "tags": { "COMPLEXITY": "3", "SEMANTICS": "superset, api, client, rest, http, dashboard, dataset, import, export", "PURPOSE": "\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Superset REST API, \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044f \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e.", "LAYER": "Core", "INVARIANT": "All network operations must use the internal APIClient instance.", "PUBLIC_API": "SupersetClient" }, "relations": [ { "type": "USES", "target": "backend.src.core.utils.network.APIClient" }, { "type": "USES", "target": "backend.src.core.config_models.Environment" } ], "children": [ { "name": "backend.src.core.superset_client.SupersetClient", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 27, "end_line": 1184, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041a\u043b\u0430\u0441\u0441-\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 Superset REST API, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430\u043c\u0438 \u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.utils.network.APIClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.config_models.Environment" } ], "children": [ { "name": "backend.src.core.superset_client.SupersetClient.__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 33, "end_line": 60, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442.", "PRE": "`env` \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Environment.", "POST": "\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b `env` \u0438 `network` \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435.", "DATA_CONTRACT": "Input[Environment] -> self.network[APIClient]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 33 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 33 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 33 } ], "score": 0.4 } }, { "name": "backend.src.core.superset_client.SupersetClient.authenticate", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 62, "end_line": 72, "tags": { "COMPLEXITY": "3", "PURPOSE": "Authenticates the client using the configured credentials.", "PRE": "self.network must be initialized with valid auth configuration.", "POST": "Client is authenticated and tokens are stored.", "DATA_CONTRACT": "None -> Output[Dict[str, str]]" }, "relations": [ { "type": "CALLS", "target": "self.network.authenticate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 83, "tags": { "COMPLEXITY": "1", "PURPOSE": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c.", "PRE": "APIClient is initialized and authenticated.", "POST": "Returns a dictionary of HTTP headers." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboards", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 87, "end_line": 119, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e.", "PRE": "Client is authenticated.", "POST": "Returns a tuple with total count and list of dashboards.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self._fetch_all_pages" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboards_page", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 121, "end_line": 156, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches a single dashboards page from Superset without iterating all pages.", "PRE": "Client is authenticated.", "POST": "Returns total count and one page of dashboards.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboards_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 158, "end_line": 241, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches dashboard metadata optimized for the grid.", "PRE": "Client is authenticated.", "POST": "Returns a list of dashboard metadata summaries.", "DATA_CONTRACT": "None -> Output[List[Dict]]" }, "relations": [ { "type": "CALLS", "target": "self.get_dashboards" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboards_summary_page", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 243, "end_line": 314, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches one page of dashboard metadata optimized for the grid.", "PRE": "page >= 1 and page_size > 0.", "POST": "Returns mapped summaries and total dashboard count.", "DATA_CONTRACT": "Input[page: int, page_size: int] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self.get_dashboards_page" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient._extract_owner_labels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 316, "end_line": 342, "tags": { "COMPLEXITY": "1", "PURPOSE": "Normalize dashboard owners payload to stable display labels.", "PRE": "owners payload can be scalar, object or list.", "POST": "Returns deduplicated non-empty owner labels preserving order.", "DATA_CONTRACT": "Input[Any] -> Output[List[str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._extract_user_display", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 344, "end_line": 371, "tags": { "COMPLEXITY": "1", "PURPOSE": "Normalize user payload to a stable display name.", "PRE": "user payload can be string, dict or None.", "POST": "Returns compact non-empty display value or None.", "DATA_CONTRACT": "Input[Optional[str], Optional[Dict]] -> Output[Optional[str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._sanitize_user_text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 373, "end_line": 385, "tags": { "COMPLEXITY": "1", "PURPOSE": "Convert scalar value to non-empty user-facing text.", "PRE": "value can be any scalar type.", "POST": "Returns trimmed string or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 387, "end_line": 398, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches a single dashboard by ID.", "PRE": "Client is authenticated and dashboard_id exists.", "POST": "Returns dashboard payload from Superset API.", "DATA_CONTRACT": "Input[dashboard_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_chart", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 400, "end_line": 411, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches a single chart by ID.", "PRE": "Client is authenticated and chart_id exists.", "POST": "Returns chart payload from Superset API.", "DATA_CONTRACT": "Input[chart_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dashboard_detail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 413, "end_line": 608, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches detailed dashboard information including related charts and datasets.", "PRE": "Client is authenticated and dashboard_id exists.", "POST": "Returns dashboard metadata with charts and datasets lists.", "DATA_CONTRACT": "Input[dashboard_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.get_dashboard" }, { "type": "CALLS", "target": "self.get_chart" } ], "children": [ { "name": "backend.src.core.superset_client.SupersetClient.get_dashboard_detail.extract_dataset_id_from_form_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 429, "end_line": 452, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_charts", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 610, "end_line": 628, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches all charts with pagination support.", "PRE": "Client is authenticated.", "POST": "Returns total count and charts list.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self._fetch_all_pages" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient._extract_chart_ids_from_layout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 630, "end_line": 661, "tags": { "COMPLEXITY": "1", "PURPOSE": "Traverses dashboard layout metadata and extracts chart IDs from common keys.", "PRE": "payload can be dict/list/scalar.", "POST": "Returns a set of chart IDs found in nested structures." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient.export_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 663, "end_line": 686, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0432 \u0432\u0438\u0434\u0435 ZIP-\u0430\u0440\u0445\u0438\u0432\u0430.", "PRE": "dashboard_id must exist in Superset.", "POST": "Returns ZIP content and filename.", "DATA_CONTRACT": "Input[dashboard_id: int] -> Output[Tuple[bytes, str]]", "SIDE_EFFECT": "Performs network I/O to download archive." }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.import_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 688, "end_line": 718, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0438\u0437 ZIP-\u0444\u0430\u0439\u043b\u0430.", "PRE": "file_name must be a valid ZIP dashboard export.", "POST": "Dashboard is imported or re-imported after deletion.", "DATA_CONTRACT": "Input[file_name: Union[str, Path]] -> Output[Dict]", "SIDE_EFFECT": "Performs network I/O to upload archive." }, "relations": [ { "type": "CALLS", "target": "self._do_import" }, { "type": "CALLS", "target": "self.delete_dashboard" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.delete_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 720, "end_line": 736, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u043f\u043e \u0435\u0433\u043e ID \u0438\u043b\u0438 slug.", "PRE": "dashboard_id must exist.", "POST": "Dashboard is removed from Superset.", "SIDE_EFFECT": "Deletes resource from upstream Superset environment." }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_datasets", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 738, "end_line": 757, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e.", "PRE": "Client is authenticated.", "POST": "Returns total count and list of datasets.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self._fetch_all_pages" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_datasets_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 759, "end_line": 782, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches dataset metadata optimized for the Dataset Hub grid.", "PRE": "Client is authenticated.", "POST": "Returns a list of dataset metadata summaries.", "RETURN": "List[Dict]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 759 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 759 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 759 } ], "score": 0.4 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dataset_detail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 784, "end_line": 895, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches detailed dataset information including columns and linked dashboards", "PRE": "Client is authenticated and dataset_id exists.", "POST": "Returns detailed dataset info with columns and linked dashboards.", "PARAM": "dataset_id (int) - The dataset ID to fetch details for.", "RETURN": "Dict - Dataset details with columns and linked_dashboards." }, "relations": [ { "type": "CALLS", "target": "self.get_dataset" }, { "type": "CALLS", "target": "self.network.request (for related_objects)" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_dataset", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 897, "end_line": 911, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 \u043f\u043e \u0435\u0433\u043e ID.", "PRE": "dataset_id must exist.", "POST": "Returns dataset details.", "DATA_CONTRACT": "Input[dataset_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.update_dataset", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 913, "end_line": 933, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u043f\u043e \u0435\u0433\u043e ID.", "PRE": "dataset_id must exist.", "POST": "Dataset is updated in Superset.", "DATA_CONTRACT": "Input[dataset_id: int, data: Dict] -> Output[Dict]", "SIDE_EFFECT": "Modifies resource in upstream Superset environment." }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_databases", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 935, "end_line": 956, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445.", "PRE": "Client is authenticated.", "POST": "Returns total count and list of databases.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [ { "type": "CALLS", "target": "self._fetch_all_pages" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_database", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 958, "end_line": 972, "tags": { "COMPLEXITY": "3", "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0435\u0451 ID.", "PRE": "database_id must exist.", "POST": "Returns database details.", "DATA_CONTRACT": "Input[database_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.network.request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_databases_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 974, "end_line": 993, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch a summary of databases including uuid, name, and engine.", "PRE": "Client is authenticated.", "POST": "Returns list of database summaries.", "DATA_CONTRACT": "None -> Output[List[Dict]]" }, "relations": [ { "type": "CALLS", "target": "self.get_databases" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_database_by_uuid", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 995, "end_line": 1009, "tags": { "COMPLEXITY": "3", "PURPOSE": "Find a database by its UUID.", "PRE": "db_uuid must be a valid UUID string.", "POST": "Returns database info or None.", "DATA_CONTRACT": "Input[db_uuid: str] -> Output[Optional[Dict]]" }, "relations": [ { "type": "CALLS", "target": "self.get_databases" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "backend.src.core.superset_client.SupersetClient._resolve_target_id_for_delete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1011, "end_line": 1032, "tags": { "COMPLEXITY": "1", "PURPOSE": "Resolves a dashboard ID from either an ID or a slug.", "PRE": "Either dash_id or dash_slug should be provided.", "POST": "Returns the resolved ID or None." }, "relations": [ { "type": "CALLS", "target": "self.get_dashboards" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._do_import", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1034, "end_line": 1054, "tags": { "COMPLEXITY": "1", "PURPOSE": "Performs the actual multipart upload for import.", "PRE": "file_name must be a path to an existing ZIP file.", "POST": "Returns the API response from the upload." }, "relations": [ { "type": "CALLS", "target": "self.network.upload_file" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._validate_export_response", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1056, "end_line": 1068, "tags": { "COMPLEXITY": "1", "PURPOSE": "Validates that the export response is a non-empty ZIP archive.", "PRE": "response must be a valid requests.Response object.", "POST": "Raises SupersetAPIError if validation fails." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._resolve_export_filename", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1070, "end_line": 1084, "tags": { "COMPLEXITY": "1", "PURPOSE": "Determines the filename for an exported dashboard.", "PRE": "response must contain Content-Disposition header or dashboard_id must be provided.", "POST": "Returns a sanitized filename string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._validate_query_params", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1086, "end_line": 1097, "tags": { "COMPLEXITY": "1", "PURPOSE": "Ensures query parameters have default page and page_size.", "PRE": "query can be None or a dictionary.", "POST": "Returns a dictionary with at least page and page_size." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._fetch_total_object_count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1099, "end_line": 1112, "tags": { "COMPLEXITY": "1", "PURPOSE": "Fetches the total number of items for a given endpoint.", "PRE": "endpoint must be a valid Superset API path.", "POST": "Returns the total count as an integer." }, "relations": [ { "type": "CALLS", "target": "self.network.fetch_paginated_count" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._fetch_all_pages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1114, "end_line": 1122, "tags": { "COMPLEXITY": "1", "PURPOSE": "Iterates through all pages to collect all data items.", "PRE": "pagination_options must contain base_query, total_count, and results_field.", "POST": "Returns a combined list of all items." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient._validate_import_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1124, "end_line": 1139, "tags": { "COMPLEXITY": "1", "PURPOSE": "Validates that the file to be imported is a valid ZIP with metadata.yaml.", "PRE": "zip_path must be a path to a file.", "POST": "Raises error if file is missing, not a ZIP, or missing metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.superset_client.SupersetClient.get_all_resources", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1141, "end_line": 1182, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetches all resources of a given type with id, uuid, and name columns.", "PARAM": "resource_type (str) - One of \"chart\", \"dataset\", \"dashboard\".", "PRE": "Client is authenticated. resource_type is valid.", "POST": "Returns a list of resource dicts with at minimum id, uuid, and name fields.", "RETURN": "List[Dict]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1141 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1141 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1141 } ], "score": 0.4 } } ], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 39, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "authenticate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 128, "end_line": 128, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards_summary_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 250, "end_line": 250, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_owner_labels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 322, "end_line": 322, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_user_display", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 350, "end_line": 350, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sanitize_user_text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 378, "end_line": 378, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 394, "end_line": 394, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_chart", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 407, "end_line": 407, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboard_detail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 421, "end_line": 421, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extract_dataset_id_from_form_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 430, "end_line": 430, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_charts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 617, "end_line": 617, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_chart_ids_from_layout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 635, "end_line": 635, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "walk", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 639, "end_line": 639, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "export_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 671, "end_line": 671, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "import_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 697, "end_line": 697, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 727, "end_line": 727, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_datasets", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 745, "end_line": 745, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_datasets_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 765, "end_line": 765, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dataset_detail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 793, "end_line": 793, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "as_bool", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 795, "end_line": 795, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dataset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 904, "end_line": 904, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_dataset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 921, "end_line": 921, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_databases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 942, "end_line": 942, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_database", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 965, "end_line": 965, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_databases_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 981, "end_line": 981, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_database_by_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1002, "end_line": 1002, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_target_id_for_delete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1017, "end_line": 1017, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_do_import", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1040, "end_line": 1040, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_export_response", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1061, "end_line": 1061, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_export_filename", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1075, "end_line": 1075, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_query_params", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1091, "end_line": 1091, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_fetch_total_object_count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1105, "end_line": 1105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_fetch_all_pages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1119, "end_line": 1119, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_import_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1129, "end_line": 1129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_resources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1148, "end_line": 1148, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 1186 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.src.core.encryption_key", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 56, "tags": { "COMPLEXITY": "5", "SEMANTICS": "encryption, key, bootstrap, environment, startup", "PURPOSE": "Resolve and persist the Fernet encryption key required by runtime services.", "LAYER": "Infra", "INVARIANT": "Runtime key resolution never falls back to an ephemeral secret." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.logger" } ], "children": [ { "name": "ensure_encryption_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 54, "tags": { "PURPOSE": "Ensure backend runtime has a persistent valid Fernet key.", "PRE": "env_file_path points to a writable backend .env file or ENCRYPTION_KEY exists in process environment.", "POST": "Returns a valid Fernet key and guarantees it is present in process environment.", "SIDE_EFFECT": "May create or append backend/.env when key is missing." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "ConfigManager", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 433, "tags": { "COMPLEXITY": "5", "SEMANTICS": "config, manager, persistence, migration, postgresql", "PURPOSE": "Manages application configuration persistence in DB with one-time migration from legacy JSON.", "LAYER": "Domain", "PRE": "Database schema for AppConfigRecord must be initialized.", "POST": "Configuration is loaded into memory and logger is configured.", "SIDE_EFFECT": "Performs DB I/O and may update global logging level.", "DATA_CONTRACT": "Input[json, record] -> Model[AppConfig]", "INVARIANT": "Configuration must always be representable by AppConfig and persisted under global record id." }, "relations": [ { "type": "DEPENDS_ON", "target": "AppConfig" }, { "type": "DEPENDS_ON", "target": "SessionLocal" }, { "type": "DEPENDS_ON", "target": "AppConfigRecord" }, { "type": "CALLS", "target": "logger" }, { "type": "CALLS", "target": "configure_logger" } ], "children": [ { "name": "ConfigManager", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 31, "end_line": 432, "tags": { "COMPLEXITY": "5", "PURPOSE": "Handles application configuration load, validation, mutation, and persistence lifecycle.", "PRE": "Database is accessible and AppConfigRecord schema is loaded.", "POST": "Configuration state is synchronized between memory and database.", "SIDE_EFFECT": "Performs DB I/O, OS path validation, and logger reconfiguration." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 63, "tags": { "PURPOSE": "Initialize manager state from persisted or migrated configuration.", "PRE": "config_path is a non-empty string path.", "POST": "self.config is initialized as AppConfig and logger is configured.", "SIDE_EFFECT": "Reads config sources and updates logging configuration.", "DATA_CONTRACT": "Input(str config_path) -> Output(None; self.config: AppConfig)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_default_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 71, "tags": { "PURPOSE": "Build default application configuration fallback." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sync_raw_payload_from_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 93, "tags": { "PURPOSE": "Merge typed AppConfig state into raw payload while preserving unsupported legacy sections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_load_from_legacy_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 122, "tags": { "PURPOSE": "Load legacy JSON configuration for migration fallback path." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 131, "tags": { "PURPOSE": "Resolve global configuration record from DB." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_load_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 203, "tags": { "PURPOSE": "Load configuration from DB or perform one-time migration from legacy JSON." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_save_config_to_db", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 205, "end_line": 238, "tags": { "PURPOSE": "Persist provided AppConfig into the global DB configuration record." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 240, "end_line": 246, "tags": { "PURPOSE": "Persist current in-memory configuration state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 248, "end_line": 253, "tags": { "PURPOSE": "Return current in-memory configuration snapshot." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 255, "end_line": 260, "tags": { "PURPOSE": "Return full persisted payload including sections outside typed AppConfig schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 262, "end_line": 291, "tags": { "PURPOSE": "Persist configuration provided either as typed AppConfig or raw payload dict." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_global_settings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 293, "end_line": 301, "tags": { "PURPOSE": "Replace global settings and persist the resulting configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "validate_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 303, "end_line": 327, "tags": { "PURPOSE": "Validate that path exists and is writable, creating it when absent." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 329, "end_line": 334, "tags": { "PURPOSE": "Return all configured environments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "has_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 336, "end_line": 341, "tags": { "PURPOSE": "Check whether at least one environment exists in configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 343, "end_line": 355, "tags": { "PURPOSE": "Resolve a configured environment by identifier." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 357, "end_line": 378, "tags": { "PURPOSE": "Upsert environment by id into configuration and persist." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 380, "end_line": 407, "tags": { "PURPOSE": "Update existing environment by id and preserve masked password placeholder behavior." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 409, "end_line": 431, "tags": { "PURPOSE": "Delete environment by id and persist when deletion occurs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 31 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 31 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 433 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.8166666666666667 } }, { "name": "SchedulerModule", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 183, "tags": { "COMPLEXITY": "3", "SEMANTICS": "scheduler, apscheduler, cron, backup", "PURPOSE": "Manages scheduled tasks using APScheduler.", "LAYER": "Core", "RELATION": "Uses TaskManager to run scheduled backups." }, "relations": [], "children": [ { "name": "SchedulerService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 20, "end_line": 123, "tags": { "COMPLEXITY": "3", "SEMANTICS": "scheduler, service, apscheduler", "PURPOSE": "Provides a service to manage scheduled backup tasks." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 35, "tags": { "PURPOSE": "Initializes the scheduler service with task and config managers.", "PRE": "task_manager and config_manager must be provided.", "POST": "Scheduler instance is created but not started." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "start", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 47, "tags": { "PURPOSE": "Starts the background scheduler and loads initial schedules.", "PRE": "Scheduler should be initialized.", "POST": "Scheduler is running and schedules are loaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stop", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 58, "tags": { "PURPOSE": "Stops the background scheduler.", "PRE": "Scheduler should be running.", "POST": "Scheduler is shut down." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "load_schedules", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 73, "tags": { "PURPOSE": "Loads backup schedules from configuration and registers them.", "PRE": "config_manager must have valid configuration.", "POST": "All enabled backup jobs are added to the scheduler." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add_backup_job", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 95, "tags": { "PURPOSE": "Adds a scheduled backup job for an environment.", "PRE": "env_id and cron_expression must be valid strings.", "POST": "A new job is added to the scheduler or replaced if it already exists.", "PARAM": "cron_expression (str) - The cron expression for the schedule." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_trigger_backup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 121, "tags": { "PURPOSE": "Triggered by the scheduler to start a backup task.", "PRE": "env_id must be a valid environment ID.", "POST": "A new backup task is created in the task manager if not already running.", "PARAM": "env_id (str) - The ID of the environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 } ], "score": 0.5499999999999999 } }, { "name": "ThrottledSchedulerConfigurator", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 125, "end_line": 181, "tags": { "COMPLEXITY": "5", "SEMANTICS": "scheduler, throttling, distribution", "PURPOSE": "Distributes validation tasks evenly within an execution window." }, "relations": [], "children": [ { "name": "calculate_schedule", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 180, "tags": { "PURPOSE": "Calculates execution times for N tasks within a window.", "PRE": "window_start, window_end (time), dashboard_ids (List), current_date (date).", "POST": "Returns List[datetime] of scheduled times.", "INVARIANT": "Tasks are distributed with near-even spacing." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 125 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 125 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.config_models", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": null, "tags": { "COMPLEXITY": "3", "SEMANTICS": "config, models, pydantic", "PURPOSE": "Defines the data models for application configuration using Pydantic.", "LAYER": "Core" }, "relations": [ { "type": "READS_FROM", "target": "app_configurations (database)" }, { "type": "USED_BY", "target": "ConfigManager" } ], "children": [ { "name": "Schedule", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 23, "tags": { "PURPOSE": "Represents a backup schedule configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.config_models.Environment", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 39, "tags": { "PURPOSE": "Represents a Superset environment configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LoggingConfig", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 50, "tags": { "PURPOSE": "Defines the configuration for the application's logging system." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanReleaseConfig", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 57, "tags": { "PURPOSE": "Configuration for clean release compliance subsystem." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GlobalSettings", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 84, "tags": { "PURPOSE": "Represents global application settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AppConfig", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 91, "tags": { "PURPOSE": "The root configuration model containing all application settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.config_models:Module] started at line 1", "severity": "ERROR", "line_number": 1 }, { "message": "Invalid @RELATION predicate: READS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.database", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 436, "tags": { "COMPLEXITY": "3", "SEMANTICS": "database, postgresql, sqlalchemy, session, persistence", "PURPOSE": "Configures database connection and session management (PostgreSQL-first).", "LAYER": "Core", "INVARIANT": "A single engine instance is used for the entire application." }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy" }, { "type": "DEPENDS_ON", "target": "backend.src.models.mapping" }, { "type": "DEPENDS_ON", "target": "backend.src.core.auth.config" } ], "children": [ { "name": "BASE_DIR", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 37, "tags": { "COMPLEXITY": "1", "PURPOSE": "Base directory for the backend." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DATABASE_URL", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 47, "tags": { "COMPLEXITY": "1", "PURPOSE": "URL for the main application database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TASKS_DATABASE_URL", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 54, "tags": { "COMPLEXITY": "1", "PURPOSE": "URL for the tasks execution database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AUTH_DATABASE_URL", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 60, "tags": { "COMPLEXITY": "1", "PURPOSE": "URL for the authentication database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "engine", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 73, "tags": { "COMPLEXITY": "1", "PURPOSE": "SQLAlchemy engine for mappings database.", "SIDE_EFFECT": "Creates database engine and manages connection pool." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "tasks_engine", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 79, "tags": { "COMPLEXITY": "1", "PURPOSE": "SQLAlchemy engine for tasks database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "auth_engine", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 85, "tags": { "COMPLEXITY": "1", "PURPOSE": "SQLAlchemy engine for authentication database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SessionLocal", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 92, "tags": { "COMPLEXITY": "1", "PURPOSE": "A session factory for the main mappings database.", "PRE": "engine is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TasksSessionLocal", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 99, "tags": { "COMPLEXITY": "1", "PURPOSE": "A session factory for the tasks execution database.", "PRE": "tasks_engine is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AuthSessionLocal", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 106, "tags": { "COMPLEXITY": "1", "PURPOSE": "A session factory for the authentication database.", "PRE": "auth_engine is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_ensure_user_dashboard_preferences_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 108, "end_line": 172, "tags": { "COMPLEXITY": "3", "PURPOSE": "Applies additive schema upgrades for user_dashboard_preferences table.", "PRE": "bind_engine points to application database where profile table is stored.", "POST": "Missing columns are added without data loss." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 } ], "score": 0.5499999999999999 } }, { "name": "_ensure_user_dashboard_preferences_health_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 175, "end_line": 216, "tags": { "COMPLEXITY": "3", "PURPOSE": "Applies additive schema upgrades for user_dashboard_preferences table (health fields)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 175 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 175 } ], "score": 0.5499999999999999 } }, { "name": "_ensure_llm_validation_results_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 219, "end_line": 256, "tags": { "COMPLEXITY": "3", "PURPOSE": "Applies additive schema upgrades for llm_validation_results table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 219 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 219 } ], "score": 0.5499999999999999 } }, { "name": "_ensure_git_server_configs_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 259, "end_line": 294, "tags": { "COMPLEXITY": "3", "PURPOSE": "Applies additive schema upgrades for git_server_configs table.", "PRE": "bind_engine points to application database.", "POST": "Missing columns are added without data loss." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 259 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 259 } ], "score": 0.5499999999999999 } }, { "name": "_ensure_auth_users_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 297, "end_line": 350, "tags": { "COMPLEXITY": "3", "PURPOSE": "Applies additive schema upgrades for auth users table.", "PRE": "bind_engine points to authentication database.", "POST": "Missing columns are added without data loss." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 297 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 297 } ], "score": 0.5499999999999999 } }, { "name": "ensure_connection_configs_table", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 353, "end_line": 368, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensures the external connection registry table exists in the main database.", "PRE": "bind_engine points to the application database.", "POST": "connection_configs table exists without dropping existing data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 353 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 353 } ], "score": 0.5499999999999999 } }, { "name": "init_db", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 371, "end_line": 388, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initializes the database by creating all tables.", "PRE": "engine, tasks_engine and auth_engine are initialized.", "POST": "Database tables created in all databases.", "SIDE_EFFECT": "Creates physical database files if they don't exist." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 371 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 371 } ], "score": 0.5499999999999999 } }, { "name": "get_db", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 390, "end_line": 403, "tags": { "COMPLEXITY": "3", "PURPOSE": "Dependency for getting a database session.", "PRE": "SessionLocal is initialized.", "POST": "Session is closed after use.", "RETURN": "Generator[Session, None, None]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 390 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 390 } ], "score": 0.5499999999999999 } }, { "name": "get_tasks_db", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 405, "end_line": 418, "tags": { "COMPLEXITY": "3", "PURPOSE": "Dependency for getting a tasks database session.", "PRE": "TasksSessionLocal is initialized.", "POST": "Session is closed after use.", "RETURN": "Generator[Session, None, None]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 405 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 405 } ], "score": 0.5499999999999999 } }, { "name": "get_auth_db", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 420, "end_line": 434, "tags": { "COMPLEXITY": "3", "PURPOSE": "Dependency for getting an authentication database session.", "PRE": "AuthSessionLocal is initialized.", "POST": "Session is closed after use.", "DATA_CONTRACT": "None -> Output[sqlalchemy.orm.Session]", "RETURN": "Generator[Session, None, None]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 420 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 420 } ], "score": 0.5499999999999999 } }, { "name": "_build_engine", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 436 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "LoggerModule", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 319, "tags": { "SEMANTICS": "logging, websocket, streaming, handler", "PURPOSE": "Configures the application's logging system, including a custom handler for buffering logs and streaming them over WebSockets.", "LAYER": "Core", "RELATION": "Used by the main application and other modules to log events. The WebSocketLogHandler is used by the WebSocket endpoint in app.py." }, "relations": [], "children": [ { "name": "BeliefFormatter", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 53, "tags": { "PURPOSE": "Custom logging formatter that adds belief state prefixes to log messages." }, "relations": [], "children": [ { "name": "format", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 52, "tags": { "PURPOSE": "Formats the log record, adding belief state context if available.", "PRE": "record is a logging.LogRecord.", "POST": "Returns formatted string.", "PARAM": "record (logging.LogRecord) - The log record to format.", "RETURN": "str - The formatted log message.", "SEMANTICS": "logging, formatter, context" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LogEntry", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 65, "tags": { "SEMANTICS": "log, entry, record, pydantic", "PURPOSE": "A Pydantic model representing a single, structured log entry. This is a re-definition for consistency, as it's also defined in task_manager.py." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "belief_scope", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 101, "tags": { "PURPOSE": "Context manager for structured Belief State logging.", "PARAM": "message (str) - Optional entry message.", "PRE": "anchor_id must be provided.", "POST": "Thread-local belief state is updated and entry/exit logs are generated.", "SEMANTICS": "logging, context, belief_state" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "configure_logger", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 146, "tags": { "PURPOSE": "Configures the logger with the provided logging settings.", "PRE": "config is a valid LoggingConfig instance.", "POST": "Logger level, handlers, belief state flag, and task log level are updated.", "PARAM": "config (LoggingConfig) - The logging configuration.", "SEMANTICS": "logging, configuration, initialization" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_task_log_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 157, "tags": { "PURPOSE": "Returns the current task log level filter.", "PRE": "None.", "POST": "Returns the task log level string.", "RETURN": "str - The current task log level (DEBUG, INFO, WARNING, ERROR).", "SEMANTICS": "logging, configuration, getter" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "should_log_task_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 176, "tags": { "PURPOSE": "Checks if a log level should be recorded based on task_log_level setting.", "PRE": "level is a valid log level string.", "POST": "Returns True if level meets or exceeds task_log_level threshold.", "PARAM": "level (str) - The log level to check.", "RETURN": "bool - True if the level should be logged.", "SEMANTICS": "logging, filter, level" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "WebSocketLogHandler", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 240, "tags": { "SEMANTICS": "logging, handler, websocket, buffer", "PURPOSE": "A custom logging handler that captures log records into a buffer. It is designed to be extended for real-time log streaming over WebSockets." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 186, "end_line": 197, "tags": { "PURPOSE": "Initializes the handler with a fixed-capacity buffer.", "PRE": "capacity is an integer.", "POST": "Instance initialized with empty deque.", "PARAM": "capacity (int) - Maximum number of logs to keep in memory.", "SEMANTICS": "logging, initialization, buffer" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "emit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 225, "tags": { "PURPOSE": "Captures a log record, formats it, and stores it in the buffer.", "PRE": "record is a logging.LogRecord.", "POST": "Log is added to the log_buffer.", "PARAM": "record (logging.LogRecord) - The log record to emit.", "SEMANTICS": "logging, handler, buffer" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_recent_logs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 227, "end_line": 238, "tags": { "PURPOSE": "Returns a list of recent log entries from the buffer.", "PRE": "None.", "POST": "Returns list of LogEntry objects.", "RETURN": "List[LogEntry] - List of buffered log entries.", "SEMANTICS": "logging, buffer, retrieval" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Logger", "type": "Global", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 318, "tags": { "SEMANTICS": "logger, global, instance", "PURPOSE": "The global logger instance for the application, configured with both a console handler and the custom WebSocket handler." }, "relations": [], "children": [ { "name": "believed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 247, "end_line": 269, "tags": { "PURPOSE": "A decorator that wraps a function in a belief scope.", "PARAM": "anchor_id (str) - The identifier for the semantic block.", "PRE": "anchor_id must be a string.", "POST": "Returns a decorator function." }, "relations": [], "children": [ { "name": "decorator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 253, "end_line": 267, "tags": { "PURPOSE": "Internal decorator for belief scope.", "PRE": "func must be a callable.", "POST": "Returns the wrapped function." }, "relations": [], "children": [ { "name": "wrapper", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 258, "end_line": 265, "tags": { "PURPOSE": "Internal wrapper that enters belief scope.", "PRE": "None.", "POST": "Executes the function within a belief scope." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "explore", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 293, "end_line": 298, "tags": { "PURPOSE": "Logs an EXPLORE message (Van der Waals force) for searching, alternatives, and hypotheses.", "SEMANTICS": "log, explore, molecule" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "reason", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 300, "end_line": 305, "tags": { "PURPOSE": "Logs a REASON message (Covalent bond) for strict deduction and core logic.", "SEMANTICS": "log, reason, molecule" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "reflect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 307, "end_line": 312, "tags": { "PURPOSE": "Logs a REFLECT message (Hydrogen bond) for self-check and structural validation.", "SEMANTICS": "log, reflect, molecule" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 319 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "PluginLoader", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 8, "end_line": 192, "tags": { "COMPLEXITY": "3", "SEMANTICS": "plugin, loader, dynamic, import", "PURPOSE": "Scans a specified directory for Python modules, dynamically loads them, and registers any classes that are valid implementations of the PluginBase interface.", "LAYER": "Core", "RELATION": "Depends on PluginBase. It is used by the main application to discover and manage available plugins." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 31, "tags": { "PURPOSE": "Initializes the PluginLoader with a directory to scan.", "PRE": "plugin_dir is a valid directory path.", "POST": "Plugins are loaded and registered.", "PARAM": "plugin_dir (str) - The directory containing plugin modules." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_load_plugins", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 66, "tags": { "PURPOSE": "Scans the plugin directory and loads all valid plugins.", "PRE": "plugin_dir exists or can be created.", "POST": "_load_module is called for each .py file." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_load_module", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 107, "tags": { "PURPOSE": "Loads a single Python module and discovers PluginBase implementations.", "PRE": "module_name and file_path are valid.", "POST": "Plugin classes are instantiated and registered.", "PARAM": "file_path (str) - The path to the module file." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_register_plugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 148, "tags": { "PURPOSE": "Registers a PluginBase instance and its configuration.", "PRE": "plugin_instance is a valid implementation of PluginBase.", "POST": "Plugin is added to _plugins and _plugin_configs.", "PARAM": "plugin_instance (PluginBase) - The plugin instance to register." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_plugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 163, "tags": { "PURPOSE": "Retrieves a loaded plugin instance by its ID.", "PRE": "plugin_id is a string.", "POST": "Returns plugin instance or None.", "PARAM": "plugin_id (str) - The unique identifier of the plugin.", "RETURN": "Optional[PluginBase] - The plugin instance if found, otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_plugin_configs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 176, "tags": { "PURPOSE": "Returns a list of all registered plugin configurations.", "PRE": "None.", "POST": "Returns list of all PluginConfig objects.", "RETURN": "List[PluginConfig] - A list of plugin configurations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "has_plugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 190, "tags": { "PURPOSE": "Checks if a plugin with the given ID is registered.", "PRE": "plugin_id is a string.", "POST": "Returns True if plugin exists.", "PARAM": "plugin_id (str) - The unique identifier of the plugin.", "RETURN": "bool - True if the plugin is registered, False otherwise." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.migration_engine", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 247, "tags": { "COMPLEXITY": "5", "SEMANTICS": "migration, engine, zip, yaml, transformation, cross-filter, id-mapping", "PURPOSE": "Transforms Superset export ZIP archives while preserving archive integrity and patching mapped identifiers.", "LAYER": "Domain", "INVARIANT": "ZIP structure and non-targeted metadata must remain valid after transformation." }, "relations": [ { "type": "DEPENDS_ON", "target": "src.core.logger" }, { "type": "DEPENDS_ON", "target": "src.core.mapping_service.IdMappingService" }, { "type": "DEPENDS_ON", "target": "src.models.mapping.ResourceType" }, { "type": "DEPENDS_ON", "target": "yaml" } ], "children": [ { "name": "MigrationEngine", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 28, "end_line": 245, "tags": { "PURPOSE": "Engine for transforming Superset export ZIPs." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 44, "tags": { "PURPOSE": "Initializes migration orchestration dependencies for ZIP/YAML metadata transformations.", "PRE": "mapping_service is None or implements batch remote ID lookup for ResourceType.CHART.", "POST": "self.mapping_service is assigned and available for optional cross-filter patching flows.", "SIDE_EFFECT": "Mutates in-memory engine state by storing dependency reference.", "DATA_CONTRACT": "Input[Optional[IdMappingService]] -> Output[MigrationEngine]", "PARAM": "mapping_service (Optional[IdMappingService]) - Used for resolving target environment integer IDs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "transform_zip", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 118, "tags": { "PURPOSE": "Extracts ZIP, replaces database UUIDs in YAMLs, patches cross-filters, and re-packages.", "PARAM": "fix_cross_filters (bool) - Whether to patch dashboard json_metadata.", "PRE": "zip_path points to a readable ZIP; output_path parent is writable; db_mapping keys/values are UUID strings.", "POST": "Returns True only when extraction, transformation, and packaging complete without exception.", "SIDE_EFFECT": "Reads/writes filesystem archives, creates temporary directory, emits structured logs.", "DATA_CONTRACT": "Input[(str zip_path, str output_path, Dict[str,str] db_mapping, bool strip_databases, Optional[str] target_env_id, bool fix_cross_filters)] -> Output[bool]", "RETURN": "bool - True if successful." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_transform_yaml", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 147, "tags": { "PURPOSE": "Replaces database_uuid in a single YAML file.", "PARAM": "db_mapping (Dict[str, str]) - UUID mapping dictionary.", "PRE": "file_path exists, is readable YAML, and db_mapping contains source->target UUID pairs.", "POST": "database_uuid is replaced in-place only when source UUID is present in db_mapping.", "SIDE_EFFECT": "Reads and conditionally rewrites YAML file on disk.", "DATA_CONTRACT": "Input[(Path file_path, Dict[str,str] db_mapping)] -> Output[None]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_chart_uuids_from_archive", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 149, "end_line": 174, "tags": { "PURPOSE": "Scans extracted chart YAML files and builds a source chart ID to UUID lookup map.", "PRE": "temp_dir exists and points to extracted archive root with optional chart YAML resources.", "POST": "Returns a best-effort Dict[int, str] containing only parseable chart id/uuid pairs.", "SIDE_EFFECT": "Reads chart YAML files from filesystem; suppresses per-file parsing failures.", "DATA_CONTRACT": "Input[Path] -> Output[Dict[int,str]]", "PARAM": "temp_dir (Path) - Root dir of unpacked archive.", "RETURN": "Dict[int, str] - Mapping of source Integer ID to UUID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_patch_dashboard_metadata", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 176, "end_line": 243, "tags": { "PURPOSE": "Rewrites dashboard json_metadata chart/dataset integer identifiers using target environment mappings.", "PRE": "file_path points to dashboard YAML with json_metadata; target_env_id is non-empty; source_map contains source id->uuid.", "POST": "json_metadata is re-serialized with mapped integer IDs when remote mappings are available; otherwise file remains unchanged.", "SIDE_EFFECT": "Reads/writes YAML file, performs mapping lookup via mapping_service, emits logs for recoverable/terminal failures.", "DATA_CONTRACT": "Input[(Path file_path, str target_env_id, Dict[int,str] source_map)] -> Output[None]", "PARAM": "source_map (Dict[int, str])" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 28 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.async_superset_client", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": null, "tags": { "COMPLEXITY": "5", "SEMANTICS": "superset, async, client, httpx, dashboards, datasets", "PURPOSE": "Async Superset client for dashboard hot-path requests without blocking FastAPI event loop.", "LAYER": "Core", "PRE": "Environment configuration is valid and Superset endpoint is reachable.", "POST": "Provides non-blocking API access to Superset resources.", "SIDE_EFFECT": "Performs network I/O via httpx.", "DATA_CONTRACT": "Input[Environment] -> Model[dashboard, chart, dataset]", "INVARIANT": "Async dashboard operations reuse shared auth cache and avoid sync requests in async routes." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client" }, { "type": "DEPENDS_ON", "target": "backend.src.core.utils.async_network.AsyncAPIClient" } ], "children": [ { "name": "backend.src.core.async_superset_client.AsyncSupersetClient", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 28, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Async sibling of SupersetClient for dashboard read paths." }, "relations": [ { "type": "INHERITS", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.utils.async_network.AsyncAPIClient" }, { "type": "CALLS", "target": "backend.src.core.utils.async_network.AsyncAPIClient.request" } ], "children": [ { "name": "backend.src.core.async_superset_client.AsyncSupersetClient.__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 35, "end_line": 55, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initialize async Superset client with AsyncAPIClient transport.", "PRE": "env is valid Environment instance.", "POST": "Client uses async network transport and inherited projection helpers.", "DATA_CONTRACT": "Input[Environment] -> self.network[AsyncAPIClient]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 35 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 35 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 35 } ], "score": 0.4 } }, { "name": "backend.src.core.async_superset_client.AsyncSupersetClient.aclose", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 57, "end_line": 64, "tags": { "COMPLEXITY": "3", "PURPOSE": "Close async transport resources.", "POST": "Underlying AsyncAPIClient is closed.", "SIDE_EFFECT": "Closes network sockets." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 57 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 57 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 57 } ], "score": 0.4 } }, { "name": "backend.src.core.async_superset_client.AsyncSupersetClient.get_dashboards_page_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 66, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch one dashboards page asynchronously.", "POST": "Returns total count and page result list.", "DATA_CONTRACT": "Input[query: Optional[Dict]] -> Output[Tuple[int, List[Dict]]]" }, "relations": [], "children": [ { "name": "get_dashboard_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 101, "end_line": 110, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch one dashboard payload asynchronously.", "POST": "Returns raw dashboard payload from Superset API.", "DATA_CONTRACT": "Input[dashboard_id: int] -> Output[Dict]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 101 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 101 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 101 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 101 } ], "score": 0.25 } }, { "name": "get_chart_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 112, "end_line": 121, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch one chart payload asynchronously.", "POST": "Returns raw chart payload from Superset API.", "DATA_CONTRACT": "Input[chart_id: int] -> Output[Dict]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 } ], "score": 0.25 } }, { "name": "get_dashboard_detail_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 123, "end_line": 317, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch dashboard detail asynchronously with concurrent charts/datasets requests.", "POST": "Returns dashboard detail payload for overview page.", "DATA_CONTRACT": "Input[dashboard_id: int] -> Output[Dict]" }, "relations": [ { "type": "CALLS", "target": "self.get_dashboard_async" }, { "type": "CALLS", "target": "self.get_chart_async" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client.AsyncSupersetClient.get_dashboards_page_async:Function] started at line 66", "severity": "ERROR", "line_number": 66 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 66 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client.AsyncSupersetClient.get_dashboards_page_async:Function] started at line 66", "severity": "ERROR", "line_number": 66 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 66 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client.AsyncSupersetClient.get_dashboards_page_async:Function] started at line 66", "severity": "ERROR", "line_number": 66 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 66 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client.AsyncSupersetClient:Class] started at line 28", "severity": "ERROR", "line_number": 28 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client.AsyncSupersetClient:Class] started at line 28", "severity": "ERROR", "line_number": 28 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "aclose", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards_page_async", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extract_dataset_id_from_form_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 138, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.async_superset_client:Module] started at line 1", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "PluginBase", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 7, "end_line": 128, "tags": { "SEMANTICS": "plugin, interface, base, abstract", "PURPOSE": "Defines the abstract base class that all plugins must implement to be recognized by the system. It enforces a common structure for plugin metadata and execution.", "LAYER": "Core", "RELATION": "Used by PluginLoader to identify valid plugins.", "INVARIANT": "All plugins MUST inherit from this class." }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 30, "tags": { "PURPOSE": "Returns the unique identifier for the plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string ID.", "RETURN": "str - Plugin ID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 43, "tags": { "PURPOSE": "Returns the human-readable name of the plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string name.", "RETURN": "str - Plugin name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 56, "tags": { "PURPOSE": "Returns a brief description of the plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string description.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 69, "tags": { "PURPOSE": "Returns the version of the plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string version.", "RETURN": "str - Plugin version." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "required_permission", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 81, "tags": { "PURPOSE": "Returns the required permission string to execute this plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string permission.", "RETURN": "str - Required permission (e.g., \"plugin:backup:execute\")." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 96, "tags": { "PURPOSE": "Returns the frontend route for the plugin's UI, if applicable.", "PRE": "Plugin instance exists.", "POST": "Returns string route or None.", "RETURN": "Optional[str] - Frontend route." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 111, "tags": { "PURPOSE": "Returns the JSON schema for the plugin's input parameters.", "PRE": "Plugin instance exists.", "POST": "Returns dict schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 127, "tags": { "PURPOSE": "Executes the plugin's core logic.", "PARAM": "params (Dict[str, Any]) - Validated input parameters.", "PRE": "params must be a dictionary.", "POST": "Plugin execution is completed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PluginConfig", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 143, "tags": { "SEMANTICS": "plugin, config, schema, pydantic", "PURPOSE": "A Pydantic model used to represent the validated configuration and metadata of a loaded plugin. This object is what gets exposed to the API layer.", "LAYER": "Core", "RELATION": "Instantiated by PluginLoader after validating a PluginBase instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "src.core", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Backend core services and infrastructure package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.mapping_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 249, "tags": { "COMPLEXITY": "5", "SEMANTICS": "mapping, ids, synchronization, environments, cross-filters", "PURPOSE": "Service for tracking and synchronizing Superset Resource IDs (UUID <-> Integer ID)", "LAYER": "Core", "TEST_DATA": "mock_superset_resources -> {'chart': [{'id': 42, 'uuid': '1234', 'slice_name': 'test'}], 'dataset': [{'id': 99, 'uuid': '5678', 'table_name': 'data'}]}", "INVARIANT": "sync_environment must handle remote API failures gracefully." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.mapping (ResourceMapping, ResourceType)" }, { "type": "DEPENDS_ON", "target": "backend.src.core.logger" } ], "children": [ { "name": "IdMappingService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 23, "end_line": 248, "tags": { "COMPLEXITY": "5", "PURPOSE": "Service handling the cataloging and retrieval of remote Superset Integer IDs.", "TEST_CONTRACT": "IdMappingServiceModel ->", "TEST_FIXTURE": "valid_mapping_service -> {\"db_session\": \"MockSession()\"}", "TEST_EDGE": "get_batch_empty_list -> returns empty dict", "TEST_INVARIANT": "resilient_fetching -> verifies: [sync_api_failure]" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 49, "tags": { "PURPOSE": "Initializes the mapping service." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "start_scheduler", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 80, "tags": { "PURPOSE": "Starts the background scheduler with a given cron string.", "PARAM": "superset_client_factory - Function to get a client for an environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "sync_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 199, "tags": { "PURPOSE": "Fully synchronizes mapping for a specific environment.", "PARAM": "superset_client - Instance capable of hitting the Superset API.", "PRE": "environment_id exists in the database.", "POST": "ResourceMapping records for the environment are created or updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_remote_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 201, "end_line": 220, "tags": { "PURPOSE": "Retrieves the remote integer ID for a given universal UUID.", "PARAM": "uuid (str)", "RETURN": "Optional[int]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_remote_ids_batch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 222, "end_line": 246, "tags": { "PURPOSE": "Retrieves remote integer IDs for a list of universal UUIDs efficiently.", "PARAM": "uuids (List[str])", "RETURN": "Dict[str, int] - Mapping of UUID -> Integer ID" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 23 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 23 } ], "score": 0.0 } }, { "name": "sync_all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.auth.config", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 47, "tags": { "SEMANTICS": "auth, config, settings, jwt, adfs", "PURPOSE": "Centralized configuration for authentication and authorization.", "LAYER": "Core", "INVARIANT": "All sensitive configuration must have defaults or be loaded from environment." }, "relations": [ { "type": "DEPENDS_ON", "target": "pydantic" } ], "children": [ { "name": "AuthConfig", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 15, "end_line": 40, "tags": { "PURPOSE": "Holds authentication-related settings.", "PRE": "Environment variables may be provided via .env file.", "POST": "Returns a configuration object with validated settings." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 15 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 15 } ], "score": 0.0 } }, { "name": "auth_config", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 45, "tags": { "PURPOSE": "Singleton instance of AuthConfig." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.auth.jwt", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 55, "tags": { "COMPLEXITY": "3", "SEMANTICS": "jwt, token, session, auth", "PURPOSE": "JWT token generation and validation logic.", "LAYER": "Core", "INVARIANT": "Tokens must include expiration time and user identifier." }, "relations": [ { "type": "DEPENDS_ON", "target": "jose" }, { "type": "USES", "target": "backend.src.core.auth.config.auth_config" } ], "children": [ { "name": "create_access_token", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 39, "tags": { "PURPOSE": "Generates a new JWT access token.", "PRE": "data dict contains 'sub' (user_id) and optional 'scopes' (roles).", "POST": "Returns a signed JWT string.", "PARAM": "expires_delta (Optional[timedelta]) - Custom expiration time.", "RETURN": "str - The encoded JWT." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "decode_token", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 53, "tags": { "PURPOSE": "Decodes and validates a JWT token.", "PRE": "token is a signed JWT string.", "POST": "Returns the decoded payload if valid.", "PARAM": "token (str) - The JWT to decode.", "RETURN": "dict - The decoded payload.", "THROW": "jose.JWTError - If token is invalid or expired." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.core.auth.oauth", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 51, "tags": { "SEMANTICS": "auth, oauth, oidc, adfs", "PURPOSE": "ADFS OIDC configuration and client using Authlib.", "LAYER": "Core", "INVARIANT": "Must use secure OIDC flows." }, "relations": [ { "type": "DEPENDS_ON", "target": "authlib" }, { "type": "USES", "target": "backend.src.core.auth.config.auth_config" } ], "children": [ { "name": "oauth", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 19, "tags": { "PURPOSE": "Global Authlib OAuth registry." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "register_adfs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 36, "tags": { "PURPOSE": "Registers the ADFS OIDC client.", "PRE": "ADFS configuration is provided in auth_config.", "POST": "ADFS client is registered in oauth registry." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "is_adfs_configured", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 46, "tags": { "PURPOSE": "Checks if ADFS is properly configured.", "PRE": "None.", "POST": "Returns True if ADFS client is registered, False otherwise.", "RETURN": "bool - Configuration status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.auth.logger", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "3", "SEMANTICS": "auth, logger, audit, security", "PURPOSE": "Audit logging for security-related events.", "LAYER": "Core", "INVARIANT": "Must not log sensitive data like passwords or full tokens." }, "relations": [ { "type": "USES", "target": "backend.src.core.logger.belief_scope" } ], "children": [ { "name": "log_security_event", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 30, "tags": { "PURPOSE": "Logs a security-related event for audit trails.", "PRE": "event_type and username are strings.", "POST": "Security event is written to the application log.", "PARAM": "details (dict) - Additional non-sensitive metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.core.auth.security", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 45, "tags": { "SEMANTICS": "security, password, hashing, bcrypt", "PURPOSE": "Utility for password hashing and verification using Passlib.", "LAYER": "Core", "INVARIANT": "Uses bcrypt for hashing with standard work factor." }, "relations": [ { "type": "DEPENDS_ON", "target": "passlib" } ], "children": [ { "name": "verify_password", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 32, "tags": { "PURPOSE": "Verifies a plain password against a hashed password.", "PRE": "plain_password is a string, hashed_password is a bcrypt hash.", "POST": "Returns True if password matches, False otherwise.", "PARAM": "hashed_password (str) - The stored hash.", "RETURN": "bool - Verification result." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_password_hash", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 43, "tags": { "PURPOSE": "Generates a bcrypt hash for a plain password.", "PRE": "password is a string.", "POST": "Returns a secure bcrypt hash string.", "PARAM": "password (str) - The password to hash.", "RETURN": "str - The generated hash." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "AuthRepository", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 118, "tags": { "TIER": "CRITICAL", "COMPLEXITY": "5", "SEMANTICS": "auth, repository, database, user, role, permission", "PURPOSE": "Data access layer for authentication and user preference entities.", "LAYER": "Domain", "INVARIANT": "All database read/write operations must execute via the injected SQLAlchemy session boundary.", "DATA_CONTRACT": "Session -> [User | Role | Permission | UserDashboardPreference]" }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy.orm.Session" }, { "type": "DEPENDS_ON", "target": "User:Class" }, { "type": "DEPENDS_ON", "target": "Role:Class" }, { "type": "DEPENDS_ON", "target": "Permission:Class" }, { "type": "DEPENDS_ON", "target": "UserDashboardPreference:Class" }, { "type": "DEPENDS_ON", "target": "belief_scope:Function" } ], "children": [ { "name": "AuthRepository", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 24, "end_line": 116, "tags": { "PURPOSE": "Initialize repository with database session." }, "relations": [], "children": [ { "name": "get_user_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 41, "tags": { "PURPOSE": "Retrieve user by UUID.", "PRE": "user_id is a valid UUID string.", "POST": "Returns User object if found, else None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_user_by_username", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 53, "tags": { "PURPOSE": "Retrieve user by username.", "PRE": "username is a non-empty string.", "POST": "Returns User object if found, else None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_role_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 60, "tags": { "PURPOSE": "Retrieve role by UUID with permissions preloaded." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_role_by_name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 67, "tags": { "PURPOSE": "Retrieve role by unique name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_permission_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 74, "tags": { "PURPOSE": "Retrieve permission by UUID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_permission_by_resource_action", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 84, "tags": { "PURPOSE": "Retrieve permission by resource and action tuple." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 91, "tags": { "PURPOSE": "List all system permissions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_user_dashboard_preference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 100, "tags": { "PURPOSE": "Retrieve dashboard filters/preferences for a user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_roles_by_ad_groups", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 114, "tags": { "PURPOSE": "Retrieve roles that match a list of AD group names.", "PRE": "groups is a list of strings representing AD group identifiers.", "POST": "Returns a list of Role objects mapped to the provided AD groups." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 24 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "src.core.auth", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Authentication and authorization package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_auth", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 271, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for authentication module", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "src.core.auth" } ], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "auth_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "auth_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_authenticate_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 103, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_role_permission_association", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_user_role_association", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 142, "end_line": 142, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_ad_group_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 164, "end_line": 164, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_authenticate_user_updates_last_login", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 181, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_authenticate_inactive_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 199, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_verify_password_empty_hash", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 215, "end_line": 215, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_provision_adfs_user_new", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 221, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_provision_adfs_user_existing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 247, "end_line": 247, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.core.utils.async_network", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": null, "tags": { "COMPLEXITY": "5", "SEMANTICS": "network, httpx, async, superset, authentication, cache", "PURPOSE": "Provides async Superset API client with shared auth-token cache to avoid per-request re-login.", "LAYER": "Infra", "PRE": "Config payloads contain a Superset base URL and authentication fields needed for login.", "POST": "Async network clients reuse cached auth tokens and expose stable async request/error translation flow.", "SIDE_EFFECT": "Performs upstream HTTP I/O and mutates process-local auth cache entries.", "DATA_CONTRACT": "Input[config: Dict[str, Any]] -> Output[authenticated async Superset HTTP interactions]", "INVARIANT": "Async client reuses cached auth tokens per environment credentials and invalidates on 401." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.utils.network.SupersetAuthCache" } ], "children": [ { "name": "backend.src.core.utils.async_network.AsyncAPIClient", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 32, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Async Superset API client backed by httpx.AsyncClient with shared auth cache." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.utils.network.SupersetAuthCache" }, { "type": "CALLS", "target": "backend.src.core.utils.network.SupersetAuthCache.get" }, { "type": "CALLS", "target": "backend.src.core.utils.network.SupersetAuthCache.set" } ], "children": [ { "name": "backend.src.core.utils.async_network.AsyncAPIClient.__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 42, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initialize async API client for one environment.", "PRE": "config contains base_url and auth payload.", "POST": "Client is ready for async request/authentication flow.", "DATA_CONTRACT": "Input[config: Dict[str, Any]] -> self._auth_cache_key[str]" }, "relations": [], "children": [ { "name": "backend.src.core.utils.async_network.AsyncAPIClient._normalize_base_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": null, "tags": { "COMPLEXITY": "1", "PURPOSE": "Normalize base URL for Superset API root construction.", "POST": "Returns canonical base URL without trailing slash and duplicate /api/v1 suffix." }, "relations": [], "children": [ { "name": "_build_api_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 92, "tags": { "COMPLEXITY": "1", "PURPOSE": "Build full API URL from relative Superset endpoint.", "POST": "Returns absolute URL for upstream request." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_auth_lock", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 106, "tags": { "COMPLEXITY": "1", "PURPOSE": "Return per-cache-key async lock to serialize fresh login attempts.", "POST": "Returns stable asyncio.Lock instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "authenticate", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 108, "end_line": 166, "tags": { "COMPLEXITY": "3", "PURPOSE": "Authenticate against Superset and cache access/csrf tokens.", "POST": "Client tokens are populated and reusable across requests.", "SIDE_EFFECT": "Performs network requests to Superset authentication endpoints.", "DATA_CONTRACT": "None -> Output[Dict[str, str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 108 } ], "score": 0.1 } }, { "name": "get_headers", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 168, "end_line": 182, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return authenticated Superset headers for async requests.", "POST": "Headers include Authorization and CSRF tokens." }, "relations": [ { "type": "CALLS", "target": "self.authenticate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "request", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 184, "end_line": 219, "tags": { "COMPLEXITY": "3", "PURPOSE": "Perform one authenticated async Superset API request.", "POST": "Returns JSON payload or raw httpx.Response when raw_response=true.", "SIDE_EFFECT": "Performs network I/O." }, "relations": [ { "type": "CALLS", "target": "self.get_headers" }, { "type": "CALLS", "target": "self._handle_http_error" }, { "type": "CALLS", "target": "self._handle_network_error" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "_handle_http_error", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 221, "end_line": 238, "tags": { "COMPLEXITY": "3", "PURPOSE": "Translate upstream HTTP errors into stable domain exceptions.", "POST": "Raises domain-specific exception for caller flow control.", "DATA_CONTRACT": "Input[httpx.HTTPStatusError] -> Exception" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 } ], "score": 0.1 } }, { "name": "_handle_network_error", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 240, "end_line": 254, "tags": { "COMPLEXITY": "3", "PURPOSE": "Translate generic httpx errors into NetworkError.", "POST": "Raises NetworkError with URL context.", "DATA_CONTRACT": "Input[httpx.HTTPError] -> NetworkError" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 } ], "score": 0.1 } }, { "name": "aclose", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 256, "end_line": 263, "tags": { "COMPLEXITY": "3", "PURPOSE": "Close underlying httpx client.", "POST": "Client resources are released.", "SIDE_EFFECT": "Closes network connections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 } ], "score": 0.1 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient._normalize_base_url:Function] started at line 68", "severity": "ERROR", "line_number": 68 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient._normalize_base_url:Function] started at line 68", "severity": "ERROR", "line_number": 68 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient._normalize_base_url:Function] started at line 68", "severity": "ERROR", "line_number": 68 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient._normalize_base_url:Function] started at line 68", "severity": "ERROR", "line_number": 68 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient.__init__:Function] started at line 42", "severity": "ERROR", "line_number": 42 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 42 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient.__init__:Function] started at line 42", "severity": "ERROR", "line_number": 42 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 42 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient.__init__:Function] started at line 42", "severity": "ERROR", "line_number": 42 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 42 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient:Class] started at line 32", "severity": "ERROR", "line_number": 32 }, { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network.AsyncAPIClient:Class] started at line 32", "severity": "ERROR", "line_number": 32 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_base_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 72, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.core.utils.async_network:Module] started at line 1", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "FileIO", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 488, "tags": { "TIER": "STANDARD", "SEMANTICS": "file, io, zip, yaml, temp, archive, utility", "PURPOSE": "\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438 ZIP, \u0444\u0430\u0439\u043b\u0430\u043c\u0438 YAML \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439.", "LAYER": "Infra", "PUBLIC_API": "create_temp_file, remove_empty_directories, read_dashboard_from_disk, calculate_crc32, RetentionPolicy, archive_exports, save_and_unpack_dashboard, update_yamls, create_dashboard_export, sanitize_filename, get_filename_from_headers, consolidate_archive_folders" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.logger" }, { "type": "DEPENDS_ON", "target": "pyyaml" } ], "children": [ { "name": "InvalidZipFormatError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 30, "tags": { "PURPOSE": "Exception raised when a file is not a valid ZIP archive." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_temp_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 71, "tags": { "PURPOSE": "\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c.", "PRE": "suffix \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u0442\u0438\u043f \u0440\u0435\u0441\u0443\u0440\u0441\u0430.", "POST": "\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d; \u0440\u0435\u0441\u0443\u0440\u0441 \u0443\u0434\u0430\u043b\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.", "PARAM": "mode (str) - \u0420\u0435\u0436\u0438\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b (e.g., 'wb').", "YIELDS": "Path - \u041f\u0443\u0442\u044c \u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0443.", "THROW": "IOError - \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "remove_empty_directories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 96, "tags": { "PURPOSE": "\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u0434\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438.", "PRE": "root_dir \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.", "POST": "\u0412\u0441\u0435 \u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u0434\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e.", "PARAM": "root_dir (str) - \u041f\u0443\u0442\u044c \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438.", "RETURN": "int - \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "read_dashboard_from_disk", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 114, "tags": { "PURPOSE": "\u0427\u0438\u0442\u0430\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0434\u0438\u0441\u043a\u0430.", "PRE": "file_path \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0431\u0430\u0439\u0442\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.", "PARAM": "file_path (str) - \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443.", "RETURN": "Tuple[bytes, str] - \u041a\u043e\u0440\u0442\u0435\u0436 (\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430).", "THROW": "FileNotFoundError - \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "calculate_crc32", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 128, "tags": { "PURPOSE": "\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 CRC32 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430.", "PRE": "file_path \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Path \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 8-\u0437\u043d\u0430\u0447\u043d\u0443\u044e hex-\u0441\u0442\u0440\u043e\u043a\u0443 CRC32.", "PARAM": "file_path (Path) - \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443.", "RETURN": "str - 8-\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 CRC32.", "THROW": "IOError - \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RetentionPolicy", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 138, "tags": { "PURPOSE": "\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u043e\u0432 (\u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435, \u0435\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0435, \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0435)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "archive_exports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 222, "tags": { "PURPOSE": "\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0440\u0445\u0438\u0432\u043e\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u0434\u0443\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e.", "PRE": "output_dir \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.", "POST": "\u0421\u0442\u0430\u0440\u044b\u0435 \u0438\u043b\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0430\u0440\u0445\u0438\u0432\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435.", "PARAM": "deduplicate (bool) - \u0424\u043b\u0430\u0433 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u043e CRC32." }, "relations": [ { "type": "CALLS", "target": "apply_retention_policy" }, { "type": "CALLS", "target": "calculate_crc32" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "apply_retention_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 224, "end_line": 257, "tags": { "PURPOSE": "(Helper) \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0442\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c.", "PRE": "files_with_dates is a list of (Path, date) tuples.", "POST": "Returns a set of files to keep.", "PARAM": "policy (RetentionPolicy) - \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f.", "RETURN": "set - \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0442\u0435\u0439 \u043a \u0444\u0430\u0439\u043b\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_and_unpack_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 259, "end_line": 288, "tags": { "PURPOSE": "\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ZIP-\u0430\u0440\u0445\u0438\u0432\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a \u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e.", "PRE": "zip_content \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e ZIP-\u0430\u0440\u0445\u0438\u0432\u0430.", "POST": "ZIP-\u0444\u0430\u0439\u043b \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d, \u0438 \u0435\u0441\u043b\u0438 unpack=True, \u043e\u043d \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d \u0432 output_dir.", "PARAM": "original_filename (Optional[str]) - \u0418\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f.", "RETURN": "Tuple[Path, Optional[Path]] - \u041f\u0443\u0442\u044c \u043a ZIP-\u0444\u0430\u0439\u043b\u0443 \u0438, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e, \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u043e\u0439.", "THROW": "InvalidZipFormatError - \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 ZIP." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_yamls", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 290, "end_line": 310, "tags": { "PURPOSE": "\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 YAML-\u0444\u0430\u0439\u043b\u0430\u0445, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f regex.", "PRE": "path \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439.", "POST": "\u0412\u0441\u0435 YAML \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c.", "THROW": "FileNotFoundError - \u0415\u0441\u043b\u0438 `path` \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.", "PARAM": "replace_string (Optional[LiteralString]) - \u0421\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b." }, "relations": [ { "type": "CALLS", "target": "_update_yaml_file" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_update_yaml_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 312, "end_line": 377, "tags": { "PURPOSE": "(Helper) \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043e\u0434\u0438\u043d YAML \u0444\u0430\u0439\u043b.", "PRE": "file_path \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Path \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 YAML \u0444\u0430\u0439\u043b\u0443.", "POST": "\u0424\u0430\u0439\u043b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c \u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e.", "PARAM": "replace_string (Optional[str]) - \u0417\u0430\u043c\u0435\u043d\u0430." }, "relations": [], "children": [ { "name": "replacer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 359, "end_line": 368, "tags": { "PURPOSE": "\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0449\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438.", "PRE": "match \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0438." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_dashboard_export", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 379, "end_line": 405, "tags": { "PURPOSE": "\u0421\u043e\u0437\u0434\u0430\u0435\u0442 ZIP-\u0430\u0440\u0445\u0438\u0432 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439.", "PRE": "source_paths \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0443\u0442\u0438.", "POST": "ZIP-\u0430\u0440\u0445\u0438\u0432 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e \u043f\u0443\u0442\u0438 zip_path.", "PARAM": "exclude_extensions (Optional[List[str]]) - \u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.", "RETURN": "bool - `True` \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435, `False` \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "sanitize_filename", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 407, "end_line": 416, "tags": { "PURPOSE": "\u041e\u0447\u0438\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u0432 \u0438\u043c\u0435\u043d\u0430\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.", "PRE": "filename \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0435\u0437 \u0441\u043f\u0435\u0446\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.", "PARAM": "filename (str) - \u0418\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.", "RETURN": "str - \u041e\u0447\u0438\u0449\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_filename_from_headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 418, "end_line": 430, "tags": { "PURPOSE": "\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 'Content-Disposition'.", "PRE": "headers \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 None, \u0435\u0441\u043b\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442.", "PARAM": "headers (dict) - \u0421\u043b\u043e\u0432\u0430\u0440\u044c HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432.", "RETURN": "Optional[str] - \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 or `None`." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "consolidate_archive_folders", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 432, "end_line": 486, "tags": { "PURPOSE": "\u041a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0430\u0440\u0445\u0438\u0432\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043b\u0430\u0433\u0430 \u0432 \u0438\u043c\u0435\u043d\u0438.", "PRE": "root_directory \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Path \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.", "POST": "\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043e\u0434\u043d\u0443.", "THROW": "TypeError, ValueError - \u0415\u0441\u043b\u0438 `root_directory` \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u0435\u043d.", "PARAM": "root_directory (Path) - \u041a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0430\u0446\u0438\u0438." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 488 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "network", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": null, "tags": { "COMPLEXITY": "3", "SEMANTICS": "network, http, client, api, requests, session, authentication", "PURPOSE": "\u0418\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e HTTP-\u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Superset API, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0435\u0439, retry-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a.", "LAYER": "Infra", "PUBLIC_API": "APIClient" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.logger" }, { "type": "DEPENDS_ON", "target": "requests" } ], "children": [ { "name": "SupersetAPIError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 39, "tags": { "COMPLEXITY": "1", "PURPOSE": "Base exception for all Superset API related errors." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 38, "tags": { "COMPLEXITY": "1", "PURPOSE": "Initializes the exception with a message and context.", "PRE": "message is a string, context is a dict.", "POST": "Exception is initialized with context." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AuthenticationError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 54, "tags": { "COMPLEXITY": "1", "PURPOSE": "Exception raised when authentication fails." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 53, "tags": { "COMPLEXITY": "1", "PURPOSE": "Initializes the authentication error.", "PRE": "message is a string, context is a dict.", "POST": "AuthenticationError is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PermissionDeniedError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 67, "tags": { "PURPOSE": "Exception raised when access is denied." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 66, "tags": { "PURPOSE": "Initializes the permission denied error.", "PRE": "message is a string, context is a dict.", "POST": "PermissionDeniedError is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardNotFoundError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 80, "tags": { "PURPOSE": "Exception raised when a dashboard cannot be found." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 79, "tags": { "PURPOSE": "Initializes the not found error with resource ID.", "PRE": "resource_id is provided.", "POST": "DashboardNotFoundError is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "NetworkError", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": null, "tags": { "PURPOSE": "Exception raised when a network level error occurs." }, "relations": [], "children": [ { "name": "network.APIClient.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": null, "tags": { "PURPOSE": "Initializes the network error.", "PRE": "message is a string.", "POST": "NetworkError is initialized." }, "relations": [], "children": [ { "name": "network.SupersetAuthCache", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": null, "tags": { "PURPOSE": "Process-local cache for Superset access/csrf tokens keyed by environment credentials.", "PRE": "base_url and username are stable strings.", "POST": "Cached entries expire automatically by TTL and can be reused across requests." }, "relations": [], "children": [ { "name": "APIClient", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 152, "end_line": 506, "tags": { "COMPLEXITY": "3", "PURPOSE": "Synchronous Superset API client with process-local auth token caching." }, "relations": [ { "type": "DEPENDS_ON", "target": "network.SupersetAuthCache" }, { "type": "DEPENDS_ON", "target": "logger" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 160, "end_line": 183, "tags": { "PURPOSE": "\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 API \u043a\u043b\u0438\u0435\u043d\u0442 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u0441\u0435\u0441\u0441\u0438\u0435\u0439 \u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u043c.", "PARAM": "timeout (int) - \u0422\u0430\u0439\u043c\u0430\u0443\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.", "PRE": "config must contain 'base_url' and 'auth'.", "POST": "APIClient instance is initialized with a session." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_init_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 185, "end_line": 229, "tags": { "PURPOSE": "\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 `requests.Session` \u0441 retry-\u043b\u043e\u0433\u0438\u043a\u043e\u0439.", "PRE": "self.request_settings must be initialized.", "POST": "Returns a configured requests.Session instance.", "RETURN": "requests.Session - \u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044f." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_base_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 231, "end_line": 241, "tags": { "PURPOSE": "Normalize Superset environment URL to base host/path without trailing slash and /api/v1 suffix.", "PRE": "raw_url can be empty.", "POST": "Returns canonical base URL suitable for building API endpoints.", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_api_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 243, "end_line": 257, "tags": { "PURPOSE": "Build absolute Superset API URL for endpoint using canonical /api/v1 base.", "PRE": "endpoint is relative path or absolute URL.", "POST": "Returns full URL without accidental duplicate slashes.", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "authenticate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 259, "end_line": 307, "tags": { "PURPOSE": "\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 Superset API \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 access \u0438 CSRF \u0442\u043e\u043a\u0435\u043d\u044b.", "PRE": "self.auth and self.base_url must be valid.", "POST": "`self._tokens` \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d, `self._authenticated` \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 `True`.", "RETURN": "Dict[str, str] - \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438.", "THROW": "AuthenticationError, NetworkError - \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 310, "end_line": 323, "tags": { "PURPOSE": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.", "PRE": "APIClient is initialized and authenticated or can be authenticated.", "POST": "Returns headers including auth tokens." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 325, "end_line": 353, "tags": { "PURPOSE": "\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u043a API.", "PARAM": "raw_response (bool) - \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043b\u0438 \u0441\u044b\u0440\u043e\u0439 \u043e\u0442\u0432\u0435\u0442.", "PRE": "method and endpoint must be strings.", "POST": "Returns response content or raw Response object.", "RETURN": "`requests.Response` \u0435\u0441\u043b\u0438 `raw_response=True`, \u0438\u043d\u0430\u0447\u0435 `dict`.", "THROW": "SupersetAPIError, NetworkError \u0438 \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u044b." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_handle_http_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 355, "end_line": 373, "tags": { "PURPOSE": "(Helper) \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 HTTP \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.", "PARAM": "endpoint (str) - \u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442.", "PRE": "e must be a valid HTTPError with a response.", "POST": "Raises a specific SupersetAPIError or subclass." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_handle_network_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 375, "end_line": 390, "tags": { "PURPOSE": "(Helper) \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 `NetworkError`.", "PARAM": "url (str) - URL.", "PRE": "e must be a RequestException.", "POST": "Raises a NetworkError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "upload_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 392, "end_line": 421, "tags": { "PURPOSE": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 multipart/form-data.", "PARAM": "timeout (Optional[int]) - \u0422\u0430\u0439\u043c\u0430\u0443\u0442.", "PRE": "file_info must contain 'file_obj' and 'file_name'.", "POST": "File is uploaded and response returned.", "RETURN": "\u041e\u0442\u0432\u0435\u0442 API \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f.", "THROW": "SupersetAPIError, NetworkError, TypeError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_perform_upload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 423, "end_line": 449, "tags": { "PURPOSE": "(Helper) \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 POST \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c.", "PARAM": "timeout (Optional[int]) - \u0422\u0430\u0439\u043c\u0430\u0443\u0442.", "PRE": "url, files, and headers must be provided.", "POST": "POST request is performed and JSON response returned.", "RETURN": "Dict - \u041e\u0442\u0432\u0435\u0442." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetch_paginated_count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 451, "end_line": 463, "tags": { "PURPOSE": "\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438.", "PARAM": "count_field (str) - \u041f\u043e\u043b\u0435 \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c.", "PRE": "query_params must be a dictionary.", "POST": "Returns total count of items.", "RETURN": "int - \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetch_paginated_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 465, "end_line": 504, "tags": { "PURPOSE": "\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043f\u0430\u0433\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430.", "PARAM": "pagination_options (Dict[str, Any]) - \u041e\u043f\u0446\u0438\u0438 \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0438.", "PRE": "pagination_options must contain 'base_query', 'results_field'. 'total_count' is optional.", "POST": "Returns all items across all pages.", "RETURN": "List[Any] - \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:network.SupersetAuthCache:Class] started at line 97", "severity": "ERROR", "line_number": 97 }, { "message": "Unclosed Anchor: [DEF:network.SupersetAuthCache:Class] started at line 97", "severity": "ERROR", "line_number": 97 }, { "message": "Unclosed Anchor: [DEF:network.SupersetAuthCache:Class] started at line 97", "severity": "ERROR", "line_number": 97 }, { "message": "Unclosed Anchor: [DEF:network.SupersetAuthCache:Class] started at line 97", "severity": "ERROR", "line_number": 97 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:network.APIClient.__init__:Function] started at line 85", "severity": "ERROR", "line_number": 85 }, { "message": "Unclosed Anchor: [DEF:network.APIClient.__init__:Function] started at line 85", "severity": "ERROR", "line_number": 85 }, { "message": "Unclosed Anchor: [DEF:network.APIClient.__init__:Function] started at line 85", "severity": "ERROR", "line_number": 85 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:NetworkError:Class] started at line 82", "severity": "ERROR", "line_number": 82 }, { "message": "Unclosed Anchor: [DEF:NetworkError:Class] started at line 82", "severity": "ERROR", "line_number": 82 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "set", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "invalidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 147, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "init_poolmanager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 196, "end_line": 196, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:network:Module] started at line 1", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.utils.matching", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 55, "tags": { "SEMANTICS": "fuzzy, matching, rapidfuzz, database, mapping", "PURPOSE": "Provides utility functions for fuzzy matching database names.", "LAYER": "Core", "INVARIANT": "Confidence scores are returned as floats between 0.0 and 1.0." }, "relations": [ { "type": "DEPENDS_ON", "target": "rapidfuzz" } ], "children": [ { "name": "suggest_mappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 53, "tags": { "PURPOSE": "Suggests mappings between source and target databases using fuzzy matching.", "PRE": "source_databases and target_databases are lists of dictionaries with 'uuid' and 'database_name'.", "POST": "Returns a list of suggested mappings with confidence scores.", "PARAM": "threshold (int) - Minimum confidence score (0-100).", "RETURN": "List[Dict] - Suggested mappings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.core.utils.dataset_mapper", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 237, "tags": { "SEMANTICS": "dataset, mapping, postgresql, xlsx, superset", "PURPOSE": "\u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 (verbose_map) \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u0445 Superset, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044f \u0438\u0445 \u0438\u0437 PostgreSQL \u0438\u043b\u0438 XLSX-\u0444\u0430\u0439\u043b\u043e\u0432.", "LAYER": "Domain", "PUBLIC_API": "DatasetMapper" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.core.superset_client" }, { "type": "DEPENDS_ON", "target": "pandas" }, { "type": "DEPENDS_ON", "target": "psycopg2" } ], "children": [ { "name": "DatasetMapper", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 235, "tags": { "PURPOSE": "\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u0435\u043f\u043f\u0438\u043d\u0433\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f verbose_map \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u0445 Superset." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 26, "tags": { "PURPOSE": "Initializes the mapper.", "POST": "\u041e\u0431\u044a\u0435\u043a\u0442 DatasetMapper \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_postgres_comments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 91, "tags": { "PURPOSE": "\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 PostgreSQL.", "PRE": "table_name \u0438 table_schema \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 - \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f - \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u0437 \u0411\u0414.", "THROW": "Exception - \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0411\u0414.", "PARAM": "table_schema (str) - \u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.", "RETURN": "Dict[str, str] - \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043a \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "load_excel_mappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 111, "tags": { "PURPOSE": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043c\u0435\u043f\u043f\u0438\u043d\u0433\u0438 'column_name' -> 'column_comment' \u0438\u0437 XLSX \u0444\u0430\u0439\u043b\u0430.", "PRE": "file_path \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 XLSX \u0444\u0430\u0439\u043b.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043c\u0435\u043f\u043f\u0438\u043d\u0433\u0430\u043c\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430.", "THROW": "Exception - \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430.", "PARAM": "file_path (str) - \u041f\u0443\u0442\u044c \u043a XLSX \u0444\u0430\u0439\u043b\u0443.", "RETURN": "Dict[str, str] - \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043c\u0435\u043f\u043f\u0438\u043d\u0433\u0430\u043c\u0438." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 234, "tags": { "PURPOSE": "\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u043f\u043f\u0438\u043d\u0433\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f verbose_map \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430 \u0432 Superset.", "PRE": "dataset_id \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c ID \u0432 Superset.", "POST": "\u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0432 Superset \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d \u0447\u0435\u0440\u0435\u0437 API.", "PARAM": "table_schema (Optional[str]) - \u0421\u0445\u0435\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 PostgreSQL." }, "relations": [ { "type": "CALLS", "target": "self.get_postgres_comments" }, { "type": "CALLS", "target": "self.load_excel_mappings" }, { "type": "CALLS", "target": "superset_client.get_dataset" }, { "type": "CALLS", "target": "superset_client.update_dataset" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "src.core.utils", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Shared utility package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.__tests__.test_superset_profile_lookup", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 128, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, superset, profile, lookup, fallback, sorting", "PURPOSE": "Verifies Superset profile lookup adapter payload normalization and fallback error precedence.", "LAYER": "Domain" }, "relations": [ { "type": "TESTS", "target": "backend.src.core.superset_profile_lookup" } ], "children": [ { "name": "_RecordingNetworkClient", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 61, "tags": { "PURPOSE": "Records request payloads and returns scripted responses for deterministic adapter tests." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 35, "tags": { "PURPOSE": "Initializes scripted network responses.", "PRE": "scripted_responses is ordered per expected request sequence.", "POST": "Instance stores response script and captures subsequent request calls." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 60, "tags": { "PURPOSE": "Mimics APIClient.request while capturing call arguments.", "PRE": "method and endpoint are provided.", "POST": "Returns scripted response or raises scripted exception." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_users_page_sends_lowercase_order_direction", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 84, "tags": { "PURPOSE": "Ensures adapter sends lowercase order_direction compatible with Superset rison schema.", "PRE": "Adapter is initialized with recording network client.", "POST": "First request query payload contains order_direction='asc' for asc sort." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_users_page_preserves_primary_schema_error_over_fallback_auth_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 105, "tags": { "PURPOSE": "Ensures fallback auth error does not mask primary schema/query failure.", "PRE": "Primary endpoint fails with SupersetAPIError and fallback fails with AuthenticationError.", "POST": "Raised exception remains primary SupersetAPIError (non-auth) to preserve root cause." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_users_page_uses_fallback_endpoint_when_primary_fails", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 125, "tags": { "PURPOSE": "Verifies adapter retries second users endpoint and succeeds when fallback is healthy.", "PRE": "Primary endpoint fails; fallback returns valid users payload.", "POST": "Result status is success and both endpoints were attempted in order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_throttled_scheduler", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 5, "end_line": 99, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for ThrottledSchedulerConfigurator distribution logic." }, "relations": [], "children": [ { "name": "test_calculate_schedule_even_distribution", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 9, "end_line": 9, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_calculate_schedule_midnight_crossing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_calculate_schedule_single_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_calculate_schedule_empty_list", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_calculate_schedule_zero_window", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 68, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_calculate_schedule_very_small_window", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 83, "end_line": 83, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 5 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 5 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 5 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.core.__tests__.test_config_manager_compat", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "3", "SEMANTICS": "config-manager, compatibility, payload, tests", "PURPOSE": "Verifies ConfigManager compatibility wrappers preserve legacy payload sections.", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "ConfigManager" } ], "children": [ { "name": "test_get_payload_preserves_legacy_sections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 23, "tags": { "PURPOSE": "Ensure get_payload merges typed config into raw payload without dropping legacy sections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_save_config_accepts_raw_payload_and_keeps_extras", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 51, "tags": { "PURPOSE": "Ensure save_config accepts raw dict payload, refreshes typed config, and preserves extra sections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_capture_save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_logger", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 281, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for logger module", "LAYER": "Infra" }, "relations": [ { "type": "VERIFIES", "target": "src.core.logger" } ], "children": [ { "name": "test_belief_scope_logs_entry_action_exit_at_debug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 75, "tags": { "PURPOSE": "Test that belief_scope generates [ID][Entry], [ID][Action], and [ID][Exit] logs at DEBUG level.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Entry, Action, and Exit tags at DEBUG level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_error_handling", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 107, "tags": { "PURPOSE": "Test that belief_scope logs Coherence:Failed on exception.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Coherence:Failed tag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_success_coherence", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 134, "tags": { "PURPOSE": "Test that belief_scope logs Coherence:OK on success.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Coherence:OK tag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_not_visible_at_info", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 137, "end_line": 156, "tags": { "PURPOSE": "Test that belief_scope Entry/Exit/Coherence logs are NOT visible at INFO level.", "PRE": "belief_scope is available. caplog fixture is used.", "POST": "Entry/Exit/Coherence logs are not captured at INFO level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_log_level_default", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 167, "tags": { "PURPOSE": "Test that default task log level is INFO.", "PRE": "None.", "POST": "Default level is INFO." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_should_log_task_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 181, "tags": { "PURPOSE": "Test that should_log_task_level correctly filters log levels.", "PRE": "None.", "POST": "Filtering works correctly for all level combinations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_configure_logger_task_log_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 184, "end_line": 199, "tags": { "PURPOSE": "Test that configure_logger updates task_log_level.", "PRE": "LoggingConfig is available.", "POST": "task_log_level is updated correctly." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enable_belief_state_flag", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 202, "end_line": 228, "tags": { "PURPOSE": "Test that enable_belief_state flag controls belief_scope logging.", "PRE": "LoggingConfig is available. caplog fixture is used.", "POST": "belief_scope logs are controlled by the flag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_missing_anchor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 231, "end_line": 241, "tags": { "PURPOSE": "Test @PRE condition: anchor_id must be provided" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_configure_logger_post_conditions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 243, "end_line": 279, "tags": { "PURPOSE": "Test @POST condition: Logger level, handlers, belief state flag, and task log level are updated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "reset_logger_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.core.migration.dry_run_orchestrator", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 235, "tags": { "COMPLEXITY": "3", "SEMANTICS": "migration, dry_run, diff, risk, superset", "PURPOSE": "Compute pre-flight migration diff and risk scoring without apply.", "LAYER": "Core", "INVARIANT": "Dry run is informative only and must not mutate target environment." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.migration_engine.MigrationEngine" }, { "type": "DEPENDS_ON", "target": "backend.src.core.migration.archive_parser.MigrationArchiveParser" }, { "type": "DEPENDS_ON", "target": "backend.src.core.migration.risk_assessor" } ], "children": [ { "name": "MigrationDryRunService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 28, "end_line": 234, "tags": { "PURPOSE": "Build deterministic diff/risk payload for migration pre-flight." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 37, "tags": { "PURPOSE": "Wire parser dependency for archive object extraction.", "PRE": "parser can be omitted to use default implementation.", "POST": "Service is ready to calculate dry-run payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 111, "tags": { "PURPOSE": "Execute full dry-run computation for selected dashboards.", "PRE": "source/target clients are authenticated and selection validated by caller.", "POST": "Returns JSON-serializable pre-flight payload with summary, diff and risk.", "SIDE_EFFECT": "Reads source export archives and target metadata via network." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_load_db_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 121, "tags": { "PURPOSE": "Resolve UUID mapping for optional DB config replacement." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_accumulate_objects", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 123, "end_line": 131, "tags": { "PURPOSE": "Merge extracted resources by UUID to avoid duplicates." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_index_by_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 142, "tags": { "PURPOSE": "Build UUID-index map for normalized resources." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_object_diff", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 144, "end_line": 164, "tags": { "PURPOSE": "Compute create/update/delete buckets by UUID+signature." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_target_signatures", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 166, "end_line": 219, "tags": { "PURPOSE": "Pull target metadata and normalize it into comparable signatures." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_risks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 231, "tags": { "PURPOSE": "Build risk items for missing datasource, broken refs, overwrite, owner mismatch." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 28 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 28 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.core.migration.archive_parser", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 139, "tags": { "COMPLEXITY": "3", "SEMANTICS": "migration, zip, parser, yaml, metadata", "PURPOSE": "Parse Superset export ZIP archives into normalized object catalogs for diffing.", "LAYER": "Core", "INVARIANT": "Parsing is read-only and never mutates archive files." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.logger" } ], "children": [ { "name": "MigrationArchiveParser", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 20, "end_line": 138, "tags": { "PURPOSE": "Extract normalized dashboards/charts/datasets metadata from ZIP archives." }, "relations": [], "children": [ { "name": "extract_objects_from_zip", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 45, "tags": { "PURPOSE": "Extract object catalogs from Superset archive.", "PRE": "zip_path points to a valid readable ZIP.", "POST": "Returns object lists grouped by resource type.", "RETURN": "Dict[str, List[Dict[str, Any]]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_collect_yaml_objects", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 69, "tags": { "PURPOSE": "Read and normalize YAML manifests for one object type.", "PRE": "object_type is one of dashboards/charts/datasets.", "POST": "Returns only valid normalized objects." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_object_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 135, "tags": { "PURPOSE": "Convert raw YAML payload to stable diff signature shape.", "PRE": "payload is parsed YAML mapping.", "POST": "Returns normalized descriptor with `uuid`, `title`, and `signature`." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 20 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 20 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.core.migration.risk_assessor", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 171, "tags": { "COMPLEXITY": "5", "SEMANTICS": "migration, dry_run, risk, scoring, preflight", "PURPOSE": "Compute deterministic migration risk items and aggregate score for dry-run reporting.", "LAYER": "Domain", "INVARIANT": "Risk scoring must remain bounded to [0,100] and preserve severity-to-weight mapping.", "TEST_CONTRACT": "[source_objects,target_objects,diff,target_client] -> [List[RiskItem]]", "TEST_SCENARIO": "[owner_mismatch_dashboard] -> [low owner_mismatch risk is emitted]", "TEST_EDGE": "[external_fail] -> [target_client get_databases exception propagates to caller]", "TEST_INVARIANT": "[score_upper_bound_100] -> VERIFIED_BY: [severity_weight_aggregation]", "UX_STATE": "[Idle] -> [N/A backend domain module]", "UX_FEEDBACK": "[N/A] -> [No direct UI side effects in this module]", "UX_RECOVERY": "[N/A] -> [Caller-level retry/recovery]", "UX_REACTIVITY": "[N/A] -> [Backend synchronous function contracts]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DISPATCHES", "target": "backend.src.core.migration.dry_run_orchestrator.MigrationDryRunService.run" } ], "children": [ { "name": "index_by_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 44, "tags": { "PURPOSE": "Build UUID-index from normalized objects.", "PRE": "Input list items are dict-like payloads potentially containing \"uuid\".", "POST": "Returns mapping keyed by string uuid; only truthy uuid values are included.", "SIDE_EFFECT": "Emits reasoning/reflective logs only.", "DATA_CONTRACT": "List[Dict[str, Any]] -> Dict[str, Dict[str, Any]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extract_owner_identifiers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 71, "tags": { "PURPOSE": "Normalize owner payloads for stable comparison.", "PRE": "Owners may be list payload, scalar values, or None.", "POST": "Returns sorted unique owner identifiers as strings.", "SIDE_EFFECT": "Emits reasoning/reflective logs only.", "DATA_CONTRACT": "Any -> List[str]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_risks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 150, "tags": { "PURPOSE": "Build risk list from computed diffs and target catalog state.", "PRE": "target_client is authenticated/usable for database list retrieval.", "POST": "Returns list of deterministic risk items derived from overwrite, missing datasource, reference, and owner mismatch checks.", "SIDE_EFFECT": "Calls target Superset API for databases metadata and emits logs.", "DATA_CONTRACT": ") -> List[Dict[str, Any]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "score_risks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 168, "tags": { "PURPOSE": "Aggregate risk list into score and level.", "PRE": "risk_items contains optional severity fields expected in {high,medium,low} or defaults to low weight.", "POST": "Returns dict with score in [0,100], derived level, and original items.", "SIDE_EFFECT": "Emits reasoning/reflective logs only.", "DATA_CONTRACT": "List[Dict[str, Any]] -> Dict[str, Any]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.core.migration.__init__", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 12, "tags": { "COMPLEXITY": "1", "SEMANTICS": "migration, package, exports", "PURPOSE": "Namespace package for migration pre-flight orchestration components.", "LAYER": "Core" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskLoggerModule", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 190, "tags": { "SEMANTICS": "task, logger, context, plugin, attribution", "PURPOSE": "Provides a dedicated logger for tasks with automatic source attribution.", "LAYER": "Core", "COMPLEXITY": "5", "INVARIANT": "Each TaskLogger instance is bound to a specific task_id and default source." }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskManager, CALLS -> TaskManager._add_log" } ], "children": [ { "name": "TaskLogger", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 13, "end_line": 188, "tags": { "SEMANTICS": "logger, task, source, attribution", "PURPOSE": "A wrapper around TaskManager._add_log that carries task_id and source context.", "COMPLEXITY": "5", "INVARIANT": "All log calls include the task_id and source.", "UX_STATE": "Idle -> Logging -> (system records log)", "TEST_CONTRACT": "TaskLoggerModel ->", "TEST_FIXTURE": "valid_task_logger -> {\"task_id\": \"test_123\", \"add_log_fn\": lambda *args: None, \"source\": \"test_plugin\"}", "TEST_EDGE": "invalid_add_log_fn -> raises TypeError", "TEST_INVARIANT": "consistent_delegation -> verifies: [valid_task_logger]" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 63, "tags": { "PURPOSE": "Initialize the TaskLogger with task context.", "PRE": "add_log_fn is a callable that accepts (task_id, level, message, context, source, metadata).", "POST": "TaskLogger is ready to log messages.", "PARAM": "source (str) - Default source for logs (default: \"plugin\")." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "with_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 78, "tags": { "PURPOSE": "Create a sub-logger with a different default source.", "PRE": "source is a non-empty string.", "POST": "Returns new TaskLogger with the same task_id but different source.", "PARAM": "source (str) - New default source.", "RETURN": "TaskLogger - New logger instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_log", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 104, "tags": { "PURPOSE": "Internal method to log a message at a given level.", "PRE": "level is a valid log level string.", "POST": "Log entry added via add_log_fn.", "PARAM": "metadata (Optional[Dict]) - Additional structured data.", "UX_STATE": "Logging -> (writing internal log)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "debug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 120, "tags": { "PURPOSE": "Log a DEBUG level message.", "PRE": "message is a string.", "POST": "Log entry added via internally with DEBUG level.", "PARAM": "metadata (Optional[Dict]) - Additional data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "info", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 136, "tags": { "PURPOSE": "Log an INFO level message.", "PRE": "message is a string.", "POST": "Log entry added internally with INFO level.", "PARAM": "metadata (Optional[Dict]) - Additional data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "warning", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 152, "tags": { "PURPOSE": "Log a WARNING level message.", "PRE": "message is a string.", "POST": "Log entry added internally with WARNING level.", "PARAM": "metadata (Optional[Dict]) - Additional data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 154, "end_line": 168, "tags": { "PURPOSE": "Log an ERROR level message.", "PRE": "message is a string.", "POST": "Log entry added internally with ERROR level.", "PARAM": "metadata (Optional[Dict]) - Additional data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "progress", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 186, "tags": { "PURPOSE": "Log a progress update with percentage.", "PRE": "percent is between 0 and 100.", "POST": "Log entry with progress metadata added.", "PARAM": "source (Optional[str]) - Override source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 13 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 13 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "TaskPersistenceModule", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 547, "tags": { "COMPLEXITY": "5", "SEMANTICS": "persistence, sqlite, sqlalchemy, task, storage", "PURPOSE": "Handles the persistence of tasks using SQLAlchemy and the tasks.db database.", "LAYER": "Core", "PRE": "Tasks database must be initialized with TaskRecord and TaskLogRecord schemas.", "POST": "Provides reliable storage and retrieval for task metadata and logs.", "SIDE_EFFECT": "Performs database I/O on tasks.db.", "DATA_CONTRACT": "Input[Task, LogEntry] -> Model[TaskRecord, TaskLogRecord]", "INVARIANT": "Database schema must match the TaskRecord model structure." }, "relations": [ { "type": "USED_BY", "target": "backend.src.core.task_manager.manager.TaskManager" }, { "type": "DEPENDS_ON", "target": "TasksSessionLocal" } ], "children": [ { "name": "TaskPersistenceService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 28, "end_line": 304, "tags": { "COMPLEXITY": "5", "SEMANTICS": "persistence, service, database, sqlalchemy", "PURPOSE": "Provides methods to save, load, and delete task records in tasks.db using SQLAlchemy models.", "PRE": "TasksSessionLocal must provide an active SQLAlchemy session, Task inputs must expose id/plugin_id/status/params/result/logs fields, and TaskRecord plus Environment schemas must be available.", "POST": "Persist operations leave matching TaskRecord rows committed or rolled back without leaking sessions, load operations return reconstructed Task objects from stored TaskRecord rows, and delete operations remove only the addressed task rows.", "SIDE_EFFECT": "Opens SQLAlchemy sessions, reads and writes task_records rows, resolves environment foreign keys against environments, commits or rolls back transactions, and emits error logs on persistence failures.", "DATA_CONTRACT": "Input[Task | List[Task] | List[str] | Query(limit:int,status:Optional[TaskStatus])] -> Model[TaskRecord, Environment] -> Output[None | List[Task]]", "INVARIANT": "Persistence must handle potentially missing task fields natively.", "TEST_CONTRACT": "TaskPersistenceService ->", "TEST_FIXTURE": "valid_task_persistence -> {\"task_id\": \"123\", \"status\": \"PENDING\"}", "TEST_EDGE": "load_corrupt_json_params -> handled gracefully", "TEST_INVARIANT": "accurate_round_trip -> verifies: [valid_task_persistence, load_corrupt_json_params]" }, "relations": [ { "type": "DEPENDS_ON", "target": "TasksSessionLocal" }, { "type": "DEPENDS_ON", "target": "TaskRecord" }, { "type": "DEPENDS_ON", "target": "Environment" }, { "type": "USED_BY", "target": "backend.src.core.task_manager.manager.TaskManager" } ], "children": [ { "name": "_json_load_if_needed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 77, "tags": { "COMPLEXITY": "1", "PURPOSE": "Safely load JSON strings from DB if necessary", "PRE": "value is an arbitrary database value", "POST": "Returns parsed JSON object, list, string, or primitive" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_parse_datetime", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 95, "tags": { "COMPLEXITY": "1", "PURPOSE": "Safely parse a datetime string from the database", "PRE": "value is an ISO string or datetime object", "POST": "Returns datetime object or None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_environment_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 97, "end_line": 134, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve environment id into existing environments.id value to satisfy FK constraints.", "PRE": "Session is active", "POST": "Returns existing environments.id or None when unresolved.", "DATA_CONTRACT": "Input[env_id: Optional[str]] -> Output[Optional[str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 } ], "score": 0.4 } }, { "name": "__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 136, "end_line": 145, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initializes the persistence service.", "PRE": "None.", "POST": "Service is ready." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 } ], "score": 0.4 } }, { "name": "persist_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 147, "end_line": 210, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persists or updates a single task in the database.", "PRE": "isinstance(task, Task)", "POST": "Task record created or updated in database.", "PARAM": "task (Task) - The task object to persist.", "SIDE_EFFECT": "Writes to task_records table in tasks.db", "DATA_CONTRACT": "Input[Task] -> Model[TaskRecord]" }, "relations": [ { "type": "CALLS", "target": "_resolve_environment_id" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "persist_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 212, "end_line": 223, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persists multiple tasks.", "PRE": "isinstance(tasks, list)", "POST": "All tasks in list are persisted.", "PARAM": "tasks (List[Task]) - The list of tasks to persist." }, "relations": [ { "type": "CALLS", "target": "persist_task" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "load_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 225, "end_line": 281, "tags": { "COMPLEXITY": "3", "PURPOSE": "Loads tasks from the database.", "PRE": "limit is an integer.", "POST": "Returns list of Task objects.", "PARAM": "status (Optional[TaskStatus]) - Filter by status.", "RETURN": "List[Task] - The loaded tasks.", "DATA_CONTRACT": "Model[TaskRecord] -> Output[List[Task]]" }, "relations": [ { "type": "CALLS", "target": "_json_load_if_needed" }, { "type": "CALLS", "target": "_parse_datetime" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "delete_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 283, "end_line": 303, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deletes specific tasks from the database.", "PRE": "task_ids is a list of strings.", "POST": "Specified task records deleted from database.", "PARAM": "task_ids (List[str]) - List of task IDs to delete.", "SIDE_EFFECT": "Deletes rows from task_records table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 283 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 283 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 283 } ], "score": 0.4 } } ], "compliance": { "valid": false, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 28 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 28 } ], "score": 0.0 } }, { "name": "TaskLogPersistenceService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 306, "end_line": 546, "tags": { "COMPLEXITY": "5", "SEMANTICS": "persistence, service, database, log, sqlalchemy", "PURPOSE": "Provides methods to store, query, summarize, and delete task log rows in the task_logs table.", "PRE": "TasksSessionLocal must provide an active SQLAlchemy session, task_id inputs must identify task log rows, LogEntry batches must expose timestamp/level/source/message/metadata fields, and LogFilter inputs must provide pagination and filter attributes used by queries.", "POST": "add_logs commits all provided log entries or rolls back on failure, query methods return TaskLog or LogStats views reconstructed from TaskLogRecord rows, and delete methods remove only log rows matching the supplied task identifiers.", "SIDE_EFFECT": "Opens SQLAlchemy sessions, inserts, reads, aggregates, and deletes task_logs rows, serializes log metadata to JSON, commits or rolls back transactions, and emits error logs on persistence failures.", "DATA_CONTRACT": "Input[task_id:str, logs:List[LogEntry], log_filter:LogFilter, task_ids:List[str]] -> Model[TaskLogRecord] -> Output[None | List[TaskLog] | LogStats | List[str]]", "INVARIANT": "Log entries are batch-inserted for performance.", "TEST_CONTRACT": "TaskLogPersistenceService ->", "TEST_FIXTURE": "valid_log_batch -> {\"task_id\": \"123\", \"logs\": [{\"level\": \"INFO\", \"message\": \"msg\"}]}", "TEST_EDGE": "add_logs_db_error -> rollback and log error", "TEST_INVARIANT": "accurate_log_aggregation -> verifies: [valid_log_batch]" }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskLogRecord" }, { "type": "DEPENDS_ON", "target": "TasksSessionLocal" }, { "type": "USED_BY", "target": "backend.src.core.task_manager.manager.TaskManager" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 337, "end_line": 344, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initializes the TaskLogPersistenceService", "PRE": "config is provided or defaults are used", "POST": "Service is ready for log persistence" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 337 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 337 } ], "score": 0.4 } }, { "name": "add_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 346, "end_line": 377, "tags": { "COMPLEXITY": "3", "PURPOSE": "Batch insert log entries for a task.", "PRE": "logs is a list of LogEntry objects.", "POST": "All logs inserted into task_logs table.", "PARAM": "logs (List[LogEntry]) - Log entries to insert.", "SIDE_EFFECT": "Writes to task_logs table.", "DATA_CONTRACT": "Input[List[LogEntry]] -> Model[TaskLogRecord]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 } ], "score": 0.4 } }, { "name": "get_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 379, "end_line": 431, "tags": { "COMPLEXITY": "3", "PURPOSE": "Query logs for a task with filtering and pagination.", "PRE": "task_id is a valid task ID.", "POST": "Returns list of TaskLog objects matching filters.", "PARAM": "log_filter (LogFilter) - Filter parameters.", "RETURN": "List[TaskLog] - Filtered log entries.", "DATA_CONTRACT": "Model[TaskLogRecord] -> Output[List[TaskLog]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 379 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 379 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 379 } ], "score": 0.4 } }, { "name": "get_log_stats", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 433, "end_line": 478, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get statistics about logs for a task.", "PRE": "task_id is a valid task ID.", "POST": "Returns LogStats with counts by level and source.", "PARAM": "task_id (str) - The task ID.", "RETURN": "LogStats - Statistics about task logs.", "DATA_CONTRACT": "Model[TaskLogRecord] -> Output[LogStats]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 433 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 433 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 433 } ], "score": 0.4 } }, { "name": "get_sources", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 480, "end_line": 499, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get unique sources for a task's logs.", "PRE": "task_id is a valid task ID.", "POST": "Returns list of unique source strings.", "PARAM": "task_id (str) - The task ID.", "RETURN": "List[str] - Unique source names.", "DATA_CONTRACT": "Model[TaskLogRecord] -> Output[List[str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 } ], "score": 0.4 } }, { "name": "delete_logs_for_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 501, "end_line": 521, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete all logs for a specific task.", "PRE": "task_id is a valid task ID.", "POST": "All logs for the task are deleted.", "PARAM": "task_id (str) - The task ID.", "SIDE_EFFECT": "Deletes from task_logs table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 501 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 501 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 501 } ], "score": 0.4 } }, { "name": "delete_logs_for_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 523, "end_line": 545, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete all logs for multiple tasks.", "PRE": "task_ids is a list of task IDs.", "POST": "All logs for the tasks are deleted.", "PARAM": "task_ids (List[str]) - List of task IDs.", "SIDE_EFFECT": "Deletes rows from task_logs table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 523 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 523 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 523 } ], "score": 0.4 } } ], "compliance": { "valid": false, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 306 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 306 } ], "score": 0.0 } }, { "name": "normalize_token", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 121, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "json_serializable", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 173, "end_line": 173, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 547 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.31666666666666665 } }, { "name": "TaskManager", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 642, "tags": { "TIER": "CRITICAL", "COMPLEXITY": "5", "SEMANTICS": "task, manager, lifecycle, execution, state", "PURPOSE": "Manages the lifecycle of tasks, including their creation, execution, and state tracking. It uses a thread pool to run plugins asynchronously.", "LAYER": "Core", "PRE": "Plugin loader and database sessions are initialized.", "POST": "Orchestrates task execution and persistence.", "SIDE_EFFECT": "Spawns worker threads and flushes logs to DB.", "DATA_CONTRACT": "Input[plugin_id, params] -> Model[Task, LogEntry]", "INVARIANT": "Task IDs are unique.", "CONSTRAINT": "Must use belief_scope for logging.", "TEST_CONTRACT": "TaskManagerModule -> {", "TEST_FIXTURE": "valid_module -> {\"manager_initialized\": true}", "TEST_EDGE": "external_failure -> {\"db_unavailable\": true}", "TEST_INVARIANT": "logger_compliance -> verifies: [valid_module]" }, "relations": [ { "type": "DEPENDS_ON", "target": "PluginLoader:Class" }, { "type": "DEPENDS_ON", "target": "TaskPersistenceModule:Module" } ], "children": [ { "name": "TaskManager", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 41, "end_line": 641, "tags": { "TIER": "CRITICAL", "COMPLEXITY": "5", "SEMANTICS": "task, manager, lifecycle, execution, state", "PURPOSE": "Manages the lifecycle of tasks, including their creation, execution, and state tracking.", "LAYER": "Core", "INVARIANT": "Log entries are never deleted after being added to a task.", "SIDE_EFFECT": "Spawns worker threads, flushes logs to database, and mutates task states.", "DATA_CONTRACT": "Input[plugin_id, params] -> Output[Task]" }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskPersistenceService:Class" }, { "type": "DEPENDS_ON", "target": "TaskLogPersistenceService:Class" }, { "type": "DEPENDS_ON", "target": "PluginLoader:Class" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 63, "end_line": 95, "tags": { "COMPLEXITY": "5", "PURPOSE": "Initialize the TaskManager with dependencies.", "PRE": "plugin_loader is initialized.", "POST": "TaskManager is ready to accept tasks.", "PARAM": "plugin_loader - The plugin loader instance." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 63 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 63 } ], "score": 0.0 } }, { "name": "_flusher_loop", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 97, "end_line": 107, "tags": { "COMPLEXITY": "3", "PURPOSE": "Background thread that periodically flushes log buffer to database.", "PRE": "TaskManager is initialized.", "POST": "Logs are batch-written to database every LOG_FLUSH_INTERVAL seconds." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 97 } ], "score": 0.4 } }, { "name": "_flush_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 109, "end_line": 134, "tags": { "COMPLEXITY": "3", "PURPOSE": "Flush all buffered logs to the database.", "PRE": "None.", "POST": "All buffered logs are written to task_logs table." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 109 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 109 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 109 } ], "score": 0.4 } }, { "name": "_flush_task_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 136, "end_line": 153, "tags": { "COMPLEXITY": "3", "PURPOSE": "Flush logs for a specific task immediately.", "PRE": "task_id exists.", "POST": "Task's buffered logs are written to database.", "PARAM": "task_id (str) - The task ID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 } ], "score": 0.4 } }, { "name": "create_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 155, "end_line": 183, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates and queues a new task for execution.", "PRE": "Plugin with plugin_id exists. Params are valid.", "POST": "Task is created, added to registry, and scheduled for execution.", "PARAM": "user_id (Optional[str]) - ID of the user requesting the task.", "RETURN": "Task - The created task instance.", "THROWS": "ValueError if plugin not found or params invalid." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 } ], "score": 0.4 } }, { "name": "_run_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 185, "end_line": 251, "tags": { "COMPLEXITY": "3", "PURPOSE": "Internal method to execute a task with TaskContext support.", "PRE": "Task exists in registry.", "POST": "Task is executed, status updated to SUCCESS or FAILED.", "PARAM": "task_id (str) - The ID of the task to run." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 185 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 185 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 185 } ], "score": 0.4 } }, { "name": "resolve_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 253, "end_line": 276, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resumes a task that is awaiting mapping.", "PRE": "Task exists and is in AWAITING_MAPPING state.", "POST": "Task status updated to RUNNING, params updated, execution resumed.", "PARAM": "resolution_params (Dict[str, Any]) - Params to resolve the wait.", "THROWS": "ValueError if task not found or not awaiting mapping." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 253 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 253 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 253 } ], "score": 0.4 } }, { "name": "wait_for_resolution", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 278, "end_line": 299, "tags": { "COMPLEXITY": "3", "PURPOSE": "Pauses execution and waits for a resolution signal.", "PRE": "Task exists.", "POST": "Execution pauses until future is set.", "PARAM": "task_id (str) - The ID of the task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 } ], "score": 0.4 } }, { "name": "wait_for_input", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 301, "end_line": 321, "tags": { "COMPLEXITY": "3", "PURPOSE": "Pauses execution and waits for user input.", "PRE": "Task exists.", "POST": "Execution pauses until future is set via resume_task_with_password.", "PARAM": "task_id (str) - The ID of the task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 301 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 301 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 301 } ], "score": 0.4 } }, { "name": "get_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 323, "end_line": 333, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves a task by its ID.", "PRE": "task_id is a string.", "POST": "Returns Task object or None.", "PARAM": "task_id (str) - ID of the task.", "RETURN": "Optional[Task] - The task or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 323 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 323 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 323 } ], "score": 0.4 } }, { "name": "get_all_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 335, "end_line": 344, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves all registered tasks.", "PRE": "None.", "POST": "Returns list of all Task objects.", "RETURN": "List[Task] - All tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 335 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 335 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 335 } ], "score": 0.4 } }, { "name": "get_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 346, "end_line": 385, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves tasks with pagination and optional status filter.", "PRE": "limit and offset are non-negative integers.", "POST": "Returns a list of tasks sorted by start_time descending.", "PARAM": "status (Optional[TaskStatus]) - Filter by task status.", "RETURN": "List[Task] - List of tasks matching criteria." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 346 } ], "score": 0.4 } }, { "name": "get_task_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 387, "end_line": 418, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves logs for a specific task (from memory for running, persistence for completed).", "PRE": "task_id is a string.", "POST": "Returns list of LogEntry or TaskLog objects.", "PARAM": "log_filter (Optional[LogFilter]) - Filter parameters.", "RETURN": "List[LogEntry] - List of log entries." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 387 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 387 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 387 } ], "score": 0.4 } }, { "name": "get_task_log_stats", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 420, "end_line": 430, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get statistics about logs for a task.", "PRE": "task_id is a valid task ID.", "POST": "Returns LogStats with counts by level and source.", "PARAM": "task_id (str) - The task ID.", "RETURN": "LogStats - Statistics about task logs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 420 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 420 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 420 } ], "score": 0.4 } }, { "name": "get_task_log_sources", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 432, "end_line": 442, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get unique sources for a task's logs.", "PRE": "task_id is a valid task ID.", "POST": "Returns list of unique source strings.", "PARAM": "task_id (str) - The task ID.", "RETURN": "List[str] - Unique source names." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 432 } ], "score": 0.4 } }, { "name": "_add_log", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 444, "end_line": 495, "tags": { "COMPLEXITY": "3", "PURPOSE": "Adds a log entry to a task buffer and notifies subscribers.", "PRE": "Task exists.", "POST": "Log added to buffer and pushed to queues (if level meets task_log_level filter).", "PARAM": "context (Optional[Dict]) - Legacy context (for backward compatibility)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 444 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 444 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 444 } ], "score": 0.4 } }, { "name": "subscribe_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 497, "end_line": 511, "tags": { "COMPLEXITY": "3", "PURPOSE": "Subscribes to real-time logs for a task.", "PRE": "task_id is a string.", "POST": "Returns an asyncio.Queue for log entries.", "PARAM": "task_id (str) - ID of the task.", "RETURN": "asyncio.Queue - Queue for log entries." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 497 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 497 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 497 } ], "score": 0.4 } }, { "name": "unsubscribe_logs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 513, "end_line": 527, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unsubscribes from real-time logs for a task.", "PRE": "task_id is a string, queue is asyncio.Queue.", "POST": "Queue removed from subscribers.", "PARAM": "queue (asyncio.Queue) - Queue to remove." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 513 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 513 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 513 } ], "score": 0.4 } }, { "name": "load_persisted_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 529, "end_line": 540, "tags": { "COMPLEXITY": "3", "PURPOSE": "Load persisted tasks using persistence service.", "PRE": "None.", "POST": "Persisted tasks loaded into self.tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 529 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 529 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 529 } ], "score": 0.4 } }, { "name": "await_input", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 542, "end_line": 563, "tags": { "COMPLEXITY": "3", "PURPOSE": "Transition a task to AWAITING_INPUT state with input request.", "PRE": "Task exists and is in RUNNING state.", "POST": "Task status changed to AWAITING_INPUT, input_request set, persisted.", "PARAM": "input_request (Dict) - Details about required input.", "THROWS": "ValueError if task not found or not RUNNING." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 542 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 542 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 542 } ], "score": 0.4 } }, { "name": "resume_task_with_password", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 565, "end_line": 593, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resume a task that is awaiting input with provided passwords.", "PRE": "Task exists and is in AWAITING_INPUT state.", "POST": "Task status changed to RUNNING, passwords injected, task resumed.", "PARAM": "passwords (Dict[str, str]) - Mapping of database name to password.", "THROWS": "ValueError if task not found, not awaiting input, or passwords invalid." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 565 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 565 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 565 } ], "score": 0.4 } }, { "name": "clear_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 595, "end_line": 640, "tags": { "COMPLEXITY": "3", "PURPOSE": "Clears tasks based on status filter (also deletes associated logs).", "PRE": "status is Optional[TaskStatus].", "POST": "Tasks matching filter (or all non-active) cleared from registry and database.", "PARAM": "status (Optional[TaskStatus]) - Filter by task status.", "RETURN": "int - Number of tasks cleared." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 595 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 595 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 595 } ], "score": 0.4 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 41 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 41 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 41 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 41 } ], "score": 0.0 } }, { "name": "sort_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 373, "end_line": 373, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 642 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.8166666666666667 } }, { "name": "TaskManagerModels", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 135, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task, models, pydantic, enum, state", "PURPOSE": "Defines the data models and enumerations used by the Task Manager.", "LAYER": "Core", "RELATION": "Used by TaskManager and API routes.", "INVARIANT": "Task IDs are immutable once created.", "CONSTRAINT": "Must use Pydantic for data validation." }, "relations": [], "children": [ { "name": "TaskStatus", "type": "Enum", "complexity": 1, "tier": "TRIVIAL", "start_line": 19, "end_line": 30, "tags": { "COMPLEXITY": "1", "SEMANTICS": "task, status, state, enum", "PURPOSE": "Defines the possible states a task can be in during its lifecycle." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LogLevel", "type": "Enum", "complexity": 3, "tier": "STANDARD", "start_line": 32, "end_line": 41, "tags": { "SEMANTICS": "log, level, severity, enum", "PURPOSE": "Defines the possible log levels for task logging.", "COMPLEXITY": "3" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LogEntry", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 43, "end_line": 63, "tags": { "SEMANTICS": "log, entry, record, pydantic", "PURPOSE": "A Pydantic model representing a single, structured log entry associated with a task.", "COMPLEXITY": "5", "INVARIANT": "Each log entry has a unique timestamp and source.", "TEST_CONTRACT": "LogEntryModel ->", "TEST_FIXTURE": "valid_log_entry -> {\"message\": \"Plugin initialized\"}", "TEST_EDGE": "empty_message -> {\"message\": \"\"}" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 43 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 43 } ], "score": 0.0 } }, { "name": "TaskLog", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 65, "end_line": 81, "tags": { "SEMANTICS": "task, log, persistent, pydantic", "PURPOSE": "A Pydantic model representing a persisted log entry from the database.", "COMPLEXITY": "3" }, "relations": [ { "type": "MAPS_TO", "target": "TaskLogRecord" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: MAPS_TO. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 65 }, { "message": "Invalid @RELATION predicate: MAPS_TO. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 65 } ], "score": 0.5499999999999999 } }, { "name": "LogFilter", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 83, "end_line": 93, "tags": { "SEMANTICS": "log, filter, query, pydantic", "PURPOSE": "Filter parameters for querying task logs.", "COMPLEXITY": "3" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 83 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 83 } ], "score": 0.5499999999999999 } }, { "name": "LogStats", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 95, "end_line": 103, "tags": { "SEMANTICS": "log, stats, aggregation, pydantic", "PURPOSE": "Statistics about log entries for a task.", "COMPLEXITY": "3" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 95 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 95 } ], "score": 0.5499999999999999 } }, { "name": "Task", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 105, "end_line": 133, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task, job, execution, state, pydantic", "PURPOSE": "A Pydantic model representing a single execution instance of a plugin, including its status, parameters, and logs." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 123, "end_line": 132, "tags": { "PURPOSE": "Initializes the Task model and validates input_request for AWAITING_INPUT status.", "PRE": "If status is AWAITING_INPUT, input_request must be provided.", "POST": "Task instance is created or ValueError is raised.", "PARAM": "**data - Keyword arguments for model initialization." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 105 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 105 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskCleanupModule", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 75, "tags": { "COMPLEXITY": "3", "SEMANTICS": "task, cleanup, retention, logs", "PURPOSE": "Implements task cleanup and retention policies, including associated logs.", "LAYER": "Core", "RELATION": "Uses TaskPersistenceService and TaskLogPersistenceService to delete old tasks and logs." }, "relations": [], "children": [ { "name": "TaskCleanupService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 13, "end_line": 74, "tags": { "PURPOSE": "Provides methods to clean up old task records and their associated logs.", "COMPLEXITY": "3" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 30, "tags": { "PURPOSE": "Initializes the cleanup service with dependencies.", "PRE": "persistence_service and config_manager are valid.", "POST": "Cleanup service is ready." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_cleanup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 55, "tags": { "PURPOSE": "Deletes tasks older than the configured retention period and their logs.", "PRE": "Config manager has valid settings.", "POST": "Old tasks and their logs are deleted from persistence." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_task_with_logs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 72, "tags": { "PURPOSE": "Delete a single task and all its associated logs.", "PRE": "task_id is a valid task ID.", "POST": "Task and all its logs are deleted.", "PARAM": "task_id (str) - The task ID to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 13 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 13 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskManagerPackage", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 16, "tags": { "COMPLEXITY": "1", "SEMANTICS": "task, manager, package, exports", "PURPOSE": "Exports the public API of the task manager package.", "LAYER": "Core", "INVARIANT": "Package exports stay aligned with manager and models contracts." }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskManagerModels" }, { "type": "DEPENDS_ON", "target": "TaskManagerModule" }, { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.manager.TaskManager" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskContextModule", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 150, "tags": { "SEMANTICS": "task, context, plugin, execution, logger", "PURPOSE": "Provides execution context passed to plugins during task execution.", "LAYER": "Core", "COMPLEXITY": "5", "INVARIANT": "Each TaskContext is bound to a single task execution." }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskLogger, USED_BY -> plugins" } ], "children": [ { "name": "TaskContext", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 16, "end_line": 148, "tags": { "SEMANTICS": "context, task, execution, plugin", "PURPOSE": "A container passed to plugin.execute() providing the logger and other task-specific utilities.", "COMPLEXITY": "5", "INVARIANT": "logger is always a valid TaskLogger instance.", "UX_STATE": "Idle -> Active -> Complete", "TEST_CONTRACT": "TaskContextInit ->", "TEST_FIXTURE": "valid_context -> {\"task_id\": \"123\", \"add_log_fn\": lambda *args: None, \"params\": {\"k\": \"v\"}, \"default_source\": \"plugin\"}", "TEST_EDGE": "missing_add_log_fn -> raises TypeError", "TEST_INVARIANT": "logger_initialized -> verifies: [valid_context]" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 73, "tags": { "PURPOSE": "Initialize the TaskContext with task-specific resources.", "PRE": "task_id is a valid task identifier, add_log_fn is callable.", "POST": "TaskContext is ready to be passed to plugin.execute().", "PARAM": "default_source (str) - Default source for logs (default: \"plugin\")." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "task_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 84, "tags": { "PURPOSE": "Get the task ID.", "PRE": "TaskContext must be initialized.", "POST": "Returns the task ID string.", "RETURN": "str - The task ID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "logger", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 95, "tags": { "PURPOSE": "Get the TaskLogger instance for this context.", "PRE": "TaskContext must be initialized.", "POST": "Returns the TaskLogger instance.", "RETURN": "TaskLogger - The logger instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "params", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 106, "tags": { "PURPOSE": "Get the task parameters.", "PRE": "TaskContext must be initialized.", "POST": "Returns the parameters dictionary.", "RETURN": "Dict[str, Any] - The task parameters." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "background_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 116, "tags": { "PURPOSE": "Expose optional background task scheduler for plugins that dispatch deferred side effects.", "PRE": "TaskContext must be initialized.", "POST": "Returns BackgroundTasks-like object or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_param", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 128, "tags": { "PURPOSE": "Get a specific parameter value with optional default.", "PRE": "TaskContext must be initialized.", "POST": "Returns parameter value or default.", "PARAM": "default (Any) - Default value if key not found.", "RETURN": "Any - Parameter value or default." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_sub_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 146, "tags": { "PURPOSE": "Create a sub-context with a different default source.", "PRE": "source is a non-empty string.", "POST": "Returns new TaskContext with different logger source.", "PARAM": "source (str) - New default source for logging.", "RETURN": "TaskContext - New context with different source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 16 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 16 } ], "score": 0.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "test_task_logger", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 102, "tags": { "PURPOSE": "Auto-generated module for backend/src/core/task_manager/__tests__/test_task_logger.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "mock_add_log", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "task_logger", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_logger_initialization", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_log_methods_delegation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_with_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 65, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_missing_task_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 74, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_invalid_add_log_fn", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_progress_log", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 86, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.core.task_manager.__tests__.test_context", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 29, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, task-context, background-tasks, sub-context", "PURPOSE": "Verify TaskContext preserves optional background task scheduler across sub-context creation." }, "relations": [], "children": [ { "name": "test_task_context_preserves_background_tasks_across_sub_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 28, "tags": { "PURPOSE": "Plugins must be able to access background_tasks from both root and sub-context loggers.", "PRE": "TaskContext is initialized with a BackgroundTasks-like object.", "POST": "background_tasks remains available on root and derived sub-contexts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "AuthApi", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 133, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, auth, routes, login, logout", "PURPOSE": "Authentication API endpoints.", "LAYER": "API", "INVARIANT": "All auth endpoints must return consistent error codes." }, "relations": [ { "type": "USES", "target": "AuthService:Class" }, { "type": "USES", "target": "get_auth_db:Function" }, { "type": "DEPENDS_ON", "target": "AuthRepository:Class" } ], "children": [ { "name": "router", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 30, "tags": { "COMPLEXITY": "1", "PURPOSE": "APIRouter instance for authentication routes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "login_for_access_token", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 32, "end_line": 60, "tags": { "COMPLEXITY": "3", "PURPOSE": "Authenticates a user and returns a JWT access token.", "PRE": "form_data contains username and password.", "POST": "Returns a Token object on success.", "THROW": "HTTPException 401 if authentication fails.", "PARAM": "db (Session) - Auth database session.", "RETURN": "Token - The generated JWT token." }, "relations": [ { "type": "CALLS", "target": "AuthService.authenticate_user" }, { "type": "CALLS", "target": "AuthService.create_session" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "read_users_me", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 62, "end_line": 74, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves the profile of the currently authenticated user.", "PRE": "Valid JWT token provided.", "POST": "Returns the current user's data.", "PARAM": "current_user (UserSchema) - The user extracted from the token.", "RETURN": "UserSchema - The current user profile." }, "relations": [ { "type": "DEPENDS_ON", "target": "get_current_user" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "logout", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 76, "end_line": 90, "tags": { "COMPLEXITY": "3", "PURPOSE": "Logs out the current user (placeholder for session revocation).", "PRE": "Valid JWT token provided.", "POST": "Returns success message.", "PARAM": "current_user (UserSchema) - The user extracted from the token." }, "relations": [ { "type": "DEPENDS_ON", "target": "get_current_user" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "login_adfs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 92, "end_line": 107, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initiates the ADFS OIDC login flow.", "POST": "Redirects the user to ADFS." }, "relations": [ { "type": "USES", "target": "is_adfs_configured" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 92 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 92 } ], "score": 0.5499999999999999 } }, { "name": "auth_callback_adfs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 109, "end_line": 131, "tags": { "COMPLEXITY": "3", "PURPOSE": "Handles the callback from ADFS after successful authentication.", "POST": "Provisions user JIT and returns session token." }, "relations": [ { "type": "CALLS", "target": "AuthService.provision_adfs_user" }, { "type": "CALLS", "target": "AuthService.create_session" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "src.api", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Backend API package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "router", "type": "Global", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 20, "tags": { "PURPOSE": "APIRouter instance for LLM routes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_is_valid_runtime_api_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 34, "tags": { "PURPOSE": "Validate decrypted runtime API key presence/shape.", "PRE": "value can be None.", "POST": "Returns True only for non-placeholder key." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_providers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 62, "tags": { "PURPOSE": "Retrieve all LLM provider configurations.", "PRE": "User is authenticated.", "POST": "Returns list of LLMProviderConfig." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_llm_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 93, "tags": { "PURPOSE": "Returns whether LLM runtime is configured for dashboard validation.", "PRE": "User is authenticated.", "POST": "configured=true only when an active provider with valid decrypted key exists." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_provider", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 119, "tags": { "PURPOSE": "Create a new LLM provider configuration.", "PRE": "User is authenticated and has admin permissions.", "POST": "Returns the created LLMProviderConfig." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_provider", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 149, "tags": { "PURPOSE": "Update an existing LLM provider configuration.", "PRE": "User is authenticated and has admin permissions.", "POST": "Returns the updated LLMProviderConfig." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_provider", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 168, "tags": { "PURPOSE": "Delete an LLM provider configuration.", "PRE": "User is authenticated and has admin permissions.", "POST": "Returns success status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 212, "tags": { "PURPOSE": "Test connection to an LLM provider.", "PRE": "User is authenticated.", "POST": "Returns success status and message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_provider_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 214, "end_line": 248, "tags": { "PURPOSE": "Test connection with a provided configuration (not yet saved).", "PRE": "User is authenticated.", "POST": "Returns success status and message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.api.routes.datasets", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 426, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, datasets, resources, hub", "PURPOSE": "API endpoints for the Dataset Hub - listing datasets with mapping progress", "LAYER": "API", "INVARIANT": "All dataset responses include last_task metadata" }, "relations": [ { "type": "DEPENDS_ON", "target": "AppDependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.services.resource_service.ResourceService" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" } ], "children": [ { "name": "MappedFields", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 30, "tags": { "COMPLEXITY": "1", "PURPOSE": "DTO for dataset mapping progress statistics" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LastTask", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 38, "tags": { "COMPLEXITY": "1", "PURPOSE": "DTO for the most recent task associated with a dataset" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatasetItem", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 53, "tags": { "COMPLEXITY": "1", "PURPOSE": "Summary DTO for a dataset in the hub listing" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LinkedDashboard", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 62, "tags": { "COMPLEXITY": "1", "PURPOSE": "DTO for a dashboard linked to a dataset" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatasetColumn", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 74, "tags": { "COMPLEXITY": "1", "PURPOSE": "DTO for a single dataset column's metadata" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatasetDetailResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 96, "tags": { "COMPLEXITY": "1", "PURPOSE": "Detailed DTO for a dataset including columns and links" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatasetsResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 107, "tags": { "COMPLEXITY": "1", "PURPOSE": "Paginated response DTO for dataset listings" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 114, "tags": { "COMPLEXITY": "1", "PURPOSE": "Response DTO containing a task ID for tracking" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dataset_ids", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 116, "end_line": 166, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch list of all dataset IDs from a specific environment (without pagination)", "PRE": "env_id must be a valid environment ID", "POST": "Returns a list of all dataset IDs", "PARAM": "search (Optional[str]) - Filter by table name", "RETURN": "List[int] - List of dataset IDs" }, "relations": [ { "type": "CALLS", "target": "get_datasets_with_status" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_datasets", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 168, "end_line": 246, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch list of datasets from a specific environment with mapping progress", "PRE": "page_size must be between 1 and 100 if provided", "POST": "Response includes pagination metadata (page, page_size, total, total_pages)", "PARAM": "page_size (Optional[int]) - Items per page (default: 10, max: 100)", "RETURN": "DatasetsResponse - List of datasets with status metadata" }, "relations": [ { "type": "CALLS", "target": "backend.src.services.resource_service.ResourceService.get_datasets_with_status" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "MapColumnsRequest", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 248, "end_line": 257, "tags": { "COMPLEXITY": "1", "PURPOSE": "Request DTO for initiating column mapping" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "map_columns", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 259, "end_line": 319, "tags": { "COMPLEXITY": "3", "PURPOSE": "Trigger bulk column mapping for datasets", "PRE": "dataset_ids is a non-empty list", "POST": "Task is created and queued for execution", "PARAM": "request (MapColumnsRequest) - Mapping request with environment and dataset IDs", "RETURN": "TaskResponse - Task ID for tracking" }, "relations": [ { "type": "DISPATCHES", "target": "backend.src.plugins.mapper.MapperPlugin" }, { "type": "CALLS", "target": "backend.src.core.task_manager.manager.TaskManager:create_task" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "GenerateDocsRequest", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 321, "end_line": 329, "tags": { "COMPLEXITY": "1", "PURPOSE": "Request DTO for initiating documentation generation" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "generate_docs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 331, "end_line": 385, "tags": { "COMPLEXITY": "3", "PURPOSE": "Trigger bulk documentation generation for datasets", "PRE": "dataset_ids is a non-empty list", "POST": "Task is created and queued for execution", "PARAM": "request (GenerateDocsRequest) - Documentation generation request", "RETURN": "TaskResponse - Task ID for tracking" }, "relations": [ { "type": "DISPATCHES", "target": "backend.src.plugins.llm_analysis.plugin.DocumentationPlugin" }, { "type": "CALLS", "target": "backend.src.core.task_manager.manager.TaskManager:create_task" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_dataset_detail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 387, "end_line": 424, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get detailed dataset information including columns and linked dashboards", "PRE": "dataset_id is a valid dataset ID", "POST": "Returns detailed dataset info with columns and linked dashboards", "PARAM": "dataset_id (int) - The dataset ID", "RETURN": "DatasetDetailResponse - Detailed dataset information" }, "relations": [ { "type": "CALLS", "target": "backend.src.core.superset_client.SupersetClient:get_dataset_detail" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 426 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.api.routes.git", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 1460, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git, routes, api, fastapi, repository, deployment", "PURPOSE": "Provides FastAPI endpoints for Git integration operations.", "LAYER": "API", "INVARIANT": "All Git operations must be routed through GitService." }, "relations": [ { "type": "USES", "target": "backend.src.services.git_service.GitService" }, { "type": "USES", "target": "backend.src.api.routes.git_schemas" }, { "type": "USES", "target": "backend.src.models.git" } ], "children": [ { "name": "_build_no_repo_status_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 72, "tags": { "COMPLEXITY": "1", "PURPOSE": "Build a consistent status payload for dashboards without initialized repositories.", "PRE": "None.", "POST": "Returns a stable payload compatible with frontend repository status parsing.", "RETURN": "dict" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_handle_unexpected_git_route_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 85, "tags": { "COMPLEXITY": "1", "PURPOSE": "Convert unexpected route-level exceptions to stable 500 API responses.", "PRE": "`error` is a non-HTTPException instance.", "POST": "Raises HTTPException(500) with route-specific context.", "PARAM": "error (Exception)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_repository_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 88, "end_line": 112, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve repository status for one dashboard with graceful NO_REPO semantics.", "PRE": "`dashboard_id` is a valid integer.", "POST": "Returns standard status payload or `NO_REPO` payload when repository path is absent.", "PARAM": "dashboard_id (int)", "RETURN": "dict" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 88 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 88 } ], "score": 0.5499999999999999 } }, { "name": "_get_git_config_or_404", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 115, "end_line": 125, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve GitServerConfig by id or raise 404.", "PRE": "db session is available.", "POST": "Returns GitServerConfig model." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 115 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 115 } ], "score": 0.5499999999999999 } }, { "name": "_find_dashboard_id_by_slug", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 128, "end_line": 152, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard numeric ID by slug in a specific environment.", "PRE": "dashboard_slug is non-empty.", "POST": "Returns dashboard ID or None when not found." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 128 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 128 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_from_ref", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 155, "end_line": 187, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard ID from slug-or-id reference for Git routes.", "PRE": "dashboard_ref is provided; env_id is required for slug values.", "POST": "Returns numeric dashboard ID or raises HTTPException." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 155 } ], "score": 0.5499999999999999 } }, { "name": "_find_dashboard_id_by_slug_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 190, "end_line": 214, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard numeric ID by slug asynchronously for hot-path Git routes.", "PRE": "dashboard_slug is non-empty.", "POST": "Returns dashboard ID or None when not found." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 190 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 190 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_from_ref_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 217, "end_line": 253, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard ID asynchronously from slug-or-id reference for hot Git routes.", "PRE": "dashboard_ref is provided; env_id is required for slug values.", "POST": "Returns numeric dashboard ID or raises HTTPException." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 217 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 217 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_repo_key_from_ref", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 256, "end_line": 286, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve repository folder key with slug-first strategy and deterministic fallback.", "PRE": "dashboard_id is resolved and valid.", "POST": "Returns safe key to be used in local repository path.", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 256 } ], "score": 0.5499999999999999 } }, { "name": "_sanitize_optional_identity_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 289, "end_line": 300, "tags": { "COMPLEXITY": "1", "PURPOSE": "Normalize optional identity value into trimmed string or None.", "PRE": "value may be None or blank.", "POST": "Returns sanitized value suitable for git identity configuration.", "RETURN": "Optional[str]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_current_user_git_identity", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 303, "end_line": 342, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve configured Git username/email from current user's profile preferences.", "PRE": "`db` may be stubbed in tests; `current_user` may be absent for direct handler invocations.", "POST": "Returns tuple(username, email) only when both values are configured.", "RETURN": "Optional[tuple[str, str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 303 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 303 } ], "score": 0.5499999999999999 } }, { "name": "_apply_git_identity_from_profile", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 345, "end_line": 366, "tags": { "COMPLEXITY": "3", "PURPOSE": "Apply user-scoped Git identity to repository-local config before write/pull operations.", "PRE": "dashboard_id is resolved; db/current_user may be missing in direct test invocation context.", "POST": "git_service.configure_identity is called only when identity and method are available.", "RETURN": "None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 345 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 345 } ], "score": 0.5499999999999999 } }, { "name": "get_git_configs", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 369, "end_line": 388, "tags": { "COMPLEXITY": "3", "PURPOSE": "List all configured Git servers.", "PRE": "Database session `db` is available.", "POST": "Returns a list of all GitServerConfig objects from the database.", "RETURN": "List[GitServerConfigSchema]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 369 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 369 } ], "score": 0.5499999999999999 } }, { "name": "create_git_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 390, "end_line": 410, "tags": { "COMPLEXITY": "3", "PURPOSE": "Register a new Git server configuration.", "PRE": "`config` contains valid GitServerConfigCreate data.", "POST": "A new GitServerConfig record is created in the database.", "PARAM": "config (GitServerConfigCreate)", "RETURN": "GitServerConfigSchema" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 390 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 390 } ], "score": 0.5499999999999999 } }, { "name": "update_git_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 412, "end_line": 445, "tags": { "COMPLEXITY": "3", "PURPOSE": "Update an existing Git server configuration.", "PRE": "`config_id` corresponds to an existing configuration.", "POST": "The configuration record is updated in the database.", "PARAM": "config_update (GitServerConfigUpdate)", "RETURN": "GitServerConfigSchema" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 412 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 412 } ], "score": 0.5499999999999999 } }, { "name": "delete_git_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 447, "end_line": 467, "tags": { "COMPLEXITY": "3", "PURPOSE": "Remove a Git server configuration.", "PRE": "`config_id` corresponds to an existing configuration.", "POST": "The configuration record is removed from the database.", "PARAM": "config_id (str)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 447 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 447 } ], "score": 0.5499999999999999 } }, { "name": "test_git_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 469, "end_line": 498, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validate connection to a Git server using provided credentials.", "PRE": "`config` contains provider, url, and pat.", "POST": "Returns success if the connection is validated via GitService.", "PARAM": "config (GitServerConfigCreate)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 } ], "score": 0.5499999999999999 } }, { "name": "list_gitea_repositories", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 501, "end_line": 529, "tags": { "COMPLEXITY": "3", "PURPOSE": "List repositories in Gitea for a saved Gitea config.", "PRE": "config_id exists and provider is GITEA.", "POST": "Returns repositories visible to PAT user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 501 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 501 } ], "score": 0.5499999999999999 } }, { "name": "create_gitea_repository", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 532, "end_line": 566, "tags": { "COMPLEXITY": "3", "PURPOSE": "Create a repository in Gitea for a saved Gitea config.", "PRE": "config_id exists and provider is GITEA.", "POST": "Returns created repository payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 532 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 532 } ], "score": 0.5499999999999999 } }, { "name": "create_remote_repository", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 569, "end_line": 627, "tags": { "COMPLEXITY": "3", "PURPOSE": "Create repository on remote Git server using selected provider config.", "PRE": "config_id exists and PAT has creation permissions.", "POST": "Returns normalized remote repository payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 569 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 569 } ], "score": 0.5499999999999999 } }, { "name": "delete_gitea_repository", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 630, "end_line": 654, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete repository in Gitea for a saved Gitea config.", "PRE": "config_id exists and provider is GITEA.", "POST": "Target repository is deleted on Gitea." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 630 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 630 } ], "score": 0.5499999999999999 } }, { "name": "init_repository", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 656, "end_line": 712, "tags": { "COMPLEXITY": "3", "PURPOSE": "Link a dashboard to a Git repository and perform initial clone/init.", "PRE": "`dashboard_ref` exists and `init_data` contains valid config_id and remote_url.", "POST": "Repository is initialized on disk and a GitRepository record is saved in DB.", "PARAM": "init_data (RepoInitRequest)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 656 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 656 } ], "score": 0.5499999999999999 } }, { "name": "get_repository_binding", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 714, "end_line": 747, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return repository binding with provider metadata for selected dashboard.", "PRE": "`dashboard_ref` resolves to a valid dashboard and repository is initialized.", "POST": "Returns dashboard repository binding and linked provider.", "PARAM": "dashboard_ref (str)", "RETURN": "RepositoryBindingSchema" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 714 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 714 } ], "score": 0.5499999999999999 } }, { "name": "delete_repository", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 749, "end_line": 772, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete local repository workspace and DB binding for selected dashboard.", "PRE": "`dashboard_ref` resolves to a valid dashboard.", "POST": "Repository files and binding record are removed when present.", "PARAM": "dashboard_ref (str)", "RETURN": "dict" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 749 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 749 } ], "score": 0.5499999999999999 } }, { "name": "get_branches", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 774, "end_line": 796, "tags": { "COMPLEXITY": "3", "PURPOSE": "List all branches for a dashboard's repository.", "PRE": "Repository for `dashboard_ref` is initialized.", "POST": "Returns a list of branches from the local repository.", "PARAM": "dashboard_ref (str)", "RETURN": "List[BranchSchema]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 774 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 774 } ], "score": 0.5499999999999999 } }, { "name": "create_branch", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 798, "end_line": 825, "tags": { "COMPLEXITY": "3", "PURPOSE": "Create a new branch in the dashboard's repository.", "PRE": "`dashboard_ref` repository exists and `branch_data` has name and from_branch.", "POST": "A new branch is created in the local repository.", "PARAM": "branch_data (BranchCreate)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 798 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 798 } ], "score": 0.5499999999999999 } }, { "name": "checkout_branch", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 827, "end_line": 851, "tags": { "COMPLEXITY": "3", "PURPOSE": "Switch the dashboard's repository to a specific branch.", "PRE": "`dashboard_ref` repository exists and branch `checkout_data.name` exists.", "POST": "The local repository HEAD is moved to the specified branch.", "PARAM": "checkout_data (BranchCheckout)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 827 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 827 } ], "score": 0.5499999999999999 } }, { "name": "commit_changes", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 853, "end_line": 880, "tags": { "COMPLEXITY": "3", "PURPOSE": "Stage and commit changes in the dashboard's repository.", "PRE": "`dashboard_ref` repository exists and `commit_data` has message and files.", "POST": "Specified files are staged and a new commit is created.", "PARAM": "commit_data (CommitCreate)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 853 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 853 } ], "score": 0.5499999999999999 } }, { "name": "push_changes", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 882, "end_line": 904, "tags": { "COMPLEXITY": "3", "PURPOSE": "Push local commits to the remote repository.", "PRE": "`dashboard_ref` repository exists and has a remote configured.", "POST": "Local commits are pushed to the remote repository.", "PARAM": "dashboard_ref (str)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 882 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 882 } ], "score": 0.5499999999999999 } }, { "name": "pull_changes", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 906, "end_line": 952, "tags": { "COMPLEXITY": "3", "PURPOSE": "Pull changes from the remote repository.", "PRE": "`dashboard_ref` repository exists and has a remote configured.", "POST": "Remote changes are fetched and merged into the local branch.", "PARAM": "dashboard_ref (str)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 906 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 906 } ], "score": 0.5499999999999999 } }, { "name": "get_merge_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 954, "end_line": 974, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return unfinished-merge status for repository (web-only recovery support).", "PRE": "`dashboard_ref` resolves to a valid dashboard repository.", "POST": "Returns merge status payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 954 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 954 } ], "score": 0.5499999999999999 } }, { "name": "get_merge_conflicts", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 977, "end_line": 997, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return conflicted files with mine/theirs previews for web conflict resolver.", "PRE": "`dashboard_ref` resolves to a valid dashboard repository.", "POST": "Returns conflict file list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 977 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 977 } ], "score": 0.5499999999999999 } }, { "name": "resolve_merge_conflicts", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1000, "end_line": 1025, "tags": { "COMPLEXITY": "3", "PURPOSE": "Apply mine/theirs/manual conflict resolutions from WebUI and stage files.", "PRE": "`dashboard_ref` resolves; request contains at least one resolution item.", "POST": "Resolved files are staged in index." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1000 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1000 } ], "score": 0.5499999999999999 } }, { "name": "abort_merge", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1028, "end_line": 1048, "tags": { "COMPLEXITY": "3", "PURPOSE": "Abort unfinished merge from WebUI flow.", "PRE": "`dashboard_ref` resolves to repository.", "POST": "Merge operation is aborted or reports no active merge." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1028 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1028 } ], "score": 0.5499999999999999 } }, { "name": "continue_merge", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1051, "end_line": 1072, "tags": { "COMPLEXITY": "3", "PURPOSE": "Finalize unfinished merge from WebUI flow.", "PRE": "All conflicts are resolved and staged.", "POST": "Merge commit is created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1051 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1051 } ], "score": 0.5499999999999999 } }, { "name": "sync_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1075, "end_line": 1104, "tags": { "COMPLEXITY": "3", "PURPOSE": "Sync dashboard state from Superset to Git using the GitPlugin.", "PRE": "`dashboard_ref` is valid; GitPlugin is available.", "POST": "Dashboard YAMLs are exported from Superset and committed to Git.", "PARAM": "source_env_id (Optional[str])" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1075 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1075 } ], "score": 0.5499999999999999 } }, { "name": "promote_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1107, "end_line": 1208, "tags": { "COMPLEXITY": "3", "PURPOSE": "Promote changes between branches via MR or direct merge.", "PRE": "dashboard repository is initialized and Git config is valid.", "POST": "Returns promotion result metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1107 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1107 } ], "score": 0.5499999999999999 } }, { "name": "get_environments", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1210, "end_line": 1231, "tags": { "COMPLEXITY": "3", "PURPOSE": "List all deployment environments.", "PRE": "Config manager is accessible.", "POST": "Returns a list of DeploymentEnvironmentSchema objects.", "RETURN": "List[DeploymentEnvironmentSchema]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1210 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1210 } ], "score": 0.5499999999999999 } }, { "name": "deploy_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1233, "end_line": 1262, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deploy dashboard from Git to a target environment.", "PRE": "`dashboard_ref` and `deploy_data.environment_id` are valid.", "POST": "Dashboard YAMLs are read from Git and imported into the target Superset.", "PARAM": "deploy_data (DeployRequest)" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1233 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1233 } ], "score": 0.5499999999999999 } }, { "name": "get_history", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1264, "end_line": 1288, "tags": { "COMPLEXITY": "3", "PURPOSE": "View commit history for a dashboard's repository.", "PRE": "`dashboard_ref` repository exists.", "POST": "Returns a list of recent commits from the repository.", "PARAM": "limit (int)", "RETURN": "List[CommitSchema]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1264 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1264 } ], "score": 0.5499999999999999 } }, { "name": "get_repository_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1290, "end_line": 1312, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get current Git status for a dashboard repository.", "PRE": "`dashboard_ref` resolves to a valid dashboard.", "POST": "Returns repository status; if repo is not initialized, returns `NO_REPO` payload.", "PARAM": "dashboard_ref (str)", "RETURN": "dict" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1290 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1290 } ], "score": 0.5499999999999999 } }, { "name": "get_repository_status_batch", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1315, "end_line": 1357, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get Git statuses for multiple dashboard repositories in one request.", "PRE": "`request.dashboard_ids` is provided.", "POST": "Returns `statuses` map where each key is dashboard ID and value is repository status payload.", "PARAM": "request (RepoStatusBatchRequest)", "RETURN": "RepoStatusBatchResponse" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1315 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1315 } ], "score": 0.5499999999999999 } }, { "name": "get_repository_diff", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1359, "end_line": 1386, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get Git diff for a dashboard repository.", "PRE": "`dashboard_ref` repository exists.", "POST": "Returns the diff text for the specified file or all changes.", "PARAM": "staged (bool)", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1359 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1359 } ], "score": 0.5499999999999999 } }, { "name": "generate_commit_message", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1388, "end_line": 1458, "tags": { "COMPLEXITY": "3", "PURPOSE": "Generate a suggested commit message using LLM.", "PRE": "Repository for `dashboard_ref` is initialized.", "POST": "Returns a suggested commit message string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1388 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1388 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 1460 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.325 } }, { "name": "ConnectionsRouter", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 113, "tags": { "SEMANTICS": "api, router, connections, database", "PURPOSE": "Defines the FastAPI router for managing external database connections.", "LAYER": "UI (API)", "RELATION": "Depends on SQLAlchemy session.", "CONSTRAINT": "Must use belief_scope for logging." }, "relations": [], "children": [ { "name": "_ensure_connections_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 29, "tags": { "PURPOSE": "Ensures the connection_configs table exists before CRUD access.", "PRE": "db is an active SQLAlchemy session.", "POST": "The current bind can safely query ConnectionConfig." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ConnectionSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 45, "tags": { "PURPOSE": "Pydantic model for connection response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ConnectionCreate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 57, "tags": { "PURPOSE": "Pydantic model for creating a connection." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_connections", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 71, "tags": { "PURPOSE": "Lists all saved connections.", "PRE": "Database session is active.", "POST": "Returns list of connection configs.", "PARAM": "db (Session) - Database session.", "RETURN": "List[ConnectionSchema] - List of connections." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 90, "tags": { "PURPOSE": "Creates a new connection configuration.", "PRE": "Connection name is unique.", "POST": "Connection is saved to DB.", "PARAM": "db (Session) - Database session.", "RETURN": "ConnectionSchema - Created connection." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 92, "end_line": 111, "tags": { "PURPOSE": "Deletes a connection configuration.", "PRE": "Connection ID exists.", "POST": "Connection is removed from DB.", "PARAM": "db (Session) - Database session.", "RETURN": "None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "health_router", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 62, "tags": { "COMPLEXITY": "3", "SEMANTICS": "health, monitoring, dashboards", "PURPOSE": "API endpoints for dashboard health monitoring and status aggregation.", "LAYER": "UI/API" }, "relations": [ { "type": "DEPENDS_ON", "target": "health_service" } ], "children": [ { "name": "get_health_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 36, "tags": { "PURPOSE": "Get aggregated health status for all dashboards.", "PRE": "Caller has read permission for dashboard health view.", "POST": "Returns HealthSummaryResponse." }, "relations": [ { "type": "CALLS", "target": "backend.src.services.health_service.HealthService" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_health_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 60, "tags": { "PURPOSE": "Delete one persisted dashboard validation report from health summary.", "PRE": "Caller has write permission for tasks/report maintenance.", "POST": "Validation record is removed; linked task/logs are cleaned when available." }, "relations": [ { "type": "CALLS", "target": "backend.src.services.health_service.HealthService" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.api.routes.environments", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 159, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, environments, superset, databases", "PURPOSE": "API endpoints for listing environments and their databases.", "LAYER": "API", "INVARIANT": "Environment IDs must exist in the configuration." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.dependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client" } ], "children": [ { "name": "_normalize_superset_env_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 33, "tags": { "PURPOSE": "Canonicalize Superset environment URL to base host/path without trailing /api/v1.", "PRE": "raw_url can be empty.", "POST": "Returns normalized base URL." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScheduleSchema", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 39, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "EnvironmentResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 49, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatabaseResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 56, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 95, "tags": { "PURPOSE": "List all configured environments.", "LAYER": "API", "SEMANTICS": "list, environments, config", "PRE": "config_manager is injected via Depends.", "POST": "Returns a list of EnvironmentResponse objects.", "RETURN": "List[EnvironmentResponse]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_environment_schedule", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 129, "tags": { "PURPOSE": "Update backup schedule for an environment.", "LAYER": "API", "SEMANTICS": "update, schedule, backup, environment", "PRE": "Environment id exists, schedule is valid ScheduleSchema.", "POST": "Backup schedule updated and scheduler reloaded.", "PARAM": "schedule (ScheduleSchema) - The new schedule." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environment_databases", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 157, "tags": { "PURPOSE": "Fetch the list of databases from a specific environment.", "LAYER": "API", "SEMANTICS": "fetch, databases, superset, environment", "PRE": "Environment id exists.", "POST": "Returns a list of database summaries from the environment.", "PARAM": "id (str) - The environment ID.", "RETURN": "List[Dict] - List of databases." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "MigrationApi", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 318, "tags": { "COMPLEXITY": "5", "SEMANTICS": "api, migration, dashboards, sync, dry-run", "PURPOSE": "HTTP contract layer for migration orchestration, settings, dry-run, and mapping sync endpoints.", "LAYER": "Infra", "INVARIANT": "Migration endpoints never execute with invalid environment references and always return explicit HTTP errors on guard failures.", "PRE": "Backend core services initialized and Database session available.", "POST": "Migration tasks are enqueued or dry-run results are computed and returned.", "SIDE_EFFECT": "Enqueues long-running tasks, potentially mutates ResourceMapping table, and performs remote Superset API calls.", "DATA_CONTRACT": "[DashboardSelection | QueryParams] -> [TaskResponse | DryRunResult | MappingSummary]", "TEST_CONTRACT": "[DashboardSelection + configured envs] -> [task_id | dry-run result | sync summary]", "TEST_SCENARIO": "[valid_execution] -> [success_payload_with_required_fields]", "TEST_EDGE": "[external_fail] ->[HTTP_500]", "TEST_INVARIANT": "[EnvironmentValidationBeforeAction] -> VERIFIED_BY: [invalid_environment, valid_execution]" }, "relations": [ { "type": "DEPENDS_ON", "target": "AppDependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.core.database" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.migration.dry_run_orchestrator.MigrationDryRunService" }, { "type": "DEPENDS_ON", "target": "backend.src.core.mapping_service.IdMappingService" }, { "type": "DEPENDS_ON", "target": "backend.src.models.dashboard" }, { "type": "DEPENDS_ON", "target": "backend.src.models.mapping" } ], "children": [ { "name": "get_dashboards", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 40, "end_line": 66, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch dashboard metadata from a requested environment for migration selection UI.", "PRE": "env_id is provided and exists in configured environments.", "POST": "Returns List[DashboardMetadata] for the resolved environment; emits HTTP_404 when environment is absent.", "SIDE_EFFECT": "Reads environment configuration and performs remote Superset metadata retrieval over network.", "DATA_CONTRACT": "Input[str env_id] -> Output[List[DashboardMetadata]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 40 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 40 } ], "score": 0.5499999999999999 } }, { "name": "execute_migration", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 68, "end_line": 107, "tags": { "COMPLEXITY": "5", "PURPOSE": "Validate migration selection and enqueue asynchronous migration task execution.", "PRE": "DashboardSelection payload is valid and both source/target environments exist.", "POST": "Returns {\"task_id\": str, \"message\": str} when task creation succeeds; emits HTTP_400/HTTP_500 on failure.", "SIDE_EFFECT": "Reads configuration, writes task record through task manager, and writes operational logs.", "DATA_CONTRACT": "Input[DashboardSelection] -> Output[Dict[str, str]]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 68 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 68 } ], "score": 0.0 } }, { "name": "dry_run_migration", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 110, "end_line": 160, "tags": { "COMPLEXITY": "5", "PURPOSE": "Build pre-flight migration diff and risk summary without mutating target systems.", "PRE": "DashboardSelection is valid, source and target environments exist, differ, and selected_ids is non-empty.", "POST": "Returns deterministic dry-run payload; emits HTTP_400 for guard violations and HTTP_500 for orchestrator value errors.", "SIDE_EFFECT": "Reads local mappings from DB and fetches source/target metadata via Superset API.", "DATA_CONTRACT": "Input[DashboardSelection] -> Output[Dict[str, Any]]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 110 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 110 } ], "score": 0.0 } }, { "name": "get_migration_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 162, "end_line": 178, "tags": { "COMPLEXITY": "3", "PURPOSE": "Read and return configured migration synchronization cron expression.", "PRE": "Configuration store is available and requester has READ permission.", "POST": "Returns {\"cron\": str} reflecting current persisted settings value.", "SIDE_EFFECT": "Reads configuration from config manager.", "DATA_CONTRACT": "Input[None] -> Output[Dict[str, str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 162 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 162 } ], "score": 0.5499999999999999 } }, { "name": "update_migration_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 180, "end_line": 204, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validate and persist migration synchronization cron expression update.", "PRE": "Payload includes \"cron\" key and requester has WRITE permission.", "POST": "Returns {\"cron\": str, \"status\": \"updated\"} and persists updated cron value.", "SIDE_EFFECT": "Mutates configuration and writes persisted config through config manager.", "DATA_CONTRACT": "Input[Dict[str, str]] -> Output[Dict[str, str]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 180 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 180 } ], "score": 0.5499999999999999 } }, { "name": "get_resource_mappings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 206, "end_line": 255, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch synchronized resource mappings with optional filters and pagination for migration mappings view.", "PRE": "skip>=0, 1<=limit<=500, DB session is active, requester has READ permission.", "POST": "Returns {\"items\": [...], \"total\": int} where items reflect applied filters and pagination.", "SIDE_EFFECT": "Executes database read queries against ResourceMapping table.", "DATA_CONTRACT": "Input[QueryParams] -> Output[Dict[str, Any]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 206 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 206 } ], "score": 0.5499999999999999 } }, { "name": "trigger_sync_now", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 257, "end_line": 316, "tags": { "COMPLEXITY": "3", "PURPOSE": "Trigger immediate ID synchronization for every configured environment.", "PRE": "At least one environment is configured and requester has EXECUTE permission.", "POST": "Returns sync summary with synced/failed counts after attempting all environments.", "SIDE_EFFECT": "Upserts Environment rows, commits DB transaction, performs network sync calls, and writes logs.", "DATA_CONTRACT": "Input[None] -> Output[Dict[str, Any]]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 257 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 257 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 318 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.8166666666666667 } }, { "name": "PluginsRouter", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, router, plugins, list", "PURPOSE": "Defines the FastAPI router for plugin-related endpoints, allowing clients to list available plugins.", "LAYER": "UI (API)", "RELATION": "Depends on the PluginLoader and PluginConfig. It is included by the main app." }, "relations": [], "children": [ { "name": "list_plugins", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 31, "tags": { "PURPOSE": "Retrieve a list of all available plugins.", "PRE": "plugin_loader is injected via Depends.", "POST": "Returns a list of PluginConfig objects.", "RETURN": "List[PluginConfig] - List of registered plugins." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.api.routes.clean_release_v2", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 274, "tags": { "COMPLEXITY": "3", "PURPOSE": "Redesigned clean release API for headless candidate lifecycle." }, "relations": [], "children": [ { "name": "ApprovalRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 19, "end_line": 25, "tags": { "COMPLEXITY": "1", "PURPOSE": "Schema for approval request payload." }, "relations": [ { "type": "USES", "target": "CandidateDTO" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 19 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 19 } ], "score": 0.7 } }, { "name": "PublishRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 34, "tags": { "COMPLEXITY": "1", "PURPOSE": "Schema for publication request payload." }, "relations": [ { "type": "USES", "target": "CandidateDTO" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 28 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 28 } ], "score": 0.7 } }, { "name": "RevokeRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 43, "tags": { "COMPLEXITY": "1", "PURPOSE": "Schema for revocation request payload." }, "relations": [ { "type": "USES", "target": "CandidateDTO" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 37 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 37 } ], "score": 0.7 } }, { "name": "register_candidate", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 45, "end_line": 75, "tags": { "COMPLEXITY": "3", "PURPOSE": "Register a new release candidate.", "PRE": "Payload contains required fields (id, version, source_snapshot_ref, created_by).", "POST": "Candidate is saved in repository.", "RETURN": "CandidateDTO" }, "relations": [ { "type": "CALLS", "target": "CleanReleaseRepository.save_candidate" }, { "type": "USES", "target": "CandidateDTO" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 45 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 45 } ], "score": 0.5499999999999999 } }, { "name": "import_artifacts", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 77, "end_line": 106, "tags": { "COMPLEXITY": "3", "PURPOSE": "Associate artifacts with a release candidate.", "PRE": "Candidate exists.", "POST": "Artifacts are processed (placeholder)." }, "relations": [ { "type": "CALLS", "target": "CleanReleaseRepository.get_candidate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "build_manifest", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 108, "end_line": 149, "tags": { "COMPLEXITY": "3", "PURPOSE": "Generate distribution manifest for a candidate.", "PRE": "Candidate exists.", "POST": "Manifest is created and saved.", "RETURN": "ManifestDTO" }, "relations": [ { "type": "CALLS", "target": "CleanReleaseRepository.save_manifest" }, { "type": "CALLS", "target": "CleanReleaseRepository.get_candidate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "approve_candidate_endpoint", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 151, "end_line": 173, "tags": { "COMPLEXITY": "3", "PURPOSE": "Endpoint to record candidate approval." }, "relations": [ { "type": "CALLS", "target": "approve_candidate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "reject_candidate_endpoint", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 176, "end_line": 198, "tags": { "COMPLEXITY": "3", "PURPOSE": "Endpoint to record candidate rejection." }, "relations": [ { "type": "CALLS", "target": "reject_candidate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "publish_candidate_endpoint", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 201, "end_line": 236, "tags": { "COMPLEXITY": "3", "PURPOSE": "Endpoint to publish an approved candidate." }, "relations": [ { "type": "CALLS", "target": "publish_candidate" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "revoke_publication_endpoint", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 239, "end_line": 272, "tags": { "COMPLEXITY": "3", "PURPOSE": "Endpoint to revoke a previous publication." }, "relations": [ { "type": "CALLS", "target": "revoke_publication" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.api.routes.mappings", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 130, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, mappings, database, fuzzy-matching", "PURPOSE": "API endpoints for managing database mappings and getting suggestions.", "LAYER": "API", "INVARIANT": "Mappings are persisted in the SQLite database." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.dependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.core.database" }, { "type": "DEPENDS_ON", "target": "backend.src.services.mapping_service" } ], "children": [ { "name": "MappingCreate", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 35, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MappingResponse", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 50, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SuggestRequest", "type": "DataClass", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 56, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_mappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 76, "tags": { "PURPOSE": "List all saved database mappings.", "PRE": "db session is injected.", "POST": "Returns filtered list of DatabaseMapping records." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 109, "tags": { "PURPOSE": "Create or update a database mapping.", "PRE": "mapping is valid MappingCreate, db session is injected.", "POST": "DatabaseMapping created or updated in database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "suggest_mappings_api", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 128, "tags": { "PURPOSE": "Get suggested mappings based on fuzzy matching.", "PRE": "request is valid SuggestRequest, config_manager is injected.", "POST": "Returns mapping suggestions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "SettingsRouter", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 527, "tags": { "COMPLEXITY": "3", "SEMANTICS": "settings, api, router, fastapi", "PURPOSE": "Provides API endpoints for managing application settings and Superset environments.", "LAYER": "UI (API)", "INVARIANT": "All settings changes must be persisted via ConfigManager.", "PUBLIC_API": "router" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.config_manager.ConfigManager" }, { "type": "DEPENDS_ON", "target": "backend.src.core.config_models" } ], "children": [ { "name": "LoggingConfigResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 39, "tags": { "COMPLEXITY": "1", "PURPOSE": "Response model for logging configuration with current task log level.", "SEMANTICS": "logging, config, response" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_superset_env_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 54, "tags": { "COMPLEXITY": "1", "PURPOSE": "Canonicalize Superset environment URL to base host/path without trailing /api/v1.", "PRE": "raw_url can be empty.", "POST": "Returns normalized base URL." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_superset_connection_fast", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 57, "end_line": 74, "tags": { "COMPLEXITY": "3", "PURPOSE": "Run lightweight Superset connectivity validation without full pagination scan.", "PRE": "env contains valid URL and credentials.", "POST": "Raises on auth/API failures; returns None on success." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 57 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 57 } ], "score": 0.5499999999999999 } }, { "name": "get_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 76, "end_line": 96, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves all application settings.", "PRE": "Config manager is available.", "POST": "Returns masked AppConfig.", "RETURN": "AppConfig - The current configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 76 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 76 } ], "score": 0.5499999999999999 } }, { "name": "update_global_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 98, "end_line": 116, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates global application settings.", "PRE": "New settings are provided.", "POST": "Global settings are updated.", "PARAM": "settings (GlobalSettings) - The new global settings.", "RETURN": "GlobalSettings - The updated settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 98 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 98 } ], "score": 0.5499999999999999 } }, { "name": "get_storage_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 118, "end_line": 129, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves storage-specific settings.", "RETURN": "StorageConfig - The storage configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 118 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 118 } ], "score": 0.5499999999999999 } }, { "name": "update_storage_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 131, "end_line": 152, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates storage-specific settings.", "PARAM": "storage (StorageConfig) - The new storage settings.", "POST": "Storage settings are updated and saved.", "RETURN": "StorageConfig - The updated storage settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 131 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 131 } ], "score": 0.5499999999999999 } }, { "name": "get_environments", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 154, "end_line": 172, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all configured Superset environments.", "PRE": "Config manager is available.", "POST": "Returns list of environments.", "RETURN": "List[Environment] - List of environments." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 154 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 154 } ], "score": 0.5499999999999999 } }, { "name": "add_environment", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 174, "end_line": 200, "tags": { "COMPLEXITY": "3", "PURPOSE": "Adds a new Superset environment.", "PRE": "Environment data is valid and reachable.", "POST": "Environment is added to config.", "PARAM": "env (Environment) - The environment to add.", "RETURN": "Environment - The added environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 174 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 174 } ], "score": 0.5499999999999999 } }, { "name": "update_environment", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 202, "end_line": 238, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates an existing Superset environment.", "PRE": "ID and valid environment data are provided.", "POST": "Environment is updated in config.", "PARAM": "env (Environment) - The updated environment data.", "RETURN": "Environment - The updated environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 202 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 202 } ], "score": 0.5499999999999999 } }, { "name": "delete_environment", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 240, "end_line": 255, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deletes a Superset environment.", "PRE": "ID is provided.", "POST": "Environment is removed from config.", "PARAM": "id (str) - The ID of the environment to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 240 } ], "score": 0.5499999999999999 } }, { "name": "test_environment_connection", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 257, "end_line": 285, "tags": { "COMPLEXITY": "3", "PURPOSE": "Tests the connection to a Superset environment.", "PRE": "ID is provided.", "POST": "Returns success or error status.", "PARAM": "id (str) - The ID of the environment to test.", "RETURN": "dict - Success message or error." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 257 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 257 } ], "score": 0.5499999999999999 } }, { "name": "get_logging_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 287, "end_line": 305, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves current logging configuration.", "PRE": "Config manager is available.", "POST": "Returns logging configuration.", "RETURN": "LoggingConfigResponse - The current logging config." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 287 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 287 } ], "score": 0.5499999999999999 } }, { "name": "update_logging_config", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 307, "end_line": 333, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates logging configuration.", "PRE": "New logging config is provided.", "POST": "Logging configuration is updated and saved.", "PARAM": "config (LoggingConfig) - The new logging configuration.", "RETURN": "LoggingConfigResponse - The updated logging config." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 307 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 307 } ], "score": 0.5499999999999999 } }, { "name": "ConsolidatedSettingsResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 335, "end_line": 346, "tags": { "COMPLEXITY": "1", "PURPOSE": "Response model for consolidated application settings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_consolidated_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 348, "end_line": 400, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieves all settings categories in a single call", "PRE": "Config manager is available.", "POST": "Returns all consolidated settings.", "RETURN": "ConsolidatedSettingsResponse - All settings categories." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 348 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 348 } ], "score": 0.5499999999999999 } }, { "name": "update_consolidated_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 402, "end_line": 446, "tags": { "COMPLEXITY": "3", "PURPOSE": "Bulk update application settings from the consolidated view.", "PRE": "User has admin permissions, config is valid.", "POST": "Settings are updated and saved via ConfigManager." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 402 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 402 } ], "score": 0.5499999999999999 } }, { "name": "get_validation_policies", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 448, "end_line": 459, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all validation policies.", "RETURN": "List[ValidationPolicyResponse] - List of policies." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 448 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 448 } ], "score": 0.5499999999999999 } }, { "name": "create_validation_policy", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 461, "end_line": 478, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates a new validation policy.", "PARAM": "policy (ValidationPolicyCreate) - The policy data.", "RETURN": "ValidationPolicyResponse - The created policy." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 461 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 461 } ], "score": 0.5499999999999999 } }, { "name": "update_validation_policy", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 480, "end_line": 505, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates an existing validation policy.", "PARAM": "policy (ValidationPolicyUpdate) - The updated policy data.", "RETURN": "ValidationPolicyResponse - The updated policy." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 480 } ], "score": 0.5499999999999999 } }, { "name": "delete_validation_policy", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 507, "end_line": 525, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deletes a validation policy.", "PARAM": "id (str) - The ID of the policy to delete." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 507 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 507 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 527 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "AdminApi", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 345, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, admin, users, roles, permissions", "PURPOSE": "Admin API endpoints for user and role management.", "LAYER": "API", "INVARIANT": "All endpoints in this module require 'Admin' role or 'admin' scope." }, "relations": [ { "type": "USES", "target": "backend.src.core.auth.repository.AuthRepository" }, { "type": "USES", "target": "backend.src.dependencies.has_permission" } ], "children": [ { "name": "router", "type": "Variable", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 36, "tags": { "PURPOSE": "APIRouter instance for admin routes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_users", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 38, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all registered users.", "PRE": "Current user has 'Admin' role.", "POST": "Returns a list of UserSchema objects.", "PARAM": "db (Session) - Auth database session.", "RETURN": "List[UserSchema] - List of users." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 38 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 38 } ], "score": 0.5499999999999999 } }, { "name": "create_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 55, "end_line": 91, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates a new local user.", "PRE": "Current user has 'Admin' role.", "POST": "New user is created in the database.", "PARAM": "db (Session) - Auth database session.", "RETURN": "UserSchema - The created user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 55 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 55 } ], "score": 0.5499999999999999 } }, { "name": "update_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 93, "end_line": 132, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates an existing user.", "PRE": "Current user has 'Admin' role.", "POST": "User record is updated in the database.", "PARAM": "db (Session) - Auth database session.", "RETURN": "UserSchema - The updated user profile." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 93 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 93 } ], "score": 0.5499999999999999 } }, { "name": "delete_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 134, "end_line": 161, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deletes a user.", "PRE": "Current user has 'Admin' role.", "POST": "User record is removed from the database.", "PARAM": "db (Session) - Auth database session.", "RETURN": "None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 134 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 134 } ], "score": 0.5499999999999999 } }, { "name": "list_roles", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 163, "end_line": 175, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all available roles.", "RETURN": "List[RoleSchema] - List of roles." }, "relations": [ { "type": "CALLS", "target": "backend.src.models.auth.Role" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "create_role", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 177, "end_line": 213, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates a new system role with associated permissions.", "PRE": "Role name must be unique.", "POST": "New Role record is created in auth.db.", "PARAM": "db (Session) - Auth database session.", "RETURN": "RoleSchema - The created role.", "SIDE_EFFECT": "Commits new role and associations to auth.db." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.auth.repository.AuthRepository.get_permission_by_id" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "update_role", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 215, "end_line": 258, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates an existing role's metadata and permissions.", "PRE": "role_id must be a valid existing role UUID.", "POST": "Role record is updated in auth.db.", "PARAM": "db (Session) - Auth database session.", "RETURN": "RoleSchema - The updated role.", "SIDE_EFFECT": "Commits updates to auth.db." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.auth.repository.AuthRepository.get_role_by_id" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "delete_role", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 260, "end_line": 285, "tags": { "COMPLEXITY": "3", "PURPOSE": "Removes a role from the system.", "PRE": "role_id must be a valid existing role UUID.", "POST": "Role record is removed from auth.db.", "PARAM": "db (Session) - Auth database session.", "RETURN": "None", "SIDE_EFFECT": "Deletes record from auth.db and commits." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.auth.repository.AuthRepository.get_role_by_id" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "list_permissions", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 287, "end_line": 311, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all available system permissions for assignment.", "POST": "Returns a list of all PermissionSchema objects.", "PARAM": "db (Session) - Auth database session.", "RETURN": "List[PermissionSchema] - List of permissions." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.auth.repository.AuthRepository.list_permissions" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "list_ad_mappings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 313, "end_line": 323, "tags": { "COMPLEXITY": "3", "PURPOSE": "Lists all AD Group to Role mappings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 313 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 313 } ], "score": 0.5499999999999999 } }, { "name": "create_ad_mapping", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 325, "end_line": 343, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates a new AD Group mapping." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 325 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 325 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 345 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.src.api.routes.git_schemas", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 293, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git, schemas, pydantic, api, contracts", "PURPOSE": "Defines Pydantic models for the Git integration API layer.", "LAYER": "API", "INVARIANT": "All schemas must be compatible with the FastAPI router." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.git" } ], "children": [ { "name": "GitServerConfigBase", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 27, "tags": { "COMPLEXITY": "1", "PURPOSE": "Base schema for Git server configuration attributes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitServerConfigUpdate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 38, "tags": { "PURPOSE": "Schema for updating an existing Git server configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitServerConfigCreate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 45, "tags": { "PURPOSE": "Schema for creating a new Git server configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitServerConfigSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 57, "tags": { "PURPOSE": "Schema for representing a Git server configuration with metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitRepositorySchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 73, "tags": { "PURPOSE": "Schema for tracking a local Git repository linked to a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "BranchSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 83, "tags": { "PURPOSE": "Schema for representing a Git branch metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CommitSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 95, "tags": { "PURPOSE": "Schema for representing Git commit details." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "BranchCreate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 103, "tags": { "PURPOSE": "Schema for branch creation requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "BranchCheckout", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 110, "tags": { "PURPOSE": "Schema for branch checkout requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CommitCreate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 112, "end_line": 118, "tags": { "PURPOSE": "Schema for staging and committing changes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ConflictResolution", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 127, "tags": { "PURPOSE": "Schema for resolving merge conflicts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MergeStatusSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 140, "tags": { "PURPOSE": "Schema representing unfinished merge status for repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MergeConflictFileSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 143, "end_line": 149, "tags": { "PURPOSE": "Schema describing one conflicted file with optional side snapshots." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MergeResolveRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 156, "tags": { "PURPOSE": "Request schema for resolving one or multiple merge conflicts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MergeContinueRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 163, "tags": { "PURPOSE": "Request schema for finishing merge with optional explicit commit message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DeploymentEnvironmentSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 176, "tags": { "PURPOSE": "Schema for representing a target deployment environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DeployRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 183, "tags": { "PURPOSE": "Schema for dashboard deployment requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RepoInitRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 185, "end_line": 191, "tags": { "PURPOSE": "Schema for repository initialization requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RepositoryBindingSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 194, "end_line": 202, "tags": { "PURPOSE": "Schema describing repository-to-config binding and provider metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RepoStatusBatchRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 204, "end_line": 208, "tags": { "PURPOSE": "Schema for requesting repository statuses for multiple dashboards in a single call." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RepoStatusBatchResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 211, "end_line": 215, "tags": { "PURPOSE": "Schema for returning repository statuses keyed by dashboard ID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GiteaRepoSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 218, "end_line": 228, "tags": { "PURPOSE": "Schema describing a Gitea repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GiteaRepoCreateRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 231, "end_line": 239, "tags": { "PURPOSE": "Request schema for creating a Gitea repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RemoteRepoSchema", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 253, "tags": { "PURPOSE": "Provider-agnostic remote repository payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RemoteRepoCreateRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 256, "end_line": 264, "tags": { "PURPOSE": "Provider-agnostic repository creation request." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PromoteRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 267, "end_line": 278, "tags": { "PURPOSE": "Request schema for branch promotion workflow." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PromoteResponse", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 281, "end_line": 291, "tags": { "PURPOSE": "Response schema for promotion operation result." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.api.routes.assistant", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 2209, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, assistant, chat, command, confirmation", "PURPOSE": "API routes for LLM assistant command parsing and safe execution orchestration.", "LAYER": "API", "INVARIANT": "Risky operations are never executed without valid confirmation token." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.manager.TaskManager" }, { "type": "DEPENDS_ON", "target": "backend.src.models.assistant" } ], "children": [ { "name": "AssistantMessageRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 57, "tags": { "COMPLEXITY": "1", "PURPOSE": "Input payload for assistant message endpoint.", "PRE": "message length is within accepted bounds.", "POST": "Request object provides message text and optional conversation binding." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AssistantAction", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 69, "tags": { "COMPLEXITY": "1", "PURPOSE": "UI action descriptor returned with assistant responses.", "PRE": "type and label are provided by orchestration logic.", "POST": "Action can be rendered as button on frontend." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AssistantMessageResponse", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 72, "end_line": 87, "tags": { "COMPLEXITY": "3", "PURPOSE": "Output payload contract for assistant interaction endpoints.", "PRE": "Response includes deterministic state and text.", "POST": "Payload may include task_id/confirmation_id/actions for UI follow-up." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 72 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 72 } ], "score": 0.5499999999999999 } }, { "name": "ConfirmationRecord", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 90, "end_line": 104, "tags": { "COMPLEXITY": "3", "PURPOSE": "In-memory confirmation token model for risky operation dispatch.", "PRE": "intent/dispatch/user_id are populated at confirmation request time.", "POST": "Record tracks lifecycle state and expiry timestamp." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 90 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 90 } ], "score": 0.5499999999999999 } }, { "name": "_append_history", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 127, "end_line": 156, "tags": { "COMPLEXITY": "3", "PURPOSE": "Append conversation message to in-memory history buffer.", "PRE": "user_id and conversation_id identify target conversation bucket.", "POST": "Message entry is appended to CONVERSATIONS key list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 127 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 127 } ], "score": 0.5499999999999999 } }, { "name": "_persist_message", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 159, "end_line": 192, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist assistant/user message record to database.", "PRE": "db session is writable and message payload is serializable.", "POST": "Message row is committed or persistence failure is logged." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 159 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 159 } ], "score": 0.5499999999999999 } }, { "name": "_audit", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 195, "end_line": 205, "tags": { "COMPLEXITY": "3", "PURPOSE": "Append in-memory audit record for assistant decision trace.", "PRE": "payload describes decision/outcome fields.", "POST": "ASSISTANT_AUDIT list for user contains new timestamped entry." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 195 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 195 } ], "score": 0.5499999999999999 } }, { "name": "_persist_audit", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 208, "end_line": 229, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist structured assistant audit payload in database.", "PRE": "db session is writable and payload is JSON-serializable.", "POST": "Audit row is committed or failure is logged with rollback." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 208 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 208 } ], "score": 0.5499999999999999 } }, { "name": "_persist_confirmation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 232, "end_line": 255, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist confirmation token record to database.", "PRE": "record contains id/user/intent/dispatch/expiry fields.", "POST": "Confirmation row exists in persistent storage." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 } ], "score": 0.5499999999999999 } }, { "name": "_update_confirmation_state", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 258, "end_line": 275, "tags": { "COMPLEXITY": "3", "PURPOSE": "Update persistent confirmation token lifecycle state.", "PRE": "confirmation_id references existing row.", "POST": "State and consumed_at fields are updated when applicable." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 258 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 258 } ], "score": 0.5499999999999999 } }, { "name": "_load_confirmation_from_db", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 278, "end_line": 301, "tags": { "COMPLEXITY": "3", "PURPOSE": "Load confirmation token from database into in-memory model.", "PRE": "confirmation_id may or may not exist in storage.", "POST": "Returns ConfirmationRecord when found, otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 278 } ], "score": 0.5499999999999999 } }, { "name": "_ensure_conversation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 304, "end_line": 321, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve active conversation id in memory or create a new one.", "PRE": "user_id identifies current actor.", "POST": "Returns stable conversation id and updates USER_ACTIVE_CONVERSATION." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 304 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 304 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_or_create_conversation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 324, "end_line": 351, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve active conversation using explicit id, memory cache, or persisted history.", "PRE": "user_id and db session are available.", "POST": "Returns conversation id and updates USER_ACTIVE_CONVERSATION cache." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 324 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 324 } ], "score": 0.5499999999999999 } }, { "name": "_cleanup_history_ttl", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 354, "end_line": 389, "tags": { "COMPLEXITY": "3", "PURPOSE": "Enforce assistant message retention window by deleting expired rows and in-memory records.", "PRE": "db session is available and user_id references current actor scope.", "POST": "Messages older than ASSISTANT_MESSAGE_TTL_DAYS are removed from persistence and memory mirrors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 354 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 354 } ], "score": 0.5499999999999999 } }, { "name": "_is_conversation_archived", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 392, "end_line": 402, "tags": { "COMPLEXITY": "3", "PURPOSE": "Determine archived state for a conversation based on last update timestamp.", "PRE": "updated_at can be null for empty conversations.", "POST": "Returns True when conversation inactivity exceeds archive threshold." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 392 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 392 } ], "score": 0.5499999999999999 } }, { "name": "_coerce_query_bool", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 405, "end_line": 416, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize bool-like query values for compatibility in direct handler invocations/tests.", "PRE": "value may be bool, string, or FastAPI Query metadata object.", "POST": "Returns deterministic boolean flag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 405 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 405 } ], "score": 0.5499999999999999 } }, { "name": "_extract_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 419, "end_line": 430, "tags": { "COMPLEXITY": "3", "PURPOSE": "Extract first regex match group from text by ordered pattern list.", "PRE": "patterns contain at least one capture group.", "POST": "Returns first matched token or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_env_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 433, "end_line": 448, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve environment identifier/name token to canonical environment id.", "PRE": "config_manager provides environment list.", "POST": "Returns matched environment id or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 433 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 433 } ], "score": 0.5499999999999999 } }, { "name": "_is_production_env", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 451, "end_line": 466, "tags": { "COMPLEXITY": "3", "PURPOSE": "Determine whether environment token resolves to production-like target.", "PRE": "config_manager provides environments or token text is provided.", "POST": "Returns True for production/prod synonyms, else False." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 451 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 451 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_provider_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 469, "end_line": 502, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve provider token to provider id with active/default fallback.", "PRE": "db session can load provider list through LLMProviderService.", "POST": "Returns provider id or None when no providers configured." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 } ], "score": 0.5499999999999999 } }, { "name": "_get_default_environment_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 505, "end_line": 524, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve default environment id from settings or first configured environment.", "PRE": "config_manager returns environments list.", "POST": "Returns default environment id or None when environment list is empty." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 505 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 505 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_by_ref", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 527, "end_line": 567, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard id by title or slug reference in selected environment.", "PRE": "dashboard_ref is a non-empty string-like token.", "POST": "Returns dashboard id when uniquely matched, otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 527 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 527 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_entity", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 570, "end_line": 599, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard id from intent entities using numeric id or dashboard_ref fallback.", "PRE": "entities may contain dashboard_id as int/str and optional dashboard_ref.", "POST": "Returns resolved dashboard id or None when ambiguous/unresolvable." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 570 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 570 } ], "score": 0.5499999999999999 } }, { "name": "_get_environment_name_by_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 602, "end_line": 612, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve human-readable environment name by id.", "PRE": "environment id may be None.", "POST": "Returns matching environment name or fallback id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 602 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 602 } ], "score": 0.5499999999999999 } }, { "name": "_extract_result_deep_links", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 615, "end_line": 669, "tags": { "COMPLEXITY": "3", "PURPOSE": "Build deep-link actions to verify task result from assistant chat.", "PRE": "task object is available.", "POST": "Returns zero or more assistant actions for dashboard open/diff." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 615 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 615 } ], "score": 0.5499999999999999 } }, { "name": "_build_task_observability_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 672, "end_line": 733, "tags": { "COMPLEXITY": "3", "PURPOSE": "Build compact textual summary for completed tasks to reduce \"black box\" effect.", "PRE": "task may contain plugin-specific result payload.", "POST": "Returns non-empty summary line for known task types or empty string fallback." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 672 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 672 } ], "score": 0.5499999999999999 } }, { "name": "_parse_command", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 736, "end_line": 927, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deterministically parse RU/EN command text into intent payload.", "PRE": "message contains raw user text and config manager resolves environments.", "POST": "Returns intent dict with domain/operation/entities/confidence/risk fields." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 736 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 736 } ], "score": 0.5499999999999999 } }, { "name": "_check_any_permission", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 930, "end_line": 945, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validate user against alternative permission checks (logical OR).", "PRE": "checks list contains resource-action tuples.", "POST": "Returns on first successful permission; raises 403-like HTTPException otherwise." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 930 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 930 } ], "score": 0.5499999999999999 } }, { "name": "_has_any_permission", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 948, "end_line": 959, "tags": { "COMPLEXITY": "3", "PURPOSE": "Check whether user has at least one permission tuple from the provided list.", "PRE": "current_user and checks list are valid.", "POST": "Returns True when at least one permission check passes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 948 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 948 } ], "score": 0.5499999999999999 } }, { "name": "_build_tool_catalog", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 962, "end_line": 1083, "tags": { "COMPLEXITY": "3", "PURPOSE": "Build current-user tool catalog for LLM planner with operation contracts and defaults.", "PRE": "current_user is authenticated; config/db are available.", "POST": "Returns list of executable tools filtered by permission and runtime availability." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 962 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 962 } ], "score": 0.5499999999999999 } }, { "name": "_coerce_intent_entities", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1086, "end_line": 1104, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize intent entity value types from LLM output to route-compatible values.", "PRE": "intent contains entities dict or missing entities.", "POST": "Returned intent has numeric ids coerced where possible and string values stripped." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1086 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1086 } ], "score": 0.5499999999999999 } }, { "name": "_confirmation_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1111, "end_line": 1204, "tags": { "COMPLEXITY": "3", "PURPOSE": "Build human-readable confirmation prompt for an intent before execution.", "PRE": "intent contains operation and entities fields.", "POST": "Returns descriptive Russian-language text ending with confirmation prompt." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1111 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1111 } ], "score": 0.5499999999999999 } }, { "name": "_clarification_text_for_intent", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1207, "end_line": 1228, "tags": { "COMPLEXITY": "3", "PURPOSE": "Convert technical missing-parameter errors into user-facing clarification prompts.", "PRE": "state was classified as needs_clarification for current intent/error combination.", "POST": "Returned text is human-readable and actionable for target operation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1207 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1207 } ], "score": 0.5499999999999999 } }, { "name": "_plan_intent_with_llm", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1231, "end_line": 1339, "tags": { "COMPLEXITY": "3", "PURPOSE": "Use active LLM provider to select best tool/operation from dynamic catalog.", "PRE": "tools list contains allowed operations for current user.", "POST": "Returns normalized intent dict when planning succeeds; otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1231 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1231 } ], "score": 0.5499999999999999 } }, { "name": "_authorize_intent", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1342, "end_line": 1351, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validate user permissions for parsed intent before confirmation/dispatch.", "PRE": "intent.operation is present for known assistant command domains.", "POST": "Returns if authorized; raises HTTPException(403) when denied." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1342 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1342 } ], "score": 0.5499999999999999 } }, { "name": "_dispatch_intent", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1354, "end_line": 1672, "tags": { "COMPLEXITY": "3", "PURPOSE": "Execute parsed assistant intent via existing task/plugin/git services.", "PRE": "intent operation is known and actor permissions are validated per operation.", "POST": "Returns response text, optional task id, and UI actions for follow-up." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1354 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1354 } ], "score": 0.5499999999999999 } }, { "name": "send_message", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1676, "end_line": 1842, "tags": { "COMPLEXITY": "3", "PURPOSE": "Parse assistant command, enforce safety gates, and dispatch executable intent.", "PRE": "Authenticated user is available and message text is non-empty.", "POST": "Response state is one of clarification/confirmation/started/success/denied/failed.", "RETURN": "AssistantMessageResponse with operation feedback and optional actions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1676 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1676 } ], "score": 0.5499999999999999 } }, { "name": "confirm_operation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1846, "end_line": 1909, "tags": { "COMPLEXITY": "3", "PURPOSE": "Execute previously requested risky operation after explicit user confirmation.", "PRE": "confirmation_id exists, belongs to current user, is pending, and not expired.", "POST": "Confirmation state becomes consumed and operation result is persisted in history.", "RETURN": "AssistantMessageResponse with task details when async execution starts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1846 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1846 } ], "score": 0.5499999999999999 } }, { "name": "cancel_operation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1913, "end_line": 1967, "tags": { "COMPLEXITY": "3", "PURPOSE": "Cancel pending risky operation and mark confirmation token as cancelled.", "PRE": "confirmation_id exists, belongs to current user, and is still pending.", "POST": "Confirmation becomes cancelled and cannot be executed anymore.", "RETURN": "AssistantMessageResponse confirming cancellation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1913 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1913 } ], "score": 0.5499999999999999 } }, { "name": "list_conversations", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1970, "end_line": 2055, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return paginated conversation list for current user with archived flag and last message preview.", "PRE": "Authenticated user context and valid pagination params.", "POST": "Conversations are grouped by conversation_id sorted by latest activity descending.", "RETURN": "Dict with items, paging metadata, and archive segmentation counts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1970 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1970 } ], "score": 0.5499999999999999 } }, { "name": "delete_conversation", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 2058, "end_line": 2089, "tags": { "COMPLEXITY": "3", "PURPOSE": "Soft-delete or hard-delete a conversation and clear its in-memory trace.", "PRE": "conversation_id belongs to current_user.", "POST": "Conversation records are removed from DB and CONVERSATIONS cache." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 2058 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 2058 } ], "score": 0.5499999999999999 } }, { "name": "get_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 2093, "end_line": 2164, "tags": { "PURPOSE": "Retrieve paginated assistant conversation history for current user.", "PRE": "Authenticated user is available and page params are valid.", "POST": "Returns persistent messages and mirrored in-memory snapshot for diagnostics.", "RETURN": "Dict with items, paging metadata, and resolved conversation_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_assistant_audit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 2168, "end_line": 2207, "tags": { "PURPOSE": "Return assistant audit decisions for current user from persistent and in-memory stores.", "PRE": "User has tasks:READ permission.", "POST": "Audit payload is returned in reverse chronological order from DB.", "RETURN": "Dict with persistent and memory audit slices." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_async_confirmation_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1116, "end_line": 1116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_label", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1132, "end_line": 1132, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 2209 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "storage_routes", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 194, "tags": { "COMPLEXITY": "3", "SEMANTICS": "storage, files, upload, download, backup, repository", "PURPOSE": "API endpoints for file storage management (backups and repositories).", "LAYER": "API", "INVARIANT": "All paths must be validated against path traversal." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.storage" } ], "children": [ { "name": "list_files", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 24, "end_line": 49, "tags": { "COMPLEXITY": "3", "PURPOSE": "List all files and directories in the storage system.", "PRE": "None.", "POST": "Returns a list of StoredFile objects.", "PARAM": "path (Optional[str]) - Subpath within the category.", "RETURN": "List[StoredFile] - List of files/directories." }, "relations": [ { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.list_files" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "upload_file", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 51, "end_line": 83, "tags": { "COMPLEXITY": "3", "PURPOSE": "Upload a file to the storage system.", "PRE": "file must be a valid UploadFile.", "POST": "Returns the StoredFile object of the uploaded file.", "PARAM": "file (UploadFile) - The file content.", "RETURN": "StoredFile - Metadata of the uploaded file.", "SIDE_EFFECT": "Writes file to the filesystem." }, "relations": [ { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.save_file" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "delete_file", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 85, "end_line": 116, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete a specific file or directory.", "PRE": "category must be a valid FileCategory.", "POST": "Item is removed from storage.", "PARAM": "path (str) - Relative path of the item.", "RETURN": "None", "SIDE_EFFECT": "Deletes item from the filesystem." }, "relations": [ { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.delete_file" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "download_file", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 118, "end_line": 149, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieve a file for download.", "PRE": "category must be a valid FileCategory.", "POST": "Returns a FileResponse.", "PARAM": "path (str) - Relative path of the file.", "RETURN": "FileResponse - The file content." }, "relations": [ { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.get_file_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_file_by_path", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 151, "end_line": 192, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieve a file by validated absolute/relative path under storage root.", "PRE": "path must resolve under configured storage root.", "POST": "Returns a FileResponse for existing files.", "PARAM": "path (str) - Absolute or storage-root-relative file path.", "RETURN": "FileResponse - The file content." }, "relations": [ { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.get_storage_root" }, { "type": "CALLS", "target": "backend.src.plugins.storage.plugin.StoragePlugin.validate_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.api.routes.clean_release", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 445, "tags": { "COMPLEXITY": "3", "SEMANTICS": "api, clean-release, candidate-preparation, compliance", "PURPOSE": "Expose clean release endpoints for candidate preparation and subsequent compliance flow.", "LAYER": "API", "INVARIANT": "API never reports prepared status if preparation errors are present." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.dependencies.get_clean_release_repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.preparation_service" } ], "children": [ { "name": "PrepareCandidateRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 52, "tags": { "PURPOSE": "Request schema for candidate preparation endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StartCheckRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 62, "tags": { "PURPOSE": "Request schema for clean compliance check run startup." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RegisterCandidateRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 72, "tags": { "PURPOSE": "Request schema for candidate registration endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ImportArtifactsRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 79, "tags": { "PURPOSE": "Request schema for candidate artifact import endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "BuildManifestRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 86, "tags": { "PURPOSE": "Request schema for manifest build endpoint." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CreateComplianceRunRequest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 94, "tags": { "PURPOSE": "Request schema for compliance run creation with optional manifest pinning." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "register_candidate_v2_endpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 128, "tags": { "PURPOSE": "Register a clean-release candidate for headless lifecycle.", "PRE": "Candidate identifier is unique.", "POST": "Candidate is persisted in DRAFT status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "import_candidate_artifacts_v2_endpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 175, "tags": { "PURPOSE": "Import candidate artifacts in headless flow.", "PRE": "Candidate exists and artifacts array is non-empty.", "POST": "Artifacts are persisted and candidate advances to PREPARED if it was DRAFT." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_candidate_manifest_v2_endpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 210, "tags": { "PURPOSE": "Build immutable manifest snapshot for prepared candidate.", "PRE": "Candidate exists and has imported artifacts.", "POST": "Returns created ManifestDTO with incremented version." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_candidate_overview_v2_endpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 213, "end_line": 282, "tags": { "PURPOSE": "Return expanded candidate overview DTO for headless lifecycle visibility.", "PRE": "Candidate exists.", "POST": "Returns CandidateOverviewDTO built from the same repository state used by headless US1 endpoints." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "prepare_candidate_endpoint", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 285, "end_line": 308, "tags": { "PURPOSE": "Prepare candidate with policy evaluation and deterministic manifest generation.", "PRE": "Candidate and active policy exist in repository.", "POST": "Returns preparation result including manifest reference and violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "start_check", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 311, "end_line": 404, "tags": { "PURPOSE": "Start and finalize a clean compliance check run and persist report artifacts.", "PRE": "Active policy and candidate exist.", "POST": "Returns accepted payload with check_run_id and started_at." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_check_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 407, "end_line": 428, "tags": { "PURPOSE": "Return terminal/intermediate status payload for a check run.", "PRE": "check_run_id references an existing run.", "POST": "Deterministic payload shape includes checks and violations arrays." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 431, "end_line": 444, "tags": { "PURPOSE": "Return persisted compliance report by report_id.", "PRE": "report_id references an existing report.", "POST": "Returns serialized report object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 445 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "ReportsRouter", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 156, "tags": { "COMPLEXITY": "5", "SEMANTICS": "api, reports, list, detail, pagination, filters", "PURPOSE": "FastAPI router for unified task report list and detail retrieval endpoints.", "LAYER": "UI (API)", "INVARIANT": "Endpoints are read-only and do not trigger long-running tasks.", "PRE": "Reports service and dependencies are initialized.", "POST": "Router is configured and endpoints are ready for registration.", "SIDE_EFFECT": "None", "DATA_CONTRACT": "[ReportQuery] -> [ReportCollection | ReportDetailView]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.reports.report_service.ReportsService" }, { "type": "DEPENDS_ON", "target": "AppDependencies" } ], "children": [ { "name": "_parse_csv_enum_list", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 63, "tags": { "COMPLEXITY": "1", "PURPOSE": "Parse comma-separated query value into enum list.", "PRE": "raw may be None/empty or comma-separated values.", "POST": "Returns enum list or raises HTTP 400 with deterministic machine-readable payload.", "PARAM": "field_name (str) - Query field name for diagnostics.", "RETURN": "List - Parsed enum values." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_reports", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 66, "end_line": 130, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return paginated unified reports list.", "PRE": "authenticated/authorized request and validated query params.", "POST": "deterministic error payload for invalid filters.", "TEST_CONTRACT": "ListReportsApi ->", "TEST_FIXTURE": "valid_list_request -> {\"page\": 1, \"page_size\": 20}", "TEST_EDGE": "malformed_query -> raises HTTPException(400)", "TEST_INVARIANT": "consistent_list_payload -> verifies: [valid_list_request]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 66 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 66 } ], "score": 0.5499999999999999 } }, { "name": "get_report_detail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 133, "end_line": 154, "tags": { "COMPLEXITY": "3", "PURPOSE": "Return one normalized report detail with diagnostics and next actions.", "PRE": "authenticated/authorized request and existing report_id.", "POST": "returns normalized detail envelope or 404 when report is not found." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 133 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 133 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9666666666666667 } }, { "name": "backend.src.api.routes.profile", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 147, "tags": { "COMPLEXITY": "5", "SEMANTICS": "api, profile, preferences, self-service, account-lookup", "PURPOSE": "Exposes self-scoped profile preference endpoints and environment-based Superset account lookup.", "LAYER": "API", "INVARIANT": "Endpoints are self-scoped and never mutate another user preference.", "UX_STATE": "LookupLoading -> Returns success/degraded Superset lookup payload.", "UX_FEEDBACK": "Stable status/message/warning payloads support profile page feedback.", "UX_RECOVERY": "Lookup degradation keeps manual username save path available." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.profile_service" }, { "type": "DEPENDS_ON", "target": "backend.src.dependencies.get_current_user" }, { "type": "DEPENDS_ON", "target": "backend.src.core.database.get_db" } ], "children": [ { "name": "_get_profile_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 59, "tags": { "PURPOSE": "Build profile service for current request scope.", "PRE": "db session and config manager are available.", "POST": "Returns a ready ProfileService instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_preferences", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 77, "tags": { "PURPOSE": "Get authenticated user's dashboard filter preference.", "PRE": "Valid JWT and authenticated user context.", "POST": "Returns preference payload for current user only." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_preferences", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 103, "tags": { "PURPOSE": "Update authenticated user's dashboard filter preference.", "PRE": "Valid JWT and valid request payload.", "POST": "Persists normalized preference for current user or raises validation/authorization errors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "lookup_superset_accounts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 145, "tags": { "PURPOSE": "Lookup Superset account candidates in selected environment.", "PRE": "Valid JWT, authenticated context, and environment_id query parameter.", "POST": "Returns success or degraded lookup payload with stable shape." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.api.routes.__init__", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 23, "tags": { "COMPLEXITY": "3", "SEMANTICS": "routes, lazy-import, module-registry", "PURPOSE": "Provide lazy route module loading to avoid heavyweight imports during tests.", "LAYER": "API", "INVARIANT": "Only names listed in __all__ are importable via __getattr__." }, "relations": [ { "type": "DEPENDS_ON", "target": "importlib" } ], "children": [ { "name": "__getattr__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 22, "tags": { "COMPLEXITY": "1", "PURPOSE": "Lazily import route module by attribute name.", "PRE": "name is module candidate exposed in __all__.", "POST": "Returns imported submodule or raises AttributeError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "TasksRouter", "type": "Module", "complexity": 4, "tier": "STANDARD", "start_line": 1, "end_line": 324, "tags": { "COMPLEXITY": "4", "SEMANTICS": "api, router, tasks, create, list, get, logs", "PURPOSE": "Defines the FastAPI router for task-related endpoints, allowing clients to create, list, and get the status of tasks.", "LAYER": "UI (API)" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.manager.TaskManager" }, { "type": "DEPENDS_ON", "target": "backend.src.core.config_manager.ConfigManager" }, { "type": "DEPENDS_ON", "target": "backend.src.services.llm_provider.LLMProviderService" } ], "children": [ { "name": "create_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 45, "end_line": 107, "tags": { "COMPLEXITY": "3", "PURPOSE": "Create and start a new task for a given plugin.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "plugin_id must exist and params must be valid for that plugin.", "POST": "A new task is created and started.", "RETURN": "Task - The created task instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 45 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 45 } ], "score": 0.5499999999999999 } }, { "name": "list_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 109, "end_line": 147, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieve a list of tasks with pagination and optional status filter.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_manager must be available.", "POST": "Returns a list of tasks.", "RETURN": "List[Task] - List of tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 109 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 109 } ], "score": 0.5499999999999999 } }, { "name": "get_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 149, "end_line": 168, "tags": { "COMPLEXITY": "3", "PURPOSE": "Retrieve the details of a specific task.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_id must exist.", "POST": "Returns task details or raises 404.", "RETURN": "Task - The task details." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 149 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 149 } ], "score": 0.5499999999999999 } }, { "name": "get_task_logs", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 170, "end_line": 214, "tags": { "COMPLEXITY": "5", "PURPOSE": "Retrieve logs for a specific task with optional filtering.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_id must exist.", "POST": "Returns a list of log entries or raises 404.", "RETURN": "List[LogEntry] - List of log entries.", "TEST_CONTRACT": "TaskLogQueryInput -> List[LogEntry]", "TEST_SCENARIO": "existing_task_logs_filtered -> Returns filtered logs by level/source/search with pagination.", "TEST_FIXTURE": "valid_task_with_mixed_logs -> backend/tests/fixtures/task_logs/valid_task_with_mixed_logs.json", "TEST_EDGE": "pagination_bounds -> offset=0 and limit=1000 remain within API bounds and do not overflow.", "TEST_INVARIANT": "logs_only_for_existing_task -> VERIFIED_BY: [existing_task_logs_filtered, missing_task]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 170 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 170 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 170 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 170 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 170 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 170 } ], "score": 0.0 } }, { "name": "get_task_log_stats", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 216, "end_line": 235, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get statistics about logs for a task (counts by level and source).", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_id must exist.", "POST": "Returns log statistics or raises 404.", "RETURN": "LogStats - Statistics about task logs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 216 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 216 } ], "score": 0.5499999999999999 } }, { "name": "get_task_log_sources", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 237, "end_line": 256, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get unique sources for a task's logs.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_id must exist.", "POST": "Returns list of unique source names or raises 404.", "RETURN": "List[str] - Unique source names." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 237 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 237 } ], "score": 0.5499999999999999 } }, { "name": "resolve_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 258, "end_line": 280, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve a task that is awaiting mapping.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task must be in AWAITING_MAPPING status.", "POST": "Task is resolved and resumes execution.", "RETURN": "Task - The updated task object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 258 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 258 } ], "score": 0.5499999999999999 } }, { "name": "resume_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 282, "end_line": 304, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resume a task that is awaiting input (e.g., passwords).", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task must be in AWAITING_INPUT status.", "POST": "Task resumes execution with provided input.", "RETURN": "Task - The updated task object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 282 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 282 } ], "score": 0.5499999999999999 } }, { "name": "clear_tasks", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 306, "end_line": 322, "tags": { "COMPLEXITY": "3", "PURPOSE": "Clear tasks matching the status filter.", "PARAM": "task_manager (TaskManager) - The task manager instance.", "PRE": "task_manager is available.", "POST": "Tasks are removed from memory/persistence." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 306 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 306 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 4)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 4)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 4)", "severity": "ERROR", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 324 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.api.routes.dashboards", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 1278, "tags": { "COMPLEXITY": "5", "SEMANTICS": "api, dashboards, resources, hub", "PURPOSE": "API endpoints for the Dashboard Hub - listing dashboards with Git and task status", "LAYER": "API", "INVARIANT": "All dashboard responses include git_status and last_task metadata", "PRE": "Valid environment configurations exist in ConfigManager.", "POST": "Dashboard responses are projected into DashboardsResponse DTO.", "SIDE_EFFECT": "Performs external calls to Superset API and potentially Git providers.", "DATA_CONTRACT": "Input(env_id, filters) -> Output(DashboardsResponse)", "TEST_CONTRACT": "DashboardsAPI -> {", "TEST_FIXTURE": "dashboard_list_happy -> {", "TEST_EDGE": "external_superset_failure -> {\"env_id\": \"bad_conn\", \"status\": 503}", "TEST_INVARIANT": "metadata_consistency -> verifies: [dashboard_list_happy, empty_dashboards]" }, "relations": [ { "type": "DEPENDS_ON", "target": "AppDependencies" }, { "type": "DEPENDS_ON", "target": "backend.src.services.resource_service.ResourceService" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" } ], "children": [ { "name": "GitStatus", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 68, "end_line": 76, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for dashboard Git synchronization status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LastTask", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 78, "end_line": 88, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for the most recent background task associated with a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardItem", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 90, "end_line": 104, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO representing a single dashboard with projected metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "EffectiveProfileFilter", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 106, "end_line": 117, "tags": { "COMPLEXITY": "3", "PURPOSE": "Metadata about applied profile filters for UI context." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardsResponse", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 119, "end_line": 129, "tags": { "COMPLEXITY": "3", "PURPOSE": "Envelope DTO for paginated dashboards list." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardChartItem", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 131, "end_line": 141, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for a chart linked to a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardDatasetItem", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 143, "end_line": 153, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for a dataset associated with a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardDetailResponse", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 155, "end_line": 170, "tags": { "COMPLEXITY": "3", "PURPOSE": "Detailed dashboard metadata including children." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardTaskHistoryItem", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 172, "end_line": 184, "tags": { "COMPLEXITY": "3", "PURPOSE": "Individual history record entry." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardTaskHistoryResponse", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 186, "end_line": 192, "tags": { "COMPLEXITY": "3", "PURPOSE": "Collection DTO for task history." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatabaseMapping", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 194, "end_line": 203, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for cross-environment database ID mapping." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DatabaseMappingsResponse", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 205, "end_line": 210, "tags": { "COMPLEXITY": "3", "PURPOSE": "Wrapper for database mappings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_find_dashboard_id_by_slug", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 213, "end_line": 238, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard numeric ID by slug using Superset list endpoint.", "PRE": "`dashboard_slug` is non-empty.", "POST": "Returns dashboard ID when found, otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 213 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 213 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_from_ref", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 241, "end_line": 263, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard ID from slug-first reference with numeric fallback.", "PRE": "`dashboard_ref` is provided in route path.", "POST": "Returns a valid dashboard ID or raises HTTPException(404)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 241 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 241 } ], "score": 0.5499999999999999 } }, { "name": "_find_dashboard_id_by_slug_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 266, "end_line": 291, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard numeric ID by slug using async Superset list endpoint.", "PRE": "dashboard_slug is non-empty.", "POST": "Returns dashboard ID when found, otherwise None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 266 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 266 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_dashboard_id_from_ref_async", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 294, "end_line": 315, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve dashboard ID from slug-first reference using async Superset client.", "PRE": "dashboard_ref is provided in route path.", "POST": "Returns valid dashboard ID or raises HTTPException(404)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 294 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 294 } ], "score": 0.5499999999999999 } }, { "name": "_normalize_filter_values", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 318, "end_line": 332, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize query filter values to lower-cased non-empty tokens.", "PRE": "values may be None or list of strings.", "POST": "Returns trimmed normalized list preserving input order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 318 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 318 } ], "score": 0.5499999999999999 } }, { "name": "_dashboard_git_filter_value", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 335, "end_line": 353, "tags": { "COMPLEXITY": "3", "PURPOSE": "Build comparable git status token for dashboards filtering.", "PRE": "dashboard payload may contain git_status or None.", "POST": "Returns one of ok|diff|no_repo|error|pending." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 335 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 335 } ], "score": 0.5499999999999999 } }, { "name": "_normalize_actor_alias_token", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 355, "end_line": 363, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize actor alias token to comparable trim+lower text.", "PRE": "value can be scalar/None.", "POST": "Returns normalized token or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 355 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 355 } ], "score": 0.5499999999999999 } }, { "name": "_normalize_owner_display_token", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 366, "end_line": 390, "tags": { "COMPLEXITY": "3", "PURPOSE": "Project owner payload value into stable display string for API response contracts.", "PRE": "owner can be scalar, dict or None.", "POST": "Returns trimmed non-empty owner display token or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 366 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 366 } ], "score": 0.5499999999999999 } }, { "name": "_normalize_dashboard_owner_values", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 393, "end_line": 415, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize dashboard owners payload to optional list of display strings.", "PRE": "owners payload can be None, scalar, or list with mixed values.", "POST": "Returns deduplicated owner labels preserving order, or None when absent." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 393 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 393 } ], "score": 0.5499999999999999 } }, { "name": "_project_dashboard_response_items", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 418, "end_line": 432, "tags": { "COMPLEXITY": "3", "PURPOSE": "Project dashboard payloads to response-contract-safe shape.", "PRE": "dashboards is a list of dict-like dashboard payloads.", "POST": "Returned items satisfy DashboardItem owners=list[str]|None contract." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 418 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 418 } ], "score": 0.5499999999999999 } }, { "name": "_resolve_profile_actor_aliases", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 435, "end_line": 497, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve stable actor aliases for profile filtering without per-dashboard detail fan-out.", "PRE": "bound username is available and env is valid.", "POST": "Returns at least normalized username; may include Superset display-name alias.", "SIDE_EFFECT": "Performs at most one Superset users-lookup request." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 435 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 435 } ], "score": 0.5499999999999999 } }, { "name": "_matches_dashboard_actor_aliases", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 500, "end_line": 519, "tags": { "COMPLEXITY": "3", "PURPOSE": "Apply profile actor matching against multiple aliases (username + optional display name).", "PRE": "actor_aliases contains normalized non-empty tokens.", "POST": "Returns True when any alias matches owners OR modified_by." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 500 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 500 } ], "score": 0.5499999999999999 } }, { "name": "get_dashboards", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 522, "end_line": 823, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch list of dashboards from a specific environment with Git status and last task status", "PRE": "page_size must be between 1 and 100 if provided", "POST": "Response includes effective profile filter metadata for main dashboards page context", "PARAM": "page_size (Optional[int]) - Items per page (default: 10, max: 100)", "RETURN": "DashboardsResponse - List of dashboards with status metadata" }, "relations": [ { "type": "CALLS", "target": "get_dashboards_with_status" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_database_mappings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 825, "end_line": 879, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get database mapping suggestions between source and target environments", "PRE": "source_env_id and target_env_id are valid environment IDs", "POST": "Returns list of suggested database mappings with confidence scores", "PARAM": "target_env_id (str) - Target environment ID", "RETURN": "DatabaseMappingsResponse - List of suggested mappings" }, "relations": [ { "type": "CALLS", "target": "MappingService:get_suggestions" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_dashboard_detail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 881, "end_line": 916, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch detailed dashboard info with related charts and datasets", "PRE": "env_id must be valid and dashboard ref (slug or id) must exist", "POST": "Returns dashboard detail payload for overview page" }, "relations": [ { "type": "CALLS", "target": "backend.src.core.async_superset_client.AsyncSupersetClient.get_dashboard_detail_async" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "_task_matches_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 919, "end_line": 950, "tags": { "COMPLEXITY": "3", "PURPOSE": "Checks whether task params are tied to a specific dashboard and environment.", "PRE": "task-like object exposes plugin_id and params fields.", "POST": "Returns True only for supported task plugins tied to dashboard_id (+optional env_id)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 919 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 919 } ], "score": 0.5499999999999999 } }, { "name": "get_dashboard_tasks_history", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 953, "end_line": 1037, "tags": { "COMPLEXITY": "3", "PURPOSE": "Returns history of backup and LLM validation tasks for a dashboard.", "PRE": "dashboard ref (slug or id) is valid.", "POST": "Response contains sorted task history (newest first)." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 953 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 953 } ], "score": 0.5499999999999999 } }, { "name": "get_dashboard_thumbnail", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1040, "end_line": 1132, "tags": { "COMPLEXITY": "3", "PURPOSE": "Proxies Superset dashboard thumbnail with cache support.", "PRE": "env_id must exist.", "POST": "Returns image bytes or 202 when thumbnail is being prepared by Superset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1040 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1040 } ], "score": 0.5499999999999999 } }, { "name": "MigrateRequest", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 1134, "end_line": 1143, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for dashboard migration requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskResponse", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 1145, "end_line": 1150, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for async task ID return." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "migrate_dashboards", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1152, "end_line": 1211, "tags": { "COMPLEXITY": "3", "PURPOSE": "Trigger bulk migration of dashboards from source to target environment", "PRE": "dashboard_ids is a non-empty list", "POST": "Task is created and queued for execution", "PARAM": "request (MigrateRequest) - Migration request with source, target, and dashboard IDs", "RETURN": "TaskResponse - Task ID for tracking" }, "relations": [ { "type": "DISPATCHES", "target": "MigrationPlugin:execute" }, { "type": "CALLS", "target": "task_manager:create_task" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "BackupRequest", "type": "DataClass", "complexity": 3, "tier": "STANDARD", "start_line": 1213, "end_line": 1220, "tags": { "COMPLEXITY": "3", "PURPOSE": "DTO for dashboard backup requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backup_dashboards", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 1222, "end_line": 1276, "tags": { "COMPLEXITY": "3", "PURPOSE": "Trigger bulk backup of dashboards with optional cron schedule", "PRE": "dashboard_ids is a non-empty list", "POST": "If schedule is provided, a scheduled task is created", "PARAM": "request (BackupRequest) - Backup request with environment and dashboard IDs", "RETURN": "TaskResponse - Task ID for tracking" }, "relations": [ { "type": "DISPATCHES", "target": "BackupPlugin:execute" }, { "type": "CALLS", "target": "task_manager:create_task" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "_matches_dashboard_filters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 754, "end_line": 754, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sort_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 995, "end_line": 995, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 1278 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.8166666666666667 } }, { "name": "backend.src.api.routes.__tests__.test_dashboards", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 877, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for Dashboards API endpoints", "LAYER": "API" }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.dashboards" } ], "children": [ { "name": "test_get_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 94, "tags": { "TEST": "GET /api/dashboards returns 200 and valid schema", "PRE": "env_id exists", "POST": "Response matches DashboardsResponse schema", "TEST_FIXTURE": "dashboard_list_happy -> {\"id\": 1, \"title\": \"Main Revenue\"}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_with_search", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 125, "tags": { "TEST": "GET /api/dashboards filters by search term", "PRE": "search parameter provided", "POST": "Filtered result count must match search" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_empty", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 128, "end_line": 145, "tags": { "TEST_EDGE": "empty_dashboards -> {env_id: 'empty_env', expected_total: 0}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_superset_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 163, "tags": { "TEST_EDGE": "external_superset_failure -> {env_id: 'bad_conn', status: 503}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 166, "end_line": 178, "tags": { "TEST": "GET /api/dashboards returns 404 if env_id missing", "PRE": "env_id does not exist", "POST": "Returns 404 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_invalid_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 198, "tags": { "TEST": "GET /api/dashboards returns 400 for invalid page/page_size", "PRE": "page < 1 or page_size > 100", "POST": "Returns 400 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_detail_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 201, "end_line": 250, "tags": { "TEST": "GET /api/dashboards/{id} returns dashboard detail with charts and datasets" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_detail_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 253, "end_line": 262, "tags": { "TEST": "GET /api/dashboards/{id} returns 404 for missing environment" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 265, "end_line": 297, "tags": { "TEST": "POST /api/dashboards/migrate creates migration task", "PRE": "Valid source_env_id, target_env_id, dashboard_ids", "POST": "Returns task_id and create_task was called" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_no_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 300, "end_line": 318, "tags": { "TEST": "POST /api/dashboards/migrate returns 400 for empty dashboard_ids", "PRE": "dashboard_ids is empty", "POST": "Returns 400 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 321, "end_line": 336, "tags": { "PRE": "source_env_id and target_env_id are valid environment IDs" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 339, "end_line": 368, "tags": { "TEST": "POST /api/dashboards/backup creates backup task", "PRE": "Valid env_id, dashboard_ids", "POST": "Returns task_id and create_task was called" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 371, "end_line": 385, "tags": { "PRE": "env_id is a valid environment ID" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_database_mappings_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 388, "end_line": 418, "tags": { "TEST": "GET /api/dashboards/db-mappings returns mapping suggestions", "PRE": "Valid source_env_id, target_env_id", "POST": "Returns list of database mappings" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_database_mappings_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 421, "end_line": 428, "tags": { "PRE": "source_env_id and target_env_id are valid environment IDs" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_tasks_history_filters_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 431, "end_line": 472, "tags": { "TEST": "GET /api/dashboards/{id}/tasks returns backup and llm tasks for dashboard" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_thumbnail_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 475, "end_line": 502, "tags": { "TEST": "GET /api/dashboards/{id}/thumbnail proxies image bytes from Superset" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_profile_preference_stub", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 505, "end_line": 518, "tags": { "PURPOSE": "Creates profile preference payload stub for dashboards filter contract tests.", "PRE": "username can be empty; enabled indicates profile-default toggle state.", "POST": "Returns object compatible with ProfileService.get_my_preference contract." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_matches_actor_case_insensitive", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 521, "end_line": 538, "tags": { "PURPOSE": "Applies trim + case-insensitive owners OR modified_by matching used by route contract tests.", "PRE": "owners can be None or list-like values.", "POST": "Returns True when bound username matches any owner or modified_by." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_profile_filter_contract_owners_or_modified_by", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 541, "end_line": 597, "tags": { "TEST": "GET /api/dashboards applies profile-default filter with owners OR modified_by trim+case-insensitive semantics.", "PRE": "Current user has enabled profile-default preference and bound username.", "POST": "Response includes only matching dashboards and effective_profile_filter metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_override_show_all_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 600, "end_line": 638, "tags": { "TEST": "GET /api/dashboards honors override_show_all and disables profile-default filter for current page.", "PRE": "Profile-default preference exists but override_show_all=true query is provided.", "POST": "Response remains unfiltered and effective_profile_filter.applied is false." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_profile_filter_no_match_results_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 641, "end_line": 693, "tags": { "TEST": "GET /api/dashboards returns empty result set when profile-default filter is active and no dashboard actors match.", "PRE": "Profile-default preference is enabled with bound username and all dashboards are non-matching.", "POST": "Response total is 0 with deterministic pagination and active effective_profile_filter metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_page_context_other_disables_profile_default", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 696, "end_line": 734, "tags": { "TEST": "GET /api/dashboards does not auto-apply profile-default filter outside dashboards_main page context.", "PRE": "Profile-default preference exists but page_context=other query is provided.", "POST": "Response remains unfiltered and metadata reflects source_page=other." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_profile_filter_matches_display_alias_without_detail_fanout", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 737, "end_line": 807, "tags": { "TEST": "GET /api/dashboards resolves Superset display-name alias once and filters without per-dashboard detail calls.", "PRE": "Profile-default filter is active, bound username is `admin`, dashboard actors contain display labels.", "POST": "Route matches by alias (`Superset Admin`) and does not call `SupersetClient.get_dashboard` in list filter path." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_profile_filter_matches_owner_object_payload_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 810, "end_line": 874, "tags": { "TEST": "GET /api/dashboards profile-default filter matches Superset owner object payloads.", "PRE": "Profile-default preference is enabled and owners list contains dict payloads.", "POST": "Response keeps dashboards where owner object resolves to bound username alias." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_deps", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 27, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_get_dashboards", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 107, "end_line": 107, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_network_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 489, "end_line": 489, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 877 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.4 } }, { "name": "backend.src.api.routes.__tests__.test_git_status_route", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 440, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, git, api, status, no_repo", "PURPOSE": "Validate status endpoint behavior for missing and error repository states.", "LAYER": "Domain (Tests)" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.api.routes.git" } ], "children": [ { "name": "test_get_repository_status_returns_no_repo_payload_for_missing_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 36, "tags": { "PURPOSE": "Ensure missing local repository is represented as NO_REPO payload instead of an API error.", "PRE": "GitService.get_status raises HTTPException(404).", "POST": "Route returns a deterministic NO_REPO status payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_repository_status_propagates_non_404_http_exception", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 59, "tags": { "PURPOSE": "Ensure HTTP exceptions other than 404 are not masked.", "PRE": "GitService.get_status raises HTTPException with non-404 status.", "POST": "Raised exception preserves original status and detail." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_repository_diff_propagates_http_exception", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 78, "tags": { "PURPOSE": "Ensure diff endpoint preserves domain HTTP errors from GitService.", "PRE": "GitService.get_diff raises HTTPException.", "POST": "Endpoint raises same HTTPException values." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_history_wraps_unexpected_error_as_500", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 97, "tags": { "PURPOSE": "Ensure non-HTTP exceptions in history endpoint become deterministic 500 errors.", "PRE": "GitService.get_commit_history raises ValueError.", "POST": "Endpoint returns HTTPException with status 500 and route context." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_commit_changes_wraps_unexpected_error_as_500", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 120, "tags": { "PURPOSE": "Ensure commit endpoint does not leak unexpected errors as 400.", "PRE": "GitService.commit_changes raises RuntimeError.", "POST": "Endpoint raises HTTPException(500) with route context." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_repository_status_batch_returns_mixed_statuses", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 123, "end_line": 147, "tags": { "PURPOSE": "Ensure batch endpoint returns per-dashboard statuses in one response.", "PRE": "Some repositories are missing and some are initialized.", "POST": "Returned map includes resolved status for each requested dashboard ID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_repository_status_batch_marks_item_as_error_on_service_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 172, "tags": { "PURPOSE": "Ensure batch endpoint marks failed items as ERROR without failing entire request.", "PRE": "GitService raises non-HTTP exception for one dashboard.", "POST": "Failed dashboard status is marked as ERROR." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_repository_status_batch_deduplicates_and_truncates_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 175, "end_line": 197, "tags": { "PURPOSE": "Ensure batch endpoint protects server from oversized payloads.", "PRE": "request includes duplicate IDs and more than MAX_REPOSITORY_STATUS_BATCH entries.", "POST": "Result contains unique IDs up to configured cap." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_commit_changes_applies_profile_identity_before_commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 200, "end_line": 258, "tags": { "PURPOSE": "Ensure commit route configures repository identity from profile preferences before commit call.", "PRE": "Profile preference contains git_username/git_email for current user.", "POST": "git_service.configure_identity receives resolved identity and commit proceeds." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_pull_changes_applies_profile_identity_before_pull", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 261, "end_line": 314, "tags": { "PURPOSE": "Ensure pull route configures repository identity from profile preferences before pull call.", "PRE": "Profile preference contains git_username/git_email for current user.", "POST": "git_service.configure_identity receives resolved identity and pull proceeds." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_merge_status_returns_service_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 317, "end_line": 346, "tags": { "PURPOSE": "Ensure merge status route returns service payload as-is.", "PRE": "git_service.get_merge_status returns unfinished merge payload.", "POST": "Route response contains has_unfinished_merge=True." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_merge_conflicts_passes_resolution_items_to_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 349, "end_line": 383, "tags": { "PURPOSE": "Ensure merge resolve route forwards parsed resolutions to service.", "PRE": "resolve_data has one file strategy.", "POST": "Service receives normalized list and route returns resolved files." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_abort_merge_calls_service_and_returns_result", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 386, "end_line": 407, "tags": { "PURPOSE": "Ensure abort route delegates to service.", "PRE": "Service abort_merge returns aborted status.", "POST": "Route returns aborted status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_continue_merge_passes_message_and_returns_commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 410, "end_line": 437, "tags": { "PURPOSE": "Ensure continue route passes commit message to service.", "PRE": "continue_data.message is provided.", "POST": "Route returns committed status and hash." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_diff", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 68, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_commit_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 87, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 106, "end_line": 106, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 132, "end_line": 132, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 156, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 159, "end_line": 159, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 181, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 184, "end_line": 184, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 206, "end_line": 206, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "configure_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 210, "end_line": 210, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 213, "end_line": 213, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 221, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 224, "end_line": 224, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 228, "end_line": 228, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 267, "end_line": 267, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "configure_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 271, "end_line": 271, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "pull_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 274, "end_line": 274, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 282, "end_line": 282, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 285, "end_line": 285, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 289, "end_line": 289, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_merge_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 323, "end_line": 323, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_merge_conflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 357, "end_line": 357, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "dict", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 364, "end_line": 364, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "abort_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 392, "end_line": 392, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "continue_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 416, "end_line": 416, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 440 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "backend.tests.test_reports_openapi_conformance", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 81, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, openapi, conformance", "PURPOSE": "Validate implemented reports payload shape against OpenAPI-required top-level contract fields.", "LAYER": "Domain (Tests)", "INVARIANT": "List and detail payloads include required contract keys." }, "relations": [ { "type": "TESTS", "target": "specs/020-task-reports-design/contracts/reports-api.openapi.yaml" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 27, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 32, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_reports_list_openapi_required_keys", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_reports_detail_openapi_required_keys", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 65, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.api.routes.test_clean_release_source_policy", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 100, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, api, clean-release, source-policy", "PURPOSE": "Validate API behavior for source isolation violations in clean release preparation.", "LAYER": "Domain", "INVARIANT": "External endpoints must produce blocking violation entries." }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.clean_release" } ], "children": [ { "name": "_repo_with_seed_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_blocks_external_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.api.routes.test_clean_release_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 138, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, api, clean-release, checks, reports", "PURPOSE": "Contract tests for clean release checks and reports endpoints.", "LAYER": "Domain", "INVARIANT": "API returns deterministic payload shapes for checks and reports." }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.clean_release" } ], "children": [ { "name": "_repo_with_seed_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_start_check_and_get_status_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_report_not_found_returns_404", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_report_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_api_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 140, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_tasks_logs", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 73, "tags": { "PURPOSE": "Auto-generated module for backend/src/api/routes/__tests__/test_tasks_logs.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "client", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_logs_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 30, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_logs_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_logs_invalid_limit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_log_stats_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 65, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.test_reports_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 139, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, api, contract, pagination, filtering", "PURPOSE": "Contract tests for GET /api/reports defaults, pagination, and filtering behavior.", "LAYER": "Domain (Tests)", "INVARIANT": "API response contract contains {items,total,page,page_size,has_next,applied_filters}." }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.reports" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 27, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 32, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_reports_default_pagination_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 44, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_reports_filter_and_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 72, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_reports_handles_mixed_naive_and_aware_datetimes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_reports_invalid_filter_returns_400", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.api.routes.__tests__.test_datasets", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 300, "tags": { "COMPLEXITY": "3", "SEMANTICS": "datasets, api, tests, pagination, mapping, docs", "PURPOSE": "Unit tests for Datasets API endpoints", "LAYER": "API", "INVARIANT": "Endpoint contracts remain stable for success and validation failure paths." }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.datasets" } ], "children": [ { "name": "test_get_datasets_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 88, "tags": { "PURPOSE": "Validate successful datasets listing contract for an existing environment.", "TEST": "GET /api/datasets returns 200 and valid schema", "PRE": "env_id exists", "POST": "Response matches DatasetsResponse schema" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 104, "tags": { "TEST": "GET /api/datasets returns 404 if env_id missing", "PRE": "env_id does not exist", "POST": "Returns 404 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_invalid_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 107, "end_line": 132, "tags": { "TEST": "GET /api/datasets returns 400 for invalid page/page_size", "PRE": "page < 1 or page_size > 100", "POST": "Returns 400 error", "TEST_EDGE": "page_size > 100 exceeds max" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_map_columns_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 166, "tags": { "TEST": "POST /api/datasets/map-columns creates mapping task", "PRE": "Valid env_id, dataset_ids, source_type", "POST": "Returns task_id" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_map_columns_invalid_source_type", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 187, "tags": { "TEST": "POST /api/datasets/map-columns returns 400 for invalid source_type", "PRE": "source_type is not 'postgresql' or 'xlsx'", "POST": "Returns 400 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_generate_docs_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 190, "end_line": 221, "tags": { "TEST": "POST /api/datasets/generate-docs creates doc generation task", "PRE": "Valid env_id, dataset_ids, llm_provider", "POST": "Returns task_id" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_map_columns_empty_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 224, "end_line": 240, "tags": { "TEST": "POST /api/datasets/map-columns returns 400 for empty dataset_ids", "PRE": "dataset_ids is empty", "POST": "Returns 400 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_generate_docs_empty_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 243, "end_line": 259, "tags": { "TEST": "POST /api/datasets/generate-docs returns 400 for empty dataset_ids", "PRE": "dataset_ids is empty", "POST": "Returns 400 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_generate_docs_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 262, "end_line": 279, "tags": { "TEST": "POST /api/datasets/generate-docs returns 404 for missing env", "PRE": "env_id does not exist", "POST": "Returns 404 error" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_superset_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 282, "end_line": 297, "tags": { "TEST_EDGE": "external_superset_failure -> {status: 503}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_deps", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 300 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "backend.src.api.routes.__tests__.test_profile_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 298, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, profile, api, preferences, lookup, contract", "PURPOSE": "Verifies profile API route contracts for preference read/update and Superset account lookup.", "LAYER": "API" }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.profile" } ], "children": [ { "name": "mock_profile_route_dependencies", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 53, "tags": { "PURPOSE": "Provides deterministic dependency overrides for profile route tests.", "PRE": "App instance is initialized.", "POST": "Dependencies are overridden for current test and restored afterward." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "profile_route_deps_fixture", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 68, "tags": { "PURPOSE": "Pytest fixture wrapper for profile route dependency overrides.", "PRE": "None.", "POST": "Yields overridden dependencies and clears overrides after test." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_preference_response", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 108, "tags": { "PURPOSE": "Builds stable profile preference response payload for route tests.", "PRE": "user_id is provided.", "POST": "Returns ProfilePreferenceResponse object with deterministic timestamps." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_profile_preferences_returns_self_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 140, "tags": { "PURPOSE": "Verifies GET /api/profile/preferences returns stable self-scoped payload.", "PRE": "Authenticated user context is available.", "POST": "Response status is 200 and payload contains current user preference." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_profile_preferences_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 143, "end_line": 190, "tags": { "PURPOSE": "Verifies PATCH /api/profile/preferences persists valid payload through route mapping.", "PRE": "Valid request payload and authenticated user.", "POST": "Response status is 200 with saved preference payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_profile_preferences_validation_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 193, "end_line": 216, "tags": { "PURPOSE": "Verifies route maps domain validation failure to HTTP 422 with actionable details.", "PRE": "Service raises ProfileValidationError.", "POST": "Response status is 422 and includes validation messages." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_profile_preferences_cross_user_denied", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 219, "end_line": 241, "tags": { "PURPOSE": "Verifies route maps domain authorization guard failure to HTTP 403.", "PRE": "Service raises ProfileAuthorizationError.", "POST": "Response status is 403 with denial message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_lookup_superset_accounts_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 244, "end_line": 277, "tags": { "PURPOSE": "Verifies lookup route returns success payload with normalized candidates.", "PRE": "Valid environment_id and service success response.", "POST": "Response status is 200 and items list is returned." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_lookup_superset_accounts_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 280, "end_line": 296, "tags": { "PURPOSE": "Verifies lookup route maps missing environment to HTTP 404.", "PRE": "Service raises EnvironmentNotFoundError.", "POST": "Response status is 404 with explicit message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.test_reports_detail_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 84, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, api, detail, diagnostics", "PURPOSE": "Contract tests for GET /api/reports/{report_id} detail endpoint behavior.", "LAYER": "Domain (Tests)", "INVARIANT": "Detail endpoint tests must keep deterministic assertions for success and not-found contracts." }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.reports" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 27, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 32, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_report_detail_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_report_detail_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.api.routes.__tests__.test_clean_release_legacy_compat", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 165, "tags": { "COMPLEXITY": "3", "PURPOSE": "Compatibility tests for legacy clean-release API paths retained during v2 migration.", "LAYER": "Tests" }, "relations": [ { "type": "TESTS", "target": "backend.src.api.routes.clean_release" } ], "children": [ { "name": "_seed_legacy_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 111, "tags": { "PURPOSE": "Seed in-memory repository with minimum trusted data for legacy endpoint contracts.", "PRE": "Repository is empty.", "POST": "Candidate, policy, registry and manifest are available for legacy checks flow." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_legacy_prepare_endpoint_still_available", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_legacy_checks_endpoints_still_available", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "test_clean_release_v2_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 93, "tags": { "COMPLEXITY": "3", "PURPOSE": "API contract tests for redesigned clean release endpoints.", "LAYER": "Domain" }, "relations": [], "children": [ { "name": "test_candidate_registration_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_artifact_import_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 43, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_build_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 72, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.api.routes.__tests__.test_assistant_authz", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 306, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, assistant, authz, confirmation, rbac", "PURPOSE": "Verify assistant confirmation ownership, expiration, and deny behavior for restricted users.", "LAYER": "UI (API Tests)", "INVARIANT": "Security-sensitive flows fail closed for unauthorized actors." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.api.routes.assistant" } ], "children": [ { "name": "_run_async", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 39, "tags": { "COMPLEXITY": "1", "PURPOSE": "Execute async endpoint handler in synchronous test context.", "PRE": "coroutine is awaitable endpoint invocation.", "POST": "Returns coroutine result or raises propagated exception." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeTask", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 50, "tags": { "COMPLEXITY": "1", "PURPOSE": "Lightweight task model used for assistant authz tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeTaskManager", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 74, "tags": { "COMPLEXITY": "1", "PURPOSE": "Minimal task manager for deterministic operation creation and lookup." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeConfigManager", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 86, "tags": { "COMPLEXITY": "1", "PURPOSE": "Provide deterministic environment aliases required by intent parsing." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 97, "tags": { "COMPLEXITY": "1", "PURPOSE": "Build admin principal fixture.", "PRE": "Test requires privileged principal for risky operations.", "POST": "Returns admin-like user stub with Admin role." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_other_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 108, "tags": { "COMPLEXITY": "1", "PURPOSE": "Build second admin principal fixture for ownership tests.", "PRE": "Ownership mismatch scenario needs distinct authenticated actor.", "POST": "Returns alternate admin-like user stub." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_limited_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 119, "tags": { "COMPLEXITY": "1", "PURPOSE": "Build limited principal without required assistant execution privileges.", "PRE": "Permission denial scenario needs non-admin actor.", "POST": "Returns restricted user stub." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeQuery", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 151, "tags": { "COMPLEXITY": "1", "PURPOSE": "Minimal chainable query object for fake DB interactions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeDb", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 198, "tags": { "COMPLEXITY": "1", "PURPOSE": "In-memory session substitute for assistant route persistence calls." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_clear_assistant_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 211, "tags": { "COMPLEXITY": "1", "PURPOSE": "Reset assistant process-local state between test cases.", "PRE": "Assistant globals may contain state from prior tests.", "POST": "Assistant in-memory state dictionaries are cleared." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_confirmation_owner_mismatch_returns_403", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 212, "end_line": 247, "tags": { "PURPOSE": "Confirm endpoint should reject requests from user that does not own the confirmation token.", "PRE": "Confirmation token is created by first admin actor.", "POST": "Second actor receives 403 on confirm operation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_expired_confirmation_cannot_be_confirmed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 248, "end_line": 284, "tags": { "PURPOSE": "Expired confirmation token should be rejected and not create task.", "PRE": "Confirmation token exists and is manually expired before confirm request.", "POST": "Confirm endpoint raises 400 and no task is created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_limited_user_cannot_launch_restricted_operation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 285, "end_line": 305, "tags": { "PURPOSE": "Limited user should receive denied state for privileged operation.", "PRE": "Restricted user attempts dangerous deploy command.", "POST": "Assistant returns denied state and does not execute operation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 44, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 64, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 79, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 124, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 127, "end_line": 127, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "order_by", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 130, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 133, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "limit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 139, "end_line": 139, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "offset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 143, "end_line": 143, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 147, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 156, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 170, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 182, "end_line": 182, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 191, "end_line": 191, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "rollback", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 194, "end_line": 194, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 306 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_clean_release_v2_release_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 107, "tags": { "COMPLEXITY": "3", "PURPOSE": "API contract test scaffolding for clean release approval and publication endpoints.", "LAYER": "Domain" }, "relations": [ { "type": "IMPLEMENTS", "target": "clean_release_v2_release_api_contracts" } ], "children": [ { "name": "_seed_candidate_and_passed_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_release_approve_and_publish_revoke_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_release_reject_contract", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 93, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "backend.src.api.routes.__tests__.test_connections_routes", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 72, "tags": { "COMPLEXITY": "3", "PURPOSE": "Verifies connection routes bootstrap their table before CRUD access.", "LAYER": "API" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.api.routes.connections" } ], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_list_connections_bootstraps_missing_table", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_connection_bootstraps_missing_table", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.api.routes.__tests__.test_git_api", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 310, "tags": { "PURPOSE": "API tests for Git configurations and repository operations." }, "relations": [ { "type": "VERIFIES", "target": "src.api.routes.git" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 13, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 37, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_git_configs_masks_pat", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 60, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_git_config_persists_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_update_git_config_modifies_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 112, "end_line": 112, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 113, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_update_git_config_raises_404_if_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 127, "end_line": 127, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_git_config_removes_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 141, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 148, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 149, "end_line": 149, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 150, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 151, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 152, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_test_git_config_validates_connection_successfully", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 167, "end_line": 167, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_test_git_config_fails_validation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 189, "end_line": 189, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_list_gitea_repositories_returns_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 207, "end_line": 207, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_gitea_repositories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 213, "end_line": 213, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_list_gitea_repositories_rejects_non_gitea", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 229, "end_line": 229, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_remote_repository_creates_provider_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 246, "end_line": 246, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_gitlab_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 252, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init_repository_initializes_and_saves_binding", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 276, "end_line": 276, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "init_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 284, "end_line": 284, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 286, "end_line": 286, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 310 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "AssistantApiTests", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 221, "tags": { "C": "3", "SEMANTICS": "tests, assistant, api", "PURPOSE": "Validate assistant API endpoint logic via direct async handler invocation.", "INVARIANT": "Every test clears assistant in-memory state before execution." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.api.routes.assistant" } ], "children": [ { "name": "_run_async", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 25, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeTask", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 40, "tags": {}, "relations": [ { "type": "BINDS_TO", "target": "AssistantApiTests" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeTaskManager", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 63, "tags": {}, "relations": [ { "type": "BINDS_TO", "target": "AssistantApiTests" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeConfigManager", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 85, "tags": {}, "relations": [ { "type": "BINDS_TO", "target": "AssistantApiTests" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_admin_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 88, "end_line": 97, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_limited_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 107, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeQuery", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 138, "tags": {}, "relations": [ { "type": "BINDS_TO", "target": "AssistantApiTests" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeDb", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 166, "tags": {}, "relations": [ { "type": "BINDS_TO", "target": "AssistantApiTests" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_clear_assistant_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 175, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_unknown_command_returns_needs_clarification", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 197, "tags": { "PURPOSE": "Unknown command should return clarification state and unknown intent." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_capabilities_question_returns_successful_help", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 200, "end_line": 216, "tags": { "PURPOSE": "Capability query should return deterministic help response." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 61, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 74, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 113, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "order_by", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 119, "end_line": 119, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "limit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "offset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 126, "end_line": 126, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "first", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 130, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 133, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 144, "end_line": 144, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 147, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 152, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 155, "end_line": 155, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "rollback", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 158, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "refresh", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 164, "end_line": 164, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "backend.src.api.routes.__tests__.test_migration_routes", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 510, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for migration API route handlers.", "LAYER": "API", "TEST_EDGE": "breaking_reference -> validates high risk on missing dataset link" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.api.routes.migration" } ], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_migration_settings_returns_default_cron", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_migration_settings_returns_fallback_when_no_cron", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 84, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_update_migration_settings_saves_cron", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 99, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_update_migration_settings_rejects_missing_cron", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 117, "end_line": 117, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_resource_mappings_returns_formatted_list", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 137, "end_line": 137, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_resource_mappings_respects_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 166, "end_line": 166, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_resource_mappings_search_by_name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 186, "end_line": 186, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_resource_mappings_filter_by_env", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 200, "end_line": 200, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_resource_mappings_filter_by_type", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 214, "end_line": 214, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_mock_env", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 230, "end_line": 230, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_sync_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 243, "end_line": 243, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_trigger_sync_now_creates_env_row_and_syncs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 257, "end_line": 257, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_trigger_sync_now_rejects_empty_environments", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 287, "end_line": 287, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_trigger_sync_now_handles_partial_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 301, "end_line": 301, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_trigger_sync_now_idempotent_env_upsert", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 331, "end_line": 331, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 350, "end_line": 350, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_invalid_env_raises_404", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 364, "end_line": 364, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_execute_migration_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 375, "end_line": 375, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_execute_migration_invalid_env_raises_400", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 394, "end_line": 394, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dry_run_migration_returns_diff_and_risk", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 411, "end_line": 411, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dry_run_migration_rejects_same_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 489, "end_line": 489, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 510 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.4 } }, { "name": "backend.src.models.config", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "5", "SEMANTICS": "database, config, settings, sqlalchemy, notification", "PURPOSE": "Defines SQLAlchemy persistence models for application and notification configuration records.", "LAYER": "Domain", "INVARIANT": "Configuration payload and notification credentials must remain persisted as non-null JSON documents." }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy" }, { "type": "DEPENDS_ON", "target": "backend.src.models.mapping:Base" } ], "children": [ { "name": "AppConfigRecord", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 17, "end_line": 31, "tags": { "PURPOSE": "Stores persisted application configuration as a single authoritative record model.", "PRE": "SQLAlchemy declarative Base is initialized and table metadata registration is active.", "POST": "ORM table 'app_configurations' exposes id, payload, and updated_at fields with declared nullability/default semantics.", "SIDE_EFFECT": "Registers ORM mapping metadata during module import.", "DATA_CONTRACT": "Input -> persistence row {id:str, payload:json, updated_at:datetime}; Output -> AppConfigRecord ORM entity." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 17 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 17 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 17 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 17 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 17 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 17 } ], "score": 0.0 } }, { "name": "NotificationConfig", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 33, "end_line": 49, "tags": { "PURPOSE": "Stores persisted provider-level notification configuration and encrypted credentials metadata.", "PRE": "SQLAlchemy declarative Base is initialized and uuid generation is available at instance creation time.", "POST": "ORM table 'notification_configs' exposes id, type, name, credentials, is_active, created_at, updated_at fields with declared constraints/defaults.", "SIDE_EFFECT": "Registers ORM mapping metadata during module import; may generate UUID values for new entity instances.", "DATA_CONTRACT": "Input -> persistence row {id:str, type:str, name:str, credentials:json, is_active:bool, created_at:datetime, updated_at:datetime}; Output -> NotificationConfig ORM entity." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 33 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 33 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 33 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 33 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 33 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 33 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.models.llm", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 68, "tags": { "COMPLEXITY": "3", "SEMANTICS": "llm, models, sqlalchemy, persistence", "PURPOSE": "SQLAlchemy models for LLM provider configuration and validation results.", "LAYER": "Domain" }, "relations": [ { "type": "INHERITS_FROM", "target": "backend.src.models.mapping.Base" } ], "children": [ { "name": "ValidationPolicy", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 34, "tags": { "PURPOSE": "Defines a scheduled rule for validating a group of dashboards within an execution window." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMProvider", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 49, "tags": { "PURPOSE": "SQLAlchemy model for LLM provider configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationRecord", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 66, "tags": { "PURPOSE": "SQLAlchemy model for dashboard validation history." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "generate_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 13, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: INHERITS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "GitModels", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 74, "tags": { "COMPLEXITY": "1", "SEMANTICS": "git, models, sqlalchemy, database, schema", "PURPOSE": "Git-specific SQLAlchemy models for configuration and repository tracking.", "LAYER": "Model", "RELATION": "specs/011-git-integration-dashboard/data-model.md" }, "relations": [], "children": [ { "name": "GitServerConfig", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 44, "tags": { "COMPLEXITY": "1", "PURPOSE": "Configuration for a Git server connection." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "GitRepository", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 59, "tags": { "COMPLEXITY": "1", "PURPOSE": "Tracking for a local Git repository linked to a dashboard." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DeploymentEnvironment", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 72, "tags": { "COMPLEXITY": "1", "PURPOSE": "Target Superset environments for dashboard deployment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.models.task", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 116, "tags": { "COMPLEXITY": "1", "SEMANTICS": "database, task, record, sqlalchemy, sqlite", "PURPOSE": "Defines the database schema for task execution records.", "LAYER": "Domain", "INVARIANT": "All primary keys are UUID strings." }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy" } ], "children": [ { "name": "TaskRecord", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 35, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents a persistent record of a task execution." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TaskLogRecord", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 37, "end_line": 114, "tags": { "PURPOSE": "Represents a single persistent log entry for a task.", "COMPLEXITY": "5", "INVARIANT": "Each log entry belongs to exactly one task.", "TEST_CONTRACT": "TaskLogCreate ->", "TEST_FIXTURE": "basic_info_log ->", "TEST_EDGE": "empty_message ->", "TEST_INVARIANT": "exact_one_task_association -> verifies: [basic_info_log, missing_required_field]" }, "relations": [ { "type": "DEPENDS_ON", "target": "TaskRecord" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 37 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.models.connection", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 36, "tags": { "COMPLEXITY": "1", "SEMANTICS": "database, connection, configuration, sqlalchemy, sqlite", "PURPOSE": "Defines the database schema for external database connection configurations.", "LAYER": "Domain", "INVARIANT": "All primary keys are UUID strings." }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy" } ], "children": [ { "name": "ConnectionConfig", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 34, "tags": { "COMPLEXITY": "1", "PURPOSE": "Stores credentials for external databases used for column mapping." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MappingModels", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 102, "tags": { "TIER": "STANDARD", "COMPLEXITY": "3", "SEMANTICS": "database, mapping, environment, migration, sqlalchemy, sqlite", "PURPOSE": "Defines the database schema for environment metadata and database mappings using SQLAlchemy.", "LAYER": "Domain", "INVARIANT": "All primary keys are UUID strings.", "CONSTRAINT": "source_env_id and target_env_id must be valid environment IDs." }, "relations": [ { "type": "DEPENDS_ON", "target": "sqlalchemy" } ], "children": [ { "name": "ResourceType", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 30, "tags": { "COMPLEXITY": "1", "PURPOSE": "Enumeration of possible Superset resource types for ID mapping." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "MigrationStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 42, "tags": { "COMPLEXITY": "1", "PURPOSE": "Enumeration of possible migration job statuses." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "Environment", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 44, "end_line": 54, "tags": { "COMPLEXITY": "3", "PURPOSE": "Represents a Superset instance environment." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 44 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 44 } ], "score": 0.5499999999999999 } }, { "name": "DatabaseMapping", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 56, "end_line": 70, "tags": { "COMPLEXITY": "3", "PURPOSE": "Represents a mapping between source and target databases." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 } ], "score": 0.5499999999999999 } }, { "name": "MigrationJob", "type": "Class", "complexity": 2, "tier": "TRIVIAL", "start_line": 72, "end_line": 84, "tags": { "COMPLEXITY": "2", "PURPOSE": "Represents a single migration execution job." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ResourceMapping", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 86, "end_line": 100, "tags": { "COMPLEXITY": "3", "PURPOSE": "Maps a universal UUID for a resource to its actual ID on a specific environment.", "TEST_DATA": "resource_mapping_record -> {'environment_id': 'prod-env-1', 'resource_type': 'chart', 'uuid': '123e4567-e89b-12d3-a456-426614174000', 'remote_integer_id': '42'}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 86 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 86 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.models.report", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 235, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, models, pydantic, normalization, pagination", "PURPOSE": "Canonical report schemas for unified task reporting across heterogeneous task types.", "LAYER": "Domain", "PRE": "Pydantic library and task manager models are available.", "POST": "Provides validated schemas for cross-plugin reporting and UI consumption.", "SIDE_EFFECT": "None (schema definition).", "DATA_CONTRACT": "Model[TaskReport, ReportCollection, ReportDetailView]", "INVARIANT": "Canonical report fields are always present for every report item." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.models" } ], "children": [ { "name": "TaskType", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 22, "end_line": 34, "tags": { "COMPLEXITY": "5", "INVARIANT": "Must contain valid generic task type mappings.", "SEMANTICS": "enum, type, task", "PURPOSE": "Supported normalized task report types." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 22 } ], "score": 0.0 } }, { "name": "ReportStatus", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 37, "end_line": 47, "tags": { "COMPLEXITY": "5", "INVARIANT": "TaskStatus enum mapping logic holds.", "SEMANTICS": "enum, status, task", "PURPOSE": "Supported normalized report status values." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 37 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 37 } ], "score": 0.0 } }, { "name": "ErrorContext", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 50, "end_line": 72, "tags": { "COMPLEXITY": "5", "INVARIANT": "The properties accurately describe error state.", "SEMANTICS": "error, context, payload", "PURPOSE": "Error and recovery context for failed/partial reports.", "TEST_CONTRACT": "ErrorContextModel ->", "TEST_FIXTURE": "basic_error -> {\"message\": \"Connection timeout\", \"code\": \"ERR_504\", \"next_actions\": [\"retry\"]}", "TEST_EDGE": "missing_message -> {\"code\": \"ERR_504\"}" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 50 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 50 } ], "score": 0.0 } }, { "name": "TaskReport", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 75, "end_line": 129, "tags": { "COMPLEXITY": "5", "INVARIANT": "Must represent canonical task record attributes.", "SEMANTICS": "report, model, summary", "PURPOSE": "Canonical normalized report envelope for one task execution.", "TEST_CONTRACT": "TaskReportModel ->", "TEST_FIXTURE": "valid_task_report ->", "TEST_EDGE": "invalid_task_type -> {\"report_id\": \"rep-123\", \"task_id\": \"task-456\", \"task_type\": \"invalid_type\", \"status\": \"success\", \"updated_at\": \"2026-02-26T12:00:00Z\", \"summary\": \"Done\"}", "TEST_INVARIANT": "non_empty_validators -> verifies: [empty_report_id, empty_summary]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 75 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 75 } ], "score": 0.0 } }, { "name": "ReportQuery", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 132, "end_line": 187, "tags": { "COMPLEXITY": "5", "INVARIANT": "Time and pagination queries are mutually consistent.", "SEMANTICS": "query, filter, search", "PURPOSE": "Query object for server-side report filtering, sorting, and pagination.", "TEST_CONTRACT": "ReportQueryModel ->", "TEST_FIXTURE": "valid_query -> {\"page\": 1, \"page_size\":20, \"sort_by\": \"updated_at\", \"sort_order\": \"desc\"}", "TEST_EDGE": "invalid_time_range -> {\"time_from\": \"2026-02-26T12:00:00Z\", \"time_to\": \"2026-02-25T12:00:00Z\"}", "TEST_INVARIANT": "attribute_constraints_enforced -> verifies: [invalid_page_size_large, invalid_sort_by, invalid_time_range]" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 132 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 132 } ], "score": 0.0 } }, { "name": "ReportCollection", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 190, "end_line": 212, "tags": { "COMPLEXITY": "5", "INVARIANT": "Represents paginated data correctly.", "SEMANTICS": "collection, pagination", "PURPOSE": "Paginated collection of normalized task reports.", "TEST_CONTRACT": "ReportCollectionModel ->", "TEST_FIXTURE": "empty_collection -> {\"items\": [], \"total\": 0, \"page\": 1, \"page_size\": 20, \"has_next\": False, \"applied_filters\": {}}", "TEST_EDGE": "negative_total -> {\"items\": [], \"total\": -5, \"page\": 1, \"page_size\": 20, \"has_next\": False, \"applied_filters\": {}}" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 190 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 190 } ], "score": 0.0 } }, { "name": "ReportDetailView", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 215, "end_line": 233, "tags": { "COMPLEXITY": "5", "INVARIANT": "Incorporates a report and logs correctly.", "SEMANTICS": "view, detail, logs", "PURPOSE": "Detailed report representation including diagnostics and recovery actions.", "TEST_CONTRACT": "ReportDetailViewModel ->", "TEST_FIXTURE": "valid_detail -> {\"report\": {\"report_id\": \"rep-1\", \"task_id\": \"task-1\", \"task_type\": \"backup\", \"status\": \"success\", \"updated_at\": \"2026-02-26T12:00:00Z\", \"summary\": \"Done\"}}", "TEST_EDGE": "missing_report -> {}" }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 215 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 215 } ], "score": 0.0 } }, { "name": "_non_empty_str", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 125, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_sort_by", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 169, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_sort_order", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 177, "end_line": 177, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_time_range", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9666666666666667 } }, { "name": "backend.src.models.assistant", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 74, "tags": { "COMPLEXITY": "3", "SEMANTICS": "assistant, audit, confirmation, chat", "PURPOSE": "SQLAlchemy models for assistant audit trail and confirmation tokens.", "LAYER": "Domain", "INVARIANT": "Assistant records preserve immutable ids and creation timestamps." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.mapping" } ], "children": [ { "name": "AssistantAuditRecord", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 16, "end_line": 32, "tags": { "COMPLEXITY": "3", "PURPOSE": "Store audit decisions and outcomes produced by assistant command handling.", "PRE": "user_id must identify the actor for every record.", "POST": "Audit payload remains available for compliance and debugging." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 16 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 16 } ], "score": 0.5499999999999999 } }, { "name": "AssistantMessageRecord", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 35, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist chat history entries for assistant conversations.", "PRE": "user_id, conversation_id, role and text must be present.", "POST": "Message row can be queried in chronological order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 35 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 35 } ], "score": 0.5499999999999999 } }, { "name": "AssistantConfirmationRecord", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 56, "end_line": 73, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist risky operation confirmation tokens with lifecycle state.", "PRE": "intent/dispatch and expiry timestamp must be provided.", "POST": "State transitions can be tracked and audited." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.models.storage", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 44, "tags": { "COMPLEXITY": "1", "SEMANTICS": "storage, file, model, pydantic", "PURPOSE": "Data models for the storage system.", "LAYER": "Domain" }, "relations": [], "children": [ { "name": "FileCategory", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 18, "tags": { "COMPLEXITY": "1", "PURPOSE": "Enumeration of supported file categories in the storage system." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StorageConfig", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 30, "tags": { "COMPLEXITY": "1", "PURPOSE": "Configuration model for the storage system, defining paths and naming patterns." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StoredFile", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 42, "tags": { "COMPLEXITY": "1", "PURPOSE": "Data model representing metadata for a file stored in the system." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.models.dashboard", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 32, "tags": { "COMPLEXITY": "3", "SEMANTICS": "dashboard, model, metadata, migration", "PURPOSE": "Defines data models for dashboard metadata and selection.", "LAYER": "Model" }, "relations": [ { "type": "USED_BY", "target": "backend.src.api.routes.migration" } ], "children": [ { "name": "DashboardMetadata", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 19, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents a dashboard available for migration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardSelection", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 30, "tags": { "COMPLEXITY": "1", "PURPOSE": "Represents the user's selection of dashboards to migrate." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.models.clean_release", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 440, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, models, lifecycle, compliance, evidence, immutability", "PURPOSE": "Define canonical clean release domain entities and lifecycle guards.", "LAYER": "Domain", "PRE": "Base mapping model and release enums are available.", "POST": "Provides SQLAlchemy and dataclass definitions for governance domain.", "SIDE_EFFECT": "None (schema definition).", "DATA_CONTRACT": "Model[ReleaseCandidate, CandidateArtifact, DistributionManifest, ComplianceRun, ComplianceReport]", "INVARIANT": "Immutable snapshots are never mutated; forbidden lifecycle transitions are rejected." }, "relations": [], "children": [ { "name": "CheckFinalStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 31, "tags": { "PURPOSE": "Backward-compatible final status enum for legacy TUI/orchestrator tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CheckStageName", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 40, "tags": { "PURPOSE": "Backward-compatible stage name enum for legacy TUI/orchestrator tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CheckStageStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 49, "tags": { "PURPOSE": "Backward-compatible stage status enum for legacy TUI/orchestrator tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CheckStageResult", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 58, "tags": { "PURPOSE": "Backward-compatible stage result container for legacy TUI/orchestrator tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ProfileType", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 64, "tags": { "PURPOSE": "Backward-compatible profile enum for legacy TUI bootstrap logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "RegistryStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 71, "tags": { "PURPOSE": "Backward-compatible registry status enum for legacy TUI bootstrap logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ReleaseCandidateStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 87, "tags": { "PURPOSE": "Backward-compatible release candidate status enum for legacy TUI." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ResourceSourceEntry", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 98, "tags": { "PURPOSE": "Backward-compatible source entry model for legacy TUI bootstrap logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ResourceSourceRegistry", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 114, "tags": { "PURPOSE": "Backward-compatible source registry model for legacy TUI bootstrap logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanProfilePolicy", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 136, "tags": { "PURPOSE": "Backward-compatible policy model for legacy TUI bootstrap logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceCheckRun", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 149, "tags": { "PURPOSE": "Backward-compatible run model for legacy TUI typing/import compatibility." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ReleaseCandidate", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 197, "tags": { "PURPOSE": "Represents the release unit being prepared and governed.", "PRE": "id, version, source_snapshot_ref are non-empty.", "POST": "status advances only through legal transitions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CandidateArtifact", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 199, "end_line": 214, "tags": { "PURPOSE": "Represents one artifact associated with a release candidate." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ManifestItem", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 216, "end_line": 224, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ManifestSummary", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 226, "end_line": 232, "tags": {}, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DistributionManifest", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 234, "end_line": 295, "tags": { "PURPOSE": "Immutable snapshot of the candidate payload.", "INVARIANT": "Immutable after creation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SourceRegistrySnapshot", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 297, "end_line": 310, "tags": { "PURPOSE": "Immutable registry snapshot for allowed sources." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanPolicySnapshot", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 312, "end_line": 324, "tags": { "PURPOSE": "Immutable policy snapshot used to evaluate a run." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceRun", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 326, "end_line": 349, "tags": { "PURPOSE": "Operational record for one compliance execution." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceStageRun", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 351, "end_line": 364, "tags": { "PURPOSE": "Stage-level execution record inside a run." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceViolation", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 366, "end_line": 380, "tags": { "PURPOSE": "Violation produced by a stage." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceReport", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 382, "end_line": 395, "tags": { "PURPOSE": "Immutable result derived from a completed run.", "INVARIANT": "Immutable after creation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ApprovalDecision", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 397, "end_line": 409, "tags": { "PURPOSE": "Approval or rejection bound to a candidate and report." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "PublicationRecord", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 411, "end_line": 424, "tags": { "PURPOSE": "Publication or revocation record." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanReleaseAuditLog", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 426, "end_line": 438, "tags": { "PURPOSE": "Represents a persistent audit log entry for clean release actions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 112, "end_line": 112, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 130, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "registry_snapshot_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 134, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "candidate_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 168, "end_line": 168, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "transition_to", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 171, "end_line": 171, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 252, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "check_run_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 347, "end_line": 347, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 440 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.31666666666666665 } }, { "name": "AuthModels", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 108, "tags": { "TIER": "STANDARD", "COMPLEXITY": "3", "SEMANTICS": "auth, models, user, role, permission, sqlalchemy", "PURPOSE": "SQLAlchemy models for multi-user authentication and authorization.", "LAYER": "Domain", "INVARIANT": "Usernames and emails must be unique." }, "relations": [ { "type": "INHERITS_FROM", "target": "Base" } ], "children": [ { "name": "generate_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 25, "tags": { "PURPOSE": "Generates a unique UUID string.", "POST": "Returns a string representation of a new UUID." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "user_roles", "type": "Table", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 35, "tags": { "PURPOSE": "Association table for many-to-many relationship between Users and Roles." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "role_permissions", "type": "Table", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 45, "tags": { "PURPOSE": "Association table for many-to-many relationship between Roles and Permissions." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "User", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 47, "end_line": 65, "tags": { "PURPOSE": "Represents an identity that can authenticate to the system." }, "relations": [ { "type": "HAS_MANY", "target": "Role (via user_roles)" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 47 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 47 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 47 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 47 } ], "score": 0.0 } }, { "name": "Role", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 67, "end_line": 80, "tags": { "PURPOSE": "Represents a collection of permissions." }, "relations": [ { "type": "HAS_MANY", "target": "User (via user_roles)" }, { "type": "HAS_MANY", "target": "Permission (via role_permissions)" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 67 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 67 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 67 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 67 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 67 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 67 } ], "score": 0.0 } }, { "name": "Permission", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 82, "end_line": 93, "tags": { "PURPOSE": "Represents a specific capability within the system." }, "relations": [ { "type": "HAS_MANY", "target": "Role (via role_permissions)" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 82 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 82 }, { "message": "Invalid @RELATION predicate: HAS_MANY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 82 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 82 } ], "score": 0.0 } }, { "name": "ADGroupMapping", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 95, "end_line": 106, "tags": { "PURPOSE": "Maps an Active Directory group to a local System Role." }, "relations": [ { "type": "DEPENDS_ON", "target": "Role" } ], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 95 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 95 } ], "score": 0.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: INHERITS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "ProfileModels", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 61, "tags": { "TIER": "STANDARD", "COMPLEXITY": "3", "SEMANTICS": "profile, preferences, persistence, user, dashboard-filter, git, ui-preferences, sqlalchemy", "PURPOSE": "Defines persistent per-user profile settings for dashboard filter, Git identity/token, and UX preferences.", "LAYER": "Domain", "INVARIANT": "Sensitive Git token is stored encrypted and never returned in plaintext." }, "relations": [ { "type": "DEPENDS_ON", "target": "AuthModels" }, { "type": "INHERITS_FROM", "target": "Base" } ], "children": [ { "name": "UserDashboardPreference", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 23, "end_line": 59, "tags": { "COMPLEXITY": "3", "PURPOSE": "Stores Superset username binding and default \"my dashboards\" toggle for one authenticated user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 23 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 23 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: INHERITS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "src.models", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Domain model package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_models", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 36, "tags": { "COMPLEXITY": "1", "PURPOSE": "Unit tests for data models", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "src.models" } ], "children": [ { "name": "test_environment_model", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 33, "tags": { "PURPOSE": "Tests that Environment model correctly stores values.", "PRE": "Environment class is available.", "POST": "Values are verified." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "test_report_models", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 235, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for report Pydantic models and their validators", "LAYER": "Domain" }, "relations": [ { "type": "TESTS", "target": "backend.src.models.report" } ], "children": [ { "name": "test_enum_values", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enum_values", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 30, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_creation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_minimal_creation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_creation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_empty_report_id_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_whitespace_report_id_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_empty_task_id_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_empty_summary_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_summary_whitespace_trimmed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 93, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_optional_fields", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 97, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_with_error_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_defaults", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_invalid_sort_by_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 124, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_sort_by_values", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_invalid_sort_order_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_sort_order_values", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 140, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_time_range_validation_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 146, "end_line": 146, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_time_range_validation_invalid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 152, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_page_ge_1", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 158, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_page_size_bounds", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 163, "end_line": 163, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_creation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 174, "end_line": 174, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_with_items", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 187, "end_line": 187, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_valid_creation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 205, "end_line": 205, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_with_all_fields", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 218, "end_line": 218, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "test_clean_release", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 149, "tags": { "PURPOSE": "Auto-generated module for backend/src/models/__tests__/test_clean_release.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "valid_candidate_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_release_candidate_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 39, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_release_candidate_empty_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 44, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "valid_policy_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enterprise_policy_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 64, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enterprise_policy_missing_prohibited", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enterprise_policy_external_allowed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_count_mismatch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_compliant_run_validation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_validation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 133, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.profile_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 754, "tags": { "COMPLEXITY": "5", "SEMANTICS": "profile, service, validation, ownership, filtering, superset, preferences", "PURPOSE": "Orchestrates profile preference persistence, Superset account lookup, and deterministic actor matching.", "LAYER": "Domain", "INVARIANT": "Username normalization is trim+lower and shared by save and matching paths.", "TEST_CONTRACT": "ProfilePreferenceUpdateRequest -> ProfilePreferenceResponse", "TEST_FIXTURE": "valid_profile_update -> {\"user_id\":\"u-1\",\"superset_username\":\"John_Doe\",\"show_only_my_dashboards\":true}", "TEST_EDGE": "lookup_env_not_found -> unknown environment_id returns not found", "TEST_INVARIANT": "normalization_consistency -> VERIFIED_BY: [valid_profile_update, enable_without_username]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.profile" }, { "type": "DEPENDS_ON", "target": "backend.src.schemas.profile" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client" }, { "type": "DEPENDS_ON", "target": "backend.src.core.auth.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.models.auth" }, { "type": "DEPENDS_ON", "target": "sqlalchemy.orm.Session" } ], "children": [ { "name": "ProfileValidationError", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 53, "end_line": 60, "tags": { "COMPLEXITY": "3", "PURPOSE": "Domain validation error for profile preference update requests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 53 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 53 } ], "score": 0.5499999999999999 } }, { "name": "EnvironmentNotFoundError", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 63, "end_line": 68, "tags": { "COMPLEXITY": "3", "PURPOSE": "Raised when environment_id from lookup request is unknown in app configuration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 63 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 63 } ], "score": 0.5499999999999999 } }, { "name": "ProfileAuthorizationError", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 71, "end_line": 76, "tags": { "COMPLEXITY": "3", "PURPOSE": "Raised when caller attempts cross-user preference mutation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 } ], "score": 0.5499999999999999 } }, { "name": "ProfileService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 79, "end_line": 752, "tags": { "COMPLEXITY": "5", "PURPOSE": "Implements profile preference read/update flow and Superset account lookup degradation strategy." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 83, "end_line": 93, "tags": { "PURPOSE": "Initialize service with DB session and config manager.", "PRE": "db session is active and config_manager supports get_environments().", "POST": "Service is ready for preference persistence and lookup operations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_my_preference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 118, "tags": { "PURPOSE": "Return current user's persisted preference or default non-configured view.", "PRE": "current_user is authenticated.", "POST": "Returned payload belongs to current_user only." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboard_filter_binding", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 145, "tags": { "PURPOSE": "Return only dashboard-filter fields required by dashboards listing hot path.", "PRE": "current_user is authenticated.", "POST": "Returns normalized username and profile-default filter toggles without security summary expansion." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "update_my_preference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 278, "tags": { "PURPOSE": "Validate and persist current user's profile preference in self-scoped mode.", "PRE": "current_user is authenticated and payload is provided.", "POST": "Preference row for current_user is created/updated when validation passes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "lookup_superset_accounts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 280, "end_line": 354, "tags": { "PURPOSE": "Query Superset users in selected environment and project canonical account candidates.", "PRE": "current_user is authenticated and environment_id exists.", "POST": "Returns success payload or degraded payload with warning while preserving manual fallback." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "matches_dashboard_actor", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 356, "end_line": 378, "tags": { "PURPOSE": "Apply trim+case-insensitive actor match across owners OR modified_by.", "PRE": "bound_username can be empty; owners may contain mixed payload.", "POST": "Returns True when normalized username matches owners or modified_by." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_security_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 380, "end_line": 438, "tags": { "PURPOSE": "Build read-only security snapshot with role and permission badges.", "PRE": "current_user is authenticated.", "POST": "Returns deterministic security projection for profile UI." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_collect_user_permission_pairs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 440, "end_line": 455, "tags": { "PURPOSE": "Collect effective permission tuples from current user's roles.", "PRE": "current_user can include role/permission graph.", "POST": "Returns unique normalized (resource, ACTION) tuples." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_format_permission_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 457, "end_line": 467, "tags": { "PURPOSE": "Convert normalized permission pair to compact UI key.", "PRE": "resource and action are normalized.", "POST": "Returns user-facing badge key." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_to_preference_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 469, "end_line": 523, "tags": { "PURPOSE": "Map ORM preference row to API DTO with token metadata.", "PRE": "preference row can contain nullable optional fields.", "POST": "Returns normalized ProfilePreference object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_mask_secret_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 525, "end_line": 536, "tags": { "PURPOSE": "Build a safe display value for sensitive secrets.", "PRE": "secret may be None or plaintext.", "POST": "Returns masked representation or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sanitize_text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 538, "end_line": 547, "tags": { "PURPOSE": "Normalize optional text into trimmed form or None.", "PRE": "value may be empty or None.", "POST": "Returns trimmed value or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sanitize_secret", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 549, "end_line": 560, "tags": { "PURPOSE": "Normalize secret input into trimmed form or None.", "PRE": "value may be None or blank.", "POST": "Returns trimmed secret or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_start_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 562, "end_line": 573, "tags": { "PURPOSE": "Normalize supported start page aliases to canonical values.", "PRE": "value may be None or alias.", "POST": "Returns one of SUPPORTED_START_PAGES." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_density", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 575, "end_line": 586, "tags": { "PURPOSE": "Normalize supported density aliases to canonical values.", "PRE": "value may be None or alias.", "POST": "Returns one of SUPPORTED_DENSITIES." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 588, "end_line": 598, "tags": { "PURPOSE": "Resolve environment model from configured environments by id.", "PRE": "environment_id is provided.", "POST": "Returns environment object when found else None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_preference_row", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 600, "end_line": 606, "tags": { "PURPOSE": "Return persisted preference row for user or None.", "PRE": "user_id is provided.", "POST": "Returns matching row or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_or_create_preference_row", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 608, "end_line": 617, "tags": { "PURPOSE": "Return existing preference row or create new unsaved row.", "PRE": "user_id is provided.", "POST": "Returned row always contains user_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_default_preference", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 619, "end_line": 644, "tags": { "PURPOSE": "Build non-persisted default preference DTO for unconfigured users.", "PRE": "user_id is provided.", "POST": "Returns ProfilePreference with disabled toggle and empty username." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_validate_update_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 646, "end_line": 696, "tags": { "PURPOSE": "Validate username/toggle constraints for preference mutation.", "PRE": "payload is provided.", "POST": "Returns validation errors list; empty list means valid." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sanitize_username", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 698, "end_line": 704, "tags": { "PURPOSE": "Normalize raw username into trimmed form or None for empty input.", "PRE": "value can be empty or None.", "POST": "Returns trimmed username or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_username", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 706, "end_line": 715, "tags": { "PURPOSE": "Apply deterministic trim+lower normalization for actor matching.", "PRE": "value can be empty or None.", "POST": "Returns lowercase normalized token or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_owner_tokens", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 717, "end_line": 751, "tags": { "PURPOSE": "Normalize owners payload into deduplicated lower-cased tokens.", "PRE": "owners can be iterable of scalars or dict-like values.", "POST": "Returns list of unique normalized owner tokens." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 79 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 79 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 754 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.resource_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": null, "tags": { "COMPLEXITY": "3", "SEMANTICS": "service, resources, dashboards, datasets, tasks, git", "PURPOSE": "Shared service for fetching resource data with Git status and task status", "LAYER": "Service", "INVARIANT": "All resources include metadata about their current state" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DEPENDS_ON", "target": "TaskManagerPackage" }, { "type": "DEPENDS_ON", "target": "TaskManagerModels" }, { "type": "DEPENDS_ON", "target": "backend.src.services.git_service.GitService" } ], "children": [ { "name": "backend.src.services.resource_service.ResourceService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 21, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Provides centralized access to resource data with enhanced metadata" }, "relations": [], "children": [ { "name": "backend.src.services.resource_service.ResourceService.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 35, "tags": { "COMPLEXITY": "1", "PURPOSE": "Initialize the resource service with dependencies", "PRE": "None", "POST": "ResourceService is ready to fetch resources" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.resource_service.ResourceService.get_dashboards_with_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 37, "end_line": null, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch dashboards from environment with Git status and last task status", "PRE": "env is a valid Environment object", "POST": "Returns list of dashboards with enhanced metadata", "PARAM": "tasks (List[Task]) - List of tasks to check for status", "RETURN": "List[Dict] - Dashboards with git_status and last_task fields" }, "relations": [ { "type": "CALLS", "target": "backend.src.core.superset_client.SupersetClient.get_dashboards_summary" }, { "type": "CALLS", "target": "backend.src.services.resource_service.ResourceService._get_git_status_for_dashboard" }, { "type": "CALLS", "target": "backend.src.services.resource_service.ResourceService._get_last_llm_task_for_dashboard" } ], "children": [ { "name": "get_dashboards_page_with_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 87, "end_line": 149, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch one dashboard page from environment and enrich only that page with status metadata.", "PRE": "env is valid; page >= 1; page_size > 0.", "POST": "Returns page items plus total counters without scanning all pages locally.", "PARAM": "page_size (int) - Page size.", "RETURN": "Dict[str, Any] - {\"dashboards\": List[Dict], \"total\": int, \"total_pages\": int}" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 87 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 87 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 87 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 87 } ], "score": 0.25 } }, { "name": "_get_last_llm_task_for_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 151, "end_line": 230, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get most recent LLM validation task for a dashboard in an environment", "PRE": "dashboard_id is a valid integer identifier", "POST": "Returns the newest llm_dashboard_validation task summary or None", "PARAM": "tasks (Optional[List[Task]]) - List of tasks to search", "RETURN": "Optional[Dict] - Task summary with task_id and status" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 151 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 151 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 151 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 151 } ], "score": 0.25 } }, { "name": "_normalize_task_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 232, "end_line": 247, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize task status to stable uppercase values for UI/API projections", "PRE": "raw_status can be enum or string", "POST": "Returns uppercase status without enum class prefix", "PARAM": "raw_status (Any) - Raw task status object/value", "RETURN": "str - Normalized status token" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 232 } ], "score": 0.25 } }, { "name": "_normalize_validation_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 249, "end_line": 263, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize LLM validation status to PASS/FAIL/WARN/UNKNOWN", "PRE": "raw_status can be any scalar type", "POST": "Returns normalized validation status token or None", "PARAM": "raw_status (Any) - Raw validation status from task result", "RETURN": "Optional[str] - PASS|FAIL|WARN|UNKNOWN" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 249 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 249 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 249 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 249 } ], "score": 0.25 } }, { "name": "_normalize_datetime_for_compare", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 265, "end_line": 278, "tags": { "COMPLEXITY": "3", "PURPOSE": "Normalize datetime values to UTC-aware values for safe comparisons.", "PRE": "value may be datetime or any scalar.", "POST": "Returns UTC-aware datetime; non-datetime values map to minimal UTC datetime.", "PARAM": "value (Any) - Candidate datetime-like value.", "RETURN": "datetime - UTC-aware comparable datetime." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 265 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 265 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 265 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 265 } ], "score": 0.25 } }, { "name": "get_datasets_with_status", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 280, "end_line": 317, "tags": { "COMPLEXITY": "3", "PURPOSE": "Fetch datasets from environment with mapping progress and last task status", "PRE": "env is a valid Environment object", "POST": "Returns list of datasets with enhanced metadata", "PARAM": "tasks (List[Task]) - List of tasks to check for status", "RETURN": "List[Dict] - Datasets with mapped_fields and last_task fields" }, "relations": [ { "type": "CALLS", "target": "SupersetClient:get_datasets_summary" }, { "type": "CALLS", "target": "self:_get_last_task_for_resource" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "get_activity_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 319, "end_line": 357, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get summary of active and recent tasks for the activity indicator", "PRE": "tasks is a list of Task objects", "POST": "Returns summary with active_count and recent_tasks", "PARAM": "tasks (List[Task]) - List of tasks to summarize", "RETURN": "Dict - Activity summary" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 319 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 319 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 319 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 319 } ], "score": 0.25 } }, { "name": "_get_git_status_for_dashboard", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 359, "end_line": 417, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get Git sync status for a dashboard", "PRE": "dashboard_id is a valid integer", "POST": "Returns git status or None if no repo exists", "PARAM": "dashboard_id (int) - The dashboard ID", "RETURN": "Optional[Dict] - Git status with branch and sync_status" }, "relations": [ { "type": "CALLS", "target": "GitService:get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "_get_last_task_for_resource", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 419, "end_line": 455, "tags": { "COMPLEXITY": "3", "PURPOSE": "Get the most recent task for a specific resource", "PRE": "resource_id is a valid string", "POST": "Returns task summary or None if no tasks found", "PARAM": "tasks (Optional[List[Task]]) - List of tasks to search", "RETURN": "Optional[Dict] - Task summary with task_id and status" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 419 } ], "score": 0.25 } }, { "name": "_extract_resource_name_from_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 457, "end_line": 467, "tags": { "COMPLEXITY": "3", "PURPOSE": "Extract resource name from task params", "PRE": "task is a valid Task object", "POST": "Returns resource name or task ID", "PARAM": "task (Task) - The task to extract from", "RETURN": "str - Resource name or fallback" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 457 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 457 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 457 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 457 } ], "score": 0.25 } }, { "name": "_extract_resource_type_from_task", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 469, "end_line": 479, "tags": { "COMPLEXITY": "3", "PURPOSE": "Extract resource type from task params", "PRE": "task is a valid Task object", "POST": "Returns resource type or 'unknown'", "PARAM": "task (Task) - The task to extract from", "RETURN": "str - Resource type" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 469 } ], "score": 0.25 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service.ResourceService.get_dashboards_with_status:Function] started at line 37", "severity": "ERROR", "line_number": 37 }, { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service.ResourceService.get_dashboards_with_status:Function] started at line 37", "severity": "ERROR", "line_number": 37 }, { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service.ResourceService.get_dashboards_with_status:Function] started at line 37", "severity": "ERROR", "line_number": 37 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service.ResourceService:Class] started at line 21", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 21 }, { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service.ResourceService:Class] started at line 21", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 21 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_dashboards_with_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_task_time", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 190, "end_line": 190, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Unclosed Anchor: [DEF:backend.src.services.resource_service:Module] started at line 1", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.llm_prompt_templates", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 200, "tags": { "COMPLEXITY": "3", "SEMANTICS": "llm, prompts, templates, settings", "PURPOSE": "Provide default LLM prompt templates and normalization helpers for runtime usage.", "LAYER": "Domain", "INVARIANT": "All required prompt template keys are always present after normalization." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.config_manager" } ], "children": [ { "name": "DEFAULT_LLM_PROMPTS", "type": "Constant", "complexity": 3, "tier": "STANDARD", "start_line": 15, "end_line": 61, "tags": { "COMPLEXITY": "3", "PURPOSE": "Default prompt templates used by documentation, dashboard validation, and git commit generation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DEFAULT_LLM_PROVIDER_BINDINGS", "type": "Constant", "complexity": 3, "tier": "STANDARD", "start_line": 64, "end_line": 72, "tags": { "COMPLEXITY": "3", "PURPOSE": "Default provider binding per task domain." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DEFAULT_LLM_ASSISTANT_SETTINGS", "type": "Constant", "complexity": 3, "tier": "STANDARD", "start_line": 75, "end_line": 82, "tags": { "COMPLEXITY": "3", "PURPOSE": "Default planner settings for assistant chat intent model/provider resolution." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalize_llm_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 85, "end_line": 126, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure llm settings contain stable schema with prompts section and default templates.", "PRE": "llm_settings is dictionary-like value or None.", "POST": "Returned dict contains prompts with all required template keys." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 85 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 85 } ], "score": 0.5499999999999999 } }, { "name": "is_multimodal_model", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 129, "end_line": 168, "tags": { "COMPLEXITY": "3", "PURPOSE": "Heuristically determine whether model supports image input required for dashboard validation.", "PRE": "model_name may be empty or mixed-case.", "POST": "Returns True when model likely supports multimodal input." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 129 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 129 } ], "score": 0.5499999999999999 } }, { "name": "resolve_bound_provider_id", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 171, "end_line": 184, "tags": { "COMPLEXITY": "3", "PURPOSE": "Resolve provider id configured for a task binding with fallback to default provider.", "PRE": "llm_settings is normalized or raw dict from config.", "POST": "Returns configured provider id or fallback id/empty string when not defined." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 171 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 171 } ], "score": 0.5499999999999999 } }, { "name": "render_prompt", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 187, "end_line": 197, "tags": { "COMPLEXITY": "3", "PURPOSE": "Render prompt template using deterministic placeholder replacement with graceful fallback.", "PRE": "template is a string and variables values are already stringifiable.", "POST": "Returns rendered prompt text with known placeholders substituted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 187 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 187 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "health_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 313, "tags": { "COMPLEXITY": "3", "SEMANTICS": "health, aggregation, dashboards", "PURPOSE": "Business logic for aggregating dashboard health status from validation records.", "LAYER": "Domain/Service" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.llm.ValidationRecord" }, { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.cleanup.TaskCleanupService" } ], "children": [ { "name": "HealthService", "type": "Class", "complexity": 4, "tier": "STANDARD", "start_line": 22, "end_line": 311, "tags": { "COMPLEXITY": "4", "PURPOSE": "Aggregate latest dashboard validation state and manage persisted health report lifecycle." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.llm.ValidationRecord" }, { "type": "DEPENDS_ON", "target": "backend.src.schemas.health.DashboardHealthItem" }, { "type": "DEPENDS_ON", "target": "backend.src.schemas.health.HealthSummaryResponse" }, { "type": "CALLS", "target": "backend.src.core.superset_client.SupersetClient" }, { "type": "CALLS", "target": "backend.src.core.task_manager.cleanup.TaskCleanupService" } ], "children": [ { "name": "HealthService.__init__", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 37, "end_line": 46, "tags": { "COMPLEXITY": "3", "PURPOSE": "Initialize health service with DB session and optional config access for dashboard metadata resolution.", "PRE": "db is a valid SQLAlchemy session.", "POST": "Service is ready to aggregate summaries and delete health reports." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 37 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 37 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 37 } ], "score": 0.4 } }, { "name": "HealthService._prime_dashboard_meta_cache", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 48, "end_line": 127, "tags": { "COMPLEXITY": "3", "PURPOSE": "Warm dashboard slug/title cache with one Superset list fetch per environment.", "PRE": "records may contain mixed numeric and slug dashboard identifiers.", "POST": "Numeric dashboard ids for known environments are cached when discoverable.", "SIDE_EFFECT": "May call Superset dashboard list API once per referenced environment." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.superset_client.SupersetClient.get_dashboards_summary" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "HealthService._resolve_dashboard_meta", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 154, "tags": { "COMPLEXITY": "1", "PURPOSE": "Resolve slug/title for a dashboard referenced by persisted validation record.", "PRE": "dashboard_id may be numeric or slug-like; environment_id may be empty.", "POST": "Returns dict with `slug` and `title` keys, using cache when possible." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "HealthService.get_health_summary", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 156, "end_line": 232, "tags": { "COMPLEXITY": "3", "PURPOSE": "Aggregate latest validation status per dashboard and enrich rows with dashboard slug/title.", "PRE": "environment_id may be omitted to aggregate across all environments.", "POST": "Returns HealthSummaryResponse with counts and latest record row per dashboard.", "SIDE_EFFECT": "May call Superset API to resolve dashboard metadata.", "DATA_CONTRACT": "Input[environment_id: Optional[str]] -> Output[HealthSummaryResponse]" }, "relations": [ { "type": "CALLS", "target": "self._prime_dashboard_meta_cache" }, { "type": "CALLS", "target": "self._resolve_dashboard_meta" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } }, { "name": "HealthService.delete_validation_report", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 234, "end_line": 309, "tags": { "COMPLEXITY": "3", "PURPOSE": "Delete one persisted health report and optionally clean linked task/log artifacts.", "PRE": "record_id is a validation record identifier.", "POST": "Returns True only when a matching record was deleted.", "SIDE_EFFECT": "Deletes DB rows, optional screenshot file, and optional task/log persistence.", "DATA_CONTRACT": "Input[record_id: str, task_manager: Optional[TaskManager]] -> Output[bool]" }, "relations": [ { "type": "CALLS", "target": "backend.src.core.task_manager.cleanup.TaskCleanupService.delete_task_with_logs" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 0.85 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 4)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 4)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 4)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 4)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 4)", "severity": "ERROR", "line_number": 22 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 4)", "severity": "ERROR", "line_number": 22 } ], "score": 0.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_prime_dashboard_meta_cache", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_dashboard_meta", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 134, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_health_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_validation_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 242, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 313 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.services.llm_provider", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 206, "tags": { "COMPLEXITY": "3", "SEMANTICS": "service, llm, provider, encryption", "PURPOSE": "Service for managing LLM provider configurations with encrypted API keys.", "LAYER": "Domain" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.database" }, { "type": "DEPENDS_ON", "target": "backend.src.models.llm" } ], "children": [ { "name": "_require_fernet_key", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 21, "end_line": 34, "tags": { "COMPLEXITY": "5", "PURPOSE": "Load and validate the Fernet key used for secret encryption.", "PRE": "ENCRYPTION_KEY environment variable must be set to a valid Fernet key.", "POST": "Returns validated key bytes ready for Fernet initialization." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Belief State Logging: Function should use belief_scope / molecular methods (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 21 }, { "message": "Missing Belief State Logging: Function should use belief_scope / molecular methods (required for complexity 5)", "severity": "ERROR", "line_number": 21 } ], "score": 0.0 } }, { "name": "EncryptionManager", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 36, "end_line": 79, "tags": { "COMPLEXITY": "5", "PURPOSE": "Handles encryption and decryption of sensitive data like API keys.", "INVARIANT": "Uses only a validated secret key from environment.", "TEST_CONTRACT": "EncryptionManagerModel ->", "TEST_FIXTURE": "basic_encryption_cycle -> {\"data\": \"my_secret_key\"}", "TEST_EDGE": "empty_string_encryption -> {\"data\": \"\"}", "TEST_INVARIANT": "symmetric_encryption -> verifies: [basic_encryption_cycle, empty_string_encryption]" }, "relations": [], "children": [ { "name": "EncryptionManager.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 60, "tags": { "PURPOSE": "Initialize the encryption manager with a Fernet key.", "PRE": "ENCRYPTION_KEY env var must be set to a valid Fernet key.", "POST": "Fernet instance ready for encryption/decryption." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "EncryptionManager.encrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 69, "tags": { "PURPOSE": "Encrypt a plaintext string.", "PRE": "data must be a non-empty string.", "POST": "Returns encrypted string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "EncryptionManager.decrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 78, "tags": { "PURPOSE": "Decrypt an encrypted string.", "PRE": "encrypted_data must be a valid Fernet-encrypted string.", "POST": "Returns original plaintext string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 36 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 36 } ], "score": 0.0 } }, { "name": "LLMProviderService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 81, "end_line": 204, "tags": { "COMPLEXITY": "3", "PURPOSE": "Service to manage LLM provider lifecycle." }, "relations": [], "children": [ { "name": "LLMProviderService.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 92, "tags": { "PURPOSE": "Initialize the service with database session.", "PRE": "db must be a valid SQLAlchemy Session.", "POST": "Service ready for provider operations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_providers", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 94, "end_line": 102, "tags": { "COMPLEXITY": "3", "PURPOSE": "Returns all configured LLM providers.", "PRE": "Database connection must be active.", "POST": "Returns list of all LLMProvider records." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 94 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 94 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 94 } ], "score": 0.4 } }, { "name": "get_provider", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 104, "end_line": 112, "tags": { "COMPLEXITY": "3", "PURPOSE": "Returns a single LLM provider by ID.", "PRE": "provider_id must be a valid string.", "POST": "Returns LLMProvider or None if not found." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 104 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 104 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 104 } ], "score": 0.4 } }, { "name": "create_provider", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 114, "end_line": 134, "tags": { "COMPLEXITY": "3", "PURPOSE": "Creates a new LLM provider with encrypted API key.", "PRE": "config must contain valid provider configuration.", "POST": "New provider created and persisted to database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 114 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 114 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 114 } ], "score": 0.4 } }, { "name": "update_provider", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 136, "end_line": 163, "tags": { "COMPLEXITY": "3", "PURPOSE": "Updates an existing LLM provider.", "PRE": "provider_id must exist, config must be valid.", "POST": "Provider updated and persisted to database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 136 } ], "score": 0.4 } }, { "name": "delete_provider", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 165, "end_line": 178, "tags": { "COMPLEXITY": "3", "PURPOSE": "Deletes an LLM provider.", "PRE": "provider_id must exist.", "POST": "Provider removed from database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 165 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 165 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 165 } ], "score": 0.4 } }, { "name": "get_decrypted_api_key", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 180, "end_line": 202, "tags": { "COMPLEXITY": "3", "PURPOSE": "Returns the decrypted API key for a provider.", "PRE": "provider_id must exist with valid encrypted key.", "POST": "Returns decrypted API key or None on failure." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 180 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 180 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 180 } ], "score": 0.4 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 81 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 81 } ], "score": 0.5499999999999999 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "encrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "decrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.rbac_permission_catalog", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 190, "tags": { "COMPLEXITY": "3", "SEMANTICS": "rbac, permissions, catalog, sync, discovery", "PURPOSE": "Discovers declared RBAC permissions from API routes/plugins and synchronizes them into auth database.", "LAYER": "Service", "INVARIANT": "Synchronization is idempotent for existing (resource, action) permission pairs." }, "relations": [ { "type": "CALLS", "target": "backend.src.core.plugin_loader.PluginLoader.get_all_plugin_configs" }, { "type": "DEPENDS_ON", "target": "backend.src.models.auth.Permission" } ], "children": [ { "name": "HAS_PERMISSION_PATTERN", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 28, "tags": { "PURPOSE": "Regex pattern for extracting has_permission(\"resource\", \"ACTION\") declarations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ROUTES_DIR", "type": "Constant", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 33, "tags": { "PURPOSE": "Absolute directory path where API route RBAC declarations are defined." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_iter_route_files", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 53, "tags": { "PURPOSE": "Iterates API route files that may contain RBAC declarations.", "PRE": "ROUTES_DIR points to backend/src/api/routes.", "POST": "Yields Python files excluding test and cache directories.", "RETURN": "Iterable[Path] - Route file paths for permission extraction." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_discover_route_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 81, "tags": { "PURPOSE": "Extracts explicit has_permission declarations from API route source code.", "PRE": "Route files are readable UTF-8 text files.", "POST": "Returns unique set of (resource, action) pairs declared in route guards.", "RETURN": "Set[Tuple[str, str]] - Permission pairs from route-level RBAC declarations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_discover_route_permissions_cached", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 92, "tags": { "PURPOSE": "Cache route permission discovery because route source files are static during normal runtime.", "PRE": "None.", "POST": "Returns stable discovered route permission pairs without repeated filesystem scans." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_discover_plugin_execute_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 120, "tags": { "PURPOSE": "Derives dynamic task permissions of form plugin:{plugin_id}:EXECUTE from plugin registry.", "PRE": "plugin_loader is optional and may expose get_all_plugin_configs.", "POST": "Returns unique plugin EXECUTE permissions if loader is available.", "RETURN": "Set[Tuple[str, str]] - Permission pairs derived from loaded plugin IDs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_discover_plugin_execute_permissions_cached", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 123, "end_line": 133, "tags": { "PURPOSE": "Cache dynamic plugin EXECUTE permission pairs by normalized plugin id tuple.", "PRE": "plugin_ids is a deterministic tuple of plugin ids.", "POST": "Returns stable permission tuple without repeated plugin catalog expansion." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "discover_declared_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 155, "tags": { "PURPOSE": "Builds canonical RBAC permission catalog from routes and plugin registry.", "PRE": "plugin_loader may be provided for dynamic task plugin permission discovery.", "POST": "Returns union of route-declared and dynamic plugin EXECUTE permissions.", "RETURN": "Set[Tuple[str, str]] - Complete discovered permission set." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "sync_permission_catalog", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 158, "end_line": 188, "tags": { "PURPOSE": "Persists missing RBAC permission pairs into auth database.", "PRE": "declared_permissions is an iterable of (resource, action) tuples.", "POST": "Missing permissions are inserted; existing permissions remain untouched.", "SIDE_EFFECT": "Commits auth database transaction when new permissions are added.", "RETURN": "int - Number of inserted permission records." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 21, "tags": { "COMPLEXITY": "3", "SEMANTICS": "services, package, init", "PURPOSE": "Package initialization for services module", "LAYER": "Core", "NOTE": "GitService, AuthService, LLMProviderService have circular import issues - import directly when needed" }, "relations": [ { "type": "EXPORTS", "target": "resource_service, mapping_service" } ], "children": [ { "name": "__getattr__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 13, "end_line": 13, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: EXPORTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.services.auth_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 131, "tags": { "COMPLEXITY": "5", "SEMANTICS": "auth, service, business-logic, login, jwt, adfs, jit-provisioning", "PURPOSE": "Orchestrates credential authentication and ADFS JIT user provisioning.", "LAYER": "Domain", "INVARIANT": "Authentication succeeds only for active users with valid credentials; issued sessions encode subject and scopes from assigned roles.", "PRE": "Core auth models and security utilities available.", "POST": "User identity verified and session tokens issued according to role scopes.", "SIDE_EFFECT": "Writes last login timestamps and JIT-provisions external users.", "DATA_CONTRACT": "[Credentials | ADFSClaims] -> [UserEntity | SessionToken]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.auth.repository.AuthRepository" }, { "type": "DEPENDS_ON", "target": "backend.src.core.auth.security.verify_password" }, { "type": "DEPENDS_ON", "target": "backend.src.core.auth.jwt.create_access_token" }, { "type": "DEPENDS_ON", "target": "backend.src.models.auth.User" }, { "type": "DEPENDS_ON", "target": "backend.src.models.auth.Role" } ], "children": [ { "name": "AuthService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 29, "end_line": 129, "tags": { "COMPLEXITY": "3", "PURPOSE": "Provides high-level authentication services." }, "relations": [], "children": [ { "name": "AuthService.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 44, "tags": { "COMPLEXITY": "1", "PURPOSE": "Initializes the authentication service with repository access over an active DB session.", "PRE": "db is a valid SQLAlchemy Session instance bound to the auth persistence context.", "POST": "self.repo is initialized and ready for auth user/role CRUD operations.", "SIDE_EFFECT": "Allocates AuthRepository and binds it to the provided Session.", "DATA_CONTRACT": "Input(Session) -> Model(AuthRepository)", "PARAM": "db (Session) - SQLAlchemy session." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "AuthService.authenticate_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 46, "end_line": 71, "tags": { "COMPLEXITY": "3", "PURPOSE": "Validates credentials and account state for local username/password authentication.", "PRE": "username and password are non-empty credential inputs.", "POST": "Returns User only when user exists, is active, and password hash verification succeeds; otherwise returns None.", "SIDE_EFFECT": "Persists last_login update for successful authentications via repository.", "DATA_CONTRACT": "Input(str username, str password) -> Output(User | None)", "PARAM": "password (str) - The plain password.", "RETURN": "Optional[User] - The authenticated user or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 46 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 46 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 46 } ], "score": 0.4 } }, { "name": "AuthService.create_session", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 73, "end_line": 89, "tags": { "COMPLEXITY": "3", "PURPOSE": "Issues an access token payload for an already authenticated user.", "PRE": "user is a valid User entity containing username and iterable roles with role.name values.", "POST": "Returns session dict with non-empty access_token and token_type='bearer'.", "SIDE_EFFECT": "Generates signed JWT via auth JWT provider.", "DATA_CONTRACT": "Input(User) -> Output(Dict[str, str]{access_token, token_type})", "PARAM": "user (User) - The authenticated user.", "RETURN": "Dict[str, str] - Session data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 73 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 73 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 73 } ], "score": 0.4 } }, { "name": "AuthService.provision_adfs_user", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 91, "end_line": 128, "tags": { "COMPLEXITY": "3", "PURPOSE": "Performs ADFS Just-In-Time provisioning and role synchronization from AD group mappings.", "PRE": "user_info contains identity claims where at least one of 'upn' or 'email' is present; 'groups' may be absent.", "POST": "Returns persisted user entity with roles synchronized to mapped AD groups and refreshed state.", "SIDE_EFFECT": "May insert new User, mutate user.roles, commit transaction, and refresh ORM state.", "DATA_CONTRACT": "Input(Dict[str, Any]{upn|email, email, groups[]}) -> Output(User persisted)", "PARAM": "user_info (Dict[str, Any]) - Claims from ADFS token.", "RETURN": "User - The provisioned user." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 91 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 91 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 91 } ], "score": 0.4 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 29 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 29 } ], "score": 0.5499999999999999 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "authenticate_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 56, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "provision_adfs_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.9666666666666667 } }, { "name": "backend.src.services.git_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 2035, "tags": { "COMPLEXITY": "3", "SEMANTICS": "git, service, gitpython, repository, version_control", "PURPOSE": "Core Git logic using GitPython to manage dashboard repositories.", "LAYER": "Service", "INVARIANT": "All Git operations must be performed on a valid local directory." }, "relations": [ { "type": "USED_BY", "target": "backend.src.api.routes.git" }, { "type": "USED_BY", "target": "backend.src.plugins.git_plugin" }, { "type": "DEPENDS_ON", "target": "backend.src.core.database.SessionLocal" }, { "type": "DEPENDS_ON", "target": "backend.src.models.config.AppConfigRecord" }, { "type": "DEPENDS_ON", "target": "backend.src.models.git.GitRepository" } ], "children": [ { "name": "backend.src.services.git_service.GitService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 34, "end_line": 2034, "tags": { "COMPLEXITY": "3", "PURPOSE": "Wrapper for GitPython operations with semantic logging and error handling." }, "relations": [], "children": [ { "name": "backend.src.services.git_service.GitService.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 55, "tags": { "PURPOSE": "Initializes the GitService with a base path for repositories.", "PARAM": "base_path (str) - Root directory for all Git clones.", "PRE": "base_path is a valid string path.", "POST": "GitService is initialized; base_path directory exists." }, "relations": [ { "type": "CALLS", "target": "GitService._resolve_base_path" }, { "type": "CALLS", "target": "GitService._ensure_base_path_exists" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._ensure_base_path_exists", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 68, "tags": { "PURPOSE": "Ensure the repositories root directory exists and is a directory.", "PRE": "self.base_path is resolved to filesystem path.", "POST": "self.base_path exists as directory or raises ValueError.", "RETURN": "None" }, "relations": [ { "type": "USES", "target": "self.base_path" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 57 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 57 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 57 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._resolve_base_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 111, "tags": { "PURPOSE": "Resolve base repository directory from explicit argument or global storage settings.", "PRE": "base_path is a string path.", "POST": "Returns absolute path for Git repositories root.", "RETURN": "str" }, "relations": [ { "type": "USES", "target": "AppConfigRecord" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 70 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 70 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 70 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._normalize_repo_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 123, "tags": { "PURPOSE": "Convert user/dashboard-provided key to safe filesystem directory name.", "PRE": "repo_key can be None/empty.", "POST": "Returns normalized non-empty key.", "RETURN": "str" }, "relations": [ { "type": "USES", "target": "re.sub" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 113 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 113 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 113 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._update_repo_local_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 147, "tags": { "PURPOSE": "Persist repository local_path in GitRepository table when record exists.", "PRE": "dashboard_id is valid integer.", "POST": "local_path is updated for existing record.", "RETURN": "None" }, "relations": [ { "type": "USES", "target": "GitRepository" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 125 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 125 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 125 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._migrate_repo_directory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 149, "end_line": 178, "tags": { "PURPOSE": "Move legacy repository directory to target path and sync DB metadata.", "PRE": "source_path exists.", "POST": "Repository content available at target_path.", "RETURN": "str" }, "relations": [ { "type": "CALLS", "target": "GitService._update_repo_local_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._ensure_gitflow_branches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 180, "end_line": 263, "tags": { "PURPOSE": "Ensure standard GitFlow branches (main/dev/preprod) exist locally and on origin.", "PRE": "repo is a valid GitPython Repo instance.", "POST": "main, dev, preprod are available in local repository and pushed to origin when available.", "RETURN": "None" }, "relations": [ { "type": "USES", "target": "Repo" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 180 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 180 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 180 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 265, "end_line": 314, "tags": { "PURPOSE": "Resolves the local filesystem path for a dashboard's repository.", "PARAM": "repo_key (Optional[str]) - Slug-like key used when DB local_path is absent.", "PRE": "dashboard_id is an integer.", "POST": "Returns DB-local_path when present, otherwise base_path/.", "RETURN": "str" }, "relations": [ { "type": "CALLS", "target": "GitService._normalize_repo_key" }, { "type": "CALLS", "target": "GitService._migrate_repo_directory" }, { "type": "CALLS", "target": "GitService._update_repo_local_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.init_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 316, "end_line": 360, "tags": { "PURPOSE": "Initialize or clone a repository for a dashboard.", "PARAM": "repo_key (Optional[str]) - Slug-like key for deterministic folder naming on first init.", "PRE": "dashboard_id is int, remote_url is valid Git URL, pat is provided.", "POST": "Repository is cloned or opened at the local path.", "RETURN": "Repo - GitPython Repo object." }, "relations": [ { "type": "CALLS", "target": "GitService._get_repo_path" }, { "type": "CALLS", "target": "GitService._ensure_gitflow_branches" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.delete_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 362, "end_line": 409, "tags": { "PURPOSE": "Remove local repository and DB binding for a dashboard.", "PRE": "dashboard_id is a valid integer.", "POST": "Local path is deleted when present and GitRepository row is removed.", "RETURN": "None" }, "relations": [ { "type": "CALLS", "target": "GitService._get_repo_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 411, "end_line": 428, "tags": { "PURPOSE": "Get Repo object for a dashboard.", "PRE": "Repository must exist on disk for the given dashboard_id.", "POST": "Returns a GitPython Repo instance for the dashboard.", "RETURN": "Repo" }, "relations": [ { "type": "CALLS", "target": "GitService._get_repo_path" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.configure_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 430, "end_line": 460, "tags": { "PURPOSE": "Configure repository-local Git committer identity for user-scoped operations.", "PRE": "dashboard_id repository exists; git_username/git_email may be empty.", "POST": "Repository config has user.name and user.email when both identity values are provided.", "RETURN": "None" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.list_branches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 462, "end_line": 515, "tags": { "PURPOSE": "List all branches for a dashboard's repository.", "PRE": "Repository for dashboard_id exists.", "POST": "Returns a list of branch metadata dictionaries.", "RETURN": "List[dict]" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_branch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 517, "end_line": 552, "tags": { "PURPOSE": "Create a new branch from an existing one.", "PARAM": "from_branch (str) - Source branch.", "PRE": "Repository exists; name is valid; from_branch exists or repo is empty.", "POST": "A new branch is created in the repository." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.checkout_branch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 554, "end_line": 564, "tags": { "PURPOSE": "Switch to a specific branch.", "PRE": "Repository exists and the specified branch name exists.", "POST": "The repository working directory is updated to the specified branch." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.commit_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 566, "end_line": 591, "tags": { "PURPOSE": "Stage and commit changes.", "PARAM": "files (List[str]) - Optional list of specific files to stage.", "PRE": "Repository exists and has changes (dirty) or files are specified.", "POST": "Changes are staged and a new commit is created." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._extract_http_host", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 593, "end_line": 615, "tags": { "PURPOSE": "Extract normalized host[:port] from HTTP(S) URL.", "PRE": "url_value may be empty.", "POST": "Returns lowercase host token or None.", "RETURN": "Optional[str]" }, "relations": [ { "type": "USES", "target": "urlparse" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 593 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 593 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 593 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._strip_url_credentials", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 617, "end_line": 637, "tags": { "PURPOSE": "Remove credentials from URL while preserving scheme/host/path.", "PRE": "url_value may contain credentials.", "POST": "Returns URL without username/password.", "RETURN": "str" }, "relations": [ { "type": "USES", "target": "urlparse" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 617 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 617 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 617 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._replace_host_in_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 639, "end_line": 676, "tags": { "PURPOSE": "Replace source URL host with host from configured server URL.", "PRE": "source_url and config_url are HTTP(S) URLs.", "POST": "Returns source URL with updated host (credentials preserved) or None.", "RETURN": "Optional[str]" }, "relations": [ { "type": "USES", "target": "urlparse" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 639 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 639 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 639 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._align_origin_host_with_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 678, "end_line": 745, "tags": { "PURPOSE": "Auto-align local origin host to configured Git server host when they drift.", "PRE": "origin remote exists.", "POST": "origin URL host updated and DB binding normalized when mismatch detected.", "RETURN": "Optional[str]" }, "relations": [ { "type": "CALLS", "target": "GitService._extract_http_host" }, { "type": "CALLS", "target": "GitService._replace_host_in_url" }, { "type": "CALLS", "target": "GitService._strip_url_credentials" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.push_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 747, "end_line": 860, "tags": { "PURPOSE": "Push local commits to remote.", "PRE": "Repository exists and has an 'origin' remote.", "POST": "Local branch commits are pushed to origin." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" }, { "type": "CALLS", "target": "GitService._align_origin_host_with_config" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._read_blob_text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 862, "end_line": 873, "tags": { "PURPOSE": "Read text from a Git blob." }, "relations": [ { "type": "USES", "target": "Blob" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 862 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 862 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 862 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._get_unmerged_file_paths", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 875, "end_line": 884, "tags": { "PURPOSE": "List files with merge conflicts." }, "relations": [ { "type": "USES", "target": "Repo" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 875 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 875 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 875 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._build_unfinished_merge_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 886, "end_line": 938, "tags": { "PURPOSE": "Build payload for unfinished merge state." }, "relations": [ { "type": "CALLS", "target": "GitService._get_unmerged_file_paths" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_merge_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 940, "end_line": 973, "tags": { "PURPOSE": "Get current merge status for a dashboard repository." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" }, { "type": "CALLS", "target": "GitService._build_unfinished_merge_payload" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_merge_conflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 975, "end_line": 1000, "tags": { "PURPOSE": "List all files with conflicts and their contents." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" }, { "type": "CALLS", "target": "GitService._read_blob_text" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.resolve_merge_conflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1002, "end_line": 1038, "tags": { "PURPOSE": "Resolve conflicts using specified strategy." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.abort_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1040, "end_line": 1055, "tags": { "PURPOSE": "Abort ongoing merge." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.continue_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1057, "end_line": 1093, "tags": { "PURPOSE": "Finalize merge after conflict resolution." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" }, { "type": "CALLS", "target": "GitService._get_unmerged_file_paths" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.pull_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1095, "end_line": 1178, "tags": { "PURPOSE": "Pull changes from remote.", "PRE": "Repository exists and has an 'origin' remote.", "POST": "Changes from origin are pulled and merged into the active branch." }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" }, { "type": "CALLS", "target": "GitService._build_unfinished_merge_payload" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1180, "end_line": 1255, "tags": { "PURPOSE": "Get current repository status (dirty files, untracked, etc.)", "PRE": "Repository for dashboard_id exists.", "POST": "Returns a dictionary representing the Git status.", "RETURN": "dict" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_diff", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1257, "end_line": 1275, "tags": { "PURPOSE": "Generate diff for a file or the whole repository.", "PARAM": "staged (bool) - Whether to show staged changes.", "PRE": "Repository for dashboard_id exists.", "POST": "Returns the diff text as a string.", "RETURN": "str" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_commit_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1277, "end_line": 1306, "tags": { "PURPOSE": "Retrieve commit history for a repository.", "PARAM": "limit (int) - Max number of commits to return.", "PRE": "Repository for dashboard_id exists.", "POST": "Returns a list of dictionaries for each commit in history.", "RETURN": "List[dict]" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.test_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1308, "end_line": 1357, "tags": { "PURPOSE": "Test connection to Git provider using PAT.", "PARAM": "pat (str)", "PRE": "provider is valid; url is a valid HTTP(S) URL; pat is provided.", "POST": "Returns True if connection to the provider's API succeeds.", "RETURN": "bool" }, "relations": [ { "type": "USES", "target": "httpx.AsyncClient" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1308 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1308 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1308 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._normalize_git_server_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1359, "end_line": 1369, "tags": { "PURPOSE": "Normalize Git server URL for provider API calls.", "PRE": "raw_url is non-empty.", "POST": "Returns URL without trailing slash.", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._gitea_headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1371, "end_line": 1385, "tags": { "PURPOSE": "Build Gitea API authorization headers.", "PRE": "pat is provided.", "POST": "Returns headers with token auth.", "RETURN": "Dict[str, str]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._gitea_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1387, "end_line": 1435, "tags": { "PURPOSE": "Execute HTTP request against Gitea API with stable error mapping.", "PRE": "method and endpoint are valid.", "POST": "Returns decoded JSON payload.", "RETURN": "Any" }, "relations": [ { "type": "CALLS", "target": "GitService._normalize_git_server_url" }, { "type": "CALLS", "target": "GitService._gitea_headers" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.get_gitea_current_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1437, "end_line": 1449, "tags": { "PURPOSE": "Resolve current Gitea user for PAT.", "PRE": "server_url and pat are valid.", "POST": "Returns current username.", "RETURN": "str" }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.list_gitea_repositories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1451, "end_line": 1467, "tags": { "PURPOSE": "List repositories visible to authenticated Gitea user.", "PRE": "server_url and pat are valid.", "POST": "Returns repository list from Gitea.", "RETURN": "List[dict]" }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_gitea_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1469, "end_line": 1504, "tags": { "PURPOSE": "Create repository in Gitea for authenticated user.", "PRE": "name is non-empty and PAT has repo creation permission.", "POST": "Returns created repository payload.", "RETURN": "dict" }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.delete_gitea_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1506, "end_line": 1526, "tags": { "PURPOSE": "Delete repository in Gitea.", "PRE": "owner and repo_name are non-empty.", "POST": "Repository deleted on Gitea server." }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._gitea_branch_exists", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1528, "end_line": 1552, "tags": { "PURPOSE": "Check whether a branch exists in Gitea repository.", "PRE": "owner/repo/branch are non-empty.", "POST": "Returns True when branch exists, False when 404.", "RETURN": "bool" }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_request" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._build_gitea_pr_404_detail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1554, "end_line": 1588, "tags": { "PURPOSE": "Build actionable error detail for Gitea PR 404 responses.", "PRE": "owner/repo/from_branch/to_branch are provided.", "POST": "Returns specific branch-missing message when detected.", "RETURN": "Optional[str]" }, "relations": [ { "type": "CALLS", "target": "GitService._gitea_branch_exists" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_github_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1590, "end_line": 1641, "tags": { "PURPOSE": "Create repository in GitHub or GitHub Enterprise.", "PRE": "PAT has repository create permission.", "POST": "Returns created repository payload.", "RETURN": "dict" }, "relations": [ { "type": "CALLS", "target": "GitService._normalize_git_server_url" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_gitlab_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1643, "end_line": 1702, "tags": { "PURPOSE": "Create repository(project) in GitLab.", "PRE": "PAT has api scope.", "POST": "Returns created repository payload.", "RETURN": "dict" }, "relations": [ { "type": "CALLS", "target": "GitService._normalize_git_server_url" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService._parse_remote_repo_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1704, "end_line": 1738, "tags": { "PURPOSE": "Parse owner/repo from remote URL for Git server API operations.", "PRE": "remote_url is a valid git URL.", "POST": "Returns owner/repo tokens.", "RETURN": "Dict[str, str]" }, "relations": [ { "type": "USES", "target": "urlparse" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1704 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1704 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1704 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService._derive_server_url_from_remote", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1740, "end_line": 1761, "tags": { "PURPOSE": "Build API base URL from remote repository URL without credentials.", "PRE": "remote_url may be any git URL.", "POST": "Returns normalized http(s) base URL or None when derivation is impossible.", "RETURN": "Optional[str]" }, "relations": [ { "type": "USES", "target": "urlparse" } ], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1740 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1740 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1740 } ], "score": 0.55 } }, { "name": "backend.src.services.git_service.GitService.promote_direct_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1763, "end_line": 1827, "tags": { "PURPOSE": "Perform direct merge between branches in local repo and push target branch.", "PRE": "Repository exists and both branches are valid.", "POST": "Target branch contains merged changes from source branch.", "RETURN": "Dict[str, Any]" }, "relations": [ { "type": "CALLS", "target": "GitService.get_repo" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_gitea_pull_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1829, "end_line": 1920, "tags": { "PURPOSE": "Create pull request in Gitea.", "PRE": "Config and remote URL are valid.", "POST": "Returns normalized PR metadata.", "RETURN": "Dict[str, Any]" }, "relations": [ { "type": "CALLS", "target": "GitService._parse_remote_repo_identity" }, { "type": "CALLS", "target": "GitService._gitea_request" }, { "type": "CALLS", "target": "GitService._derive_server_url_from_remote" }, { "type": "CALLS", "target": "GitService._normalize_git_server_url" }, { "type": "CALLS", "target": "GitService._build_gitea_pr_404_detail" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_github_pull_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1922, "end_line": 1976, "tags": { "PURPOSE": "Create pull request in GitHub or GitHub Enterprise.", "PRE": "Config and remote URL are valid.", "POST": "Returns normalized PR metadata.", "RETURN": "Dict[str, Any]" }, "relations": [ { "type": "CALLS", "target": "GitService._parse_remote_repo_identity" }, { "type": "CALLS", "target": "GitService._normalize_git_server_url" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.git_service.GitService.create_gitlab_merge_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1978, "end_line": 2032, "tags": { "PURPOSE": "Create merge request in GitLab.", "PRE": "Config and remote URL are valid.", "POST": "Returns normalized MR metadata.", "RETURN": "Dict[str, Any]" }, "relations": [ { "type": "CALLS", "target": "GitService._parse_remote_repo_identity" }, { "type": "CALLS", "target": "GitService._normalize_git_server_url" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 34 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 34 } ], "score": 0.5499999999999999 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_ensure_base_path_exists", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 63, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_base_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 76, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_repo_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 119, "end_line": 119, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_update_repo_local_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 131, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_migrate_repo_directory", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 155, "end_line": 155, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_ensure_gitflow_branches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 186, "end_line": 186, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_repo_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 275, "end_line": 275, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "init_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 327, "end_line": 327, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 368, "end_line": 368, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 417, "end_line": 417, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "configure_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 436, "end_line": 436, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_branches", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 468, "end_line": 468, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_branch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 524, "end_line": 524, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "checkout_branch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 559, "end_line": 559, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 573, "end_line": 573, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_http_host", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 599, "end_line": 599, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_strip_url_credentials", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 623, "end_line": 623, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_replace_host_in_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 645, "end_line": 645, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_align_origin_host_with_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 686, "end_line": 686, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "push_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 753, "end_line": 753, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_read_blob_text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 865, "end_line": 865, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_unmerged_file_paths", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 878, "end_line": 878, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_unfinished_merge_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 889, "end_line": 889, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_merge_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 944, "end_line": 944, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_merge_conflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 979, "end_line": 979, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_merge_conflicts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1005, "end_line": 1005, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "abort_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1043, "end_line": 1043, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "continue_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1061, "end_line": 1061, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "pull_changes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1101, "end_line": 1101, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1186, "end_line": 1186, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_diff", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1265, "end_line": 1265, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_commit_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1284, "end_line": 1284, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1317, "end_line": 1317, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_normalize_git_server_url", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1364, "end_line": 1364, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_gitea_headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1376, "end_line": 1376, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_gitea_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1394, "end_line": 1394, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_gitea_current_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1443, "end_line": 1443, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_gitea_repositories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1457, "end_line": 1457, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_gitea_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1475, "end_line": 1475, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_gitea_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1511, "end_line": 1511, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_gitea_branch_exists", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1534, "end_line": 1534, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_gitea_pr_404_detail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1560, "end_line": 1560, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_github_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1596, "end_line": 1596, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_gitlab_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1649, "end_line": 1649, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_parse_remote_repo_identity", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1710, "end_line": 1710, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_derive_server_url_from_remote", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1746, "end_line": 1746, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "promote_direct_merge", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1769, "end_line": 1769, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_gitea_pull_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1839, "end_line": 1839, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_github_pull_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1929, "end_line": 1929, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_gitlab_merge_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 1985, "end_line": 1985, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 2035 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.src.services.mapping_service", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 71, "tags": { "SEMANTICS": "service, mapping, fuzzy-matching, superset", "PURPOSE": "Orchestrates database fetching and fuzzy matching suggestions.", "LAYER": "Service", "INVARIANT": "Suggestions are based on database names." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.superset_client" }, { "type": "DEPENDS_ON", "target": "backend.src.core.utils.matching" } ], "children": [ { "name": "MappingService", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 69, "tags": { "PURPOSE": "Service for handling database mapping logic." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 30, "tags": { "PURPOSE": "Initializes the mapping service with a config manager.", "PRE": "config_manager is provided.", "PARAM": "config_manager (ConfigManager) - The configuration manager.", "POST": "Service is initialized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_client", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 46, "tags": { "PURPOSE": "Helper to get an initialized SupersetClient for an environment.", "PARAM": "env_id (str) - The ID of the environment.", "PRE": "environment must exist in config.", "POST": "Returns an initialized SupersetClient.", "RETURN": "SupersetClient - Initialized client." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_suggestions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 67, "tags": { "PURPOSE": "Fetches databases from both environments and returns fuzzy matching suggestions.", "PARAM": "target_env_id (str) - Target environment ID.", "PRE": "Both environments must be accessible.", "POST": "Returns fuzzy-matched database suggestions.", "RETURN": "List[Dict] - Suggested mappings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_encryption_manager", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 137, "tags": { "COMPLEXITY": "3", "SEMANTICS": "encryption, security, fernet, api-keys, tests", "PURPOSE": "Unit tests for EncryptionManager encrypt/decrypt functionality.", "LAYER": "Domain", "INVARIANT": "Encrypt+decrypt roundtrip always returns original plaintext." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.llm_provider.EncryptionManager" } ], "children": [ { "name": "TestEncryptionManager", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 136, "tags": { "PURPOSE": "Validate EncryptionManager encrypt/decrypt roundtrip, uniqueness, and error handling.", "PRE": "cryptography package installed.", "POST": "All encrypt/decrypt invariants verified." }, "relations": [], "children": [ { "name": "test_encrypt_decrypt_roundtrip", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 54, "tags": { "PURPOSE": "Encrypt then decrypt returns original plaintext.", "PRE": "Valid plaintext string.", "POST": "Decrypted output equals original input." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_encrypt_produces_different_output", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 66, "tags": { "PURPOSE": "Same plaintext produces different ciphertext (Fernet uses random IV).", "PRE": "Two encrypt calls with same input.", "POST": "Ciphertexts differ but both decrypt to same value." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_different_inputs_yield_different_ciphertext", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 77, "tags": { "PURPOSE": "Different inputs produce different ciphertexts.", "PRE": "Two different plaintext values.", "POST": "Encrypted outputs differ." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_decrypt_invalid_data_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 87, "tags": { "PURPOSE": "Decrypting invalid data raises InvalidToken.", "PRE": "Invalid ciphertext string.", "POST": "Exception raised." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_encrypt_empty_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 99, "tags": { "PURPOSE": "Encrypting and decrypting an empty string works.", "PRE": "Empty string input.", "POST": "Decrypted output equals empty string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_missing_key_fails_fast", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 111, "tags": { "PURPOSE": "Missing ENCRYPTION_KEY must abort initialization instead of using a fallback secret.", "PRE": "ENCRYPTION_KEY is unset.", "POST": "RuntimeError raised during EncryptionManager construction." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_custom_key_roundtrip", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 134, "tags": { "PURPOSE": "Custom Fernet key produces valid roundtrip.", "PRE": "Generated Fernet key.", "POST": "Encrypt/decrypt with custom key succeeds." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "encrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "decrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "encrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 125, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "decrypt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 127, "end_line": 127, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_health_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 7, "end_line": 285, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for HealthService aggregation logic." }, "relations": [], "children": [ { "name": "test_get_health_summary_aggregation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_health_summary_empty", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 79, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_health_summary_resolves_slug_and_title_from_superset", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_health_summary_reuses_dashboard_metadata_cache_across_service_instances", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 126, "end_line": 126, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_validation_report_deletes_dashboard_scope_and_linked_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 162, "end_line": 162, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_validation_report_returns_false_for_unknown_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 231, "end_line": 231, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_validation_report_swallows_linked_task_cleanup_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 240, "end_line": 240, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 7 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 7 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 7 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.services.__tests__.test_llm_plugin_persistence", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 150, "tags": { "COMPLEXITY": "3", "PURPOSE": "Regression test for ValidationRecord persistence fields populated from task context." }, "relations": [], "children": [ { "name": "_DummyLogger", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 28, "tags": { "PURPOSE": "Minimal logger shim for TaskContext-like objects used in tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_FakeDBSession", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 47, "tags": { "PURPOSE": "Captures persisted records for assertion and mimics SQLAlchemy session methods used by plugin." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dashboard_validation_plugin_persists_task_and_environment_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 147, "tags": { "PURPOSE": "Ensure db ValidationRecord includes context.task_id and params.environment_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "with_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 14, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "info", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 17, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "debug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "warning", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "add", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 39, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "commit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "close", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 67, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_provider", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_decrypted_api_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "capture_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 84, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "analyze_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 87, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 95, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "dispatch_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 98, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.services.__tests__.test_llm_prompt_templates", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 110, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, llm, prompts, templates, settings", "PURPOSE": "Validate normalization and rendering behavior for configurable LLM prompt templates.", "LAYER": "Domain Tests", "INVARIANT": "All required prompt keys remain available after normalization." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.llm_prompt_templates" } ], "children": [ { "name": "test_normalize_llm_settings_adds_default_prompts", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 20, "end_line": 38, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure legacy/partial llm settings are expanded with all prompt defaults.", "PRE": "Input llm settings do not contain complete prompts object.", "POST": "Returned structure includes required prompt templates with fallback defaults." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 } ], "score": 0.5499999999999999 } }, { "name": "test_normalize_llm_settings_keeps_custom_prompt_values", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 41, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure user-customized prompt values are preserved during normalization.", "PRE": "Input llm settings contain custom prompt override.", "POST": "Custom prompt value remains unchanged in normalized output." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 41 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 41 } ], "score": 0.5499999999999999 } }, { "name": "test_render_prompt_replaces_known_placeholders", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 56, "end_line": 68, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure template placeholders are deterministically replaced.", "PRE": "Template contains placeholders matching provided variables.", "POST": "Rendered prompt string contains substituted values." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 56 } ], "score": 0.5499999999999999 } }, { "name": "test_is_multimodal_model_detects_known_vision_models", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 71, "end_line": 79, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure multimodal model detection recognizes common vision-capable model names." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 71 } ], "score": 0.5499999999999999 } }, { "name": "test_resolve_bound_provider_id_prefers_binding_then_default", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 82, "end_line": 92, "tags": { "COMPLEXITY": "3", "PURPOSE": "Verify provider binding resolution priority." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 82 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 82 } ], "score": 0.5499999999999999 } }, { "name": "test_normalize_llm_settings_keeps_assistant_planner_settings", "type": "Function", "complexity": 3, "tier": "STANDARD", "start_line": 95, "end_line": 107, "tags": { "COMPLEXITY": "3", "PURPOSE": "Ensure assistant planner provider/model fields are preserved and normalized." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 95 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 95 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "_test_encryption_key_fixture", "type": "Global", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 18, "tags": { "PURPOSE": "Ensure encryption-dependent provider tests run with a valid Fernet key." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_llm_provider", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 116, "tags": { "PURPOSE": "Auto-generated module for backend/src/services/__tests__/test_llm_provider.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "test_encryption_cycle", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_empty_string_encryption", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_decrypt_invalid_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_db", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_all_providers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_provider", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_decrypted_api_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 76, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_decrypted_api_key_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_update_provider_ignores_masked_placeholder_api_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.__tests__.test_resource_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 424, "tags": { "COMPLEXITY": "3", "SEMANTICS": "resource-service, tests, dashboards, datasets, activity", "PURPOSE": "Unit tests for ResourceService", "LAYER": "Service", "INVARIANT": "Resource summaries preserve task linkage and status projection behavior." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.resource_service" }, { "type": "VERIFIES", "target": "ResourceService" } ], "children": [ { "name": "test_get_dashboards_with_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 75, "tags": { "PURPOSE": "Validate dashboard enrichment includes git/task status projections.", "TEST": "get_dashboards_with_status returns dashboards with git and task status", "PRE": "SupersetClient returns dashboard list", "POST": "Each dashboard has git_status and last_task fields" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_with_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 115, "tags": { "TEST": "get_datasets_with_status returns datasets with task status", "PRE": "SupersetClient returns dataset list", "POST": "Each dataset has last_task field" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_activity_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 152, "tags": { "TEST": "get_activity_summary returns active count and recent tasks", "PRE": "tasks list provided", "POST": "Returns dict with active_count and recent_tasks" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_git_status_for_dashboard_no_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 155, "end_line": 174, "tags": { "TEST": "_get_git_status_for_dashboard returns None when no repo exists", "PRE": "GitService returns None for repo", "POST": "Returns None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_last_task_for_resource", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 177, "end_line": 206, "tags": { "TEST": "_get_last_task_for_resource returns most recent task for resource", "PRE": "tasks list with matching resource_id", "POST": "Returns task summary with task_id and status" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_extract_resource_name_from_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 209, "end_line": 235, "tags": { "TEST": "_extract_resource_name_from_task extracts name from params", "PRE": "task has resource_name in params", "POST": "Returns resource name or fallback" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_last_task_for_resource_empty_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 238, "end_line": 249, "tags": { "TEST": "_get_last_task_for_resource returns None for empty tasks list", "PRE": "tasks is empty list", "POST": "Returns None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_last_task_for_resource_no_match", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 269, "tags": { "TEST": "_get_last_task_for_resource returns None when no tasks match resource_id", "PRE": "tasks list has no matching resource_id", "POST": "Returns None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_with_status_handles_mixed_naive_and_aware_task_datetimes", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 272, "end_line": 308, "tags": { "TEST": "get_dashboards_with_status handles mixed naive/aware datetimes without comparison errors.", "PRE": "Task list includes both timezone-aware and timezone-naive timestamps.", "POST": "Latest task is selected deterministically and no exception is raised." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_with_status_prefers_latest_decisive_validation_status_over_newer_unknown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 311, "end_line": 351, "tags": { "TEST": "get_dashboards_with_status keeps latest task identity while falling back to older decisive validation status.", "PRE": "Same dashboard has older WARN and newer UNKNOWN validation tasks.", "POST": "Returned last_task points to newest task but preserves WARN as last meaningful validation state." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_with_status_falls_back_to_latest_unknown_without_decisive_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 354, "end_line": 393, "tags": { "TEST": "get_dashboards_with_status still returns newest UNKNOWN when no decisive validation exists.", "PRE": "Same dashboard has only UNKNOWN validation tasks.", "POST": "Returned last_task keeps newest UNKNOWN task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_last_task_for_resource_handles_mixed_naive_and_aware_created_at", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 396, "end_line": 421, "tags": { "TEST": "_get_last_task_for_resource handles mixed naive/aware created_at values.", "PRE": "Matching tasks include naive and aware created_at timestamps.", "POST": "Latest task is returned without raising datetime comparison errors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 424 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.src.services.__tests__.test_rbac_permission_catalog", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 140, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, rbac, permissions, catalog, discovery, sync", "PURPOSE": "Verifies RBAC permission catalog discovery and idempotent synchronization behavior.", "LAYER": "Service Tests", "INVARIANT": "Synchronization adds only missing normalized permission pairs." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.rbac_permission_catalog" } ], "children": [ { "name": "test_discover_route_permissions_extracts_declared_pairs_and_ignores_tests", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 51, "tags": { "PURPOSE": "Ensures route-scanner extracts has_permission pairs from route files and skips __tests__.", "PRE": "Temporary route directory contains route and test files.", "POST": "Returned set includes production route permissions and excludes test-only declarations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_discover_declared_permissions_unions_route_and_plugin_permissions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 77, "tags": { "PURPOSE": "Ensures full catalog includes route-level permissions plus dynamic plugin EXECUTE rights.", "PRE": "Route discovery and plugin loader both return permission sources.", "POST": "Result set contains union of both sources." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_permission_catalog_inserts_only_missing_normalized_pairs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 110, "tags": { "PURPOSE": "Ensures synchronization inserts only missing pairs and normalizes action/resource tokens.", "PRE": "DB already contains subset of permissions.", "POST": "Only missing normalized pairs are inserted and commit is executed once." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_permission_catalog_is_noop_when_all_permissions_exist", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 137, "tags": { "PURPOSE": "Ensures synchronization is idempotent when all declared pairs already exist.", "PRE": "DB contains full declared permission set.", "POST": "No inserts are added and commit is not called." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.services.notifications.providers", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 123, "tags": { "COMPLEXITY": "5", "SEMANTICS": "notifications, providers, smtp, slack, telegram, abstraction", "PURPOSE": "Defines abstract base and concrete implementations for external notification delivery.", "LAYER": "Infra", "INVARIANT": "Sensitive credentials must be handled via encrypted config." }, "relations": [], "children": [ { "name": "NotificationProvider", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 35, "tags": { "PURPOSE": "Abstract base class for all notification providers." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SMTPProvider", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 68, "tags": { "PURPOSE": "Delivers notifications via SMTP." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TelegramProvider", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 96, "tags": { "PURPOSE": "Delivers notifications via Telegram Bot API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "SlackProvider", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 121, "tags": { "PURPOSE": "Delivers notifications via Slack Webhooks or API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "send", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "send", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 74, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "send", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 77, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 102, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "send", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.notifications.service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 146, "tags": { "COMPLEXITY": "5", "SEMANTICS": "notifications, service, routing, dispatch, background-tasks", "PURPOSE": "Orchestrates notification routing based on user preferences and policy context.", "LAYER": "Domain", "INVARIANT": "Missing profile or provider config must not crash the pipeline." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.notifications.providers" }, { "type": "DEPENDS_ON", "target": "backend.src.services.profile_service" }, { "type": "DEPENDS_ON", "target": "backend.src.models.llm" } ], "children": [ { "name": "NotificationService", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 144, "tags": { "PURPOSE": "Routes validation reports to appropriate users and channels." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_initialize_providers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "dispatch_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_should_notify", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 91, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_targets", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_find_dashboard_owners", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 125, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_build_body", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 136, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "src.services.notifications", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Notification service package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.src.services.notifications.__tests__.test_notification_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 120, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for NotificationService routing and dispatch logic." }, "relations": [], "children": [ { "name": "mock_db", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "mock_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_should_notify_fail_only", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_should_notify_warn_and_fail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_targets_owner_routing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_targets_custom_channels", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dispatch_report_skips_if_no_notify", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_dispatch_report_calls_providers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.services.clean_release.compliance_orchestrator", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 167, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, orchestrator, compliance-gate, stages", "PURPOSE": "Execute mandatory clean compliance stages and produce final COMPLIANT/BLOCKED/FAILED outcome.", "LAYER": "Domain", "INVARIANT": "COMPLIANT is impossible when any mandatory stage fails.", "TEST_CONTRACT": "ComplianceCheckRun -> ComplianceCheckRun", "TEST_FIXTURE": "compliant_candidate -> file:backend/tests/fixtures/clean_release/fixtures_clean_release.json", "TEST_EDGE": "report_generation_error -> Downstream reporting failure does not alter orchestrator status derivation contract", "TEST_INVARIANT": "compliant_requires_all_mandatory_pass -> VERIFIED_BY: [stage_failure_blocks_release]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.report_builder" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" } ], "children": [ { "name": "CleanComplianceOrchestrator", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 140, "tags": { "PURPOSE": "Coordinate clean-release compliance verification stages." }, "relations": [], "children": [ { "name": "CleanComplianceOrchestrator.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 53, "tags": { "PURPOSE": "Bind repository dependency used for orchestrator persistence and lookups.", "PRE": "repository is a valid CleanReleaseRepository instance with required methods.", "POST": "self.repository is assigned and used by all orchestration steps.", "SIDE_EFFECT": "Stores repository reference on orchestrator instance.", "DATA_CONTRACT": "Input -> CleanReleaseRepository, Output -> None" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "start_check_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 80, "tags": { "PURPOSE": "Initiate a new compliance run session.", "PRE": "candidate_id/policy_id/manifest_id identify existing records in repository.", "POST": "Returns initialized ComplianceRun in RUNNING state persisted in repository.", "SIDE_EFFECT": "Reads manifest/policy and writes new ComplianceRun via repository.save_check_run.", "DATA_CONTRACT": "Input -> (candidate_id:str, policy_id:str, requested_by:str, manifest_id:str), Output -> ComplianceRun" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute_stages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 122, "tags": { "PURPOSE": "Execute or accept compliance stage outcomes and set intermediate/final check-run status fields.", "PRE": "check_run exists and references candidate/policy/registry/manifest identifiers resolvable by repository.", "POST": "Returns persisted ComplianceRun with status FAILED on missing dependencies, otherwise SUCCEEDED with final_status set.", "SIDE_EFFECT": "Reads candidate/policy/registry/manifest and persists updated check_run.", "DATA_CONTRACT": "Input -> (check_run:ComplianceRun, forced_results:Optional[List[ComplianceStageRun]]), Output -> ComplianceRun" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "finalize_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 139, "tags": { "PURPOSE": "Finalize run status based on cumulative stage results.", "PRE": "check_run was started and may already contain a derived final_status from stage execution.", "POST": "Returns persisted ComplianceRun in SUCCEEDED status with final_status guaranteed non-empty.", "SIDE_EFFECT": "Mutates check_run terminal fields and persists via repository.save_check_run.", "DATA_CONTRACT": "Input -> ComplianceRun, Output -> ComplianceRun" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "run_check_legacy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 143, "end_line": 166, "tags": { "PURPOSE": "Legacy wrapper for compatibility with previous orchestrator call style.", "PRE": "repository and identifiers are valid and resolvable by orchestrator dependencies.", "POST": "Returns finalized ComplianceRun produced by orchestrator start->execute->finalize sequence.", "SIDE_EFFECT": "Reads/writes compliance entities through repository during orchestrator calls.", "DATA_CONTRACT": "Input -> (repository:CleanReleaseRepository, candidate_id:str, policy_id:str, requested_by:str, manifest_id:str), Output -> ComplianceRun" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 50, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.compliance_execution_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 197, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, compliance, execution, stages, immutable-evidence", "PURPOSE": "Create and execute compliance runs with trusted snapshots, deterministic stages, violations and immutable report persistence.", "LAYER": "Domain", "INVARIANT": "A run binds to exactly one candidate/manifest/policy/registry snapshot set." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.policy_resolution_service" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.report_builder" } ], "children": [ { "name": "ComplianceExecutionResult", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 39, "tags": { "PURPOSE": "Return envelope for compliance execution with run/report and persisted stage artifacts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceExecutionService", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 195, "tags": { "PURPOSE": "Execute clean-release compliance lifecycle over trusted snapshots and immutable evidence.", "PRE": "repository and config_manager are initialized.", "POST": "run state, stage records, violations and optional report are persisted consistently." }, "relations": [], "children": [ { "name": "_resolve_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 78, "tags": { "PURPOSE": "Resolve explicit manifest or fallback to latest candidate manifest.", "PRE": "candidate exists.", "POST": "Returns manifest snapshot or raises ComplianceRunError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_persist_stage_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 86, "tags": { "PURPOSE": "Persist stage run if repository supports stage records.", "POST": "Stage run is persisted when adapter is available, otherwise no-op." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_persist_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 88, "end_line": 94, "tags": { "PURPOSE": "Persist stage violations via repository adapters.", "POST": "Violations are appended to repository evidence store." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 96, "end_line": 194, "tags": { "PURPOSE": "Execute compliance run stages and finalize immutable report on terminal success.", "PRE": "candidate exists and trusted policy/registry snapshots are resolvable.", "POST": "Run and evidence are persisted; report exists for SUCCEEDED runs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.manifest_builder", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 109, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, manifest, deterministic-hash, summary", "PURPOSE": "Build deterministic distribution manifest from classified artifact input.", "LAYER": "Domain", "INVARIANT": "Equal semantic artifact sets produce identical deterministic hash values." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "build_distribution_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 87, "tags": { "PURPOSE": "Build DistributionManifest with deterministic hash and validated counters.", "PRE": "artifacts list contains normalized classification values.", "POST": "Returns DistributionManifest with summary counts matching items cardinality." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 108, "tags": { "PURPOSE": "Legacy compatibility wrapper for old manifest builder import paths.", "PRE": "Same as build_distribution_manifest.", "POST": "Returns DistributionManifest produced by canonical builder." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_stable_hash_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.policy_engine", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 152, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, policy, classification, source-isolation", "PURPOSE": "Evaluate artifact/source policies for enterprise clean profile with deterministic outcomes.", "LAYER": "Domain", "INVARIANT": "Enterprise-clean policy always treats non-registry sources as violations." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release.CleanProfilePolicy" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release.ResourceSourceRegistry" } ], "children": [ { "name": "CleanPolicyEngine", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 151, "tags": { "PRE": "Active policy exists and is internally consistent.", "POST": "Deterministic classification and source validation are available.", "TEST_CONTRACT": "CandidateEvaluationInput -> PolicyValidationResult|SourceValidationResult", "TEST_SCENARIO": "policy_valid -> Enterprise clean policy with matching registry returns ok=True", "TEST_FIXTURE": "policy_enterprise_clean -> file:backend/tests/fixtures/clean_release/fixtures_clean_release.json", "TEST_EDGE": "external_endpoint -> endpoint not present in enabled internal registry entries", "TEST_INVARIANT": "deterministic_classification -> VERIFIED_BY: [policy_valid]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "validate_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "classify_artifact", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "validate_resource_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 89, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "evaluate_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 121, "end_line": 121, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "clean_release_exceptions", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 38, "tags": { "COMPLEXITY": "3", "PURPOSE": "Domain exceptions for clean release compliance subsystem.", "LAYER": "Domain" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.services.clean_release.candidate_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 107, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, candidate, artifacts, lifecycle, validation", "PURPOSE": "Register release candidates with validated artifacts and advance lifecycle through legal transitions.", "LAYER": "Domain", "PRE": "candidate_id must be unique; artifacts input must be non-empty and valid.", "POST": "candidate and artifacts are persisted; candidate transitions DRAFT -> PREPARED only.", "INVARIANT": "Candidate lifecycle transitions are delegated to domain guard logic." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "_validate_artifacts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 47, "tags": { "PURPOSE": "Validate raw artifact payload list for required fields and shape.", "PRE": "artifacts payload is provided by caller.", "POST": "Returns normalized artifact list or raises ValueError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "register_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 105, "tags": { "PURPOSE": "Register a candidate and persist its artifacts with legal lifecycle transition.", "PRE": "candidate_id must be unique and artifacts must pass validation.", "POST": "Candidate exists in repository with PREPARED status and artifacts persisted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "clean_release_enums", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 72, "tags": { "COMPLEXITY": "3", "PURPOSE": "Canonical enums for clean release lifecycle and compliance.", "LAYER": "Domain" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.services.clean_release.publication_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 173, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, publication, revoke, gate, lifecycle", "PURPOSE": "Enforce publication and revocation gates with append-only publication records.", "LAYER": "Domain", "INVARIANT": "Publication records are append-only snapshots; revoke mutates only publication status for targeted record." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.approval_service" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.audit_service" } ], "children": [ { "name": "_get_or_init_publications_store", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 36, "tags": { "PURPOSE": "Provide in-memory append-only publication storage.", "PRE": "repository is initialized.", "POST": "Returns publication list attached to repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_latest_publication_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 51, "tags": { "PURPOSE": "Resolve latest publication record for candidate.", "PRE": "candidate_id is non-empty.", "POST": "Returns latest record or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_latest_approval_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 64, "tags": { "PURPOSE": "Resolve latest approval decision from repository decision store.", "PRE": "candidate_id is non-empty.", "POST": "Returns latest decision object or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "publish_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 128, "tags": { "PURPOSE": "Create immutable publication record for approved candidate.", "PRE": "Candidate exists, report belongs to candidate, latest approval is APPROVED.", "POST": "New ACTIVE publication record is appended." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "revoke_publication", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 171, "tags": { "PURPOSE": "Revoke existing publication record without deleting history.", "PRE": "publication_id exists in repository publication store.", "POST": "Target publication status becomes REVOKED and updated record is returned." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.artifact_catalog_loader", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 94, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, artifacts, bootstrap, json, tui", "PURPOSE": "Load bootstrap artifact catalogs for clean release real-mode flows.", "LAYER": "Domain", "INVARIANT": "Artifact catalog must produce deterministic CandidateArtifact entries with required identity and checksum fields." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release.CandidateArtifact" } ], "children": [ { "name": "load_bootstrap_artifacts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 92, "tags": { "PURPOSE": "Parse artifact catalog JSON into CandidateArtifact models for TUI/bootstrap flows.", "PRE": "path points to readable JSON file; payload is list[artifact] or {\"artifacts\": list[artifact]}.", "POST": "Returns non-mutated CandidateArtifact models with required fields populated." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.audit_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 107, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, audit, lifecycle, logging", "PURPOSE": "Provide lightweight audit hooks for clean release preparation/check/report lifecycle.", "LAYER": "Infra", "INVARIANT": "Audit hooks are append-only log actions." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.logger" } ], "children": [ { "name": "_append_event", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "audit_preparation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "audit_check_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "audit_violation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 61, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "audit_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 86, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.source_isolation", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 33, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, source-isolation, internal-only, validation", "PURPOSE": "Validate that all resource endpoints belong to the approved internal source registry.", "LAYER": "Domain", "INVARIANT": "Any endpoint outside enabled registry entries is treated as external-source violation." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release.ResourceSourceRegistry" } ], "children": [ { "name": "validate_internal_sources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.report_builder", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 68, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, report, audit, counters, violations", "PURPOSE": "Build and persist compliance reports with consistent counter invariants.", "LAYER": "Domain", "INVARIANT": "blocking_violations_count never exceeds violations_count.", "TEST_CONTRACT": "ComplianceCheckRun,List[ComplianceViolation] -> ComplianceReport", "TEST_FIXTURE": "blocked_with_two_violations -> file:backend/tests/fixtures/clean_release/fixtures_clean_release.json", "TEST_EDGE": "missing_operator_summary -> non-terminal run prevents report creation and summary generation", "TEST_INVARIANT": "blocking_count_le_total_count -> VERIFIED_BY: [counter_mismatch, empty_violations_for_blocked]" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_report_payload", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "persist_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 124, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, repository, persistence, in-memory", "PURPOSE": "Provide repository adapter for clean release entities with deterministic access methods.", "LAYER": "Infra", "INVARIANT": "Repository operations are side-effect free outside explicit save/update calls." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "CleanReleaseRepository", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 123, "tags": { "PURPOSE": "Data access object for clean release lifecycle." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_active_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 60, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 64, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_artifact", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 67, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_artifacts_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 74, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 78, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_distribution_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_distribution_manifest", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 84, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_check_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 87, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_check_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 91, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_compliance_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_compliance_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 97, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 107, "end_line": 107, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_violation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 110, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_violations_by_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_manifests_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 117, "end_line": 117, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "clear_history", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 119, "end_line": 119, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.preparation_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 92, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, preparation, manifest, policy-evaluation", "PURPOSE": "Prepare release candidate by policy evaluation and deterministic manifest creation.", "LAYER": "Domain", "INVARIANT": "Candidate preparation always persists manifest and candidate status deterministically." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.policy_engine" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.manifest_builder" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" } ], "children": [ { "name": "prepare_candidate_legacy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 91, "tags": { "PURPOSE": "Legacy compatibility wrapper kept for migration period.", "PRE": "Same as prepare_candidate.", "POST": "Delegates to canonical prepare_candidate and preserves response shape." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "prepare_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "clean_release_facade", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 122, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unified entry point for clean release operations.", "LAYER": "Application" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_active_policy_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_active_registry_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 60, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_candidate_overview", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_candidates", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 114, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.services.clean_release.policy_resolution_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 64, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, policy, registry, trusted-resolution, immutable-snapshots", "PURPOSE": "Resolve trusted policy and registry snapshots from ConfigManager without runtime overrides.", "LAYER": "Domain", "INVARIANT": "Trusted snapshot resolution is based only on ConfigManager active identifiers." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.config_manager" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.exceptions" } ], "children": [ { "name": "resolve_trusted_policy_snapshots", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 62, "tags": { "PURPOSE": "Resolve immutable trusted policy and registry snapshots using active config IDs only.", "PRE": "ConfigManager provides active_policy_id and active_registry_id; repository contains referenced snapshots.", "POST": "Returns immutable policy and registry snapshots; runtime override attempts are rejected.", "SIDE_EFFECT": "None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.demo_data_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 50, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, demo-mode, namespace, isolation, repository", "PURPOSE": "Provide deterministic namespace helpers and isolated in-memory repository creation for demo and real modes.", "LAYER": "Domain", "INVARIANT": "Demo and real namespaces must never collide for generated physical identifiers." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" } ], "children": [ { "name": "resolve_namespace", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 23, "tags": { "PURPOSE": "Resolve canonical clean-release namespace for requested mode.", "PRE": "mode is a non-empty string identifying runtime mode.", "POST": "Returns deterministic namespace key for demo/real separation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_namespaced_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 36, "tags": { "PURPOSE": "Build storage-safe physical identifier under mode namespace.", "PRE": "namespace and logical_id are non-empty strings.", "POST": "Returns deterministic \"{namespace}::{logical_id}\" identifier." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_isolated_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 48, "tags": { "PURPOSE": "Create isolated in-memory repository instance for selected mode namespace.", "PRE": "mode is a valid runtime mode marker.", "POST": "Returns repository instance tagged with namespace metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "clean_release_dto", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 85, "tags": { "COMPLEXITY": "3", "PURPOSE": "Data Transfer Objects for clean release compliance subsystem.", "LAYER": "Application" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "clean_release_mappers", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 67, "tags": { "COMPLEXITY": "3", "PURPOSE": "Map between domain entities (SQLAlchemy models) and DTOs.", "LAYER": "Application" }, "relations": [], "children": [ { "name": "map_candidate_to_dto", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "map_manifest_to_dto", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "map_run_to_dto", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "map_report_to_dto", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "clean_release", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 16, "tags": { "COMPLEXITY": "3", "PURPOSE": "Redesigned clean release compliance subsystem.", "LAYER": "Domain" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.services.clean_release.manifest_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 88, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, manifest, versioning, immutability, lifecycle", "PURPOSE": "Build immutable distribution manifests with deterministic digest and version increment.", "LAYER": "Domain", "PRE": "Candidate exists and is PREPARED or MANIFEST_BUILT; artifacts are present.", "POST": "New immutable manifest is persisted with incremented version and deterministic digest.", "INVARIANT": "Existing manifests are never mutated." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.manifest_builder" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "build_manifest_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 86, "tags": { "PURPOSE": "Create a new immutable manifest version for a candidate.", "PRE": "Candidate is prepared, artifacts are available, candidate_id is valid.", "POST": "Returns persisted DistributionManifest with monotonically incremented version." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.clean_release.approval_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 178, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, approval, decision, lifecycle, gate", "PURPOSE": "Enforce approval/rejection gates over immutable compliance reports.", "LAYER": "Domain", "INVARIANT": "Approval is allowed only for PASSED report bound to candidate; decisions are append-only." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.audit_service" } ], "children": [ { "name": "_get_or_init_decisions_store", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 35, "tags": { "PURPOSE": "Provide append-only in-memory storage for approval decisions.", "PRE": "repository is initialized.", "POST": "Returns mutable decision list attached to repository." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_latest_decision_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 48, "tags": { "PURPOSE": "Resolve latest approval decision for candidate from append-only store.", "PRE": "candidate_id is non-empty.", "POST": "Returns latest ApprovalDecision or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_resolve_candidate_and_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 73, "tags": { "PURPOSE": "Validate candidate/report existence and ownership prior to decision persistence.", "PRE": "candidate_id and report_id are non-empty.", "POST": "Returns tuple(candidate, report); raises ApprovalGateError on contract violation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "approve_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 136, "tags": { "PURPOSE": "Persist immutable APPROVED decision and advance candidate lifecycle to APPROVED.", "PRE": "Candidate exists, report belongs to candidate, report final_status is PASSED, candidate not already APPROVED.", "POST": "Approval decision is appended and candidate transitions to APPROVED." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "reject_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 139, "end_line": 176, "tags": { "PURPOSE": "Persist immutable REJECTED decision without promoting candidate lifecycle.", "PRE": "Candidate exists and report belongs to candidate.", "POST": "Rejected decision is appended; candidate lifecycle is unchanged." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.tests.services.clean_release.test_audit_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 27, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, audit, logging", "PURPOSE": "Validate audit hooks emit expected log patterns for clean release lifecycle.", "LAYER": "Infra" }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.audit_service" } ], "children": [ { "name": "test_audit_preparation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_audit_check_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 17, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_audit_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 22, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_policy_engine", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 114, "tags": { "PURPOSE": "Auto-generated module for backend/src/services/clean_release/__tests__/test_policy_engine.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "enterprise_clean_setup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 19, "end_line": 19, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_policy_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 43, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_missing_registry_ref", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_conflicting_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 60, "end_line": 60, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_classify_artifact", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_validate_resource_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_evaluate_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 95, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_compliance_orchestrator", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 112, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, orchestrator, stage-state-machine", "PURPOSE": "Validate compliance orchestrator stage transitions and final status derivation.", "LAYER": "Domain", "INVARIANT": "Failed mandatory stage forces BLOCKED terminal status." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.compliance_orchestrator" } ], "children": [ { "name": "test_orchestrator_stage_failure_blocks_release", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 48, "tags": { "PURPOSE": "Verify mandatory stage failure forces BLOCKED final status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_orchestrator_compliant_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 75, "tags": { "PURPOSE": "Verify happy path where all mandatory stages pass yields COMPLIANT." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_orchestrator_missing_stage_result", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 92, "tags": { "PURPOSE": "Verify incomplete mandatory stage set cannot end as COMPLIANT and results in FAILED." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_orchestrator_report_generation_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 111, "tags": { "PURPOSE": "Verify downstream report errors do not mutate orchestrator final status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.services.clean_release.test_report_builder", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 112, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, report-builder, counters", "PURPOSE": "Validate compliance report builder counter integrity and blocked-run constraints.", "LAYER": "Domain", "INVARIANT": "blocked run requires at least one blocking violation." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.report_builder" } ], "children": [ { "name": "_terminal_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 39, "tags": { "PURPOSE": "Build terminal/non-terminal run fixtures for report builder tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_blocking_violation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 55, "tags": { "PURPOSE": "Build a blocking violation fixture for blocked report scenarios." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_builder_blocked_requires_blocking_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 66, "tags": { "PURPOSE": "Verify BLOCKED run requires at least one blocking violation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_builder_blocked_with_two_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 86, "tags": { "PURPOSE": "Verify report builder generates conformant payload for a BLOCKED run with violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_builder_counter_consistency", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 98, "tags": { "PURPOSE": "Verify violations counters remain consistent for blocking payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_missing_operator_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 111, "tags": { "PURPOSE": "Validate non-terminal run prevents operator summary/report generation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.services.clean_release.test_manifest_builder", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 41, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, manifest, deterministic", "PURPOSE": "Validate deterministic manifest generation behavior for US1.", "LAYER": "Domain", "INVARIANT": "Same input artifacts produce identical deterministic hash." }, "relations": [ { "type": "VERIFIES", "target": "backend.src.services.clean_release.manifest_builder" } ], "children": [ { "name": "test_manifest_deterministic_hash_for_same_input", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 40, "tags": { "PURPOSE": "Ensure hash is stable for same candidate/policy/artifact input.", "PRE": "Same input lists are passed twice.", "POST": "Hash and summary remain identical." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.services.clean_release.test_stages", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 30, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, compliance, stages", "PURPOSE": "Validate final status derivation logic from stage results.", "LAYER": "Domain" }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.stages" } ], "children": [ { "name": "test_derive_final_status_compliant", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 11, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_derive_final_status_blocked", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_derive_final_status_failed_missing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_derive_final_status_failed_skipped", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.services.clean_release.test_source_isolation", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 60, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, source-isolation, internal-only", "PURPOSE": "Verify internal source registry validation behavior.", "LAYER": "Domain", "INVARIANT": "External endpoints always produce blocking violations." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.source_isolation" } ], "children": [ { "name": "_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_validate_internal_sources_all_internal_ok", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_validate_internal_sources_external_blocked", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 50, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.services.clean_release.test_preparation_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 171, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, clean-release, preparation, flow", "PURPOSE": "Validate release candidate preparation flow, including policy evaluation and manifest persisting.", "LAYER": "Domain", "INVARIANT": "Candidate preparation always persists manifest and candidate status deterministically." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.preparation_service:Module" } ], "children": [ { "name": "backend.tests.services.clean_release.test_preparation_service._mock_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 38, "tags": { "PURPOSE": "Build a valid clean profile policy fixture for preparation tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service._mock_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 50, "tags": { "PURPOSE": "Build an internal-only source registry fixture for preparation tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service._mock_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 64, "tags": { "PURPOSE": "Build a draft release candidate fixture with provided identifier." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service.test_prepare_candidate_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 101, "tags": { "PURPOSE": "Verify candidate transitions to PREPARED when evaluation returns no violations.", "TEST_CONTRACT": "[valid_candidate + active_policy + internal_sources + no_violations] -> [status=PREPARED, manifest_persisted, candidate_saved]", "TEST_SCENARIO": "[prepare_success] -> [prepared status and persistence side effects are produced]", "TEST_FIXTURE": "[INLINE_MOCKS] -> INLINE_JSON", "TEST_EDGE": "[external_fail] -> [none; dependency interactions mocked and successful]", "TEST_INVARIANT": "[prepared_flow_persists_state] -> VERIFIED_BY: [prepare_success]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service.test_prepare_candidate_with_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 137, "tags": { "PURPOSE": "Verify candidate transitions to BLOCKED when evaluation returns blocking violations.", "TEST_CONTRACT": "[valid_candidate + active_policy + evaluation_with_violations] -> [status=BLOCKED, violations_exposed]", "TEST_SCENARIO": "[prepare_blocked_due_to_policy] -> [blocked status and violation list are produced]", "TEST_FIXTURE": "[INLINE_MOCKS] -> INLINE_JSON", "TEST_EDGE": "[external_fail] -> [none; dependency interactions mocked and successful]", "TEST_INVARIANT": "[blocked_flow_reports_violations] -> VERIFIED_BY: [prepare_blocked_due_to_policy]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service.test_prepare_candidate_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 139, "end_line": 152, "tags": { "PURPOSE": "Verify preparation raises ValueError when candidate does not exist.", "TEST_CONTRACT": "[missing_candidate] -> [ValueError('Candidate not found')]", "TEST_SCENARIO": "[prepare_missing_candidate] -> [raises candidate not found error]", "TEST_FIXTURE": "[INLINE_MOCKS] -> INLINE_JSON", "TEST_EDGE": "[missing_field] -> [candidate lookup returns None]", "TEST_INVARIANT": "[missing_candidate_is_rejected] -> VERIFIED_BY: [prepare_missing_candidate]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.services.clean_release.test_preparation_service.test_prepare_candidate_no_active_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 154, "end_line": 168, "tags": { "PURPOSE": "Verify preparation raises ValueError when no active policy is available.", "TEST_CONTRACT": "[candidate_present + missing_active_policy] -> [ValueError('Active clean policy not found')]", "TEST_SCENARIO": "[prepare_missing_policy] -> [raises active policy missing error]", "TEST_FIXTURE": "[INLINE_MOCKS] -> INLINE_JSON", "TEST_EDGE": "[invalid_type] -> [policy dependency resolves to None]", "TEST_INVARIANT": "[active_policy_required] -> VERIFIED_BY: [prepare_missing_policy]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_mock_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_mock_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_mock_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_with_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 110, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 146, "end_line": 146, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_prepare_candidate_no_active_policy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 161, "end_line": 161, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.stages.no_external_endpoints", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 82, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance-stage, endpoints, network", "PURPOSE": "Block manifest payloads that expose external endpoints outside trusted schemes and hosts.", "LAYER": "Domain", "INVARIANT": "Endpoint outside allowed scheme/host always yields BLOCKED stage decision." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.services.clean_release.stages.base.ComplianceStage" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages.base" } ], "children": [ { "name": "NoExternalEndpointsStage", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 19, "end_line": 80, "tags": { "PURPOSE": "Validate endpoint references from manifest against trusted registry.", "PRE": "context.registry includes allowed hosts and schemes.", "POST": "Returns PASSED when all endpoints are trusted, otherwise BLOCKED with endpoint violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.stages.internal_sources_only", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 76, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance-stage, source-isolation, registry", "PURPOSE": "Verify manifest-declared sources belong to trusted internal registry allowlist.", "LAYER": "Domain", "INVARIANT": "Any source host outside allowed_hosts yields BLOCKED decision with at least one violation." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.services.clean_release.stages.base.ComplianceStage" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages.base" } ], "children": [ { "name": "InternalSourcesOnlyStage", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 74, "tags": { "PURPOSE": "Enforce internal-source-only policy from trusted registry snapshot.", "PRE": "context.registry.allowed_hosts is available.", "POST": "Returns PASSED when all hosts are allowed; otherwise BLOCKED and violations captured." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.stages.data_purity", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 66, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance-stage, data-purity", "PURPOSE": "Evaluate manifest purity counters and emit blocking violations for prohibited artifacts.", "LAYER": "Domain", "INVARIANT": "prohibited_detected_count > 0 always yields BLOCKED stage decision." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.services.clean_release.stages.base.ComplianceStage" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages.base" } ], "children": [ { "name": "DataPurityStage", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 64, "tags": { "PURPOSE": "Validate manifest summary for prohibited artifacts.", "PRE": "context.manifest.content_json contains summary block or defaults to safe counters.", "POST": "Returns PASSED when no prohibited artifacts are detected, otherwise BLOCKED with violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.stages.base", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 123, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance, stages, contracts, base", "PURPOSE": "Define shared contracts and helpers for pluggable clean-release compliance stages.", "LAYER": "Domain", "INVARIANT": "Stage execution is deterministic for equal input context." }, "relations": [ { "type": "CALLED_BY", "target": "backend.src.services.clean_release.compliance_execution_service" }, { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "ComplianceStageContext", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 40, "tags": { "PURPOSE": "Immutable input envelope passed to each compliance stage." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "StageExecutionResult", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 50, "tags": { "PURPOSE": "Structured stage output containing decision, details and violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ComplianceStage", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 60, "tags": { "PURPOSE": "Protocol for pluggable stage implementations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_stage_run_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 87, "tags": { "PURPOSE": "Build persisted stage run record from stage result.", "PRE": "run_id and stage_name are non-empty.", "POST": "Returns ComplianceStageRun with deterministic identifiers and timestamps." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_violation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 121, "tags": { "PURPOSE": "Construct a compliance violation with normalized defaults.", "PRE": "run_id, stage_name, code and message are non-empty.", "POST": "Returns immutable-style violation payload ready for persistence." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: CALLED_BY. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.src.services.clean_release.stages.manifest_consistency", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 70, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance-stage, manifest, consistency, digest", "PURPOSE": "Ensure run is bound to the exact manifest snapshot and digest used at run creation time.", "LAYER": "Domain", "INVARIANT": "Digest mismatch between run and manifest yields ERROR with blocking violation evidence." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.services.clean_release.stages.base.ComplianceStage" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.stages.base" } ], "children": [ { "name": "ManifestConsistencyStage", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 68, "tags": { "PURPOSE": "Validate run/manifest linkage consistency.", "PRE": "context.run and context.manifest are loaded from repository for same run.", "POST": "Returns PASSED when digests match, otherwise ERROR with one violation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 24, "end_line": 24, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.src.services.clean_release.stages", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 80, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, compliance, stages, state-machine", "PURPOSE": "Define compliance stage order and helper functions for deterministic run-state evaluation.", "LAYER": "Domain", "INVARIANT": "Stage order remains deterministic for all compliance runs." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.clean_release" } ], "children": [ { "name": "build_default_stages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 40, "tags": { "PURPOSE": "Build default deterministic stage pipeline implementation order.", "PRE": "None.", "POST": "Returns stage instances in mandatory execution order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "stage_result_map", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 49, "tags": { "PURPOSE": "Convert stage result list to dictionary by stage name.", "PRE": "stage_results may be empty or contain unique stage names.", "POST": "Returns stage->status dictionary for downstream evaluation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "missing_mandatory_stages", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 58, "tags": { "PURPOSE": "Identify mandatory stages that are absent from run results.", "PRE": "stage_status_map contains zero or more known stage statuses.", "POST": "Returns ordered list of missing mandatory stages." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "derive_final_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 79, "tags": { "PURPOSE": "Derive final run status from stage results with deterministic blocking behavior.", "PRE": "Stage statuses correspond to compliance checks.", "POST": "Returns one of PASSED/BLOCKED/ERROR according to mandatory stage outcomes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "candidate_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 47, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query release candidates.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "compliance_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 87, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query compliance runs, stage runs, and violations.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_runs_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_stage_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_stages_by_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_violation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 59, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_violations", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_violations_by_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "audit_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 46, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query audit logs for clean release operations.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "log", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 39, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "manifest_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query distribution manifests.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_latest_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "artifact_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 54, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query candidate artifacts.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_all", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 47, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "policy_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 52, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query policy and registry snapshots.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_policy_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_policy_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_registry_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_registry_snapshot", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "report_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 50, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query compliance reports.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 43, "end_line": 43, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "approval_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query approval decisions.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_latest_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "publication_repository", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 53, "tags": { "COMPLEXITY": "3", "PURPOSE": "Persist and query publication records.", "LAYER": "Infra" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_by_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_latest_for_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 36, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_by_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "clean_release_repositories", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 28, "tags": { "COMPLEXITY": "3", "PURPOSE": "Export all clean release repositories." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.32500000000000007 } }, { "name": "backend.src.services.reports.normalizer", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 171, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, normalization, tasks, fallback", "PURPOSE": "Convert task manager task objects into canonical unified TaskReport entities with deterministic fallback behavior.", "LAYER": "Domain", "INVARIANT": "Unknown task types and partial payloads remain visible via fallback mapping." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.models.Task" }, { "type": "DEPENDS_ON", "target": "backend.src.models.report" }, { "type": "DEPENDS_ON", "target": "backend.src.services.reports.type_profiles" } ], "children": [ { "name": "status_to_report_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 22, "end_line": 38, "tags": { "PURPOSE": "Normalize internal task status to canonical report status.", "PRE": "status may be known or unknown string/enum value.", "POST": "Always returns one of canonical ReportStatus values.", "PARAM": "status (Any) - Internal task status value.", "RETURN": "ReportStatus - Canonical report status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "build_summary", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 63, "tags": { "PURPOSE": "Build deterministic user-facing summary from task payload and status.", "PRE": "report_status is canonical; plugin_id may be unknown.", "POST": "Returns non-empty summary text.", "PARAM": "report_status (ReportStatus) - Canonical status.", "RETURN": "str - Normalized summary." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "extract_error_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 107, "tags": { "PURPOSE": "Extract normalized error context and next actions for failed/partial reports.", "PRE": "task is a valid Task object.", "POST": "Returns ErrorContext for failed/partial when context exists; otherwise None.", "PARAM": "report_status (ReportStatus) - Canonical status.", "RETURN": "Optional[ErrorContext] - Error context block." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "normalize_task_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 169, "tags": { "PURPOSE": "Convert one Task to canonical TaskReport envelope.", "PRE": "task has valid id and plugin_id fields.", "POST": "Returns TaskReport with required fields and deterministic fallback behavior.", "PARAM": "task (Task) - Source task.", "RETURN": "TaskReport - Canonical normalized report.", "TEST_CONTRACT": "NormalizeTaskReport ->", "TEST_FIXTURE": "valid_task -> {\"task\": \"MockTask(id='1', plugin_id='superset-migration', status=TaskStatus.SUCCESS)\"}", "TEST_EDGE": "unknown_plugin_type -> {\"task\": \"MockTask(plugin_id='unknown-plugin', status=TaskStatus.PENDING)\"}", "TEST_INVARIANT": "deterministic_normalization -> verifies: [valid_task, task_with_error, unknown_plugin_type]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.reports.type_profiles", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 123, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, type_profiles, normalization, fallback", "PURPOSE": "Deterministic mapping of plugin/task identifiers to canonical report task types and fallback profile metadata.", "LAYER": "Domain", "INVARIANT": "Unknown input always resolves to TaskType.UNKNOWN with a single fallback profile." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.models.report.TaskType" } ], "children": [ { "name": "PLUGIN_TO_TASK_TYPE", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 26, "tags": { "PURPOSE": "Maps plugin identifiers to normalized report task types." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "TASK_TYPE_PROFILES", "type": "Data", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 74, "tags": { "PURPOSE": "Profile metadata registry for each normalized task type." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_task_type", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 100, "tags": { "PURPOSE": "Resolve canonical task type from plugin/task identifier with guaranteed fallback.", "PRE": "plugin_id may be None or unknown.", "POST": "Always returns one of TaskType enum values.", "PARAM": "plugin_id (Optional[str]) - Source plugin/task identifier from task record.", "RETURN": "TaskType - Resolved canonical type or UNKNOWN fallback.", "TEST_CONTRACT": "ResolveTaskType ->", "TEST_FIXTURE": "valid_plugin -> {\"plugin_id\": \"superset-migration\"}", "TEST_EDGE": "unknown_plugin -> {\"plugin_id\": \"invalid-plugin\"}", "TEST_INVARIANT": "fallback_to_unknown -> verifies: [empty_plugin, none_plugin, unknown_plugin]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_type_profile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 121, "tags": { "PURPOSE": "Return deterministic profile metadata for a task type.", "PRE": "task_type may be known or unknown.", "POST": "Returns a profile dict and never raises for unknown types.", "PARAM": "task_type (TaskType) - Canonical task type.", "RETURN": "Dict[str, Any] - Profile metadata used by normalization and UI contracts.", "TEST_CONTRACT": "GetTypeProfile ->", "TEST_FIXTURE": "valid_profile -> {\"task_type\": \"migration\"}", "TEST_EDGE": "missing_profile -> {\"task_type\": \"some_new_type\"}", "TEST_INVARIANT": "always_returns_dict -> verifies: [valid_profile, missing_profile]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "backend.src.services.reports.report_service", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 246, "tags": { "COMPLEXITY": "5", "SEMANTICS": "reports, service, aggregation, filtering, pagination, detail", "PURPOSE": "Aggregate, normalize, filter, and paginate task reports for unified list/detail API use cases.", "LAYER": "Domain", "INVARIANT": "List responses are deterministic and include applied filter echo metadata." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.core.task_manager.manager.TaskManager" }, { "type": "DEPENDS_ON", "target": "backend.src.models.report" }, { "type": "DEPENDS_ON", "target": "backend.src.services.reports.normalizer" } ], "children": [ { "name": "ReportsService", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 24, "end_line": 244, "tags": { "PURPOSE": "Service layer for list/detail report retrieval and normalization.", "COMPLEXITY": "5", "PRE": "TaskManager dependency is initialized.", "POST": "Provides deterministic list/detail report responses.", "INVARIANT": "Service methods are read-only over task history source.", "TEST_CONTRACT": "ReportsServiceModel ->", "TEST_FIXTURE": "valid_service -> {\"task_manager\": \"MockTaskManager()\"}", "TEST_EDGE": "report_not_found -> get_report_detail returns None", "TEST_INVARIANT": "consistent_pagination -> verifies: [valid_service]" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 5, "tier": "CRITICAL", "start_line": 44, "end_line": 55, "tags": { "COMPLEXITY": "5", "PURPOSE": "Initialize service with TaskManager dependency.", "PRE": "task_manager is a live TaskManager instance.", "POST": "self.task_manager is assigned and ready for read operations.", "INVARIANT": "Constructor performs no task mutations.", "PARAM": "task_manager (TaskManager) - Task manager providing source task history." }, "relations": [], "children": [], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 44 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 44 } ], "score": 0.0 } }, { "name": "_load_normalized_reports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 68, "tags": { "PURPOSE": "Build normalized reports from all available tasks.", "PRE": "Task manager returns iterable task history records.", "POST": "Returns normalized report list preserving source cardinality.", "INVARIANT": "Every returned item is a TaskReport.", "RETURN": "List[TaskReport] - Reports sorted later by list logic." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_to_utc_datetime", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 84, "tags": { "PURPOSE": "Normalize naive/aware datetime values to UTC-aware datetime for safe comparisons.", "PRE": "value is either datetime or None.", "POST": "Returns UTC-aware datetime or None.", "INVARIANT": "Naive datetimes are interpreted as UTC to preserve deterministic ordering/filtering.", "PARAM": "value (Optional[datetime]) - Source datetime value.", "RETURN": "Optional[datetime] - UTC-aware datetime or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_datetime_sort_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 86, "end_line": 99, "tags": { "PURPOSE": "Produce stable numeric sort key for report timestamps.", "PRE": "report contains updated_at datetime.", "POST": "Returns float timestamp suitable for deterministic sorting.", "INVARIANT": "Mixed naive/aware datetimes never raise TypeError.", "PARAM": "report (TaskReport) - Report item.", "RETURN": "float - UTC timestamp key." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_matches_query", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 129, "tags": { "PURPOSE": "Apply query filtering to a report.", "PRE": "report and query are normalized schema instances.", "POST": "Returns True iff report satisfies all active query filters.", "INVARIANT": "Filter evaluation is side-effect free.", "PARAM": "query (ReportQuery) - Applied query.", "RETURN": "bool - True if report matches all filters." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_sort_reports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 151, "tags": { "PURPOSE": "Sort reports deterministically according to query settings.", "PRE": "reports contains only TaskReport items.", "POST": "Returns reports ordered by selected sort field and order.", "INVARIANT": "Sorting criteria are deterministic for equal input.", "PARAM": "query (ReportQuery) - Sort config.", "RETURN": "List[TaskReport] - Sorted reports." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_reports", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 179, "tags": { "PURPOSE": "Return filtered, sorted, paginated report collection.", "PRE": "query has passed schema validation.", "POST": "Returns {items,total,page,page_size,has_next,applied_filters}.", "PARAM": "query (ReportQuery) - List filters and pagination.", "RETURN": "ReportCollection - Paginated unified reports payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_report_detail", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 243, "tags": { "PURPOSE": "Return one normalized report with timeline/diagnostics/next actions.", "PRE": "report_id exists in normalized report set.", "POST": "Returns normalized detail envelope with diagnostics and next actions where applicable.", "PARAM": "report_id (str) - Stable report identifier.", "RETURN": "Optional[ReportDetailView] - Detailed report or None if not found." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 24 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 24 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 } ], "score": 0.0 } }, { "name": "src.services.reports", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Report service package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_type_profiles", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 47, "tags": { "PURPOSE": "Auto-generated module for backend/src/services/reports/__tests__/test_type_profiles.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "test_resolve_task_type_fallbacks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 12, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_task_type_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_type_profile_valid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 28, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_type_profile_fallback", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 37, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 183, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for ReportsService list/detail operations", "LAYER": "Domain" }, "relations": [ { "type": "TESTS", "target": "backend.src.services.reports.report_service.ReportsService" } ], "children": [ { "name": "_make_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_empty_tasks_returns_empty_collection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 40, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_single_task_normalized", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_pagination_first_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 57, "end_line": 57, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_pagination_last_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 70, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_filter_by_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_filter_by_task_type", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 93, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_search_filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sort_by_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 117, "end_line": 117, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_applied_filters_echoed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 130, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 142, "end_line": 142, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_detail_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 148, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_detail_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 155, "end_line": 155, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_detail_includes_timeline", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 160, "end_line": 160, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_detail_failed_task_has_next_actions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 170, "end_line": 170, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_detail_success_task_no_error_next_actions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 176, "end_line": 176, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.test_report_normalizer", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 68, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, reports, normalizer, fallback", "PURPOSE": "Validate unknown task type fallback and partial payload normalization behavior.", "LAYER": "Domain (Tests)", "INVARIANT": "Unknown plugin types are mapped to canonical unknown task type." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.reports.normalizer" } ], "children": [ { "name": "test_unknown_type_maps_to_unknown_profile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 15, "end_line": 15, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_partial_payload_keeps_report_visible_with_placeholders", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 33, "end_line": 33, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_clean_release_plugin_maps_to_clean_release_task_type", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 51, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "BackupPlugin", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 261, "tags": { "SEMANTICS": "backup, superset, automation, dashboard, plugin", "PURPOSE": "A plugin that provides functionality to back up Superset dashboards.", "LAYER": "App" }, "relations": [ { "type": "IMPLEMENTS", "target": "PluginBase" }, { "type": "DEPENDS_ON", "target": "superset_tool.client" }, { "type": "DEPENDS_ON", "target": "superset_tool.utils" }, { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "BackupPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 260, "tags": { "PURPOSE": "Implementation of the backup plugin logic." }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 45, "tags": { "PURPOSE": "Returns the unique identifier for the backup plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string ID.", "RETURN": "str - \"superset-backup\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 56, "tags": { "PURPOSE": "Returns the human-readable name of the backup plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string name.", "RETURN": "str - Plugin name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 67, "tags": { "PURPOSE": "Returns a description of the backup plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string description.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 78, "tags": { "PURPOSE": "Returns the version of the backup plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string version.", "RETURN": "str - \"1.0.0\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 87, "tags": { "PURPOSE": "Returns the frontend route for the backup plugin.", "RETURN": "str - \"/tools/backups\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 112, "tags": { "PURPOSE": "Returns the JSON schema for backup plugin parameters.", "PRE": "Plugin instance exists.", "POST": "Returns dictionary schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 114, "end_line": 259, "tags": { "PURPOSE": "Executes the dashboard backup logic with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "Target environment must be configured. params must be a dictionary.", "POST": "All dashboards are exported and archived." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "DebugPluginModule", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 216, "tags": { "SEMANTICS": "plugin, debug, api, database, superset", "PURPOSE": "Implements a plugin for system diagnostics and debugging Superset API responses.", "LAYER": "Plugins", "RELATION": "Inherits from PluginBase. Uses SupersetClient from core.", "CONSTRAINT": "Must use belief_scope for logging." }, "relations": [ { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "DebugPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 215, "tags": { "PURPOSE": "Plugin for system diagnostics and debugging." }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 33, "tags": { "PURPOSE": "Returns the unique identifier for the debug plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string ID.", "RETURN": "str - \"system-debug\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 44, "tags": { "PURPOSE": "Returns the human-readable name of the debug plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string name.", "RETURN": "str - Plugin name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 55, "tags": { "PURPOSE": "Returns a description of the debug plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string description.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 66, "tags": { "PURPOSE": "Returns the version of the debug plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string version.", "RETURN": "str - \"1.0.0\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 75, "tags": { "PURPOSE": "Returns the frontend route for the debug plugin.", "RETURN": "str - \"/tools/debug\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 116, "tags": { "PURPOSE": "Returns the JSON schema for the debug plugin parameters.", "PRE": "Plugin instance exists.", "POST": "Returns dictionary schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 143, "tags": { "PURPOSE": "Executes the debug logic with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "action must be provided in params.", "POST": "Debug action is executed and results returned.", "RETURN": "Dict[str, Any] - Execution results." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_test_db_api", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 181, "tags": { "PURPOSE": "Tests database API connectivity for source and target environments.", "PRE": "source_env and target_env params exist in params.", "POST": "Returns DB counts for both envs.", "PARAM": "log - Logger instance for superset_api source.", "RETURN": "Dict - Comparison results." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_dataset_structure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 213, "tags": { "PURPOSE": "Retrieves the structure of a dataset.", "PRE": "env and dataset_id params exist in params.", "POST": "Returns dataset JSON structure.", "PARAM": "log - Logger instance for superset_api source.", "RETURN": "Dict - Dataset structure." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "SearchPluginModule", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 221, "tags": { "SEMANTICS": "plugin, search, datasets, regex, superset", "PURPOSE": "Implements a plugin for searching text patterns across all datasets in a specific Superset environment.", "LAYER": "Plugins", "RELATION": "Inherits from PluginBase. Uses SupersetClient from core.", "CONSTRAINT": "Must use belief_scope for logging." }, "relations": [ { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "SearchPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 220, "tags": { "PURPOSE": "Plugin for searching text patterns in Superset datasets." }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 34, "tags": { "PURPOSE": "Returns the unique identifier for the search plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string ID.", "RETURN": "str - \"search-datasets\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 37, "end_line": 45, "tags": { "PURPOSE": "Returns the human-readable name of the search plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string name.", "RETURN": "str - Plugin name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 56, "tags": { "PURPOSE": "Returns a description of the search plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string description.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 67, "tags": { "PURPOSE": "Returns the version of the search plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string version.", "RETURN": "str - \"1.0.0\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 76, "tags": { "PURPOSE": "Returns the frontend route for the search plugin.", "RETURN": "str - \"/tools/search\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 101, "tags": { "PURPOSE": "Returns the JSON schema for the search plugin parameters.", "PRE": "Plugin instance exists.", "POST": "Returns dictionary schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 180, "tags": { "PURPOSE": "Executes the dataset search logic with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "Params contain valid 'env' and 'query'.", "POST": "Returns a dictionary with count and results list.", "RETURN": "Dict[str, Any] - Search results." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 182, "end_line": 218, "tags": { "PURPOSE": "Extracts a small context around the match for display.", "PARAM": "context_lines (int) - Number of lines of context to include.", "PRE": "text and match_text must be strings.", "POST": "Returns context string.", "RETURN": "str - Extracted context." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "MapperPluginModule", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 215, "tags": { "SEMANTICS": "plugin, mapper, datasets, postgresql, excel", "PURPOSE": "Implements a plugin for mapping dataset columns using external database connections or Excel files.", "LAYER": "Plugins", "RELATION": "Inherits from PluginBase. Uses DatasetMapper from superset_tool.", "CONSTRAINT": "Must use belief_scope for logging." }, "relations": [ { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "MapperPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 214, "tags": { "PURPOSE": "Plugin for mapping dataset columns verbose names." }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 36, "tags": { "PURPOSE": "Returns the unique identifier for the mapper plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string ID.", "RETURN": "str - \"dataset-mapper\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 47, "tags": { "PURPOSE": "Returns the human-readable name of the mapper plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string name.", "RETURN": "str - Plugin name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 58, "tags": { "PURPOSE": "Returns a description of the mapper plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string description.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 61, "end_line": 69, "tags": { "PURPOSE": "Returns the version of the mapper plugin.", "PRE": "Plugin instance exists.", "POST": "Returns string version.", "RETURN": "str - \"1.0.0\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 78, "tags": { "PURPOSE": "Returns the frontend route for the mapper plugin.", "RETURN": "str - \"/tools/mapper\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 130, "tags": { "PURPOSE": "Returns the JSON schema for the mapper plugin parameters.", "PRE": "Plugin instance exists.", "POST": "Returns dictionary schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 132, "end_line": 212, "tags": { "PURPOSE": "Executes the dataset mapping logic with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "Params contain valid 'env', 'dataset_id', and 'source'. params must be a dictionary.", "POST": "Updates the dataset in Superset.", "RETURN": "Dict[str, Any] - Execution status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "backend.src.plugins.git_plugin", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 401, "tags": { "SEMANTICS": "git, plugin, dashboard, version_control, sync, deploy", "PURPOSE": "\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u043e\u0432 Superset.", "LAYER": "Plugin", "INVARIANT": "\u0412\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 Git \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 GitService.", "CONSTRAINT": "\u041f\u043b\u0430\u0433\u0438\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 YAML-\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430\u043c\u0438 Superset." }, "relations": [ { "type": "INHERITS_FROM", "target": "src.core.plugin_base.PluginBase" }, { "type": "USES", "target": "src.services.git_service.GitService" }, { "type": "USES", "target": "src.core.superset_client.SupersetClient" }, { "type": "USES", "target": "src.core.config_manager.ConfigManager" }, { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "GitPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 400, "tags": { "PURPOSE": "\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Git Integration \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u043e\u0432." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 36, "end_line": 64, "tags": { "PURPOSE": "\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.", "PRE": "config.json exists or shared config_manager is available.", "POST": "\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b git_service \u0438 config_manager." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 74, "tags": { "PURPOSE": "Returns the plugin identifier.", "PRE": "GitPlugin is initialized.", "POST": "Returns 'git-integration'." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 84, "tags": { "PURPOSE": "Returns the plugin name.", "PRE": "GitPlugin is initialized.", "POST": "Returns the human-readable name." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 94, "tags": { "PURPOSE": "Returns the plugin description.", "PRE": "GitPlugin is initialized.", "POST": "Returns the plugin's purpose description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 104, "tags": { "PURPOSE": "Returns the plugin version.", "PRE": "GitPlugin is initialized.", "POST": "Returns the version string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 107, "end_line": 113, "tags": { "PURPOSE": "Returns the frontend route for the git plugin.", "RETURN": "str - \"/git\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 132, "tags": { "PURPOSE": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON-\u0441\u0445\u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043b\u0430\u0433\u0438\u043d\u0430.", "PRE": "GitPlugin is initialized.", "POST": "Returns a JSON schema dictionary.", "RETURN": "Dict[str, Any] - \u0421\u0445\u0435\u043c\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "initialize", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 399, "tags": { "PURPOSE": "\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430.", "PRE": "GitPlugin is initialized.", "POST": "\u041f\u043b\u0430\u0433\u0438\u043d \u0433\u043e\u0442\u043e\u0432 \u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u0447." }, "relations": [], "children": [ { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 142, "end_line": 179, "tags": { "PURPOSE": "\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 TaskContext.", "PRE": "task_data \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 'operation' \u0438 'dashboard_id'.", "POST": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "RETURN": "Dict[str, Any] - \u0421\u0442\u0430\u0442\u0443\u0441 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435." }, "relations": [ { "type": "CALLS", "target": "self._handle_sync" }, { "type": "CALLS", "target": "self._handle_deploy" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_handle_sync", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 261, "tags": { "PURPOSE": "\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0438\u0437 Superset \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0432 Git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.", "PRE": "\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c.", "POST": "\u0424\u0430\u0439\u043b\u044b \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 Superset.", "PARAM": "source_env_id (Optional[str]) - ID \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.", "RETURN": "Dict[str, str] - \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438.", "SIDE_EFFECT": "\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f." }, "relations": [ { "type": "CALLS", "target": "src.services.git_service.GitService.get_repo" }, { "type": "CALLS", "target": "src.core.superset_client.SupersetClient.export_dashboard" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_handle_deploy", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 263, "end_line": 332, "tags": { "PURPOSE": "\u0423\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0432 ZIP \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 Superset.", "PRE": "environment_id \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e.", "POST": "\u0414\u0430\u0448\u0431\u043e\u0440\u0434 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 Superset.", "PARAM": "superset_log - Superset API-specific logger instance.", "RETURN": "Dict[str, Any] - \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u043f\u043b\u043e\u044f.", "SIDE_EFFECT": "\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 ZIP-\u0444\u0430\u0439\u043b." }, "relations": [ { "type": "CALLS", "target": "src.core.superset_client.SupersetClient.import_dashboard" } ], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_get_env", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 334, "end_line": 397, "tags": { "PURPOSE": "\u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.", "PARAM": "env_id (Optional[str]) - ID \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.", "PRE": "env_id is a string or None.", "POST": "Returns an Environment object from config or DB.", "RETURN": "Environment - \u041e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: INHERITS_FROM. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 401 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.10000000000000009 } }, { "name": "MigrationPlugin", "type": "Module", "complexity": 5, "tier": "CRITICAL", "start_line": 1, "end_line": 384, "tags": { "COMPLEXITY": "5", "SEMANTICS": "migration, superset, automation, dashboard, plugin, transformation", "PURPOSE": "Orchestrates export, DB-mapping transformation, and import of Superset dashboards across environments.", "LAYER": "App", "INVARIANT": "Dashboards must never be imported with unmapped/source DB connections to prevent data leaks or cross-environment pollution." }, "relations": [ { "type": "IMPLEMENTS", "target": "PluginBase" }, { "type": "DEPENDS_ON", "target": "SupersetClient" }, { "type": "DEPENDS_ON", "target": "MigrationEngine" }, { "type": "DEPENDS_ON", "target": "IdMappingService" }, { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "MigrationPlugin", "type": "Class", "complexity": 5, "tier": "CRITICAL", "start_line": 27, "end_line": 383, "tags": { "PURPOSE": "Implementation of the migration plugin workflow and transformation orchestration.", "PRE": "Plugin loader must register this instance.", "POST": "Provides migration UI schema and executes atomic dashboard transfers.", "TEST_FIXTURE": "password_inject_payload -> INLINE_JSON: {\"passwords\": {\"PostgreSQL\": \"secret123\"}}", "TEST_INVARIANT": "strict_db_isolation -> VERIFIED_BY: [successful_dashboard_transfer, missing_mapping_resolution]" }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 49, "tags": { "PURPOSE": "Returns the unique identifier for the migration plugin.", "PRE": "None.", "POST": "Returns stable string \"superset-migration\".", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 60, "tags": { "PURPOSE": "Returns the human-readable name of the plugin.", "PRE": "None.", "POST": "Returns \"Superset Dashboard Migration\".", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 71, "tags": { "PURPOSE": "Returns the semantic description of the plugin.", "PRE": "None.", "POST": "Returns description string.", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 74, "end_line": 82, "tags": { "PURPOSE": "Returns the semantic version of the migration plugin.", "PRE": "None.", "POST": "Returns \"1.0.0\".", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 93, "tags": { "PURPOSE": "Returns the frontend routing anchor for the plugin.", "PRE": "None.", "POST": "Returns \"/migration\".", "RETURN": "str" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 95, "end_line": 147, "tags": { "PURPOSE": "Generates the JSON Schema for the plugin execution form dynamically.", "PRE": "ConfigManager is accessible and environments are defined.", "POST": "Returns a JSON Schema dict matching current system environments.", "RETURN": "Dict[str, Any]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 149, "end_line": 382, "tags": { "PURPOSE": "Orchestrates the dashboard migration pipeline including extraction, AST mutation, and ingestion.", "PARAM": "context (Optional[TaskContext]) - Dependency injected TaskContext for IO tracing.", "PRE": "Source and target environments must resolve. Matching dashboards must exist.", "POST": "Dashboard ZIP bundles are transformed and imported. ID mappings are synchronized.", "SIDE_EFFECT": "Creates temp files, mutates target Superset state, blocks on user input (passwords/mappings).", "TEST_CONTRACT": "Dict[str, Any] -> Dict[str, Any]", "TEST_SCENARIO": "empty_selection -> Returns NO_MATCHES gracefully when regex finds zero dashboards.", "TEST_EDGE": "target_api_timeout -> [Dashboard added to failed_dashboards, task concludes with PARTIAL_SUCCESS]" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @INVARIANT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 27 }, { "message": "Missing @INVARIANT tag (required for complexity 5)", "severity": "ERROR", "line_number": 27 } ], "score": 0.0 } } ], "compliance": { "valid": false, "issues": [ { "message": "Missing Mandatory Tag: @PRE (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @POST (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @SIDE_EFFECT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Missing Mandatory Tag: @DATA_CONTRACT (required for complexity 5)", "severity": "ERROR", "line_number": 1 }, { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "ERROR", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 384 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.0 } }, { "name": "src.plugins", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Plugin package root for dynamic discovery and runtime imports." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "schedule_dashboard_validation", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 42, "tags": { "PURPOSE": "Schedules a recurring dashboard validation task.", "PARAM": "params (Dict[str, Any]) - Task parameters (environment_id, provider_id).", "SIDE_EFFECT": "Adds a job to the scheduler service." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_parse_cron", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 60, "tags": { "PURPOSE": "Basic cron parser placeholder.", "PARAM": "cron (str) - Cron expression.", "RETURN": "Dict[str, str] - Parsed cron parts." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "scheduler", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 62, "tags": { "PURPOSE": "Auto-generated module for backend/src/plugins/llm_analysis/scheduler.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "job_func", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMProviderType", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 18, "tags": { "PURPOSE": "Enum for supported LLM providers." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMProviderConfig", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 30, "tags": { "PURPOSE": "Configuration for an LLM provider." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationStatus", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 39, "tags": { "PURPOSE": "Enum for dashboard validation status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DetectedIssue", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 47, "tags": { "PURPOSE": "Model for a single issue detected during validation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ValidationResult", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 60, "tags": { "PURPOSE": "Model for dashboard validation result." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_is_masked_or_invalid_api_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 46, "tags": { "PURPOSE": "Guards against placeholder or malformed API keys in runtime.", "PRE": "value may be None.", "POST": "Returns True when value cannot be used for authenticated provider calls." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_json_safe_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 60, "tags": { "PURPOSE": "Recursively normalize payload values for JSON serialization.", "PRE": "value may be nested dict/list with datetime values.", "POST": "datetime values are converted to ISO strings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DashboardValidationPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 323, "tags": { "PURPOSE": "Plugin for automated dashboard health analysis using LLMs." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.core.plugin_base.PluginBase" } ], "children": [ { "name": "DashboardValidationPlugin.execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 322, "tags": { "PURPOSE": "Executes the dashboard validation task with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "params contains dashboard_id, environment_id, and provider_id.", "POST": "Returns a dictionary with validation results and persists them to the database.", "SIDE_EFFECT": "Captures a screenshot, calls LLM API, and writes to the database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "DocumentationPlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 325, "end_line": 479, "tags": { "PURPOSE": "Plugin for automated dataset documentation using LLMs." }, "relations": [ { "type": "IMPLEMENTS", "target": "backend.src.core.plugin_base.PluginBase" } ], "children": [ { "name": "DocumentationPlugin.execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 356, "end_line": 478, "tags": { "PURPOSE": "Executes the dataset documentation task with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "params contains dataset_id, environment_id, and provider_id.", "POST": "Returns generated documentation and updates the dataset in Superset.", "SIDE_EFFECT": "Calls LLM API and updates dataset metadata in Superset." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "plugin", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 481, "tags": { "PURPOSE": "Auto-generated module for backend/src/plugins/llm_analysis/plugin.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 67, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 79, "end_line": 79, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 100, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 330, "end_line": 330, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 334, "end_line": 334, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 338, "end_line": 338, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 342, "end_line": 342, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 345, "end_line": 345, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 363, "end_line": 363, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 481 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "ScreenshotService", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 675, "tags": { "PURPOSE": "Handles capturing screenshots of Superset dashboards." }, "relations": [], "children": [ { "name": "ScreenshotService.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 36, "tags": { "PURPOSE": "Initializes the ScreenshotService with environment configuration.", "PRE": "env is a valid Environment object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._find_first_visible_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 53, "tags": { "PURPOSE": "Resolve the first visible locator from multiple Playwright locator strategies.", "PRE": "candidates is a non-empty list of locator-like objects.", "POST": "Returns a locator ready for interaction or None when nothing matches." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._iter_login_roots", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 69, "tags": { "PURPOSE": "Enumerate page and child frames where login controls may be rendered.", "PRE": "page is a Playwright page-like object.", "POST": "Returns ordered roots starting with main page followed by frames." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._extract_hidden_login_fields", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 90, "tags": { "PURPOSE": "Collect hidden form fields required for direct login POST fallback.", "PRE": "Login page is loaded.", "POST": "Returns hidden input name/value mapping aggregated from page and child frames." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._extract_csrf_token", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 92, "end_line": 99, "tags": { "PURPOSE": "Resolve CSRF token value from main page or embedded login frame.", "PRE": "Login page is loaded.", "POST": "Returns first non-empty csrf token or empty string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._response_looks_like_login_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 118, "tags": { "PURPOSE": "Detect when fallback login POST returned the login form again instead of an authenticated page.", "PRE": "response_text is normalized HTML or text from login POST response.", "POST": "Returns True when login-page markers dominate the response body." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._redirect_looks_authenticated", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 129, "tags": { "PURPOSE": "Treat non-login redirects after form POST as successful authentication without waiting for redirect target.", "PRE": "redirect_location may be empty or relative.", "POST": "Returns True when redirect target does not point back to login flow." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._submit_login_via_form_post", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 191, "tags": { "PURPOSE": "Fallback login path that submits credentials directly with csrf token.", "PRE": "login_url is same-origin and csrf token can be read from DOM.", "POST": "Browser context receives authenticated cookies when login succeeds." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._find_login_field_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 193, "end_line": 231, "tags": { "PURPOSE": "Resolve login form input using semantic label text plus generic visible-input fallbacks.", "PRE": "field_name is `username` or `password`.", "POST": "Returns a locator for the corresponding input or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._find_submit_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 233, "end_line": 251, "tags": { "PURPOSE": "Resolve login submit button from main page or embedded auth frame.", "PRE": "page is ready for login interaction.", "POST": "Returns visible submit locator or None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService._goto_resilient", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 253, "end_line": 272, "tags": { "PURPOSE": "Navigate without relying on networkidle for pages with long-polling or persistent requests.", "PRE": "page is a valid Playwright page and url is non-empty.", "POST": "Returns last navigation response or raises when both primary and fallback waits fail." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ScreenshotService.capture_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 274, "end_line": 674, "tags": { "PURPOSE": "Captures a full-page screenshot of a dashboard using Playwright and CDP.", "PRE": "dashboard_id is a valid string, output_path is a writable path.", "POST": "Returns True if screenshot is saved successfully.", "SIDE_EFFECT": "Launches a browser, performs UI login, switches tabs, and writes a PNG file.", "UX_STATE": "[Capturing] -> Executing CDP screenshot" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMClient", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 677, "end_line": 951, "tags": { "PURPOSE": "Wrapper for LLM provider APIs." }, "relations": [], "children": [ { "name": "LLMClient.__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 680, "end_line": 720, "tags": { "PURPOSE": "Initializes the LLMClient with provider settings.", "PRE": "api_key, base_url, and default_model are non-empty strings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMClient._supports_json_response_format", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 722, "end_line": 740, "tags": { "PURPOSE": "Detect whether provider/model is likely compatible with response_format=json_object.", "PRE": "Client initialized with base_url and default_model.", "POST": "Returns False for known-incompatible combinations to avoid avoidable 400 errors." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMClient.get_json_completion", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 742, "end_line": 862, "tags": { "PURPOSE": "Helper to handle LLM calls with JSON mode and fallback parsing.", "PRE": "messages is a list of valid message dictionaries.", "POST": "Returns a parsed JSON dictionary.", "SIDE_EFFECT": "Calls external LLM API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMClient.test_runtime_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 864, "end_line": 878, "tags": { "PURPOSE": "Validate provider credentials using the same chat completions transport as runtime analysis.", "PRE": "Client is initialized with provider credentials and default_model.", "POST": "Returns lightweight JSON payload when runtime auth/model path is valid.", "SIDE_EFFECT": "Calls external LLM API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "LLMClient.analyze_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 880, "end_line": 950, "tags": { "PURPOSE": "Sends dashboard data (screenshot + logs) to LLM for health analysis.", "PRE": "screenshot_path exists, logs is a list of strings.", "POST": "Returns a structured analysis dictionary (status, summary, issues).", "SIDE_EFFECT": "Reads screenshot file and calls external LLM API." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "service", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 953, "tags": { "PURPOSE": "Auto-generated module for backend/src/plugins/llm_analysis/service.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_find_first_visible_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_iter_login_roots", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 59, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_hidden_login_fields", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_extract_csrf_token", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 96, "end_line": 96, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_response_looks_like_login_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_redirect_looks_authenticated", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 124, "end_line": 124, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_submit_login_via_form_post", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_find_login_field_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 197, "end_line": 197, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_find_submit_locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 237, "end_line": 237, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_goto_resilient", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 257, "end_line": 257, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "capture_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 283, "end_line": 283, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "switch_tabs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 514, "end_line": 514, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 683, "end_line": 683, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_supports_json_response_format", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 726, "end_line": 726, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_should_retry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 747, "end_line": 747, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_json_completion", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 761, "end_line": 761, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_runtime_connection", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 869, "end_line": 869, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "analyze_dashboard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 885, "end_line": 885, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Fractal limit warning: Module length is 953 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.85 } }, { "name": "backend.src.plugins.llm_analysis.__tests__.test_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 67, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, llm-analysis, fallback, provider-error, unknown-status", "PURPOSE": "Verify LLM analysis transport/provider failures do not masquerade as dashboard FAIL results." }, "relations": [], "children": [ { "name": "test_test_runtime_connection_uses_json_completion_transport", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 12, "end_line": 37, "tags": { "PURPOSE": "Provider self-test must exercise the same chat completion transport as runtime analysis.", "PRE": "get_json_completion is available on initialized client.", "POST": "Self-test forwards a lightweight user message into get_json_completion and returns its payload." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_analyze_dashboard_provider_error_maps_to_unknown", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 40, "end_line": 66, "tags": { "PURPOSE": "Infrastructure/provider failures must produce UNKNOWN analysis status rather than FAIL.", "PRE": "LLMClient.get_json_completion raises provider/auth exception.", "POST": "Returned payload uses status=UNKNOWN and issue severity UNKNOWN." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_fake_get_json_completion", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_raise_provider_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 56, "end_line": 56, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.plugins.llm_analysis.__tests__.test_client_headers", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 30, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, llm-client, openrouter, headers", "PURPOSE": "Verify OpenRouter client initialization includes provider-specific headers." }, "relations": [], "children": [ { "name": "test_openrouter_client_includes_referer_and_title_headers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 10, "end_line": 29, "tags": { "PURPOSE": "OpenRouter requests should carry site/app attribution headers for compatibility.", "PRE": "Client is initialized for OPENROUTER provider.", "POST": "Async client headers include Authorization, HTTP-Referer, and X-Title." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.src.plugins.llm_analysis.__tests__.test_screenshot_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 344, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, screenshot-service, navigation, timeout-regression", "PURPOSE": "Protect dashboard screenshot navigation from brittle networkidle waits." }, "relations": [], "children": [ { "name": "test_iter_login_roots_includes_child_frames", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 11, "end_line": 24, "tags": { "PURPOSE": "Login discovery must search embedded auth frames, not only the main page.", "PRE": "Page exposes child frames list.", "POST": "Returned roots include page plus child frames in order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_response_looks_like_login_page_detects_login_markup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 48, "tags": { "PURPOSE": "Direct login fallback must reject responses that render the login screen again.", "PRE": "Response body contains stable login-page markers.", "POST": "Helper returns True so caller treats fallback as failed authentication." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_find_first_visible_locator_skips_hidden_first_match", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 84, "tags": { "PURPOSE": "Locator helper must not reject a selector collection just because its first element is hidden.", "PRE": "First matched element is hidden and second matched element is visible.", "POST": "Helper returns the second visible candidate." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_submit_login_via_form_post_uses_browser_context_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 176, "tags": { "PURPOSE": "Fallback login must submit hidden fields and credentials through the context request cookie jar.", "PRE": "Login DOM exposes csrf hidden field and request context returns authenticated HTML.", "POST": "Helper returns True and request payload contains csrf_token plus credentials plus request options." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_submit_login_via_form_post_accepts_authenticated_redirect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 179, "end_line": 238, "tags": { "PURPOSE": "Fallback login must treat non-login 302 redirect as success without waiting for redirect target.", "PRE": "Request response is 302 with Location outside login path.", "POST": "Helper returns True." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_submit_login_via_form_post_rejects_login_markup_response", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 241, "end_line": 308, "tags": { "PURPOSE": "Fallback login must fail when POST response still contains login form content.", "PRE": "Login DOM exposes csrf hidden field and request response renders login markup.", "POST": "Helper returns False." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_goto_resilient_falls_back_from_domcontentloaded_to_load", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 311, "end_line": 343, "tags": { "PURPOSE": "Pages with unstable primary wait must retry with fallback wait strategy.", "PRE": "First page.goto call raises; second succeeds.", "POST": "Helper returns second response and attempts both wait modes in order." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 58, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "is_visible", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 66, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "nth", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 72, "end_line": 72, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_attribute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 98, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "input_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 101, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 105, "end_line": 105, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "nth", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 118, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 122, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "post", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 125, "end_line": 125, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 137, "end_line": 137, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 141, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 145, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 186, "end_line": 186, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_attribute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 190, "end_line": 190, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "input_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 193, "end_line": 193, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 197, "end_line": 197, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 200, "end_line": 200, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "nth", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 203, "end_line": 203, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 211, "end_line": 211, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "post", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 215, "end_line": 215, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 219, "end_line": 219, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 223, "end_line": 223, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 227, "end_line": 227, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 248, "end_line": 248, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_attribute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 252, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "input_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 255, "end_line": 255, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 259, "end_line": 259, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "count", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 262, "end_line": 262, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "nth", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 265, "end_line": 265, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "text", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 272, "end_line": 272, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "post", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 285, "end_line": 285, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 289, "end_line": 289, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 293, "end_line": 293, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "locator", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 297, "end_line": 297, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 318, "end_line": 318, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "goto", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 321, "end_line": 321, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @LAYER (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 344 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.4 } }, { "name": "StoragePlugin", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 391, "tags": { "SEMANTICS": "storage, files, filesystem, plugin", "PURPOSE": "Provides core filesystem operations for managing backups and repositories.", "LAYER": "App", "INVARIANT": "All file operations must be restricted to the configured storage root." }, "relations": [ { "type": "IMPLEMENTS", "target": "PluginBase" }, { "type": "DEPENDS_ON", "target": "backend.src.models.storage" }, { "type": "USES", "target": "TaskContext" } ], "children": [ { "name": "StoragePlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 27, "end_line": 390, "tags": { "PURPOSE": "Implementation of the storage management plugin." }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 41, "tags": { "PURPOSE": "Initializes the StoragePlugin and ensures required directories exist.", "PRE": "Configuration manager must be accessible.", "POST": "Storage root and category directories are created on disk." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 52, "tags": { "PURPOSE": "Returns the unique identifier for the storage plugin.", "PRE": "None.", "POST": "Returns the plugin ID string.", "RETURN": "str - \"storage-manager\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 63, "tags": { "PURPOSE": "Returns the human-readable name of the storage plugin.", "PRE": "None.", "POST": "Returns the plugin name string.", "RETURN": "str - \"Storage Manager\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "description", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 66, "end_line": 74, "tags": { "PURPOSE": "Returns a description of the storage plugin.", "PRE": "None.", "POST": "Returns the plugin description string.", "RETURN": "str - Plugin description." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 77, "end_line": 85, "tags": { "PURPOSE": "Returns the version of the storage plugin.", "PRE": "None.", "POST": "Returns the version string.", "RETURN": "str - \"1.0.0\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ui_route", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 88, "end_line": 94, "tags": { "PURPOSE": "Returns the frontend route for the storage plugin.", "RETURN": "str - \"/tools/storage\"" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_schema", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 96, "end_line": 114, "tags": { "PURPOSE": "Returns the JSON schema for storage plugin parameters.", "PRE": "None.", "POST": "Returns a dictionary representing the JSON schema.", "RETURN": "Dict[str, Any] - JSON schema." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 132, "tags": { "PURPOSE": "Executes storage-related tasks with TaskContext support.", "PARAM": "context (Optional[TaskContext]) - Task context for logging with source attribution.", "PRE": "params must match the plugin schema.", "POST": "Task is executed and logged." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_storage_root", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 154, "tags": { "PURPOSE": "Resolves the absolute path to the storage root.", "PRE": "Settings must define a storage root path.", "POST": "Returns a Path object representing the storage root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "resolve_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 178, "tags": { "PURPOSE": "Resolves a dynamic path pattern using provided variables.", "PARAM": "variables (Dict[str, str]) - Variables to substitute in the pattern.", "PRE": "pattern must be a valid format string.", "POST": "Returns the resolved path string.", "RETURN": "str - The resolved path." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "ensure_directories", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 180, "end_line": 193, "tags": { "PURPOSE": "Creates the storage root and category subdirectories if they don't exist.", "PRE": "Storage root must be resolvable.", "POST": "Directories are created on the filesystem.", "SIDE_EFFECT": "Creates directories on the filesystem." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "validate_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 195, "end_line": 209, "tags": { "PURPOSE": "Prevents path traversal attacks by ensuring the path is within the storage root.", "PRE": "path must be a Path object.", "POST": "Returns the resolved absolute path if valid, otherwise raises ValueError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "list_files", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 211, "end_line": 307, "tags": { "PURPOSE": "Lists all files and directories in a specific category and subpath.", "PARAM": "recursive (bool) - Whether to scan nested subdirectories recursively.", "PRE": "Storage root must exist.", "POST": "Returns a list of StoredFile objects.", "RETURN": "List[StoredFile] - List of file and directory metadata objects." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "save_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 309, "end_line": 341, "tags": { "PURPOSE": "Saves an uploaded file to the specified category and optional subpath.", "PARAM": "subpath (Optional[str]) - The target subpath.", "PRE": "file must be a valid UploadFile; category must be valid.", "POST": "File is written to disk and metadata is returned.", "RETURN": "StoredFile - Metadata of the saved file.", "SIDE_EFFECT": "Writes file to disk." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "delete_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 343, "end_line": 367, "tags": { "PURPOSE": "Deletes a file or directory from the specified category and path.", "PARAM": "path (str) - The relative path of the file or directory.", "PRE": "path must belong to the specified category and exist on disk.", "POST": "The file or directory is removed from disk.", "SIDE_EFFECT": "Removes item from disk." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_file_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 369, "end_line": 388, "tags": { "PURPOSE": "Returns the absolute path of a file for download.", "PARAM": "path (str) - The relative path of the file.", "PRE": "path must belong to the specified category and be a file.", "POST": "Returns the absolute Path to the file.", "RETURN": "Path - Absolute path to the file." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: USES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 391 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.7 } }, { "name": "GitLLMExtension", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 62, "tags": { "PURPOSE": "Provides LLM capabilities to the Git plugin." }, "relations": [], "children": [ { "name": "suggest_commit_message", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 61, "tags": { "PURPOSE": "Generates a suggested commit message based on a diff and history.", "PARAM": "history (List[str]) - Recent commit messages for context.", "RETURN": "str - The suggested commit message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "llm_extension", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 64, "tags": { "PURPOSE": "Auto-generated module for backend/src/plugins/git/llm_extension.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 17, "end_line": 17, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "src.plugins.git", "type": "Package", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 3, "tags": { "PURPOSE": "Git plugin extension package root." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_persistence", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 431, "tags": { "SEMANTICS": "test, task, persistence, unit_test", "PURPOSE": "Unit tests for TaskPersistenceService.", "LAYER": "Test", "COMPLEXITY": "5", "TEST_DATA": "valid_task -> {\"id\": \"test-uuid-1\", \"plugin_id\": \"backup\", \"status\": \"PENDING\"}" }, "relations": [ { "type": "TESTS", "target": "TaskPersistenceService" } ], "children": [ { "name": "TestTaskPersistenceHelpers", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 23, "end_line": 109, "tags": { "PURPOSE": "Test suite for TaskPersistenceService static helper methods.", "COMPLEXITY": "5" }, "relations": [], "children": [ { "name": "test_json_load_if_needed_none", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 28, "end_line": 32, "tags": { "PURPOSE": "Test _json_load_if_needed with None input." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_dict", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 39, "tags": { "PURPOSE": "Test _json_load_if_needed with dict input." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_list", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 46, "tags": { "PURPOSE": "Test _json_load_if_needed with list input." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_json_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 53, "tags": { "PURPOSE": "Test _json_load_if_needed with JSON string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_empty_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 61, "tags": { "PURPOSE": "Test _json_load_if_needed with empty/null strings." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_plain_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 68, "tags": { "PURPOSE": "Test _json_load_if_needed with non-JSON string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_json_load_if_needed_integer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 70, "end_line": 74, "tags": { "PURPOSE": "Test _json_load_if_needed with integer." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_parse_datetime_none", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 80, "tags": { "PURPOSE": "Test _parse_datetime with None." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_parse_datetime_datetime_object", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 87, "tags": { "PURPOSE": "Test _parse_datetime with datetime object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_parse_datetime_iso_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 89, "end_line": 95, "tags": { "PURPOSE": "Test _parse_datetime with ISO string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_parse_datetime_invalid_string", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 101, "tags": { "PURPOSE": "Test _parse_datetime with invalid string." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_parse_datetime_integer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 103, "end_line": 107, "tags": { "PURPOSE": "Test _parse_datetime with non-string, non-datetime." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 23 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 23 } ], "score": 0.5499999999999999 } }, { "name": "TestTaskPersistenceService", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 112, "end_line": 430, "tags": { "PURPOSE": "Test suite for TaskPersistenceService CRUD operations.", "COMPLEXITY": "5", "TEST_DATA": "valid_task -> {\"id\": \"test-uuid-1\", \"plugin_id\": \"backup\", \"status\": \"PENDING\"}" }, "relations": [], "children": [ { "name": "setup_class", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 127, "tags": { "PURPOSE": "Setup in-memory test database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "teardown_class", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 134, "tags": { "PURPOSE": "Dispose of test database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setup_method", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 144, "tags": { "PURPOSE": "Clean task_records table before each test." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_new", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 164, "end_line": 182, "tags": { "PURPOSE": "Test persisting a new task creates a record.", "PRE": "Empty database.", "POST": "TaskRecord exists in database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_update", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 184, "end_line": 208, "tags": { "PURPOSE": "Test updating an existing task.", "PRE": "Task already persisted.", "POST": "Task record updated with new status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_with_logs", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 210, "end_line": 231, "tags": { "PURPOSE": "Test persisting a task with log entries.", "PRE": "Task has logs attached.", "POST": "Logs serialized as JSON in task record." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_failed_extracts_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 233, "end_line": 255, "tags": { "PURPOSE": "Test that FAILED task extracts last error message.", "PRE": "Task has FAILED status with ERROR logs.", "POST": "record.error contains last error message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_tasks_batch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 257, "end_line": 276, "tags": { "PURPOSE": "Test persisting multiple tasks.", "PRE": "Empty database.", "POST": "All task records created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_load_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 278, "end_line": 304, "tags": { "PURPOSE": "Test loading tasks from database.", "PRE": "Tasks persisted.", "POST": "Returns list of Task objects with correct data." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_load_tasks_with_status_filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 306, "end_line": 327, "tags": { "PURPOSE": "Test loading tasks filtered by status.", "PRE": "Tasks with different statuses persisted.", "POST": "Returns only tasks matching status filter." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_load_tasks_with_limit", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 329, "end_line": 347, "tags": { "PURPOSE": "Test loading tasks with limit.", "PRE": "Multiple tasks persisted.", "POST": "Returns at most `limit` tasks." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 349, "end_line": 373, "tags": { "PURPOSE": "Test deleting tasks by ID list.", "PRE": "Tasks persisted.", "POST": "Specified tasks deleted, others remain." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_tasks_empty_list", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 375, "end_line": 383, "tags": { "PURPOSE": "Test deleting with empty list (no-op).", "PRE": "None.", "POST": "No error, no changes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_with_datetime_in_params", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 385, "end_line": 404, "tags": { "PURPOSE": "Test json_serializable handles datetime in params.", "PRE": "Task params contain datetime values.", "POST": "Params serialized correctly." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_persist_task_resolves_environment_slug_to_existing_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 406, "end_line": 428, "tags": { "PURPOSE": "Ensure slug-like environment token resolves to environments.id before persisting task.", "PRE": "environments table contains env with name convertible to provided slug token.", "POST": "task_records.environment_id stores actual environments.id and does not violate FK." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 112 } ], "score": 0.5499999999999999 } }, { "name": "_patched", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 146, "end_line": 146, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 153, "end_line": 153, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 431 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "test_environment_model", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 4, "end_line": 20, "tags": { "PURPOSE": "Tests that Environment model correctly stores values.", "PRE": "Environment class is available.", "POST": "Values are verified." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_manager", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 495, "tags": { "COMPLEXITY": "5", "SEMANTICS": "task-manager, lifecycle, CRUD, log-buffer, filtering, tests", "PURPOSE": "Unit tests for TaskManager lifecycle, CRUD, log buffering, and filtering.", "LAYER": "Core", "INVARIANT": "TaskManager state changes are deterministic and testable with mocked dependencies." }, "relations": [ { "type": "TESTS", "target": "backend.src.core.task_manager.manager.TaskManager" } ], "children": [ { "name": "_make_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_cleanup_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 53, "end_line": 53, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init_creates_empty_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init_loads_persisted_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init_starts_flusher_thread", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 76, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_returns_none_for_missing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 87, "end_line": 87, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_task_returns_existing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_all_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_tasks_with_status_filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_tasks_with_plugin_filter", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_tasks_with_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 152, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_tasks_completed_only", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 169, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_task_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 198, "end_line": 198, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_task_unknown_plugin_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 210, "end_line": 210, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_task_invalid_params_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 220, "end_line": 220, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_add_log_appends_to_task_and_buffer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 232, "end_line": 232, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_add_log_skips_nonexistent_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 248, "end_line": 248, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_flush_logs_writes_to_persistence", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 256, "end_line": 256, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_flush_task_logs_writes_single_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 274, "end_line": 274, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_flush_logs_requeues_on_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 290, "end_line": 290, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_clear_all_non_active", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 311, "end_line": 311, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_clear_by_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 334, "end_line": 334, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_clear_preserves_awaiting_input", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 352, "end_line": 352, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_subscribe_creates_queue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 371, "end_line": 371, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_unsubscribe_removes_queue", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 382, "end_line": 382, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_multiple_subscribers", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 392, "end_line": 392, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_await_input_sets_status", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 408, "end_line": 408, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_await_input_not_running_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 429, "end_line": 429, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_await_input_nonexistent_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 442, "end_line": 442, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resume_with_password", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 450, "end_line": 450, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resume_not_awaiting_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 469, "end_line": 469, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resume_empty_passwords_raises", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 482, "end_line": 482, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 495 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "backend.tests.test_dashboards_api", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 366, "tags": { "COMPLEXITY": "3", "PURPOSE": "Comprehensive contract-driven tests for Dashboard Hub API", "LAYER": "Domain (Tests)", "SEMANTICS": "tests, dashboards, api, contract, remediation", "TEST_FIXTURE": "expected_count: 1" }, "relations": [], "children": [ { "name": "mock_deps", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 54, "end_line": 54, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_with_search", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 83, "end_line": 83, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_empty", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 99, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_superset_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_invalid_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_database_mappings_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 152, "end_line": 152, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_database_mappings_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 167, "end_line": 167, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_detail_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 174, "end_line": 174, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_detail_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 194, "end_line": 194, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_tasks_history_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 201, "end_line": 201, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_tasks_history_sorting", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 213, "end_line": 213, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_thumbnail_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 240, "end_line": 240, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_thumbnail_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 253, "end_line": 253, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboard_thumbnail_202", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 258, "end_line": 258, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 279, "end_line": 279, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_pre_checks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 291, "end_line": 291, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migrate_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 299, "end_line": 299, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 310, "end_line": 310, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_pre_checks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 321, "end_line": 321, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_env_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 327, "end_line": 327, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_backup_dashboards_with_schedule", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 336, "end_line": 336, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_matches_dashboard_logic", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 356, "end_line": 356, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 366 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "test_dashboards_api", "type": "Test", "complexity": 1, "tier": "TRIVIAL", "start_line": 9, "end_line": 82, "tags": { "PURPOSE": "Verify GET /api/dashboards contract compliance", "TEST": "Search filter works" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_datasets_api", "type": "Test", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 127, "tags": { "PURPOSE": "Verify GET /api/datasets contract compliance", "TEST": "Negative - Service failure returns 503" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_pagination_boundaries", "type": "Test", "complexity": 1, "tier": "TRIVIAL", "start_line": 130, "end_line": 156, "tags": { "PURPOSE": "Verify pagination validation for GET endpoints", "TEST": "page<1 and page_size>100 return 400" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resource_hubs", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 156, "tags": { "PURPOSE": "Auto-generated module for backend/tests/test_resource_hubs.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "mock_deps", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 16, "end_line": 16, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 71, "end_line": 71, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_search", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_success", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 91, "end_line": 91, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_not_found", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_search", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_service_failure", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 120, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_pagination_zero_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 134, "end_line": 134, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_dashboards_pagination_oversize", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 140, "end_line": 140, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_pagination_zero_page", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 146, "end_line": 146, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_datasets_pagination_oversize", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 151, "end_line": 151, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_logger", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 374, "tags": { "SEMANTICS": "test, task_logger, task_context, unit_test", "PURPOSE": "Unit tests for TaskLogger and TaskContext.", "LAYER": "Test", "COMPLEXITY": "3" }, "relations": [ { "type": "TESTS", "target": "TaskLogger, TaskContext" } ], "children": [ { "name": "TestTaskLogger", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 15, "end_line": 219, "tags": { "PURPOSE": "Test suite for TaskLogger.", "COMPLEXITY": "3" }, "relations": [], "children": [ { "name": "setup_method", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 32, "tags": { "PURPOSE": "Setup for each test method.", "PRE": "None.", "POST": "Mock add_log_fn created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 43, "tags": { "PURPOSE": "Test TaskLogger initialization.", "PRE": "None.", "POST": "Logger instance created with correct attributes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_with_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 56, "tags": { "PURPOSE": "Test creating a sub-logger with different source.", "PRE": "Logger initialized.", "POST": "New logger created with different source but same task_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_debug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 58, "end_line": 73, "tags": { "PURPOSE": "Test debug log level.", "PRE": "Logger initialized.", "POST": "add_log_fn called with DEBUG level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_info", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 90, "tags": { "PURPOSE": "Test info log level.", "PRE": "Logger initialized.", "POST": "add_log_fn called with INFO level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_warning", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 92, "end_line": 107, "tags": { "PURPOSE": "Test warning log level.", "PRE": "Logger initialized.", "POST": "add_log_fn called with WARNING level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_error", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 109, "end_line": 124, "tags": { "PURPOSE": "Test error log level.", "PRE": "Logger initialized.", "POST": "add_log_fn called with ERROR level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_error_with_metadata", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 126, "end_line": 142, "tags": { "PURPOSE": "Test error logging with metadata.", "PRE": "Logger initialized.", "POST": "add_log_fn called with ERROR level and metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_progress", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 144, "end_line": 160, "tags": { "PURPOSE": "Test progress logging.", "PRE": "Logger initialized.", "POST": "add_log_fn called with INFO level and progress metadata." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_progress_clamping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 162, "end_line": 179, "tags": { "PURPOSE": "Test progress value clamping (0-100).", "PRE": "Logger initialized.", "POST": "Progress values clamped to 0-100 range." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_source_override", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 181, "end_line": 196, "tags": { "PURPOSE": "Test overriding the default source.", "PRE": "Logger initialized.", "POST": "add_log_fn called with overridden source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sub_logger_source_independence", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 198, "end_line": 217, "tags": { "PURPOSE": "Test sub-logger independence from parent.", "PRE": "Logger and sub-logger initialized.", "POST": "Sub-logger has different source, parent unchanged." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 15 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 15 } ], "score": 0.5499999999999999 } }, { "name": "TestTaskContext", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 221, "end_line": 373, "tags": { "PURPOSE": "Test suite for TaskContext.", "COMPLEXITY": "3" }, "relations": [], "children": [ { "name": "setup_method", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 226, "end_line": 240, "tags": { "PURPOSE": "Setup for each test method.", "PRE": "None.", "POST": "Mock add_log_fn created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_init", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 242, "end_line": 252, "tags": { "PURPOSE": "Test TaskContext initialization.", "PRE": "None.", "POST": "Context instance created with correct attributes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_id_property", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 254, "end_line": 261, "tags": { "PURPOSE": "Test task_id property.", "PRE": "Context initialized.", "POST": "Returns correct task_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_logger_property", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 263, "end_line": 273, "tags": { "PURPOSE": "Test logger property.", "PRE": "Context initialized.", "POST": "Returns TaskLogger instance." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_params_property", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 275, "end_line": 282, "tags": { "PURPOSE": "Test params property.", "PRE": "Context initialized.", "POST": "Returns correct params dict." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_param", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 284, "end_line": 294, "tags": { "PURPOSE": "Test getting a specific parameter.", "PRE": "Context initialized with params.", "POST": "Returns parameter value or default." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_sub_context", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 296, "end_line": 308, "tags": { "PURPOSE": "Test creating a sub-context with different source.", "PRE": "Context initialized.", "POST": "New context created with different logger source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_context_logger_delegates_to_task_logger", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 310, "end_line": 327, "tags": { "PURPOSE": "Test context logger delegates to TaskLogger.", "PRE": "Context initialized.", "POST": "Logger calls are delegated to TaskLogger." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sub_context_with_source", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 329, "end_line": 348, "tags": { "PURPOSE": "Test sub-context logger uses new source.", "PRE": "Context initialized.", "POST": "Sub-context logger uses new source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_multiple_sub_contexts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 350, "end_line": 371, "tags": { "PURPOSE": "Test creating multiple sub-contexts.", "PRE": "Context initialized.", "POST": "Each sub-context has independent logger source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 221 } ], "score": 0.5499999999999999 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 374 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "test_smoke_plugins", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 64, "tags": { "PURPOSE": "Auto-generated module for backend/tests/test_smoke_plugins.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "test_plugins_load_successfully", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_manager_initializes_with_plugins", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "tests.test_logger", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 222, "tags": { "COMPLEXITY": "3", "SEMANTICS": "logging, tests, belief_state", "PURPOSE": "Unit tests for the custom logger formatters and configuration context manager.", "LAYER": "Logging (Tests)", "INVARIANT": "All required log statements must correctly check the threshold." }, "relations": [ { "type": "VERIFIES", "target": "src/core/logger.py" } ], "children": [ { "name": "test_belief_scope_logs_entry_action_exit_at_debug", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 49, "tags": { "PURPOSE": "Test that belief_scope generates [ID][Entry], [ID][Action], and [ID][Exit] logs at DEBUG level.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Entry, Action, and Exit tags at DEBUG level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_error_handling", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 81, "tags": { "PURPOSE": "Test that belief_scope logs Coherence:Failed on exception.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Coherence:Failed tag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_success_coherence", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 110, "tags": { "PURPOSE": "Test that belief_scope logs Coherence:OK on success.", "PRE": "belief_scope is available. caplog fixture is used. Logger configured to DEBUG.", "POST": "Logs are verified to contain Coherence:OK tag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_belief_scope_not_visible_at_info", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 113, "end_line": 132, "tags": { "PURPOSE": "Test that belief_scope Entry/Exit/Coherence logs are NOT visible at INFO level.", "PRE": "belief_scope is available. caplog fixture is used.", "POST": "Entry/Exit/Coherence logs are not captured at INFO level." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_log_level_default", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 143, "tags": { "PURPOSE": "Test that default task log level is INFO.", "PRE": "None.", "POST": "Default level is INFO." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_should_log_task_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 146, "end_line": 157, "tags": { "PURPOSE": "Test that should_log_task_level correctly filters log levels.", "PRE": "None.", "POST": "Filtering works correctly for all level combinations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_configure_logger_task_log_level", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 160, "end_line": 184, "tags": { "PURPOSE": "Test that configure_logger updates task_log_level.", "PRE": "LoggingConfig is available.", "POST": "task_log_level is updated correctly." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_enable_belief_state_flag", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 187, "end_line": 221, "tags": { "PURPOSE": "Test that enable_belief_state flag controls belief_scope logging.", "PRE": "LoggingConfig is available. caplog fixture is used.", "POST": "belief_scope logs are controlled by the flag." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_auth", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 236, "tags": { "PURPOSE": "Auto-generated module for backend/tests/test_auth.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 29, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "auth_service", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "auth_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 46, "end_line": 46, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 49, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_authenticate_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 67, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 92, "end_line": 92, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_role_permission_association", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 110, "end_line": 110, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_user_role_association", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 129, "end_line": 129, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_ad_group_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 150, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_admin_creates_user_with_optional_email", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 167, "end_line": 167, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_admin_is_idempotent_for_existing_user", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 180, "end_line": 180, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_ensure_encryption_key_generates_backend_env_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 196, "end_line": 196, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_ensure_encryption_key_reuses_existing_env_file_value", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 209, "end_line": 209, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_ensure_encryption_key_prefers_process_environment", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 222, "end_line": 222, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "verify_fernet_key", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 234, "end_line": 234, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_log_persistence", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 338, "tags": { "SEMANTICS": "test, log, persistence, unit_test", "PURPOSE": "Unit tests for TaskLogPersistenceService.", "LAYER": "Test", "COMPLEXITY": "5" }, "relations": [ { "type": "TESTS", "target": "TaskLogPersistenceService" } ], "children": [ { "name": "TestLogPersistence", "type": "Class", "complexity": 3, "tier": "STANDARD", "start_line": 20, "end_line": 337, "tags": { "PURPOSE": "Test suite for TaskLogPersistenceService.", "COMPLEXITY": "5", "TEST_DATA": "log_entry -> {\"task_id\": \"test-task-1\", \"level\": \"INFO\", \"source\": \"test_source\", \"message\": \"Test message\"}" }, "relations": [], "children": [ { "name": "setup_class", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 37, "tags": { "PURPOSE": "Setup test database and service instance.", "PRE": "None.", "POST": "In-memory database and service instance created." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "teardown_class", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 39, "end_line": 47, "tags": { "PURPOSE": "Clean up test database.", "PRE": "None.", "POST": "Database disposed." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "setup_method", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 60, "tags": { "PURPOSE": "Setup for each test method \u2014 clean task_logs table.", "PRE": "None.", "POST": "task_logs table is empty." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_add_logs_single", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 95, "tags": { "PURPOSE": "Test adding a single log entry.", "PRE": "Service and session initialized.", "POST": "Log entry persisted to database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_add_logs_batch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 118, "tags": { "PURPOSE": "Test adding multiple log entries in batch.", "PRE": "Service and session initialized.", "POST": "All log entries persisted to database." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_add_logs_empty", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 120, "end_line": 134, "tags": { "PURPOSE": "Test adding empty log list (should be no-op).", "PRE": "Service initialized.", "POST": "No logs added." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_logs_by_task_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 136, "end_line": 154, "tags": { "PURPOSE": "Test retrieving logs by task ID.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns logs for the specified task." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_logs_with_filters", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 156, "end_line": 181, "tags": { "PURPOSE": "Test retrieving logs with level and source filters.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns filtered logs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_logs_with_pagination", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 203, "tags": { "PURPOSE": "Test retrieving logs with pagination.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns paginated logs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_logs_with_search", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 205, "end_line": 223, "tags": { "PURPOSE": "Test retrieving logs with search query.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns logs matching search query." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_log_stats", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 225, "end_line": 250, "tags": { "PURPOSE": "Test retrieving log statistics.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns LogStats model with counts by level and source." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_sources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 252, "end_line": 273, "tags": { "PURPOSE": "Test retrieving unique log sources.", "PRE": "Service and session initialized, logs exist.", "POST": "Returns list of unique sources." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_logs_for_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 275, "end_line": 301, "tags": { "PURPOSE": "Test deleting logs by task ID.", "PRE": "Service and session initialized, logs exist.", "POST": "Logs for the task are deleted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_logs_for_tasks", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 303, "end_line": 325, "tags": { "PURPOSE": "Test deleting logs for multiple tasks.", "PRE": "Service and session initialized, logs exist.", "POST": "Logs for all specified tasks are deleted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_delete_logs_for_tasks_empty", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 327, "end_line": 335, "tags": { "PURPOSE": "Test deleting with empty list (no-op).", "PRE": "Service initialized.", "POST": "No error, no deletion." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 20 } ], "score": 0.5499999999999999 } }, { "name": "_patched", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 62, "end_line": 62, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 338 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "test_clean_release_cli", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 305, "tags": { "COMPLEXITY": "3", "PURPOSE": "Smoke tests for the redesigned clean release CLI.", "LAYER": "Domain" }, "relations": [], "children": [ { "name": "test_cli_candidate_register_scaffold", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 20, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_cli_manifest_build_scaffold", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_cli_compliance_run_scaffold", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 84, "end_line": 84, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_cli_release_gate_commands_scaffold", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 184, "end_line": 184, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Fractal limit warning: Module length is 305 lines (must be < 300)", "severity": "WARNING", "line_number": 1 } ], "score": 0.4 } }, { "name": "backend.tests.scripts.test_clean_release_tui", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 223, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, tui, clean-release, curses", "PURPOSE": "Unit tests for the interactive curses TUI of the clean release process.", "LAYER": "Scripts", "INVARIANT": "TUI initializes, handles hotkeys (F5, F10) and safely falls back without TTY." }, "relations": [ { "type": "TESTS", "target": "backend.src.scripts.clean_release_tui" } ], "children": [ { "name": "mock_stdscr", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_headless_fallback", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 30, "end_line": 30, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_initial_render", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 48, "end_line": 48, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_run_checks_f5", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 81, "end_line": 81, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "side_effect", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 97, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_exit_f10", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 116, "end_line": 116, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_clear_history_f7", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 133, "end_line": 133, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_real_mode_bootstrap_imports_artifacts_catalog", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 157, "end_line": 157, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "test_clean_release_tui_v2", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 97, "tags": { "COMPLEXITY": "3", "PURPOSE": "Smoke tests for thin-client TUI action dispatch and blocked transition behavior.", "LAYER": "Domain" }, "relations": [ { "type": "TESTS", "target": "backend.src.scripts.clean_release_tui" } ], "children": [ { "name": "_build_mock_stdscr", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_f5_dispatches_run_action", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_f5_run_smoke_reports_blocked_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 44, "end_line": 44, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_set_blocked_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 55, "end_line": 55, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_non_tty_refuses_startup", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 68, "end_line": 68, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_tui_f8_blocked_without_facade_binding", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 80, "end_line": 80, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.core.test_git_service_gitea_pr", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 104, "tags": { "COMPLEXITY": "3", "SEMANTICS": "tests, git, gitea, pull_request, fallback", "PURPOSE": "Validate Gitea PR creation fallback behavior when configured server URL is stale.", "LAYER": "Domain", "INVARIANT": "A 404 from primary Gitea URL retries once against remote-url host when different." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.git_service.create_gitea_pull_request" } ], "children": [ { "name": "test_derive_server_url_from_remote_strips_credentials", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 31, "tags": { "PURPOSE": "Ensure helper returns host base URL and removes embedded credentials.", "PRE": "remote_url is an https URL with username/token.", "POST": "Result is scheme+host only." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_gitea_pull_request_retries_with_remote_host_on_404", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 66, "tags": { "PURPOSE": "Verify create_gitea_pull_request retries with remote URL host after primary 404.", "PRE": "primary server_url differs from remote_url host.", "POST": "Method returns success payload from fallback request." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_gitea_pull_request_returns_branch_error_when_target_missing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 102, "tags": { "PURPOSE": "Ensure Gitea 404 on PR creation is mapped to actionable target-branch validation error.", "PRE": "PR create call returns 404 and target branch is absent.", "POST": "Service raises HTTPException 400 with explicit missing target branch message." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fake_gitea_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fake_gitea_request", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 76, "end_line": 76, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.775 } }, { "name": "backend.tests.core.test_mapping_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 249, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for the IdMappingService matching UUIDs to integer IDs.", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.core.mapping_service" } ], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 25, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 35, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_resources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 38, "end_line": 38, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_upserts_correctly", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 41, "end_line": 41, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_remote_id_returns_integer", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 59, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_remote_ids_batch_returns_dict", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_updates_existing_mapping", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 99, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_skips_resources_without_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 131, "end_line": 131, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_handles_api_error_gracefully", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 147, "end_line": 147, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_all_resources", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 150, "end_line": 150, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_remote_id_returns_none_for_missing", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 165, "end_line": 165, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_get_remote_ids_batch_returns_empty_for_empty_input", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 171, "end_line": 171, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_mapping_service_alignment_with_test_data", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 178, "end_line": 178, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_requires_existing_env", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 202, "end_line": 202, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_sync_environment_deletes_stale_mappings", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 221, "end_line": 221, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "test_defensive_guards", "type": "Module", "complexity": 1, "tier": "TRIVIAL", "start_line": 1, "end_line": 132, "tags": { "PURPOSE": "Auto-generated module for backend/tests/core/test_defensive_guards.py", "COMPLEXITY": "1", "LAYER": "Unknown" }, "relations": [], "children": [ { "name": "test_git_service_get_repo_path_guard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 14, "end_line": 14, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_git_service_get_repo_path_recreates_base_dir", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 21, "end_line": 21, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_superset_client_import_dashboard_guard", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_git_service_init_repo_reclones_when_path_is_not_a_git_repo", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 45, "end_line": 45, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_git_service_ensure_gitflow_branches_creates_and_pushes_missing_defaults", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 64, "end_line": 64, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 69, "end_line": 69, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 73, "end_line": 73, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 78, "end_line": 78, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "fetch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 82, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "push", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 85, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 90, "end_line": 90, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 94, "end_line": 94, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "create_head", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 99, "end_line": 99, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "remote", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_git_service_configure_identity_updates_repo_local_config", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 118, "end_line": 118, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "backend.tests.core.test_migration_engine", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 290, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for MigrationEngine's cross-filter patching algorithms.", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.core.migration_engine" } ], "children": [ { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_remote_ids_batch", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 34, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_write_dashboard_yaml", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_dashboard_metadata_replaces_chart_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 52, "end_line": 52, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_dashboard_metadata_replaces_dataset_ids", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 75, "end_line": 75, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_dashboard_metadata_skips_when_no_metadata", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 98, "end_line": 98, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_patch_dashboard_metadata_handles_missing_targets", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 115, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_extract_chart_uuids_from_archive", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 143, "end_line": 143, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_transform_yaml_replaces_database_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 166, "end_line": 166, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_transform_yaml_ignores_unmapped_uuid", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 183, "end_line": 183, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_transform_zip_end_to_end", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 202, "end_line": 202, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_transform_zip_invalid_path", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 274, "end_line": 274, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_transform_yaml_nonexistent_file", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 281, "end_line": 281, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.core.migration.test_dry_run_orchestrator", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 110, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for MigrationDryRunService diff and risk computation contracts.", "LAYER": "Domain", "TEST_CONTRACT": "dry_run_result_contract -> {", "TEST_FIXTURE": "migration_dry_run_fixture -> backend/tests/fixtures/migration_dry_run_fixture.json", "TEST_EDGE": "breaking_reference -> fixture.transformed_zip_objects.charts[0].dataset_uuid" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.core.migration.dry_run_orchestrator" } ], "children": [ { "name": "_load_fixture", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 31, "end_line": 31, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_migration_dry_run_service_builds_diff_and_risk", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 42, "end_line": 42, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.core.migration.test_archive_parser", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 62, "tags": { "COMPLEXITY": "3", "PURPOSE": "Unit tests for MigrationArchiveParser ZIP extraction contract.", "LAYER": "Domain" }, "relations": [ { "type": "VERIFIES", "target": "backend.src.core.migration.archive_parser" } ], "children": [ { "name": "test_extract_objects_from_zip_collects_all_types", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 23, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: VERIFIES. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.services.clean_release.test_publication_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 148, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, publication, revoke, gate", "PURPOSE": "Define publication gate contracts over approved candidates and immutable publication records.", "LAYER": "Tests", "INVARIANT": "Publish requires approval; revoke requires existing publication; republish after revoke is allowed as a new record." }, "relations": [ { "type": "TESTS", "target": "src.services.clean_release.publication_service" }, { "type": "TESTS", "target": "src.services.clean_release.approval_service" }, { "type": "TESTS", "target": "src.services.clean_release.repository" } ], "children": [ { "name": "_seed_candidate_with_passed_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 56, "tags": { "PURPOSE": "Seed candidate/report fixtures for publication gate scenarios.", "PRE": "candidate_id and report_id are non-empty.", "POST": "Repository contains candidate and PASSED report." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_publish_without_approval_rejected", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 59, "end_line": 79, "tags": { "PURPOSE": "Ensure publish action is blocked until candidate is approved.", "PRE": "Candidate has PASSED report but status is not APPROVED.", "POST": "publish_candidate raises PublicationGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_revoke_unknown_publication_rejected", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 82, "end_line": 98, "tags": { "PURPOSE": "Ensure revocation is rejected for unknown publication id.", "PRE": "Repository has no matching publication record.", "POST": "revoke_publication raises PublicationGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_republish_after_revoke_creates_new_active_record", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 101, "end_line": 146, "tags": { "PURPOSE": "Ensure republish after revoke is allowed and creates a new ACTIVE record.", "PRE": "Candidate is APPROVED and first publication has been revoked.", "POST": "New publish call returns distinct publication id with ACTIVE status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.tests.services.clean_release.test_compliance_task_integration", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 250, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, compliance, task-manager, integration", "PURPOSE": "Verify clean release compliance runs execute through TaskManager lifecycle with observable success/failure outcomes.", "LAYER": "Tests", "INVARIANT": "Compliance execution triggered as task produces terminal task status and persists run evidence." }, "relations": [ { "type": "TESTS", "target": "backend.src.core.task_manager.manager.TaskManager" }, { "type": "TESTS", "target": "backend.src.services.clean_release.compliance_orchestrator.CleanComplianceOrchestrator" } ], "children": [ { "name": "_seed_repository", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 32, "end_line": 97, "tags": { "PURPOSE": "Prepare deterministic candidate/policy/registry/manifest fixtures for task integration tests.", "PRE": "with_manifest controls manifest availability.", "POST": "Returns initialized repository and identifiers for compliance run startup." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "CleanReleaseCompliancePlugin", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 100, "end_line": 129, "tags": { "PURPOSE": "TaskManager plugin shim that executes clean release compliance orchestration." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_PluginLoaderStub", "type": "Class", "complexity": 1, "tier": "TRIVIAL", "start_line": 132, "end_line": 145, "tags": { "PURPOSE": "Provide minimal plugin loader contract used by TaskManager in integration tests." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_make_task_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 148, "end_line": 165, "tags": { "PURPOSE": "Build TaskManager with mocked persistence services for isolated integration tests.", "POST": "Returns TaskManager ready for async task execution." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_wait_for_terminal_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 168, "end_line": 181, "tags": { "PURPOSE": "Poll task registry until target task reaches terminal status.", "PRE": "task_id exists in manager registry.", "POST": "Returns task with SUCCESS or FAILED status, otherwise raises TimeoutError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_compliance_run_executes_as_task_manager_task", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 184, "end_line": 217, "tags": { "PURPOSE": "Verify successful compliance execution is observable as TaskManager SUCCESS task.", "PRE": "Candidate, policy and manifest are available in repository.", "POST": "Task ends with SUCCESS; run is persisted with SUCCEEDED status and task binding." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_compliance_run_missing_manifest_marks_task_failed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 220, "end_line": 248, "tags": { "PURPOSE": "Verify missing manifest startup failure is surfaced as TaskManager FAILED task.", "PRE": "Candidate/policy exist but manifest is absent.", "POST": "Task ends with FAILED and run history remains empty." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "name", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 108, "end_line": 108, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "execute", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 111, "end_line": 111, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "__init__", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 135, "end_line": 135, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "has_plugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 138, "end_line": 138, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "get_plugin", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 141, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } }, { "name": "backend.tests.services.clean_release.test_demo_mode_isolation", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 87, "tags": { "COMPLEXITY": "3", "SEMANTICS": "clean-release, demo-mode, isolation, namespace, repository", "PURPOSE": "Verify demo and real mode namespace isolation contracts before TUI integration.", "LAYER": "Tests" }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.demo_data_service" } ], "children": [ { "name": "test_resolve_namespace_separates_demo_and_real", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 20, "end_line": 31, "tags": { "PURPOSE": "Ensure namespace resolver returns deterministic and distinct namespaces.", "PRE": "Mode names are provided as user/runtime strings.", "POST": "Demo and real namespaces are different and stable." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_build_namespaced_id_prevents_cross_mode_collisions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 34, "end_line": 46, "tags": { "PURPOSE": "Ensure ID generation prevents demo/real collisions for identical logical IDs.", "PRE": "Same logical candidate id is used in two different namespaces.", "POST": "Produced physical IDs differ by namespace prefix." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_create_isolated_repository_keeps_mode_data_separate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 49, "end_line": 85, "tags": { "PURPOSE": "Verify demo and real repositories do not leak state across mode boundaries.", "PRE": "Two repositories are created for distinct modes.", "POST": "Candidate mutations in one mode are not visible in the other mode." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.tests.services.clean_release.test_report_audit_immutability", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 114, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, report, audit, immutability, append-only", "PURPOSE": "Validate report snapshot immutability expectations and append-only audit hook behavior for US2.", "LAYER": "Tests", "INVARIANT": "Built reports are immutable snapshots; audit hooks produce append-only event traces." }, "relations": [ { "type": "TESTS", "target": "src.services.clean_release.report_builder.ComplianceReportBuilder" }, { "type": "TESTS", "target": "src.services.clean_release.audit_service" }, { "type": "TESTS", "target": "src.services.clean_release.repository.CleanReleaseRepository" } ], "children": [ { "name": "_terminal_run", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 25, "end_line": 44, "tags": { "PURPOSE": "Build deterministic terminal run fixture for report snapshot tests.", "PRE": "final_status is a valid ComplianceDecision value.", "POST": "Returns a terminal ComplianceRun suitable for report generation." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_report_builder_sets_immutable_snapshot_flag", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 47, "end_line": 62, "tags": { "PURPOSE": "Ensure generated report payload is marked immutable and persisted as snapshot.", "PRE": "Terminal run exists.", "POST": "Built report has immutable=True and repository stores same immutable object." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_repository_rejects_report_overwrite_for_same_report_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 65, "end_line": 94, "tags": { "PURPOSE": "Define immutability contract that report snapshots cannot be overwritten by same identifier.", "PRE": "Existing report with id is already persisted.", "POST": "Second save for same report id is rejected with explicit immutability error." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_audit_hooks_emit_append_only_event_stream", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 97, "end_line": 112, "tags": { "PURPOSE": "Verify audit hooks emit one event per action call and preserve call order.", "PRE": "Logger backend is patched.", "POST": "Three calls produce three ordered info entries with molecular prefixes." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "test_candidate_manifest_services", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 203, "tags": { "COMPLEXITY": "3", "PURPOSE": "Test lifecycle and manifest versioning for release candidates.", "LAYER": "Tests" }, "relations": [], "children": [ { "name": "db_session", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 18, "end_line": 18, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_candidate_lifecycle_transitions", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 26, "end_line": 26, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_versioning_and_immutability", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 50, "end_line": 50, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "_valid_artifacts", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 93, "end_line": 93, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_register_candidate_rejects_duplicate_candidate_id", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 104, "end_line": 104, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_register_candidate_rejects_malformed_artifact_input", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 126, "end_line": 126, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_register_candidate_rejects_empty_artifact_set", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 141, "end_line": 141, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_service_rebuild_creates_new_version", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 155, "end_line": 155, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_service_existing_manifest_cannot_be_mutated", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 174, "end_line": 174, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_manifest_service_rejects_missing_candidate", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 197, "end_line": 197, "tags": { "PURPOSE": "Auto-detected function (orphan)", "COMPLEXITY": "1" }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Missing Mandatory Tag: @SEMANTICS (required for complexity 3)", "severity": "WARNING", "line_number": 1 }, { "message": "Missing Mandatory Tag: @RELATION (required for complexity 3)", "severity": "WARNING", "line_number": 1 } ], "score": 0.5499999999999999 } }, { "name": "backend.tests.services.clean_release.test_policy_resolution_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 105, "tags": { "COMPLEXITY": "5", "SEMANTICS": "clean-release, policy-resolution, trusted-snapshots, contracts", "PURPOSE": "Verify trusted policy snapshot resolution contract and error guards.", "LAYER": "Tests", "INVARIANT": "Resolution uses only ConfigManager active IDs and rejects runtime override attempts." }, "relations": [ { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.policy_resolution_service" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.repository" }, { "type": "DEPENDS_ON", "target": "backend.src.services.clean_release.exceptions" } ], "children": [ { "name": "_config_manager", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 32, "tags": { "PURPOSE": "Build deterministic ConfigManager-like stub for tests.", "PRE": "policy_id and registry_id may be None or non-empty strings.", "POST": "Returns object exposing get_config().settings.clean_release active IDs." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_trusted_policy_snapshots_missing_profile", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 35, "end_line": 48, "tags": { "PURPOSE": "Ensure resolution fails when trusted profile is not configured.", "PRE": "active_policy_id is None.", "POST": "Raises PolicyResolutionError with missing trusted profile reason." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_trusted_policy_snapshots_missing_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 51, "end_line": 64, "tags": { "PURPOSE": "Ensure resolution fails when trusted registry is not configured.", "PRE": "active_registry_id is None and active_policy_id is set.", "POST": "Raises PolicyResolutionError with missing trusted registry reason." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_resolve_trusted_policy_snapshots_rejects_override_attempt", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 67, "end_line": 103, "tags": { "PURPOSE": "Ensure runtime override attempt is rejected even if snapshots exist.", "PRE": "valid trusted snapshots exist in repository and override is provided.", "POST": "Raises PolicyResolutionError with override forbidden reason." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [], "score": 0.925 } }, { "name": "backend.tests.services.clean_release.test_approval_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 199, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, approval, lifecycle, gate", "PURPOSE": "Define approval gate contracts for approve/reject operations over immutable compliance evidence.", "LAYER": "Tests", "INVARIANT": "Approval is allowed only for PASSED report bound to candidate; duplicate approve and foreign report must be rejected." }, "relations": [ { "type": "TESTS", "target": "src.services.clean_release.approval_service" }, { "type": "TESTS", "target": "src.services.clean_release.enums" }, { "type": "TESTS", "target": "src.services.clean_release.repository" } ], "children": [ { "name": "_seed_candidate_with_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 23, "end_line": 60, "tags": { "PURPOSE": "Seed candidate and report fixtures for approval gate tests.", "PRE": "candidate_id and report_id are non-empty.", "POST": "Repository contains candidate and report linked by candidate_id." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_approve_rejects_blocked_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 63, "end_line": 82, "tags": { "PURPOSE": "Ensure approve is rejected when latest report final status is not PASSED.", "PRE": "Candidate has BLOCKED report.", "POST": "approve_candidate raises ApprovalGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_approve_rejects_foreign_report", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 85, "end_line": 112, "tags": { "PURPOSE": "Ensure approve is rejected when report belongs to another candidate.", "PRE": "Candidate exists, report candidate_id differs.", "POST": "approve_candidate raises ApprovalGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_approve_rejects_duplicate_approve", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 115, "end_line": 142, "tags": { "PURPOSE": "Ensure repeated approve decision for same candidate is blocked.", "PRE": "Candidate has already been approved once.", "POST": "Second approve_candidate call raises ApprovalGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_reject_persists_decision_without_promoting_candidate_state", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 166, "tags": { "PURPOSE": "Ensure reject decision is immutable and does not promote candidate to APPROVED.", "PRE": "Candidate has PASSED report and CHECK_PASSED lifecycle state.", "POST": "reject_candidate persists REJECTED decision; candidate status remains unchanged." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_reject_then_publish_is_blocked", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 169, "end_line": 197, "tags": { "PURPOSE": "Ensure latest REJECTED decision blocks publication gate.", "PRE": "Candidate is rejected for passed report.", "POST": "publish_candidate raises PublicationGateError." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.47500000000000003 } }, { "name": "backend.tests.services.clean_release.test_compliance_execution_service", "type": "Module", "complexity": 3, "tier": "STANDARD", "start_line": 1, "end_line": 173, "tags": { "COMPLEXITY": "5", "SEMANTICS": "tests, clean-release, compliance, pipeline, run-finalization", "PURPOSE": "Validate stage pipeline and run finalization contracts for compliance execution.", "LAYER": "Tests", "INVARIANT": "Missing manifest prevents run startup; failed execution cannot finalize as PASSED." }, "relations": [ { "type": "TESTS", "target": "backend.src.services.clean_release.compliance_orchestrator" }, { "type": "TESTS", "target": "backend.src.services.clean_release.report_builder" } ], "children": [ { "name": "_seed_with_candidate_policy_registry", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 29, "end_line": 99, "tags": { "PURPOSE": "Build deterministic repository state for run startup tests.", "PRE": "candidate_id and snapshot ids are non-empty.", "POST": "Returns repository with candidate, policy and registry; manifest is optional." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_run_without_manifest_rejected", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 102, "end_line": 119, "tags": { "PURPOSE": "Ensure compliance run cannot start when manifest is unresolved.", "PRE": "Candidate/policy exist but manifest is missing.", "POST": "start_check_run raises ValueError and no run is persisted." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_task_crash_mid_run_marks_failed", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 122, "end_line": 142, "tags": { "PURPOSE": "Ensure execution crash conditions force FAILED run status.", "PRE": "Run exists, then required dependency becomes unavailable before execute_stages.", "POST": "execute_stages persists run with FAILED status." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } }, { "name": "test_blocked_run_finalization_blocks_report_builder", "type": "Function", "complexity": 1, "tier": "TRIVIAL", "start_line": 145, "end_line": 171, "tags": { "PURPOSE": "Ensure blocked runs require blocking violations before report creation.", "PRE": "Manifest contains prohibited artifacts leading to BLOCKED decision.", "POST": "finalize keeps BLOCKED and report_builder rejects zero blocking violations." }, "relations": [], "children": [], "compliance": { "valid": true, "issues": [], "score": 1.0 } } ], "compliance": { "valid": true, "issues": [ { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 }, { "message": "Invalid @RELATION predicate: TESTS. Allowed: BINDS_TO, CALLS, DEPENDS_ON, DISPATCHES, IMPLEMENTS, INHERITS", "severity": "WARNING", "line_number": 1 } ], "score": 0.625 } } ] }