Files
cowork-local/CONTRIBUTING.md
T
anhtnm1andClaude Opus 5 be5c5747a9 refactor: gom i18n/ và theme/ thành gói, gộp requirements về một file
Thư mục gốc: 22 file .py -> 7
--------------------------------
13 file "thành phần" nằm rải rác ngay ngoài thư mục gốc, mỗi file chỉ có ĐÚNG
MỘT nơi import — chính cái hub của nó:

    i18n.py + 10 file i18n_*.py    ->  i18n/__init__.py  + i18n/*.py
    theme.py + 3 file theme_*.py   ->  theme/__init__.py + theme/*.py

Đổi hub thành `__init__.py` nên 78 chỗ `from ..i18n import tr` và 24 chỗ
`from ..theme import current_palette` KHÔNG phải sửa một dòng nào. Git nhận ra
11/15 file là đổi tên thuần, 0 dòng thay đổi; 4 file còn lại chỉ sửa đúng dòng
import và mấy tham chiếu tên file trong docstring.

Đối chiếu với bản trước khi gom, cùng một phép băm:

    số khoá i18n  1431 -> 1431      hash STRINGS  a06cc34b... (trùng)
    QSS dark                        hash          7bb230a4... (trùng)
    QSS light                       hash          884f73ce... (trùng)

`check_loc.py` phải khai thêm "i18n", "theme" vào DEFAULT_TARGET_DIRS: chúng
từng được quét theo diện "module nằm ở thư mục gốc", gom vào gói rồi thì không
khai là lặng lẽ tuột khỏi tầm quét.

Bánh cóc `ui/widgets.py` siết 505 -> 466 sau khi tách SegmentedControl — nợ cũ
co lại thì con số phải co theo, không thì bánh cóc đứng yên mãi ở mức cũ.

Một file requirements
---------------------
Xoá `requirements-test.txt`. Nó chỉ có `pytest` + `pydantic`, nhưng 64/108 file
test dựng widget thật và 20 file trong đó import PySide6 thẳng ở đầu file không
có bảo vệ — nên CI cài mỗi file kia thì pytest chết ngay lúc thu thập test chứ
không phải "vài test bị bỏ qua". Hai file cho một danh sách gần trùng nhau chỉ
tạo thêm một chỗ để lệch phiên bản, và `pydantic` đã bị chép ở cả hai.

CI đổi sang cài `requirements.txt`. Người dùng cuối cài thừa pytest vài MB.

Kèm theo: `install.bat` bỏ cờ `--dev` (không còn gì để cài thêm). Khối `if`
rỗng còn sót lại làm cmd.exe báo "( was unexpected at this time" và script chết
ngay sau bước cài thư viện — đã gỡ hẳn.

859 test xanh · 4/4 cổng CASAN · check_design_parity 32/32 ·
check_layout_geometry trùng từng byte với bản trước refactor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 11:25:27 +09:00

2.6 KiB

Contributing to Cowork Local

Cowork Local is owned by the Cowork Team. Contributions from the FSG AI Core Team are welcome for selected generic capabilities, but final review and merge remain with the Cowork Team.

Workflow

Core AI Issue -> Pick task -> Branch on cowork-local -> Implement -> Tests
-> Core AI pre-review -> Cowork Pull Request -> Cowork Team review -> Merge
-> Core AI Issue Done

Core AI execution source of truth is the fsg-ai-core-assets issue/project system. Do not duplicate its complete backlog here.

Board states for a Core AI contribution mean:

  • Review: Core AI internal/pre-review.
  • Upstream Review: the Cowork Pull Request is waiting for Cowork Team review.
  • Done: the Cowork Team merged the Pull Request into the stable branch.

Branches

Use a short, focused branch name:

feat/<short-description>
fix/<short-description>
test/<short-description>
docs/<short-description>
perf/<short-description>
refactor/<short-description>

Core AI contributions use:

core-ai/<task-id>-<short-name>

Examples: core-ai/TL-065-co4e-if-switch, core-ai/TL-146-model-routing-tests, and core-ai/TL-148-superpowers-phase1.

Commits

Prefer the existing lightweight Conventional Commit prefixes: feat:, fix:, test:, docs:, refactor:, perf:, and chore:. Scopes are optional, for example test(routing): verify model fallback policy.

Development and validation

Run the application from the parent directory with python -m cowork_local. The current reliable test command is:

python -m pip install -r requirements.txt
python -m pytest tests -q

Also run any focused checks relevant to the area you changed. Never use live provider credentials in automated tests.

Pull Requests

One logical change equals one Pull Request. Do not combine unrelated task IDs into a mega PR; split large work into vertical, reviewable slices.

Complete the Pull Request template, including scope, test evidence, compatibility, and security impact. A Core AI Pull Request must include the full Core repository URL, Core issue URL or number, and Core task ID. Use a full URL if cross-repository linking is unavailable.

Normal Cowork changes follow the Cowork Team reviewer policy. Core AI contributions require both Core AI pre-review and Cowork Team final review. Critical areas listed in SECURITY.md receive additional scrutiny and are never auto-merged solely because tests pass.

The detailed ownership, review, and completion rules are in docs/governance/.