Skip to main content

regres

img.png

Narzędzia do analizy regresji, refaktoryzacji i duplikatów kodu — z naciskiem na autonomiczne wykrywanie regresji frontendu (placeholder pages, broken imports, runtime 500 z Vite, niezgodność konwencji loadera modułów) i generowanie skryptów naprawczych z trybami --preview / --diff / --apply.

Installation

pip install -e .

What's new (0.1.55)

  • --runtime-log end-to-end — doctor_cli + regres_cli forwarding dla diagnostyki runtime z logów konsoli (np. [IconComponent] SVG icon not found).
  • runtime_icon_registry_miss diagnosis — wykrywa brakujące wpisy w rejestrze ikon na podstawie logów runtime (emoji-tokeny używane w UI bez definicji SVG).
  • Fixed DoctorOrchestrator._extract_page_token — poprawione parsowanie nested routes (np. connect-test/operator-workshop), wcześniej zwracało None.
  • Rozszerzone wzorce placeholderów — dodano generic 'w trakcie migracji' do PLACEHOLDER_TEXT_PATTERNS.
  • Page-registry compliance check (page_registry_default_missing) — parsuje <module>/pages-index.ts, weryfikuje że defaultPage istnieje w rejestrze stron (z pominięciem zakomentowanych wpisów). Brak → krytyczna diagnoza z gotową instrukcją naprawy.
  • Module-loader compliance check (module_loader_no_class) — wykrywa pliki <name>.module.ts, które nie eksportują klasy *Module ani default.
  • Vite runtime probe (--vite-base, autoderywowane z --url) — pobiera plik celu z dev-servera Vite i parsuje błędy 500.
  • Dependency chain analysis — BFS po relatywnych importach pliku celu (depth=1); zaznacza BROKEN/STUB.
  • Decision-tree workflow w raporcie — ścieżka decyzyjna, snapshot struktury, plan kroków.
  • Patch scripts z --preview / --diff / --apply + automatyczne przepisywanie ścieżek importów.
  • Nowe workflows: .windsurf/workflows/c2004-preanalysis-predeploy.md i .windsurf/workflows/c2004-security-settings-baseline.md.

What's new (0.1.40-0.1.45)

  • DoctorConfig + .regres/.env loader — 4-tier priority chain: CLI > os.environ > .regres/.env > defaults.
  • Startup banner — pokazuje aktywne okno analizy (history days, max iterations, shrinkage factor, vite base).
  • Nowe flagi CLI: --history-window-days, --history-max-iterations, --history-shrinkage-factor, --no-banner.
  • Defaults bumped: HISTORY_DEFAULT_DAYS 2→30, HISTORY_DEFAULT_ITERATIONS 10→30.
  • Mapping connect-deleted w MODULE_PATH_MAP.

Usage

Główny CLI regres obsługuje następujące komendy:

  • regres — analiza regresji plików (historia, zmiany)
  • regres refactor — analiza kodu przy refaktoryzacji (duplikaty, zależności, symbole)
  • regres defscan — skaner duplikatów definicji klas, funkcji i modeli
  • regres doctor — orchestrator analizy i generator akcji naprawczych (z trybem URL)
  • regres import-error-toon-report — raport błędów importów TS w formacie Toon

Doctor — typowy workflow URL → naprawa

# 1) Analiza konkretnej strony, która nie wyświetla się poprawnie:
regres doctor \
  --scan-root /path/to/repo \
  --url 'http://localhost:8100/connect-config-sitemap?...' \
  --all --git-history \
  --vite-base http://localhost:8100 \
  --out-md .regres/sitemap-doctor.md

# Raport zawiera:
#   - Plan kroków (decision-tree) z inputs/outputs/decision per krok
#   - Page implementation analysis (placeholder/stub detection)
#   - Module loader compliance (czy <name>.module.ts spełnia kontrakt loadera)
#   - Dependency chain (broken/stub linki w importach celu)
#   - Vite runtime probe (autorytatywny status 200/500 + missing import)
#   - Patch scripts z preview/diff/apply per kandydat z historii git

