Quality Pack

🧪 InterIA Quality Pack v4

Moteur qualité modulaire · aide au maintien · pont IA · cartes de structure pour dépôts scientifiques

💠 Qu’est‑ce que InterIA Quality Pack v4 ?

interia-quality est le paquet Python autonome derrière le InterIA Quality Pack v4.

Il fournit :

  • des contrôles qualité modulaires (Python, Markdown, LaTeX, BibTeX),
  • un pipeline d’analyse JSON‑first (rapports, plans de refactor, chronologie),
  • un Pont IA agnostique (AI Bridge) pour une aide à la refonte en toute sécurité,
  • des galaxies LaTeX & BibTeX pour les documents scientifiques,
  • une Cosmos Map & une timeline documentaire pour le dépôt entier,
  • des tableaux de bord HTML (portail, rapport qualité, cosmos, galaxies).

Toutes les commandes opèrent sur le répertoire courant et supposent que vous êtes à la racine du projet.

🚀 Démarrage rapide (CLI)

Une fois installé (via pip install interia-quality) :

# depuis la racine de votre projet
interia-quality          # lance tous les checks qualité (défaut)
interia-quality check    # équivalent

Cela exécute tous les plugins qualité et écrit quality_report.json.

Commandes principales :

  • interia-quality / check – exécute les checks et écrit quality_report.json
  • refactor-plan – génère refactor_plan.json + refactor_plan.md
  • refactor-apply – applique des refactors sûrs (docstrings automatiques, petites améliorations)
  • cosmos-map – construit cosmos_map.json + cosmos_map_summary.json
  • cosmos-timelapse – met à jour cosmos_history/ + cosmos_timeline.json
  • latex-galaxy – génère latex_galaxy.json
  • latex-explorer – génère latex_explorer.json
  • bib-galaxy – génère bib_galaxy.json
  • init-board – copie le board HTML/CSS/JS dans ./interia_quality/board
  • portal – démarre un serveur HTTP local et ouvre le portail InterIA

🤖 Refactor Assist – flux du Pont IA

Le Pont IA coordonne les suggestions de refactor avec des LLM externes via des fichiers JSON. Il est agnostique (aucun fournisseur imposé).

  1. Construire le plan de refactor :
    interia-quality refactor-plan
    Produit refactor_plan.json et refactor_plan.md.
  2. Construire la requête IA :
    interia-quality ai-request
    Produit ai_request.json.
  3. Option : générer un prompt prêt à coller dans un LLM :
    interia-quality ai-prompt
    Produit ai_prompt.txt.
  4. Envoyer ai_request.json ou ai_prompt.txt à votre LLM préféré (ChatGPT, Claude, Gemini, …) et enregistrer la réponse dans ai_response.json à la racine du dépôt.
  5. Résumer la réponse :
    interia-quality ai-summary
  6. Prévisualiser et appliquer les modifications :
    • via le board : ai_preview.html (voir carte correspondante),
    • via la CLI :
      interia-quality ai-apply
      Applique les modifications jugées sûres (avec sauvegardes).

Tous les fichiers intermédiaires sont en JSON et lisibles : refactor_plan.json, ai_request.json, ai_response.json.

🌐 Cosmos, Galaxies & Multivers

