Metadata-Version: 2.4
Name: phi47-superpowers
Version: 0.1.1
Summary: Structural code quality layer based on IIT 4.0
Author-email: wcalmels <wcalmels@phi47.cl>
License: ﻿MIT License
        
        Copyright (c) 2025 wcalmels
        TUCH Systems Research Laboratory -- Buenos Aires / Santiago
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Project-URL: Homepage, https://phi47.tuch.systems
Project-URL: Repository, https://github.com/wcalmels/phi47-superpowers
Keywords: linter,code-quality,iit,phi,ast,developer-tools
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.11
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Provides-Extra: llm
Requires-Dist: anthropic>=0.20; extra == "llm"
Requires-Dist: openai>=1.0; extra == "llm"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Dynamic: license-file

﻿# Phi47 Superpowers Layer

[![CI](https://github.com/TUCHSystems/phi47-superpowers/actions/workflows/ci.yml/badge.svg)](https://github.com/TUCHSystems/phi47-superpowers/actions)
[![PyPI](https://img.shields.io/pypi/v/phi47-superpowers)](https://pypi.org/project/phi47-superpowers/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

> Structural code quality layer based on Integrated Information Theory (IIT 4.0).
> Works on top of any editor (VS Code, Cursor, Neovim) or LLM (Claude, GPT-4, Gemini).
> No vendor lock-in. Use your own API keys.

## Install

    pip install phi47-superpowers
    pip install "phi47-superpowers[llm]"

## Quick start

    phi47 analyze mycode.py
    phi47 analyze .
    phi47 generate "Build a REST API" --output api.py
    phi47 init

## Diagnostic codes

| Code | Issue                     | Severity        |
|------|---------------------------|-----------------|
| P001 | Low system Phi            | error / warning |
| P002 | Zombie function           | warning         |
| P003 | High cyclomatic complexity| error / warning |
| P004 | Low causal density        | info            |
| P006 | Disconnected class        | hint            |
| P007 | God function              | hint            |

## Use as a library

    from phi47 import Phi47Linter
    linter = Phi47Linter()
    for d in linter.lint_file("mycode.py"):
        print(d)

## Scientific background

Phi47 applies spectral IIT 4.0 to dependency graphs:
    Phi = H(eigenvalues(C*C^T)) * (1 - e^(-k))
Runs in O(n^3) instead of exact O(2^n).

## License

MIT License -- Copyright (c) 2025 Walter Calmels Von dem Knesebeck
TUCH Systems Research Laboratory
