Skip to content
Apothem
Architektur

Quellcode-Layout

Warum Apothem ein src/-Layout verwendet und wie der Baum organisiert ist.

Apothem hat das PyPA-src-Layout übernommen und legt sämtlichen importierbaren Python-Code unter src/apothem/ ab.

Warum src-Layout

  • Import-Isolation. import apothem wird nur aufgelöst, wenn src/ im Pfad liegt (die Engine läuft als PYTHONPATH=src python -m apothem), was versehentliche Importe des Arbeitsbaums aus einem nicht zugehörigen Verzeichnis verhindert.
  • Eigenständige Laufzeit. Apothem läuft direkt aus einem Checkout, mit seinen unter src/apothem/_vendor/ gevendorten Abhängigkeiten — kein Installationsschritt ist erforderlich. Das src-Layout hält diese importierbare Oberfläche sauber getrennt von den Werkzeugen, Tests und Skripten des Repositorys.
  • Saubere Distribution. Dasselbe Layout erzeugt ein wohlgeformtes sdist und Wheel (sowie eine optionale editierbare Installation per pip install -e .), deren Inhalt exakt dem entspricht, was ausgeliefert wird, ohne dass verirrte Module auf oberster Ebene hineingeraten.

Baumstruktur

src/apothem/
    agents/         persistent agent definitions (*.md)
    audit/          inventory and provenance tools
    benchmarks/     performance benchmarks
    cli/            Click CLI (top-level commands listed below the tree)
    commands/       slash command definitions (*.md)
    conformity/     mechanical gate checkers (*_grep.py)
    harnesses/      one sub-package per harness adapter (17 adapters)
    hooks/          hook dispatcher + message files
    lib/            shared Python library
    output-styles/  output-style definitions (*.md)
    rules/          behavioral rules (*.md)
    schemas/        YAML/JSON schemas
    skills/         reusable skill templates (folder/SKILL.md)
    statuslines/    status-line config (*.json)
    templates/      reusable template artifacts

CLI-Befehle

Die folgende Liste wird aus dem Click-Befehlsbaum generiert.

The cli/ package registers 14 top-level commands:

Importierbare Artefakte vs. Konfigurationsartefakte

Viele Elemente unter src/apothem/ sind Markdown-Konfigurationsartefakte, keine Python-Module. Die importierbare Python-Oberfläche ist:

  • src/apothem/cli/ (die Click-CLI, bereitgestellt als Einstiegspunkt apothem)
  • src/apothem/harnesses/ (die 17 Subpakete der Harness-Adapter)
  • src/apothem/lib/ (gemeinsame Bibliothek: Profil, Registry, Materializer, Propagation)
  • src/apothem/hooks/ (dispatch.py, lib/)
  • src/apothem/conformity/ (mechanische Grep-Skripte)
  • src/apothem/audit/ (Inventarskripte)
  • src/apothem/benchmarks/ (Treiber für Performance-Benchmarks)

On this page