mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-09-05 04:00:31 +00:00
* fix mutable default argument in graph_analyzer.py * fix mutable default argument in kg_chunkers.py * fix mutable default argument in methods.py * Address review: move default-init code out of docstrings, default levels in split_hierarchical Three findings from the Qodo review: - analyze_temporal_evolution: the 'if metrics is None' block had landed inside the docstring, so it never executed and metrics_tracked came back None. Moved below the docstring where it runs. - HierarchicalChunker.__init__: the same misplacement turned the docstring into a dead string constant and broke help()/introspection. Moved the default-init below it. - split_hierarchical: the signature now defaults levels to None, but the body still ran 'in levels' membership tests — calling it without levels raised TypeError. Defaults to the documented hierarchy, matching the class-level default. * test: add mutable-default regression tests for the three fixed sites - tests/split/test_chunkers.py: TestMutableDefaultRegression (6 tests) - split_hierarchical() default levels and chunk_sizes stay independent across calls - HierarchicalChunker() default levels stay independent across instances - tests/kg/test_kg.py: TestAnalyzeTemporalEvolutionMutableDefault (5 tests) - analyze_temporal_evolution() default metrics value is canonical - mutations to a returned metrics_tracked list do not affect the next call - explicit metrics override is forwarded and reflected in the return value - mutating an explicitly passed list does not corrupt a subsequent default call All 96 tests in the two affected test files pass. --------- Co-authored-by: Zohaib Hassnain <109234410+ZohaibHassan16@users.noreply.github.com> Co-authored-by: Sameer Kadam <sskadam6305@gmail.com>