Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
46 changes: 46 additions & 0 deletions .agents/tasks/m01-l3-002-docking/final-report-vi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Báo cáo cuối: OM9-L3-01-01-002 Workbench Docking Regions

## Diễn giải yêu cầu
"M01 - L2-01 L3-02" = milestone M01, L2-01-01 (Febe Application Shell Docking), L3-002 (Workbench Docking Regions) = OM9-L3-01-01-002. Đây là mục khớp duy nhất.

## Các L4 đã hoàn thành (có bằng chứng, chạy trong `standalone`)
- L4-01 Source audit: `implementation/design/M01/OM9-L3-01-01-002/source_crosswalk.json`. QymCAD ghim `746a17f1...`, sạch (`git status --porcelain` rỗng). Không chép mã, không phụ thuộc QymCAD.
- L4-02 Hợp đồng API và thiết kế test: `api.md`, `positive.json`, `negative.json`. RED trước khi code: `cargo test -p om9-app --lib workbench_regions` và `--test workbench_regions` thoát 101 (lib 3 đạt 18 lỗi; tích hợp 1 đạt 6 lỗi), lỗi assertion, không lỗi build.
- L4-03 Triển khai (Rust an toàn, không ngoại lệ native):
- `cargo test -p om9-app --lib workbench_regions`: 21 đạt, 0 lỗi
- `cargo test -p om9-app --test workbench_regions`: 8 đạt, 0 lỗi
- `cargo test -p om9-app --test shell_docking`: 10 đạt (test cũ không sửa)
- `cargo test -p om9-app` và `cargo test --workspace`: exit 0
- `cargo fmt --all -- --check`, `cargo check --workspace --all-targets`, `cargo build --workspace`, `cargo clippy --workspace --all-targets -- -D warnings`: exit 0
- L4-05 Nghiệm thu tự động: `om9.exe --ui-audit` chạy hai lần, exit 0, 21 pass (RTX 3060, Vulkan). 1600x1000: rail trái, 4 viewport, dock phải. 800x600: dock phải nhường (`RightDockYielded/NarrowWindow`), ô nhập lệnh và 4 viewport được giữ, không chồng lấn. Ảnh: `build/standalone-validation/ui-artifacts/2026-10-16-m01-l3-002-docking/`.
- Review: APPROVED (`review.json`).

## Tệp tạo hoặc thay đổi
- Mới: `standalone/crates/om9-app/src/workbench_regions.rs`, `standalone/crates/om9-app/tests/workbench_regions.rs`, `docs/validation/2026-10-16-m01-l3-002-workbench-docking-regions.md`, `implementation/{design,fixtures,evidence}/M01/OM9-L3-01-01-002/*`, `.agents/tasks/m01-l3-002-docking/*`.
- Sửa: `standalone/crates/om9-app/src/ui.rs` (kế hoạch vùng mỗi khung hình, biến audit `OM9_UI_AUDIT_WINDOW`, `OM9_UI_AUDIT_RIGHT_DOCK`), `src/ui/chrome.rs` (`sync_panel_size` không ghi khi đang có lỗi vùng), và `docs/openmatrix9-progress.json` (thêm `final_reconciliation` vào mục `m01-l3-01-01-002-...`).
- Không đổi `planning_state` trong `l3.json` (giữ `SPEC_ONLY_NOT_IMPLEMENTED`) và bốn `l4.json` (giữ `NOT_STARTED`). Quy ước repo không có giá trị "hoàn thành", cổng M00 là NOT_PASS, nên không có cơ sở nâng trạng thái. Không commit, không stage, không sửa skill.

## Kiểm toán nguồn công khai
`python tools/public_source_audit.py` chạy lại: exit 1, 11721 lỗi, số lượng không đổi. Tất cả nằm trong `ref/`, `manuals/`, `OM9_Milestones/`, `QymCAD/`, `vendor-research/`, `om9-window.png`. Không có lỗi ở đường dẫn của mục này. Không sửa vì AGENTS.md cấm đụng tham chiếu riêng tư. Không tuyên bố là đã đạt.