Au‑delà de la qualité, la suite offre des vues structurelles à plus grande échelle :

  • Cosmos Map – fusionne les signaux Python / Markdown / LaTeX / BibTeX dans cosmos_map.json + cosmos_map_summary.json
    CLI : interia-quality cosmos-map
    Makefile : make cosmos-mapmake cosmos-map-html
  • Cosmos Timeline – enregistre des snapshots dans cosmos_history/ et suit l’évolution de la cohérence et de la structure dans le temps.
    CLI : interia-quality cosmos-timelapse
    Makefile : make cosmos-timelinemake cosmos-timeline-html
  • LaTeX Galaxy – cartographie des sections, labels et macros sur tous les fichiers .tex dans latex_galaxy.json.
    CLI : interia-quality latex-galaxy
    Makefile : make latex-galaxymake latex-galaxy-html
  • LaTeX Explorer – carte de structure LaTeX enrichie dans latex_explorer.json.
    CLI : interia-quality latex-explorer
    Makefile : make latex-explorermake latex-explorer-html
  • Galaxie BibTeX – analyse des fichiers .bib + .tex et produit bib_galaxy.json (références citées / manquantes / inutilisées).
    CLI : interia-quality bib-galaxy
    Makefile : make bib-galaxymake bib-galaxy-html
  • Multivers (multi‑dépôts) – à lancer depuis un dépôt “multiverse root” avec un Makefile :
    make multiverse-map repos="../repoA ../repoB ..."
    make multiverse-gravity · make multiverse-cli
    make multiverse-bridges
    make multiverse-3dmake multiverse-3d-html repos="..."
    NB : exécuter make cosmos-map dans chaque dépôt avant.

📡 Portail InterIA & board

Le board est la face visuelle de la suite : rapport qualité, prévisualisation des refactors, galaxies, Cosmos, Multivers – le tout dans un seul portail.

1. Installer le board (une fois par dépôt) :

cd /chemin/vers/votre/depot
interia-quality init-board

2. Ouvrir le portail via la CLI :

interia-quality portal

Cela démarre un serveur local sur http://127.0.0.1:8000 et ouvre le portail InterIA : interia-quality/board/interia_portal.html

3. Ou via les cibles Makefile (mode “vendored”) :

  • make portal-all – analyse minimale + ouverture du portail
  • make portal-html – ouvre le portail (serveur + navigateur)
  • make quality-serve – ouvre quality_report.html
  • make ai-preview – ouvre ai_preview.html

Depuis le portail, vous pouvez naviguer vers : quality_report.html, ai_preview.html, cosmos_explorer.html, cosmos_timeline.html, galaxy_latex_explorer.html, doctor_latex_galaxy.html, bib_galaxy.html, multiverse_3d.html, etc.

📜 Principes de conception

  • JSON‑first – chaque analyse produit du JSON diffable et scriptable.
  • IA‑agnostique – le Pont IA définit des formats de fichiers, pas des fournisseurs.
  • Humain dans la boucle – plans de refactor et réponses IA toujours inspectables.
  • Application sûre – sauvegardes et vérifications de base avant d’écrire.
  • Fonctionne hors‑ligne – tout est local, sauf l’appel à l’IA externe.
  • Un seul portailInterIA Suite – one portal to see them all.
Modular quality engine · refactor assist · AI bridge · structure maps for scientific repos

💠 What is InterIA Quality Pack v4?

interia-quality is the standalone Python package behind the InterIA Quality Pack v4.

It provides:

  • modular quality checks (Python, Markdown, LaTeX, BibTeX),
  • a JSON‑first analysis pipeline (reports, refactor plans, timelines),
  • an AI‑agnostic Bridge for safe refactor assistance,
  • LaTeX & BibTeX “galaxies” for scientific documents,
  • a Cosmos Map and documentary timeline for the whole repo,
  • HTML dashboards (portal, quality report, cosmos, galaxies).

All commands operate on the current working directory and expect to be run from the project root.

🚀 Quick start (CLI)

Once installed (via pip install interia-quality):

# from your project root
interia-quality          # run all quality checks (default)
interia-quality check    # same as above

This runs all quality plugins and writes quality_report.json.

Core CLI commands:

  • interia-quality / check – run checks and write quality_report.json
  • refactor-plan – write refactor_plan.json + refactor_plan.md
  • refactor-apply – apply safe refactors (docstring templates, small cleanups)
  • cosmos-map – build cosmos_map.json + cosmos_map_summary.json
  • cosmos-timelapse – update cosmos_history/ + cosmos_timeline.json
  • latex-galaxy – build latex_galaxy.json
  • latex-explorer – build latex_explorer.json
  • bib-galaxy – build bib_galaxy.json
  • init-board – copy board HTML/CSS/JS into ./interia_quality/board
  • portal – start a local HTTP server and open the InterIA portal

