feat(launcher): install.bat + run.bat, và 8 thư viện thiếu trong requirements

Trình chạy
----------
Cả hai lệnh trong README đều không chạy được từ một thư mục checkout tên
khác `cowork_local`:

    python -m cowork_local   -> No module named cowork_local
    python __main__.py       -> ModuleNotFoundError: No module named 'cowork_local'

Không sửa được bằng mẹo sys.path, vì `state.py` khởi động máy chủ MCP MS365
bằng tiến trình con `python -m cowork_local.mcp_servers.ms365_server` — tiến
trình con cũng phải import được. Hai script tạo một junction ở
`%LOCALAPPDATA%\CoworkLocal\launcher` thay vì bắt người dùng đổi tên thư mục
làm việc.

Môi trường ảo đặt ở `%LOCALAPPDATA%\CoworkLocal\venv`, cố ý KHÔNG đặt trong
repo: các cổng chất lượng quét toàn bộ cây thư mục chứ không đọc
`.gitignore`, nên một `.venv` ở đây sẽ biến vài nghìn module thư viện thành
"mã production không ai import" và làm Gate O đỏ.

requirements.txt
----------------
Chạy thử `run.bat` trên một profile trắng thì app chết ngay lúc mở:

    presentation/folder/code_editor.py:41
    ModuleNotFoundError: No module named 'pygments'

Quét toàn bộ import bên thứ ba thì thiếu 8 thư viện, trong đó `pygments` và
`pydantic` là bắt buộc — import không có try/except, nên triệu chứng không
phải "tính năng đó không chạy" mà là app không mở được. Nghĩa là cài đúng
theo requirements.txt xong app vẫn hỏng.

Đã tách rõ nhóm bắt buộc / tuỳ chọn kèm lý do từng dòng.
`opendataloader-pdf` để nguyên dạng chú thích vì code tự cài khi cần qua
`core/deps.py::ensure_module`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 10:41:44 +09:00
co-authored by Claude Opus 5
parent 81b9482011
commit fa94a0b287
4 changed files with 359 additions and 4 deletions
+24 -3
View File
@@ -29,14 +29,35 @@ infrastructure/ (Adapters, LLM Providers, Atomic Persistence, Keyring SecretStor
## 🚀 Quick Start
### 1. Run the Desktop Application
From the repository root:
### 1. Windows — two double-clicks
```
install.bat once, to install the Python dependencies
run.bat every time, to start the app
```
`install.bat` builds an isolated virtualenv under `%LOCALAPPDATA%\CoworkLocal`
(deliberately **outside** the repo — the quality gates walk the whole directory
tree, so a `.venv` in here would turn every vendored module into a Gate O
violation). Add `--dev` to also install the test dependencies, or `--system` to
skip the virtualenv and install into the Python already on `PATH`.
Both scripts also make the source importable under its package name. That step
is not optional: `python -m cowork_local` only resolves when the checkout
directory is literally named `cowork_local`, and the MS365 MCP server is
launched as a subprocess with `python -m cowork_local.mcp_servers.ms365_server`,
so a differently-named checkout breaks the app *and* its subprocesses. The
scripts create a junction instead of forcing anyone to rename their folder.
### 2. Any platform — run from source
From the **parent** of a checkout directory named `cowork_local`:
```bash
python -m cowork_local
```
### 2. Run Automated Tests
### 3. Run Automated Tests
```bash
python -m pip install -r requirements-test.txt
pytest -q