## Chưa được xác minh
- Cổng M01-UI đang MỞ: danh sách 7 mục chờ người kiểm tra trên Windows (gồm 150% DPI và màn hình thứ hai). Vị trí: `.agents/tasks/m01-l3-002-docking/verification.md` (mục "L4-05 manual checklist") và `implementation/evidence/M01/OM9-L3-01-01-002/OM9-L4-01-01-002-05.ui-review.json` (`reviewer.status = NOT_SIGNED`).
- Quyền tái sử dụng pháp lý: PENDING_HUMAN_M00_APPROVAL.
- OM9-L2-01-02 và OM9-L2-01-03 chưa triển khai: `CommandInputHost` và `ViewportSceneHost` chỉ được test với stub; `command_input_ready` luôn trả true (BLOCKED_DEPENDENCY).
- `tools/validate_m01_*` và `OpenMatrix9_Codex_Spec_v2/` không có, định nghĩa `om9.m01.oracle.v1.5` không có; file `*.evidence.json` theo runbook chưa ghi được.
- Chữ trên thanh trạng thái tự chồng lên nhau ở 800x600 (có từ trước, thuộc L3-007).

## Thay đổi quy tắc nghiệp vụ: cần sự đồng ý của bạn
Trước và sau:
1. Cửa sổ dưới 560x286 (320x286 khi không có rail trái). Trước: tự kẹp (clamp) âm thầm. Sau: hiện lỗi "Layout:" trên thanh trạng thái và giữ kế hoạch tốt gần nhất.
2. Dòng lệnh bị đánh dấu ẩn. Trước: có thể mất. Sau: vẫn được giữ chỗ, kèm thông báo `CommandInputKept`.
3. Khi đang có lỗi vùng. Trước: layout lưu có thể bị ghi lại. Sau: đồng bộ kích thước panel và kẹp menu nổi không ghi lại layout.
4. Thông báo dock phải nhường hoặc rail trái bị thu hẹp. Trước: không có. Sau: ghi vào lịch sử CMD, và vào thanh trạng thái nếu không có lỗi đang hiện.

Đề xuất nội dung skill (thêm vào `skills/openmatrix9-workspace-contract/SKILL.md`):
> Vùng workbench: rail trái, bốn viewport và ô nhập lệnh luôn được giữ. Dock phải nhường khi cửa sổ hẹp hơn khoảng 900 px. Cửa sổ nhỏ hơn mức tối thiểu hiển thị lỗi "Layout:", giữ kế hoạch cuối và không ghi lại layout. Dòng lệnh không thể bị mất bằng cách ẩn.

Bạn có muốn ghi các thay đổi này vào skill không? Tôi chưa sửa file skill nào.

## Hành động tiếp theo
Người kiểm tra chạy checklist M01-UI và ký `OM9-L4-01-01-002-05.ui-review.json`, đồng thời quyết định phê duyệt pháp lý M00. Sau đó làm L3-003 (live drag preview) của OM9-L2-01-01.
56 changes: 56 additions & 0 deletions .agents/tasks/m01-l3-002-docking/orientation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Orientation: M01 > L2-01-01 > L3-002 Workbench Docking Regions

## 1. Interpretation
User wrote "M01 - L2-01 L3-02". Only match: `OM9-L2-01-01` (Febe Application Shell Docking), `OM9-L3-01-01-002` (Workbench Docking Regions), capability `cap.01-01.workbench-docking-regions`, owner key `OM9-L2-01-01/workbench-docking-regions`. Goal: "left dock, center viewports and optional right dock". Positive oracle: "Show left rail, four viewport center region and optional right properties dock". Negative oracle: "Narrow window does not overlap/lose critical command input panel". Spec dir: `OM9_Milestones/M01 - CAD Shell, OCCT Bridge, Document, Undo, GPU and Viewport Foundation/L2-01-01 - Febe Application Shell Docking/L3-002 - Workbench Docking Regions/` (l3.json, reference/{REFERENCE.md,images,text}; L2.json sits in the parent folder).

## 2. Files that exist / do not exist (verified)
- Exists: `AGENTS.md`, `skills/` (workflow, ui, workspace-contract, build-validation, feature-port, icons, layers-contract, native-mapping), `skills/openmatrix9-workflow/references/rust-first.md`, `docs/openmatrix9-skills.md`, `docs/openmatrix9-progress.json`, `.agents/tasks/m03-l4/{CONVENTIONS.md,validate_l4.py}`.
- ABSENT: `OpenMatrix9_Codex_Spec_v2/` (so its AGENTS/RCORE-00/CODE_GUIDE/BACKEND_POLICY/MATRIX9_UI_CONTRACT/MIGRATION_LEDGER cannot be read here; record this as an unverified constraint, rely on the root AGENTS.md summary and skills).
- ABSENT tools (per docs/validation/2026-10-16-m01-l2-01-01-source-audit.md): `tools/validate_m00_execution.py`, `validate_m01_spec.py`, `next_m01_task.py`, `m01_capture.py`, `m01_proof.py`. Use workspace convention (`docs/validation/**` + `docs/openmatrix9-progress.json`).
- I did not re-read the four SKILL.md bodies in this step; the implementer must read openmatrix9-workflow, openmatrix9-ui, openmatrix9-workspace-contract, openmatrix9-build-validation SKILL.md before editing.

