Private
Public Access
refactor(scripts): move 7 code_path_audit files from src/ to scripts/code_path_audit/
The 7 code_path_audit*.py files (2604 lines total) are pure static analysis tools. They do AST traversal of src/, no intrusive profiling, no runtime markers. They were inlaid with src/ but only import: - src.result_types (the Result[T] convention type) - each other (the 6 siblings) After the move: - src/ is now pure application code; line-count audit metrics are clean - scripts/code_path_audit/ is a new namespace-isolated subdir per AGENTS.md 'scripts are namespace-isolated by directory' rule TIER-3 READ AGENTS.md + conductor/workflow.md + conductor/edit_workflow.md + conductor/code_styleguides/code_path_audit.md + the 7 files before this commit. Changes: - 7 files moved: src/code_path_audit*.py -> scripts/code_path_audit/ - 7 files updated: internal imports rom src.code_path_audit_X -> rom code_path_audit_X (siblings in same subdir) - 7 files updated: add sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'src')) to find src.result_types when run standalone - 5 test files updated: rom src.code_path_audit -> rom code_path_audit + sys.path setup to find the new subdir - 6 throwaway scripts in scripts/tier2/artifacts/ updated: import path + sys.path setup (parents[3] / 'src' + parents[3] / 'scripts' / 'code_path_audit') - 2 styleguide/spec references updated: conductor/code_styleguides/code_path_audit.md + conductor/tracks/code_path_audit_20260607/spec_v2.md - 1 meta-audit docstring updated: scripts/audit_code_path_audit_coverage.py - 1 type registry entry deleted: docs/type_registry/src_code_path_audit.md (the type is no longer in src/) - 1 type registry index updated: docs/type_registry/index.md (22 files, was 23) Verification: - 7/7 audit gates pass --strict (weak_types 102<=112, type_registry 22 files, main_thread_imports OK, no_models_config_io OK, code_path_audit_coverage 0 violations, exception_handling 0 violations, optional_in_3_files 0 violations) - 6/6 test files pass: test_code_path_audit, test_code_path_audit_integration, test_code_path_audit_phase78, test_code_path_audit_phase89, test_code_path_audit_ssdl_behavioral, test_metadata_nil_sentinel - src/ line count: 29997 lines (down from 32621 = -2624 lines) - scripts/code_path_audit/ line count: 2620 lines
This commit is contained in:
@@ -7,7 +7,6 @@ Generated by `scripts/generate_type_registry.py`. Re-run the script (or invoke `
|
||||
|
||||
- [`src\api_hooks.py`](src\api_hooks.md)
|
||||
- [`src\beads_client.py`](src\beads_client.md)
|
||||
- [`src\code_path_audit.py`](src\code_path_audit.md)
|
||||
- [`src\command_palette.py`](src\command_palette.md)
|
||||
- [`src\diff_viewer.py`](src\diff_viewer.md)
|
||||
- [`src\history.py`](src\history.md)
|
||||
@@ -31,18 +30,6 @@ Generated by `scripts/generate_type_registry.py`. Re-run the script (or invoke `
|
||||
|
||||
- `WebSocketMessage` (dataclass) - [`src\api_hooks.py`](src\api_hooks.md#src\api_hooks.py::WebSocketMessage)
|
||||
- `Bead` (dataclass) - [`src\beads_client.py`](src\beads_client.md#src\beads_client.py::Bead)
|
||||
- `FunctionRef` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::FunctionRef)
|
||||
- `AccessPatternEvidence` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::AccessPatternEvidence)
|
||||
- `FrequencyEvidence` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::FrequencyEvidence)
|
||||
- `ResultCoverage` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::ResultCoverage)
|
||||
- `TypeAliasCoverage` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::TypeAliasCoverage)
|
||||
- `CrossAuditFinding` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::CrossAuditFinding)
|
||||
- `CrossAuditFindings` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::CrossAuditFindings)
|
||||
- `DecompositionCost` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::DecompositionCost)
|
||||
- `OptimizationCandidate` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::OptimizationCandidate)
|
||||
- `AggregateProfile` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::AggregateProfile)
|
||||
- `ProducerConsumerGraph` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::ProducerConsumerGraph)
|
||||
- `AuditSummary` (dataclass) - [`src\code_path_audit.py`](src\code_path_audit.md#src\code_path_audit.py::AuditSummary)
|
||||
- `Command` (dataclass) - [`src\command_palette.py`](src\command_palette.md#src\command_palette.py::Command)
|
||||
- `ScoredCommand` (dataclass) - [`src\command_palette.py`](src\command_palette.md#src\command_palette.py::ScoredCommand)
|
||||
- `DiffHunk` (dataclass) - [`src\diff_viewer.py`](src\diff_viewer.md#src\diff_viewer.py::DiffHunk)
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
# Module: `src\code_path_audit.py`
|
||||
|
||||
Auto-generated from source. 12 struct(s) defined in this module.
|
||||
|
||||
## `src\code_path_audit.py::AccessPatternEvidence`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 70
|
||||
|
||||
**Fields:**
|
||||
- `function: FunctionRef`
|
||||
- `pattern: AccessPattern`
|
||||
- `field_accesses: dict[str, int]`
|
||||
- `confidence: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::AggregateProfile`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 136
|
||||
|
||||
**Fields:**
|
||||
- `name: str`
|
||||
- `aggregate_kind: AggregateKind`
|
||||
- `memory_dim: MemoryDim`
|
||||
- `producers: tuple[FunctionRef, ...]`
|
||||
- `consumers: tuple[FunctionRef, ...]`
|
||||
- `access_pattern: AccessPattern`
|
||||
- `access_pattern_evidence: tuple[AccessPatternEvidence, ...]`
|
||||
- `frequency: Frequency`
|
||||
- `frequency_evidence: tuple[FrequencyEvidence, ...]`
|
||||
- `result_coverage: ResultCoverage`
|
||||
- `type_alias_coverage: TypeAliasCoverage`
|
||||
- `cross_audit_findings: CrossAuditFindings`
|
||||
- `decomposition_cost: DecompositionCost`
|
||||
- `optimization_candidates: tuple[OptimizationCandidate, ...]`
|
||||
- `is_candidate: bool`
|
||||
- `mermaid: str`
|
||||
- `markdown: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::AuditSummary`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 1032
|
||||
|
||||
**Fields:**
|
||||
- `aggregate_profiles: tuple[AggregateProfile, ...]`
|
||||
- `output_paths: dict[str, str]`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::CrossAuditFinding`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 99
|
||||
|
||||
**Fields:**
|
||||
- `audit_script: str`
|
||||
- `site_count: int`
|
||||
- `example_file: str`
|
||||
- `example_line: int`
|
||||
- `note: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::CrossAuditFindings`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 107
|
||||
|
||||
**Fields:**
|
||||
- `weak_types: tuple[CrossAuditFinding, ...]`
|
||||
- `exception_handling: tuple[CrossAuditFinding, ...]`
|
||||
- `optional_in_baseline: tuple[CrossAuditFinding, ...]`
|
||||
- `config_io_ownership: tuple[CrossAuditFinding, ...]`
|
||||
- `import_graph: tuple[CrossAuditFinding, ...]`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::DecompositionCost`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 115
|
||||
|
||||
**Fields:**
|
||||
- `current_cost_estimate: int`
|
||||
- `componentize_savings: int`
|
||||
- `unify_savings: int`
|
||||
- `recommended_direction: RecommendedDirection`
|
||||
- `recommended_rationale: str`
|
||||
- `batch_size: int | None`
|
||||
- `struct_field_count: int`
|
||||
- `struct_frozen: bool`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::FrequencyEvidence`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 77
|
||||
|
||||
**Fields:**
|
||||
- `function: FunctionRef`
|
||||
- `frequency: Frequency`
|
||||
- `source: str`
|
||||
- `note: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::FunctionRef`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 63
|
||||
|
||||
**Fields:**
|
||||
- `fqname: str`
|
||||
- `file: str`
|
||||
- `line: int`
|
||||
- `role: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::OptimizationCandidate`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 126
|
||||
|
||||
**Fields:**
|
||||
- `candidate: str`
|
||||
- `direction: RecommendedDirection`
|
||||
- `affected_files: tuple[str, ...]`
|
||||
- `estimated_savings_us: int`
|
||||
- `effort: str`
|
||||
- `priority: str`
|
||||
- `cross_ref: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::ProducerConsumerGraph`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 156
|
||||
**Summary:** Bipartite graph: aggregates <-> functions.
|
||||
|
||||
**Fields:**
|
||||
- `edges: dict[tuple[str, str], set[str]]`
|
||||
- `producers: dict[str, set[FunctionRef]]`
|
||||
- `consumers: dict[str, set[FunctionRef]]`
|
||||
- `field_accesses: dict[tuple[str, str], tuple[str, int]]`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::ResultCoverage`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 84
|
||||
|
||||
**Fields:**
|
||||
- `total_producers: int`
|
||||
- `result_producers: int`
|
||||
- `total_consumers: int`
|
||||
- `result_consumers: int`
|
||||
- `summary: str`
|
||||
|
||||
|
||||
## `src\code_path_audit.py::TypeAliasCoverage`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 92
|
||||
|
||||
**Fields:**
|
||||
- `total_sites: int`
|
||||
- `typed_sites: int`
|
||||
- `untyped_sites: int`
|
||||
- `summary: str`
|
||||
|
||||
Reference in New Issue
Block a user