orchestrata_ultimate.refactor.codemod

Reference › orchestrata_ultimate › refactor › codemod › init

The facade of the SPEC-110 codemod engine, the in-memory code intelligence platform. It re-exports the main classes: CodemodWorkspace from workspace, the code intelligence graph from _cig, the transform passes from passes, the report types from report, the review modules (review, review_catalogue, review_engine) and the event types from the observability package. The daemon server and the scripts.codemod command import it. The codemod index explains the whole package.

At a glance

Source src/orchestrata_ultimate/refactor/codemod/__init__.py
Lines of code 74
Classes 0
Functions 0
Imports (internal) orchestrata_ultimate.refactor.codemod._cig, orchestrata_ultimate.refactor.codemod.observability.events, orchestrata_ultimate.refactor.codemod.passes, orchestrata_ultimate.refactor.codemod.report, orchestrata_ultimate.refactor.codemod.review, orchestrata_ultimate.refactor.codemod.review_catalogue, orchestrata_ultimate.refactor.codemod.review_engine, orchestrata_ultimate.refactor.codemod.workspace
Imported by orchestrata_ultimate.refactor.codemod.server, scripts.codemod
Tests that import it tests/refactor/codemod/test_fast_fallback_coverage.py, tests/refactor/codemod/test_review_checks.py, tests/refactor/codemod/test_review_engine.py, tests/refactor/codemod/test_review_passes.py

Class diagram

No classes; see Functions.

Dependency diagram

Dependency diagram orchestrata_ultimate.refactor.codemod

API

No public API: the module defines no classes, functions or constants.

Source

Permalink: https://gitlab.com/MSamy/orchestrata-ultimate-architecture/-/blob/a4cbc2bdf/src/orchestrata_ultimate/refactor/codemod/__init__.py

"""
SPEC-110: In-Memory Code Intelligence Platform

This package provides a complete code intelligence substrate that loads an entire
Python codebase as a lossless CST forest, builds a multihop-queryable Code
Intelligence Graph, executes composable transform and review passes entirely in
RAM, and commits changes atomically with full rollback capability.

Key components:
- CodemodWorkspace: Main entry point for loading and transforming code
- CodeIntelligenceGraph: Multihop graph queries (blast radius, cycles, etc.)
- TransformPass: Base class for code transformations
- ReviewPass: Base class for code review checks
- InMemoryReviewEngine: The 40-check review of the mutated forest (REQ-110-033)
- CodemodGraphRepository: Protocol for graph database persistence

Dependencies:
- libcst>=1.8.6: CST parsing (native Rust parser with cp314t wheels)
- xxhash>=3.0.0: Content fingerprinting (5 GB/s)
- psutil>=7.2.2: RSS measurement (already installed)

Example usage:
    from orchestrata_ultimate.refactor.codemod import CodemodWorkspace
    from orchestrata_ultimate.refactor.codemod.passes import ReplaceStringLiteralPass

    ws = CodemodWorkspace.load(Path("."), include=("src", "scripts", "tests"))
    pass_ = ReplaceStringLiteralPass(old="Neo4j", new="Graph")
    changes = ws.run([pass_])
    report = ws.commit(changes, dry_run=False)
"""

from orchestrata_ultimate.refactor.codemod._cig import CodeIntelligenceGraph
from orchestrata_ultimate.refactor.codemod.observability.events import (
    CodemodEvent,
    CodemodEventType,
)
from orchestrata_ultimate.refactor.codemod.passes import TransformPass
from orchestrata_ultimate.refactor.codemod.report import (
    ChangeEntry,
    ChangeSet,
    CommitReport,
    Finding,
)
from orchestrata_ultimate.refactor.codemod.review import ReviewPass
from orchestrata_ultimate.refactor.codemod.review_catalogue import (
    CheckCategory,
    CheckDescriptor,
    CheckRegistry,
    ReviewCheck,
)
from orchestrata_ultimate.refactor.codemod.review_engine import (
    InMemoryReviewEngine,
    ReviewContext,
)
from orchestrata_ultimate.refactor.codemod.workspace import CodemodWorkspace

__all__ = [
    "ChangeEntry",
    "ChangeSet",
    "Finding",
    "CommitReport",
    "CodemodEvent",
    "CodemodEventType",
    "CodemodWorkspace",
    "CodeIntelligenceGraph",
    "TransformPass",
    "ReviewPass",
    "InMemoryReviewEngine",
    "ReviewContext",
    "ReviewCheck",
    "CheckRegistry",
    "CheckCategory",
    "CheckDescriptor",
]