Add configurable adapter selection to app runner

This commit is contained in:
ben
2026-04-02 14:47:03 -04:00
parent 309ce87abb
commit 90b9dad59c
4 changed files with 48 additions and 11 deletions

View File

@@ -272,21 +272,23 @@ Build a simple Python orchestration layer in youdis.py so the standard app stack
- leave room for future Zulip/XMPP adapters without redesigning the runner
** evidence
- commit:
- commit: 309ce87
- tests:
1. `python3 -m py_compile ./youdis.py ./youdis/adapters/discord.py`
2. backend direct run still works: `python3 -m uvicorn youdis.main:app --host 127.0.0.1 --port 8000`
3. discord direct run still works: `python3 -m youdis.adapters.discord`
4. app runner backend-only smoke test: `YOUDIS_RUN_DISCORD=0 timeout 5s python3 ./youdis.py`
4. app runner backend-only smoke test: `YOUDIS_ENABLED_ADAPTERS= timeout 5s python3 ./youdis.py`
5. app runner default path: `python3 ./youdis.py`
- date:
- date: [2026-04-02 Thu 14:13]
** notes
- `youdis.py` is now the default v2 app runner and starts the standard stack explicitly rather than dynamically discovering adapters
- backend starts first and must pass a health check before the Discord adapter is launched
- backend and Discord adapter remain directly runnable for debugging and tests
- Docker is intended to invoke `python3 /app/youdis.py`; Python owns app orchestration while Docker owns packaging and runtime environment
- runner flags currently include `YOUDIS_RUN_BACKEND`, `YOUDIS_RUN_DISCORD`, `YOUDIS_BACKEND_HOST`, and `YOUDIS_BACKEND_PORT`
- adapter startup remains explicit in `youdis.py`, while `YOUDIS_ENABLED_ADAPTERS` selects which known adapters to run
- adding an adapter means creating `youdis/adapters/<adapter>.py`, adding `start_<adapter>()` in `youdis.py`, registering it in the explicit adapter map, and documenting any env vars in `.env.example`
- runner flags currently include `YOUDIS_RUN_BACKEND`, `YOUDIS_ENABLED_ADAPTERS`, `YOUDIS_BACKEND_HOST`, and `YOUDIS_BACKEND_PORT`
* ==== BACKLOG ====