docs(adr): separate binaries by default, opt-in unified build#1116
docs(adr): separate binaries by default, opt-in unified build#1116chaodu-agent wants to merge 3 commits into
Conversation
Add ADR for restructuring OpenAB as a Cargo workspace that ships all platform adapters in a single binary, activated at runtime via config. This eliminates the two-process (core + gateway sidecar) deployment model for most users while keeping the standalone gateway available for advanced use cases.
|
CHANGES REQUESTED What This PR DoesProposes restructuring OpenAB into a Cargo workspace shipping all platform adapters (Telegram, LINE, Feishu, Google Chat, WeCom, Teams) in a single binary alongside Discord and Slack. Adapters activate at runtime via config — eliminating the two-process sidecar model for most users. How It Works
Findings
Finding Details🟡 F1: Default features expand attack surface
Suggestion: Add a section on dependency governance — e.g., 🟡 F2: No supply chain hardening requirementsFuture platform crates will pull in 🟡 F3: CI/release pipeline undefinedThree published images ( 🟡 F4: Code duplication between standalone gateway and workspace crateADR shows Suggestion: Explicitly state that 🟡 F5: Network-isolated deployment gapSome deployments run gateway in a DMZ (webhook ingress) separate from core (internal network). Phase 3 deprecation of standalone gateway removes this option. ADR should document the recommended architecture for network-segmented environments post-deprecation. 🟡 F6: Hardcoded axum portDiagram shows 🟡 F7: Tracing context propagationMoving from WS (separate processes with explicit trace propagation) to in-process 🟡 F8: Media handling for remote gatewayADR lists "no shared volume" as an advantage of single-binary mode. But for users who keep standalone gateway (Phase 1-2, or network-isolated), media colocate mode still needs shared volume or a proxy mechanism. ADR should clarify what happens to media flow in hybrid deployments. 🟡 F9: Missing optional dependency declarationThe [dependencies]
openab-gateway = { path = "crates/openab-gateway", optional = true }Without showing this, implementers may be confused about how 🟡 F10: Incomplete workspace manifest exampleADR should show the workspace root Baseline Check
What's Good (🟢)
Additional Note: Cross-ADR Security Model ChangeThe custom-gateway ADR §Credential Isolation specifies "platform credentials must reside in the gateway, not in OAB." The unified binary changes this model — OAB now directly holds platform tokens. This is acceptable (same process = no transport risk), but should be explicitly acknowledged in §7 Trade-offs with rationale for why the security boundary change is safe. Summary: Strong ADR with clear problem statement and elegant solution. The 10 findings are all 🟡 — no blockers. Core architectural decision is sound. Recommend adding: (1) dependency governance section, (2) CI pipeline sketch, (3) network-isolated deployment guidance, (4) gateway code sharing strategy, and (5) complete Cargo manifest examples. |
- Default: two separate binaries (core + gateway), unchanged from today - Opt-in: --features unified compiles all adapters into single binary - Zero code changes needed — just a build flag or image swap - Published: openab:latest (core), openab:unified (all-in-one)
ADR Updated: Flipped default directionPer maintainer's request, the ADR now proposes separate binaries by default with unified single-binary as opt-in. Key changes:
This gives users the simplicity of the current two-binary model while making it trivial to opt into a single binary when desired — config only, no code changes. |
Summary
Proposes restructuring OpenAB as a Cargo workspace that keeps two separate binaries by default (core + gateway), while enabling a single unified binary via
--features unifiedor a DockerfileBUILD_MODEarg — zero code changes required.Key Design
cargo build→ core binary (Discord + Slack). Gateway ships separately.cargo build --features unified→ all adapters in one binary.docker build --build-arg BUILD_MODE=unifiedflips to single binary.telegram,lineif you don't need all adapters.Published Artifacts
openab:latestopenab-gateway:latestopenab:unifiedChanges
docs/adr/unified-binary.md— new ADR document