Skip to main content

REFLEX — Reflexive Evidence-based Loop for UI Development

Project description

iil-reflex

REFLEX — Reflexive Evidence-based Loop for UI Development

Evidence-based UI development methodology with LLM-powered domain agent, UC quality checker, and failure classifier. Pure Python — no Django dependency.

Architecture

reflex/
├── agent.py       # DomainAgent (variable domain, LLM-powered)
├── quality.py     # UC Quality Checker (11 criteria, rule-based)
├── classify.py    # Failure Classifier (decision tree + LLM)
├── config.py      # ReflexConfig from reflex.yaml
├── providers.py   # KnowledgeProvider, DocumentProvider (Protocol)
├── types.py       # Dataclasses (Results, Questions, Entries)
└── templates/     # promptfw .jinja2 templates (6 templates)

Installation

pip install iil-reflex
# Optional: Playwright for Zirkel 2
pip install iil-reflex[playwright]

Quick Start

from reflex.agent import DomainAgent
from reflex.config import ReflexConfig
from reflex.quality import UCQualityChecker

# 1. Load hub config
config = ReflexConfig.from_yaml("reflex.yaml")

# 2. UC Quality Check (rule-based, no LLM needed)
checker = UCQualityChecker(config)
result = checker.check(uc_text="...", uc_slug="sds-upload")
print(f"Score: {result.score_percent}%, Passed: {result.passed}")

# 3. Domain Agent (LLM-powered)
agent = DomainAgent(
    config=config,
    llm=your_llm_provider,
    knowledge=your_knowledge_provider,  # optional
    documents=your_document_provider,   # optional
)
research = agent.research("SDS Upload Pipeline")
questions = agent.generate_interview(research)
kb = agent.distill_kb(research, expert_answers={...})

Hub Configuration (reflex.yaml)

hub_name: risk-hub
vertical: chemical_safety
domain_keywords: ["SDS", "CAS", "GHS", "REACH"]
quality:
  min_acceptance_criteria: 2
  max_uc_steps: 7
  require_error_cases: true
viewports:
  - {name: mobile, width: 375, height: 812}
  - {name: desktop, width: 1280, height: 800}
htmx_patterns:
  banned: ["hx-boost"]
  required_on_forms: ["hx-indicator"]
permissions_matrix:
  /substances/: {anonymous: 302, viewer: 200, admin: 200}

Provider Pattern

All external dependencies use Protocols (Dependency Inversion):

from reflex.providers import KnowledgeProvider, LLMProvider

class OutlineProvider(KnowledgeProvider):
    def search(self, query, limit=5):
        return mcp3_search_knowledge(query, limit=limit)

class GroqProvider(LLMProvider):
    def complete(self, messages, action_code=""):
        return groq_client.chat(messages=messages)

Mock providers included for testing: MockKnowledgeProvider, MockDocumentProvider, MockLLMProvider

REFLEX Methodology

Three quality circles — no artifact without evidence:

  1. Zirkel 0 — Domain KB (DomainAgent + Expert sign-off)
  2. Zirkel 1 — UC Quality (11 criteria, 100% score required)
  3. Zirkel 2 — Playwright Tests (1 test per acceptance criterion)

Failure Classification:

  • UC_PROBLEM → UC needs revision (Zirkel 1 restart)
  • UI_PROBLEM → Wireframe needs fix
  • INFRA_PROBLEM → Server/browser/network issue

Dependencies

  • iil-promptfw>=0.7.0 — prompt template rendering
  • pyyaml>=6.0 — config file parsing
  • Optional: playwright — for Zirkel 2 test execution

Related

License

MIT

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

iil_reflex-0.1.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

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

iil_reflex-0.1.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file iil_reflex-0.1.0.tar.gz.

File metadata

  • Download URL: iil_reflex-0.1.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for iil_reflex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91cb9caaba3db63898064468acff47619f6b7a4b9e463a6cb3297c0f231a613c
MD5 6f67cff845f70a89be6677b6efa0a7ce
BLAKE2b-256 d25f6d1dd84395489d7e825d2c4dcd0eecdf26c9a04c5852515cc6e2077a5a88

See more details on using hashes here.

File details

Details for the file iil_reflex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iil_reflex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for iil_reflex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b72a0c97c773ceb70f1304863e01f36d1a8b95b662def1ce65afe36ec2a48a6b
MD5 90ca1cb5668509e57c823594d48012af
BLAKE2b-256 2aa29c5d73c579ec26be07c5ee3c66ccdaad77bcabe0e03f90b48032534e898e

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