Skip to content
Apothem
البنية

تخطيط المصدر

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

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

لماذا تخطيط src-layout

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

بنية الشجرة

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

أوامر واجهة سطر الأوامر

القائمة أدناه مُولَّدة من شجرة أوامر Click.

The cli/ package registers 14 top-level commands:

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

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

  • src/apothem/cli/ (واجهة سطر الأوامر المبنية على Click والمكشوفة بوصفها نقطة الدخول 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