You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Story] Simplify and de-duplicate the Python analysis backend #36
area: python-backendPython analysis backend (backend/)stream: cleanup-refactorEpic #26: deep cleanup and restructuring of the extensiontfmAdds the issue to the TFM board automatically. Do not removeuser-storySub-issue of an epic ([Story] title prefix)
As a researcher who will add ML-based analyses on top of the backend, I want the Python analyzers to be small, table-driven and free of duplicated windows, so that adding a language or a metric is a data change, not a copy of a 500-line function.
Scope (ROADMAP W4-P P01–P20 and W5-44..49)
Reuse _empty_metrics, _add_graph_metrics, _iter_raw_targets; single get_file_size; single read in build_line_metrics; narrow exception types; CAPABILITIES read from the contract; relation count in one pass; dead locals.
One shared directory-coordinator helper; rename sumaryFiles/ → summaryFiles/ (with its TS caller).
analyze_classes (536 lines, CCN 90) becomes table-driven behind a 21-arm golden test; analyze_dependencies and analyze_file_dependencies into helpers; _infer_class_owner characterized and refactored.
Do not touch
The XR field-schema contract (xr_field_schema.py ↔ xrFieldSchemaService.ts): XR_SCHEMA_VERSION, field order/labels, _text_field/_numeric_field syntax, complexity-band thresholds. Known behaviour quirks recorded in V1.2.1_STATUS.md (non-deterministic dependency resolution, class-owner inference) are pinned as they are and left for 1.3.0.
Acceptance criteria
Goldens identical before and after every refactor; npm run test:python and test:analysis green.
Done in #50, merged into v1.2.1 with CI green on Linux, macOS and Windows. Worst backend CCN 90 → 18, functions over CCN 15 10 → 1. F5 notes for #43 are in .claude/docs/v1.2.1/sessions/36-python-backend.md.
area: python-backendPython analysis backend (backend/)stream: cleanup-refactorEpic #26: deep cleanup and restructuring of the extensiontfmAdds the issue to the TFM board automatically. Do not removeuser-storySub-issue of an epic ([Story] title prefix)
Activity
refactor(python): reuse _empty_metrics in analyze_dependencies
refactor(python): analyze_dependencies calls _add_graph_metrics
refactor(python): one _iter_raw_targets generator behind both extractors
refactor(python): _find_block_end and _lexical_function_entry
perf(python): stat the file only when the snapshot lacks fileSizeBytes
refactor(python): one lizard-free get_file_size
perf(python): read each file once in build_line_metrics
refactor(python): narrow read_text_lines to (OSError, ValueError)
refactor(python): dependency CAPABILITIES read the language contract
test(python): pin relationCount semantics for self-edges and parallel…
perf(python): relationCount in one pre-pass over the edges
9 remaining items
test(python): extension-driven golden of analyze_classes
refactor(python): table-driven analyze_classes
chore(python): delete the class_counter CLI and its imports
refactor(python): analyze_dependencies into six helpers
refactor(python): analyze_file_dependencies and _ensure_external_node
test(python): characterize _infer_class_owner before its refactor
refactor(python): split _infer_class_owner into one helper per algorithm
docs(cleanup): feature-baseline names summaryFiles/ after the P20 rename
docs(v1.2.1): session logs for #31 (Python) and #36, CHANGELOG line
docs(v1.2.1): session logs record the second v1.2.1 merge
Merge pull request #50 from Code-XR-Project/claude/project-thread-n2s…
aMonteSl commentedon Nov 25, 2026
Done in #50, merged into
v1.2.1with CI green on Linux, macOS and Windows. Worst backend CCN 90 → 18, functions over CCN 15 10 → 1. F5 notes for #43 are in.claude/docs/v1.2.1/sessions/36-python-backend.md.Generated by Claude Code