# 2) Każdy "broken link" w raporcie zawiera gotową komendę regres
#    dla pliku, który zgłosił błąd — wystarczy ją skopiować i uruchomić,
#    aby kontynuować naprawę łańcuchową.

# 3) Po wybraniu kandydata uruchom patch script:
bash .regres/patches/<page-token>/restore-<hash>.sh --preview   # podgląd
bash .regres/patches/<page-token>/restore-<hash>.sh --diff      # diff
bash .regres/patches/<page-token>/restore-<hash>.sh --apply     # zapis

Examples

# Analiza regresji pliku
regres regres --file path/to/file.py

# Analiza kodu przy refaktoryzacji
regres refactor find encoder
regres refactor symbols encoder
regres refactor duplicates

# Skan duplikatów definicji
regres defscan
regres defscan --kind class --min-count 2

# Orchestrator analizy i generator akcji naprawczych
regres doctor --all
regres doctor --import-log .regres/import-error-toon-report.raw.log --out-md .regres/doctor-report.md
regres doctor --url http://localhost:8100/connect-deleted --vite-base http://localhost:8100

# Raport błędów importów TS
regres import-error-toon-report

Diagnozy doctor — typy

problem_type Severity Wykrycie
page_content_regression high git history pokazuje znacznie większą poprzednią wersję pliku
placeholder_page high tekst pasuje do PLACEHOLDER_TEXT_PATTERNS (w tym 'w trakcie migracji')
import_resolution_failure high/medium BFS po relatywnych importach — nie rozwiązany / placeholder
vite_runtime_failure critical HTTP probe Vite zwraca 500 z Failed to resolve import
module_loader_no_class critical <name>.module.ts bez *Module / export default
page_registry_default_missing critical pages-index.ts ma defaultPage nieobecny w rejestrze → ryzyko nieskończonej rekurencji w BasePageManager
runtime_icon_registry_miss medium/high Logi runtime z [IconComponent] SVG icon not found: <emoji> — brak definicji ikony w rejestrze
module_not_found medium URL prefix bez modułu w MODULE_PATH_MAP (obsługa nested routes: connect-test/operator-workshop)
import_error medium TS2307/TS2305 z logu kompilatora

Documentation

AI Cost Tracking

AI Cost AI Model

This project uses AI-generated code. Total cost: $21.4770 with 57 AI commits.

Generated on 2026-06-29 using openrouter/qwen/qwen3-coder-next


License

Licensed under Apache-2.0.

Metadata

Release files for regres 0.1.59

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for regres 0.1.59
File Size Uploaded Provenance Actions
regres-0.1.59.tar.gz 133.5 kB Without provenance Details for regres-0.1.59.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for regres 0.1.59
File Interpreter ABI Platform Actions
regres-0.1.59-py3-none-any.whl Python 3 none any Details for regres-0.1.59-py3-none-any.whl

Total release size: 247.1 kB

Release files / regres-0.1.59.tar.gz

Download URL regres-0.1.59.tar.gz
Size 133.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cc6690dcb0e1d668f41f43cd6519691f11766bc1d54034927a6f3c8eeb3330f7
BLAKE2b-256 checksum
How to use checksums
b2c24fdf106204b032ceb55938571ee679d93103de10274b4117596a496b8aeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / regres-0.1.59-py3-none-any.whl

Download URL regres-0.1.59-py3-none-any.whl
Size 113.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f29ec0fff909be7d54bc4f09f8551eeb6fd33c337e945118e5db2d2ccb21538
BLAKE2b-256 checksum
How to use checksums
abd932406e4b162c40d77a788252d7b2cd8daa66abef6693e9cd0bba49bf84fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for regres 0.1.59

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.59 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page