아키텍처
소스 레이아웃
Apothem이 src/ 레이아웃을 사용하는 이유와 트리의 구성 방식입니다.
Apothem은 PyPA src-layout을 채택하여, 임포트할 수 있는 모든 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 artifactsCLI 명령
아래 목록은 Click 명령 트리에서 생성됩니다.
The cli/ package registers 14 top-level commands:
apothem backupsapothem completionapothem diffapothem doctorapothem harnessesapothem installapothem migrate-workspaceapothem profileapothem quickstartapothem rollbackapothem statusapothem uninstallapothem updateapothem verify
임포트 가능 아티팩트와 구성 아티팩트
src/apothem/ 아래의 많은 항목은 Python 모듈이 아니라 Markdown 구성
아티팩트입니다. 임포트할 수 있는 Python 표면은 다음과 같습니다.
src/apothem/cli/(apothem진입점으로 노출되는 Click CLI)src/apothem/harnesses/(17개 하니스 어댑터 서브패키지)src/apothem/lib/(공유 라이브러리: 프로필, 레지스트리, 머티리얼라이저, 전파)src/apothem/hooks/(dispatch.py, lib/)src/apothem/conformity/(기계적 grep 스크립트)src/apothem/audit/(인벤토리 스크립트)src/apothem/benchmarks/(성능 벤치마크 드라이버)