Skip to content
Apothem
البنية

تخطيط المصدر

لماذا يستخدم Apothem تخطيط src/ وكيف تُنظَّم الشجرة.

اعتمد Apothem تخطيط src من PyPA، واضعًا كل شيفرة Python القابلة للاستيراد تحت src/apothem/.

لماذا تخطيط src

  • عزل الاستيراد. لا يُحَل import apothem إلا عندما يكون src/ في المسار (يعمل المحرك بصيغة PYTHONPATH=src python -m apothem)، مما يمنع الاستيراد العَرَضي لشجرة العمل من دليل غير ذي صلة.
  • زمن تشغيل مكتفٍ ذاتيًا. يعمل Apothem مباشرةً من نسخة مسحوبة مع اعتماديّاته المُضمَّنة تحت src/apothem/_vendor/ — دون الحاجة إلى خطوة تثبيت. يُبقي تخطيط src ذلك السطح القابل للاستيراد منفصلًا بوضوح عن أدوات المستودع واختباراته وبرامجه النصّية.
  • توزيع نظيف. يُنتِج التخطيط نفسه sdist وwheel سليمَي التكوين (وتثبيتًا قابلًا للتعديل اختياريًا عبر pip install -e .) يطابق محتواهما بدقّة ما يُشحَن فعلًا، دون تسرُّب أي وحدات دخيلة على المستوى الأعلى.

بنية الشجرة

src/apothem/
    agents/         persistent agent definitions (*.md)
    audit/          inventory and provenance tools
    benchmarks/     performance benchmarks
    cli/            Click CLI (quickstart, install, update, uninstall, verify, status, diff, rollback, harnesses, profile, doctor, completion)
    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

المُخرَجات القابلة للاستيراد مقابل مُخرَجات التهيئة

كثير من العناصر تحت src/apothem/ هي مُخرَجات تهيئة بصيغة Markdown، لا وحدات Python. سطح Python القابل للاستيراد هو:

  • src/apothem/cli/ (واجهة Click CLI المُتاحة كنقطة دخول apothem)
  • src/apothem/harnesses/ (الحزم الفرعية لمُحَوِّلات إطار العمل السبعة عشر)
  • src/apothem/lib/ (المكتبة المشتركة: الملف الشخصي، السجلّ، المُجسِّد، الانتشار)
  • src/apothem/hooks/ (dispatch.py، lib/)
  • src/apothem/conformity/ (برامج grep النصّية الميكانيكية)
  • src/apothem/audit/ (برامج الجرد النصّية)
  • src/apothem/benchmarks/ (مُشغِّلات قياس الأداء)

On this page