Batch of fixes for defects tracked in "Task Tracking Template.xlsx" (sheet Defect Management), verified against the sheet's Root Cause/Cach xu ly columns before this commit: - DF-002: Co4E node status not reflected after tab switch + missing edit-lock on running/done nodes (node_property_panel.py, co4e_runs.py, co4e_workflow_crud.py, co4e_canvas_widget.py, co4e_flow_tabs.py, canvas_items.py) - DF-003: hide the run.bat console window unless the app exits with an error (run.bat, scripts/console_visibility.ps1 - new) - DF-004: floating Help Assistant icon covering the Send button after a window resize (presentation/shell/main_window.py) - DF-005: "block network" toggle didn't stop ICMP/raw-socket tools like ping (infrastructure/filesystem/command_tools.py, security/command_risk_classifier.py) - DF-006: Monitoring "gay nang khi log lon" - root cause was re-reading the ENTIRE audit log history every 3s tick, not missing pagination; bounded to a 30-day window (presentation/monitoring/monitoring_tab.py) AND added the "So dong/trang" page-size control the ticket also asked for (presentation/monitoring/shared/event_table.py, shared/filter_scaffold.py, tabs/action_logs_tab.py, tabs/mcp_tab.py, tabs/security_events_tab.py, i18n/agents_admin_tab.py) - DF-007: support choosing a OneDrive/SharePoint folder as a project's working directory via Microsoft Graph, downloaded as a local mirror with manual sync (core/projects.py, core/ms365_graph.py, core/cloud_workspace_sync.py - new, ui/ms365_signin_dialog.py - new, ui/cloud_folder_picker_dialog.py - new, i18n/cloud_workspace.py - new, ui/workspace_tab.py) - DF-008: AI-edit instruction box was a fixed-height single-line QLineEdit; replaced with an auto-expanding, Enter-to-send/Shift+Enter-newline input (presentation/folder/ai_file_editor_dialog.py) - DF-011: run_command failed with WinError 267 for a project whose per-turn output directory had never been created (application/conversations/core_runtime_adapter.py) DF-009 (AI-edit Apply/Discard buttons easy to miss) and DF-010 (AI reply language - dev-confirmed not a bug) are intentionally NOT part of this commit: DF-009 has no code fix yet (still "Assigned" in the sheet, only a UX recommendation was recorded), DF-010 was rejected as expected behavior. Tests: tests/test_cloud_workspace_sync.py, tests/test_ms365_cloud_dialogs.py, tests/test_ai_file_editor_input.py, tests/test_monitoring_page_size.py (all new, all passing). Full suite: 896 passed, 13 known-and-documented failures unrelated to this change (an existing core/audit_log.py bug, this checkout not being a git repo before now, and a repo/subprocess folder-naming mismatch affecting ~66 characterization tests) - see the sheet's DF-006 Evidence column for details.
Cowork Local
Cowork Local is the internal AI cowork desktop platform. It provides a local-first desktop runtime, multi-turn conversational agents, workspace isolation, task scheduling, MCP connectors, security guardrails, and model routing.
🏛️ 4-Tier Clean Architecture
The codebase strictly adheres to Clean Architecture with unidirectional inward dependencies:
presentation/ (PySide6 UI, Shell, NavRail, Chat, Scheduling, Settings, Dashboard)
│
▼
application/ (Pure Python Orchestration: Conversations, Scheduling, Workspaces, Monitoring, Routing)
│
▼
domain/ (Pure Python: Entities, Immutable Execution Requests, Agent Events, Descriptors)
▲
│
infrastructure/ (Adapters, LLM Providers, Atomic Persistence, Keyring SecretStore, MCP)
- Domain & Application Layers: 100% Pure Python (zero Qt/UI imports).
- Single Responsibility: Every production module is strictly
<= 400 LOC. - Security & Durability: API keys stored in OS Keyring; atomic JSON disk persistence.
🚀 Quick Start
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:
python -m cowork_local
3. Run Automated Tests
python -m pip install -r requirements.txt
pytest -q
There is one requirements file, not a runtime/test pair. A separate test file
would hold only pytest: 64 of the 108 test modules build real widgets, and 20
of them import PySide6 unguarded at module scope, so it would have to pull in
almost the whole runtime list anyway — two files for one near-identical list is
just a second place for the pins to drift.
🛡️ CASAN Quality Gate & Verification
Before submitting any Pull Request, run the unified CASAN Quality Gate:
# Run all 4 quality gates (Clean Arch, Secrets, LOC, and Pytest Suite)
python scripts/run_quality_gate.py
# Run static and architectural guards only (fast check)
python scripts/run_quality_gate.py --skip-tests
Individual guard scripts:
- Clean Architecture Import Guard:
python scripts/check_imports.py - Secrets & Plaintext Audit:
python scripts/audit_security.py - Single Responsibility LOC Guard:
python scripts/check_loc.py --max-lines 400 - Release E2E Smoke Test:
pytest tests/e2e/test_smoke.py -v
🤝 Contributing & Recipes
- Quick Start Guide: See START_CONTRIBUTING.md.
- Contributor Recipes: See docs/governance/contributor-recipes.md for step-by-step recipes to:
- Add a new AI Model Provider.
- Add a new Built-in Tool / MCP Server.
- Add a new Screen / Tab / Widget.
- Security Policy: See SECURITY.md.