🤖 Refactor Assist – AI Bridge workflow

The AI Bridge coordinates refactor suggestions with external LLMs via JSON files. It is AI‑agnostic (no vendor lock‑in).

  1. Build the refactor plan:
    interia-quality refactor-plan
    This writes refactor_plan.json and refactor_plan.md.
  2. Build the AI request payload:
    interia-quality ai-request
    This writes ai_request.json.
  3. Optionally, generate a ready‑to‑paste LLM prompt:
    interia-quality ai-prompt
    This writes ai_prompt.txt.
  4. Send ai_request.json or ai_prompt.txt to your favourite LLM (ChatGPT, Claude, Gemini, …) and save the answer as ai_response.json at the repo root.
  5. Summarise the response:
    interia-quality ai-summary
  6. Preview and apply edits:
    • via the board: ai_preview.html (see the corresponding card),
    • via the CLI:
      interia-quality ai-apply
      Applies safe edits (with backups).

All intermediate files are JSON and human‑readable: refactor_plan.json, ai_request.json, ai_response.json.

🌐 Cosmos, Galaxies & Multiverse

Beyond basic quality, the suite offers higher‑level structural views:

  • Cosmos Map – unify Python / Markdown / LaTeX / BibTeX signals into cosmos_map.json + cosmos_map_summary.json
    CLI: interia-quality cosmos-map
    Makefile: make cosmos-mapmake cosmos-map-html
  • Cosmos Timeline – record snapshots in cosmos_history/ and track the evolution of coherence and structure over time.
    CLI: interia-quality cosmos-timelapse
    Makefile: make cosmos-timelinemake cosmos-timeline-html
  • LaTeX Galaxy – map sections, labels and macros across all .tex files into latex_galaxy.json.
    CLI: interia-quality latex-galaxy
    Makefile: make latex-galaxymake latex-galaxy-html
  • LaTeX Explorer – richer LaTeX structure map in latex_explorer.json.
    CLI: interia-quality latex-explorer
    Makefile: make latex-explorermake latex-explorer-html
  • BibTeX Galaxy – analyse .bib + .tex and build bib_galaxy.json (cited / missing / unused refs).
    CLI: interia-quality bib-galaxy
    Makefile: make bib-galaxymake bib-galaxy-html
  • Multiverse (multi‑repo) – run from a multiverse root with a Makefile:
    make multiverse-map repos="../repoA ../repoB ..."
    make multiverse-gravity · make multiverse-cli
    make multiverse-bridges
    make multiverse-3dmake multiverse-3d-html repos="..."
    Nb: run make cosmos-map inside each repo beforehand.

📡 InterIA Portal & board

The board is the visual side of the suite: quality report, refactor preview, galaxies, Cosmos, Multiverse – all in one place.

1. Install the board assets (once per repo):

cd /path/to/your/repo
interia-quality init-board

2. Open the portal via the CLI:

interia-quality portal

This starts a local server on http://127.0.0.1:8000 and opens the InterIA portal: interia-quality/board/interia_portal.html

3. Or via Makefile targets (vendored mode):

  • make portal-all – minimal analysis + open the portal
  • make portal-html – open the portal (server + browser)
  • make quality-serve – open quality_report.html
  • make ai-preview – open ai_preview.html

From the portal you can navigate to: quality_report.html, ai_preview.html, cosmos_explorer.html, cosmos_timeline.html, galaxy_latex_explorer.html, doctor_latex_galaxy.html, bib_galaxy.html, multiverse_3d.html, etc.

📜 Design principles

  • JSON‑first – every analysis produces JSON that is diffable and scriptable.
  • AI‑agnostic – the AI Bridge only defines file formats, never providers.
  • Human in the loop – refactor plans and AI edits are always inspectable.
  • Safe application – backups and basic checks before writing changes.
  • Offline‑friendly – everything runs locally except the external AI call.
  • One portalInterIA Suite – one portal to see them all.