Skip to content

Architecture

Ward follows a dependency direction of infrastructure adapters → application use cases → domain contracts and models:

dev.ward
├── domain/<feature>/ Models, policies, outbound port contracts
├── application/<feature>/ Use cases and orchestration
├── infrastructure/<feature>/ Outbound adapters
├── infrastructure/cli/ Picocli inbound adapters and terminal I/O
├── config/WardComponent Explicit Dagger composition root
└── WardApplication Executable entry point

CLI adapters must not perform filesystem/process work or depend on concrete outbound adapters. Domain models contain no I/O or framework implementations; outbound adapters implement domain ports. Raw-key terminal input is isolated behind the RawTerminal port and a POSIX adapter; ArchitectureBoundaryTest enforces these rules.

QualityGate is the gate extension point. Gate orchestration belongs in application.gate, supported IDs in the domain vocabulary, and the registry in QualityGateFactory; configuration examples and the gate reference must stay in sync. Explicit constructor wiring also supports native-image builds. Picocli command reflection metadata is generated from command annotations by picocli-codegen at compile time, so adding a command or option does not require a manual metadata entry. Hand-written native metadata is reserved for non-Picocli requirements such as FFM downcalls.