## 3. The four L4 children (all `planning_state: NOT_STARTED`; role / outputs)
All: owner `OM9-L2-01-01`, stage E02, `provisional_decision: ADAPT`, `source_revision 746a17f127897e921a57118b6caad08968602bf5`, `m00_gate_required: true`, mini gate `G01-C`. Output paths are repo-relative to `h:\OpenMatrix9\`.
- L4-01 Source Audit `OM9-L4-01-01-002-01` (SOURCE_AUDIT, manual_test_required false, approval_required false). Output: `implementation/design/M01/OM9-L3-01-01-002/source_crosswalk.json`. Steps: copy IDs; verify pinned SHA (`git rev-parse HEAD` must equal it), read anchors, rg for symbols; table of implemented API / missing behavior / license-reuse / path+line; propose ADAPT or ADD; if API cannot be verified -> BLOCKED_SOURCE, no fake implementation. Oracle: "Local symbol+source path/line and reuse decision".
- L4-02 API Contract and Test Design `...-02` (CONTRACT_TEST, depends on -01, approval false). Outputs: `implementation/design/M01/OM9-L3-01-01-002/api.md`, `implementation/fixtures/M01/OM9-L3-01-01-002/positive.json`, `.../negative.json`. Steps: typed API (input/output/result/errors, document/transaction ownership); small independent positive + negative fixtures; red test before code (create harness if missing); record REUSE/ADAPT/ADD with local paths and SHA; no duplicate API names backend vs UI.
- L4-03 Implementation `...-03` (IMPLEMENT, approval false). depends_on: `OM9-L4-01-01-002-02`, `OM9-L4-01-01-001-05`, `OM9-L4-01-02-001-05`, `OM9-L4-01-03-001-05`. Outputs: `implementation/evidence/M01/OM9-L3-01-01-002/OM9-L4-01-01-002-03.diffstat.txt`, `...-03.target-test.log`. Microsteps S01 minimal logic in owner with typed IDs/error enum; S02 RED->GREEN against fixture; S03 narrow-window failure protection with rollback / no scene or render-cache change. Do not edit upstream QymCAD.
- L4-05 Acceptance Test `...-05` (ACCEPTANCE, manual_test_required true, approval_required TRUE). depends on -03. Outputs: `implementation/evidence/M01/OM9-L3-01-01-002/OM9-L4-01-01-002-05.regression.log`, `...-05.ui-review.json`. Steps: run L4-02 test target + full owner regression with real command/stdout/stderr/exit code; negative case + no leaked handle/dropped scene refs; screenshots + Windows UI checklist (before/after, error, undo, save/open) for human reviewer; digest-lock evidence; hand to reviewer, do NOT self-sign acceptance.
- Stop conditions (all four): M00 not PASS => BLOCKED_M00; wrong upstream SHA => BLOCKED_SOURCE; prerequisite missing PASS => BLOCKED_DEPENDENCY; no fixture harness => BLOCKED_FIXTURE; missing Rust/OCCT/GPU/Windows => BLOCKED_ENV; license/fork not approved => BLOCKED_APPROVAL.

## 4. Source anchors (L4-01 must read; paths relative to QymCAD root)
Pinned SHA 746a17f127897e921a57118b6caad08968602bf5. Verified checkout: `h:\OpenMatrix9\vendor-research\QymCAD` (HEAD == pin; untracked in git, `?? vendor-research/`). `h:\OpenMatrix9\QymCAD\` is a non-git copy (no .git; `git -C QymCAD rev-parse` returns the OM9 parent repo HEAD 7349d4a, NOT the pin) so SHA verification must use `vendor-research/QymCAD`, matching L3-001's crosswalk (`"checkout": "vendor-research/QymCAD"`).
- `crates/qymcad/src/gui.rs` (purpose "desktop state", blob 8f6ab517f24792f7feeda644163182754db493a3, evidence CONTENT_READ_AT_PINNED_SHA; L3-001 saw 2419 lines)
- `crates/qymcad/Cargo.toml` ("eframe app deps", CANDIDATE_RECHECK_LOCAL; L3-001 saw eframe 0.35 persistence+wgpu)
- `crates/qymcad-shell/src/lib.rs` ("shell", CANDIDATE_RECHECK_LOCAL)
- `crates/qymcad-ui-state/src/lib.rs` ("GUI state", CANDIDATE_RECHECK_LOCAL)
A quick grep for `SidePanel|TopBottomPanel|CentralPanel` in vendor gui.rs returned no hits, so the crosswalk must record the true symbols found (or "not found -> ADD") rather than assume.
Rules: l3.json `reuse_decision` is `UNDETERMINED_PENDING_SOURCE_AUDIT`, provisional `ADAPT`; "No implementation may be assumed from QymCAD until source paths are checked"; `reuse_approval_condition`: audit local checkout at pinned SHA, compile/tests, M00 human legal approval. OM9 must NEVER build-depend on QymCAD (no path/crate dependency; samples are ported as OM9-owned Rust). Keep `QymCAD/THIRD-PARTY-NOTICES.md` and `QymCAD/LICENSE` notices when adapting. No edits under `vendor-research/` (no approved fork). `qymcad_source_paths_verified` in l3.json is `[]` today.

## 5. Dependencies
- `OM9-L2-01-02` (Be Command Dispatch Undo Redo) and `OM9-L2-01-03` (document/scene): L2.json files exist in the plan tree, all `SPEC_ONLY_NOT_IMPLEMENTED`; they are not formally implemented/accepted. Real working seams exist in code: `om9-core` (document/history/transaction), `om9-scene` (workspace, `ViewId::ALL`), and the CMD frame in `om9-app/src/ui/command.rs` + `session.rs`. L4-03 lists dependency L4 ids `OM9-L4-01-01-001-05`, `-02-001-05`, `-03-001-05` (L3-001 evidence exists under `implementation/evidence/M01/OM9-L3-01-01-001/` but it is not PASS-promoted; M00 gate G00-01 is BLOCKED_APPROVAL/BLOCKED_DEPENDENCY, no task PASS). Required approach: docking stays a pure layout/UI-state concern; do not fake L2-01-02/03; if a seam is needed, a minimal typed trait + stub, report dependencies as unmet/BLOCKED_DEPENDENCY honestly.

## 6. Existing implementation (EXTEND, do not duplicate)
Workspace: `h:\OpenMatrix9\standalone\Cargo.toml`, members `om9-core, om9-archive, om9-app, om9-scene, om9-native-owner, om9-exchange`; resolver 3, edition 2024, workspace rust-version 1.88 (om9-app 1.95); installed cargo/rustc 1.98.1. License LGPL-2.1-or-later. Pinned deps (serde 1.0.228, serde_json 1.0.150, sha2, uuid); om9-app uses `eframe =0.36.2` (wgpu, `__screenshot`), image, resvg. Binary `om9` (`om9-app/src/main.rs`). eframe/egui standalone app target EXISTS.
Already present (uncommitted working-tree changes, from the earlier 2026-10-16 L2-01-01 pass): `standalone/crates/om9-app/src/dock_layout.rs` (1130 lines, header names it owner for L3-002..005,008; constants LEFT_RAIL_MIN/MAX/DEFAULT 240/420/300, RIGHT_DOCK 200/420/300, COMMAND_MIN/MAX/DEFAULT 58/400/90, TOOLBAR_HEIGHT 67, STATUS_BAR_HEIGHT 20, CANVAS_MIN_WIDTH 320, CANVAS_MIN_HEIGHT 120, NARROW_WINDOW_WIDTH 900; `DockSide`; schema 2), `src/ui.rs`, `src/ui/chrome.rs`, `src/status_surface.rs`, `src/window_identity_guard.rs`, `tests/shell_docking.rs` (10 UI tests incl. `narrow_window_yields_the_right_column_and_keeps_command_line_and_canvas`, `the_left_rail_and_command_line_keep_their_documented_bounds`, `left_column_renders_the_documented_sections_with_builders_below_projects`), `tests/ui_events.rs`, `tests/chrome_actions.rs`, `om9-scene/src/workspace.rs` (`ViewId::ALL`). Ledger entry `m01-l2-01-01-shell-docking-implementation-2026-10-16` in `docs/openmatrix9-progress.json` (~line 7828) records runtime evidence (`om9.exe --ui-audit` passes=21, 4 view rects, 1600x1000 screenshot, NVIDIA RTX 3060) and notes gate M01-UI still open (no DPI/multi-monitor capture). Reports: `docs/validation/2026-10-16-m01-l2-01-01-docking-implementation.md`, `...-source-audit.md`, dir `docs/validation/2026-10-16-m01-l2-01-01-docking/`. So L3-002 behavior is largely implemented; remaining work is the per-L3 L4 artifact set (crosswalk, api.md, fixtures, red/green evidence, regression logs, ui-review.json), gap hardening of L3-002 specifically (verify with tests; add a dedicated `tests/` file or tests for region geometry invariants if missing), and ledger update. Sibling L3-001 pattern to copy for artifact shape: `implementation/design/M01/OM9-L3-01-01-001/{api.md,source_crosswalk.json}` (schema `om9.m01.source_crosswalk.v1`, fields task_id, l3_id, owner_module_id, source_revision, checkout, verified_head, verified_clean, planned_anchors[path,blob_sha,present,lines,observed_symbols,decision,om9_owner]), `implementation/fixtures/M01/OM9-L3-01-01-001/{positive,negative}.json`, `implementation/evidence/M01/OM9-L3-01-01-001/*` (`...ui-review.json` schema `om9.m01.ui_review.v1`).

## 7. Build / test commands (run from `h:\OpenMatrix9\standalone`)
- `cargo test -p om9-app --test shell_docking`
- `cargo test -p om9-app` ; `cargo test --workspace` ; `cargo check --workspace --all-targets`
- UI audit: `cargo run -p om9-app --bin om9 -- --ui-audit` (receipt/screenshot; per ledger it ran in this environment on a real GPU).
- Public-source audit after changes: `python tools/public_source_audit.py` (from repo root). Use `;` not `&&` in PowerShell. I did not run builds in this step (orientation only).
- GUI launch: ledger evidence shows the egui/eframe window and `--ui-audit` ran on this machine (NVIDIA GeForce RTX 3060, Vulkan). Treat as launchable but re-verify at L4-05.

## 8. Status-field convention
- l3.json: `planning_state` = `SPEC_ONLY_NOT_IMPLEMENTED` (also L2.json). l4.json: `planning_state` = `NOT_STARTED`. M03 CONVENTIONS.md states `planning_state` must be exactly `SPEC_ONLY_NOT_IMPLEMENTED` for its files, and L4 files use `NOT_STARTED`. The 2026-10-16 audit explicitly did not promote any plan status ("Không có status nào trong OM9_Milestones/ được nâng"). Blocker vocabulary for outcomes: BLOCKED_M00 / BLOCKED_SOURCE / BLOCKED_DEPENDENCY / BLOCKED_FIXTURE / BLOCKED_ENV / BLOCKED_APPROVAL (M00 status file uses BLOCKED_APPROVAL and BLOCKED_DEPENDENCY). No other state vocabulary (e.g. PASS/DONE) is defined in these files; keep edits inside these values, prefer recording results in evidence files and `docs/openmatrix9-progress.json` rather than inventing new planning_state values. Recommended: leave plan JSON planning_state untouched unless the user authorizes a promotion; M00 gate G00-01 has no PASS so promotion is not supportable.

## 9. Project rules constraining the work
- Rust first: portable logic/state/UI in safe Rust; no C++/Python unless required; native exceptions recorded.
- QymCAD = code samples only, not target UI/runtime; no build-time dependency; keep THIRD-PARTY-NOTICES/LICENSE.
- Legal reuse approval is PENDING human M00 approval (M00 L4-01-01-01 BLOCKED_APPROVAL); never claim approved.
- Preserve Matrix9 UI per MATRIX9_UI_CONTRACT (file absent locally): left rail, four viewports, optional right properties dock mirroring ~300 px left column; keep unsupported commands visible+disabled; keep command identifiers.
- Authored SVG only (tools/export_menu_assets.py); no commercial bitmaps/binary resources/manuals/decompiled source/private models. Note `reference/images/*.png` in the spec folder are provided plan references; do not copy into source.
- M01-UI is a human manual gate (`manual_test_gate: M01-UI`, `requires_manual_test: true`); must not be claimed passed. L4-05 produces evidence for the reviewer only.
- Do not commit or stage anything unless asked; do not stage `vendor-research/`, ignored private refs, or unrelated working-tree changes (many files are already modified/untracked). No push.
- Business-rule changes: present before/after and ask before editing skills (consent policy).
- Progress: after verified work update `docs/openmatrix9-progress.json` with evidence, uncertainties, next action.
- Open uncertainties: SKILL.md bodies and v2 spec docs unread/absent; L2-01-02/03 not implemented; M00 gate unresolved; whether the L3-002 gap list beyond the existing implementation needs code changes must be determined by running `shell_docking` tests and comparing to the oracles.
Loading
Loading