Skip to main content

Préprocesseur érotétique — prétraitement formel des questions avant le moteur de réponse

Project description

Préprocesseur érotétique

Les LLM ont résolu le problème de la réponse — la capacité d'exécution est quasi-illimitée. Le goulot est désormais la question : pour la première fois dans l'histoire, l'outil dépasse structurellement la capacité de spécification de celui qui s'en sert.

Manifeste · Livre blanc

Format Fichier Statut
F1 — Positioning Statement docs/positioning-statement.md brouillon
F3 — Manifeste docs/manifeste.md brouillon
F5 — Livre blanc docs/livre-blanc.md brouillon
G0 — Ontologie erotetique/ontology/erotetique.ttl brouillon
CQ — Competency Questions erotetique/ontology/cq-erotetique.ttl brouillon

Architecture

ontology/erotetique.ttl          ← G0 source de vérité (dimensions, quadrants, outils, opérations)
ontology/erotetique-shapes.ttl   ← contraintes SHACL
ontology/cq-erotetique.ttl       ← 7 Competency Questions SPARQL

erotetique/
  classifier.py   ← lit quadrants depuis Turtle, classification linguistique
  soundness.py    ← extraction heuristique présupposés
  augmenter.py    ← lit dimensions depuis Turtle, génère prompt dynamique
  server.py       ← MCP JSON-RPC stdio

Invariant SDD — le code ne connaît ni les dimensions ni les quadrants. Tout est lu depuis le Turtle au runtime. Ajouter une dimension dans erotetique.ttl = elle apparaît dans l'analyse sans toucher au Python (test_sdd_acid_test le vérifie).


Installation

uv sync
uv run pytest        # 67 tests

Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json :

{
  "mcpServers": {
    "erotetique": {
      "command": "/opt/homebrew/bin/uv",
      "args": ["run", "--project", "/Users/luc/Projets/erotetique", "python", "-m", "erotetique.server"],
      "env": { "HOME": "/Users/luc" }
    }
  }
}

Usage as Python Library

Install from PyPI:

pip install erotetique

Or locally (editable mode for development):

pip install -e /path/to/erotetique

Basic usage:

from erotetique import classify_question, check_soundness, valorize_question
from pathlib import Path

# Locate ontology (installed as package data)
ontology = Path(__file__).parent / "erotetique" / "ontology" / "erotetique.ttl"

question = "Pourquoi notre chiffre d'affaires a-t-il baissé ?"

# Classify into ignorance quadrant (KK/KU/UK/UU)
result = classify_question(question, ontology)
print(f"Quadrant: {result.quadrant_label}")
print(f"Action: {result.action}")

# Check soundness and extract presuppositions
soundness = check_soundness(question)
print(f"Sound: {soundness.sound}")
for p in soundness.presuppositions[:3]:
    print(f"  • {p.text}")

# Estimate value of information (two proxies)
voi = valorize_question(question, result, ontology)
print(f"VoI score (proxy 1 — decisional sensitivity): {voi.score:.2f}")
print(f"VoI score (proxy 2 — prior entropy): {voi.proxy2_score:.2f}")
print(f"Prescribed operations: {', '.join(voi.prescribed_operations)}")

Key Types

  • ClassificationResult — quadrant URI, label, rationale, action
  • SoundnessResultsound: bool, presuppositions: list[PresuppositionCheck]
  • VoIEstimatescore: float, proxy2_score: float, prescribed_operations: list[str], rationale: str

Architecture

All logic is deterministic, LLM-free, zero network:

  • Classifier reads quadrant definitions from ontology at runtime (SDD invariant)
  • Soundness extracts presuppositions heuristically (linguistic patterns)
  • Valorizer estimates VoI via two proxies:
    • Proxy 1: Decision-marker sensitivity (choisir, sélectionner, décider keywords → VoI ↑)
    • Proxy 2: Prior entropy of answer distribution (enumerable answers → low entropy; causal questions → high entropy)

Stack

Composant Techno
Ontologie Turtle — rdflib
Validation SHACL — pyshacl
Classification Linguistique pure — re
MCP JSON-RPC stdio
LLM Claude Desktop (le client est le LLM)

Zéro clé API. Zéro base externe. Zéro dépendance réseau au runtime.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erotetique-0.2.0.tar.gz (99.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

erotetique-0.2.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file erotetique-0.2.0.tar.gz.

File metadata

  • Download URL: erotetique-0.2.0.tar.gz
  • Upload date:
  • Size: 99.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for erotetique-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9502c4e721b497b844a46d3ff3e0dc68d2477394761bc3f43bbef0fb10be4392
MD5 782dfc6620c8fe1d0fe85bb90e7ae57d
BLAKE2b-256 1e0d397d409714f0d570b48810646f05e5a5ac00fe1ad5c11002ef5d0b6b7697

See more details on using hashes here.

File details

Details for the file erotetique-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: erotetique-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for erotetique-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5be37d6166a8636f8cd5017958e585d5fa7b17c4c04fac7b24dbd8ce9db419c
MD5 d9620aa4285b85c2ce6365e5013f06b8
BLAKE2b-256 3752a7f67b78bba8d9a1c0a3e0b3895b3bcca9eafe573703c75a85eae1e39737

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page