Skip to content

Physics Analysis

Tool: physics-analysis Model: Advanced Requires: ENABLE_PHYSICS_SKILLS=true

Triggered by: The qual-review loop when cyclomatic complexity exceeds 80, or coupling metrics are breached.

Intent: Use QM/GR metaphors to diagnose unmaintainable dependency webs without bias from conventional heuristics.

Capability profile: physics_analysis — requires math_physics + deep_reasoning, no fallback configured, schema enforcement enabled.

SkillRole
gr-event-horizon-detectorIdentifies modules past the point of refactoring return
qm-entanglement-mapperDetects invisible coupling through co-change histories
qm-heisenberg-pictureTracks non-commuting quality metrics
{
targetPath: string;
baselineAST: unknown;
}

Calculates spacetime debt and proposes a geodesic refactoring path. If the cost of the refactor is too high, throws execution back to strategy to prioritize in the roadmap instead of proceeding.

Terminal node — does not chain to other workflows on completion (outputs feed back to strategy-plan or code-refactor as user-driven decisions).

stateDiagram-v2
    [*] --> CodebaseAsObserved
    CodebaseAsObserved --> PrimaryQualityModel
    PrimaryQualityModel --> MetricGuidedAction
    MetricGuidedAction --> SystemResponse
    SystemResponse --> CodebaseAsObserved

    PrimaryQualityModel --> SpacetimeSelfObservation
    SpacetimeSelfObservation --> GravitationalDebtMetaModel
    GravitationalDebtMetaModel --> RefactoringPathRevision
    RefactoringPathRevision --> PrimaryQualityModel

    GravitationalDebtMetaModel --> AnalysisParalysis: over-modelling spiral
    AnalysisParalysis --> GroundingInMetrics
    GroundingInMetrics --> CodebaseAsObserved

    SystemResponse --> [*]: geodesic refactor path approved
sequenceDiagram
    participant Orchestrator
    participant Pool (Analytical)
    participant Pool (Mechanical)
    participant Tool (Context)

    Orchestrator->>Pool (Analytical): Allocate Capability Profile
    activate Pool (Analytical)
    Pool (Analytical)->>Tool (Context): Issue Tool Calls (Parallel)
    Tool (Context)-->>Pool (Analytical): Return Data

    alt Shallow Loop
        Pool (Analytical)->>Pool (Analytical): Auto-correct Schema
    else Medium Loop
        Pool (Analytical)->>Pool (Mechanical): Delegate Fixes
    end

    Pool (Analytical)-->>Orchestrator: Synthesis Gate
    deactivate Pool (Analytical)

    opt Deep Loop
        Orchestrator->>Orchestrator: Complete Throw-back to Prior Stage
    end