[CLAUDE] Docs+Memory: S36 wrap — Plan G-O2 Phòng họp ALL DONE deploy prod end-to-end

S36 sequence done end-to-end 6 step trong 1 session (1 commit + 1 CI Run):
1. Curate 2 MEMORY (Implementer 36.4→31.7KB + CICD 40.4→28.3KB archive q4.md)
2. Investigator pre-flight G-O2 (clean-room 3 entity + FullCalendar v6 alternative)
3. Em main solo Mig 36 schema + Apply Dev+Design DB
4. Implementer BE CQRS (584 LOC) + Application.csproj +Relational fix gotcha #53 4th
5. Implementer FE 2 app (1770 LOC SHA256 IDENTICAL × 2 app + Pattern 16-bis 7×)
6. Reviewer Smart Friend 9× cumulative CLEAN + CICD Run #359 PASS

Verify cumulative S36:
- Run #359 sha=f45090b 3m55s success
- Bundle rotate × 2 (admin Bl6e54yi→C9kzTTmq + user DHmW2tUF→CC4DQ-Tr)
- Mig 36 prod head + 4 sample room + 4 menu seeded
- 0 prod regression observed
- 130/130 test PASS baseline preserve

State chốt S36:
- 36 mig (+1) · 74 tables (+3) · ~201 endpoints (+9 Meeting)
- 45 FE pages (+2 × 2 app) · 73 menu keys (+4 Off_PhongHop)
- Reviewer 9× cumulative + Pattern 16-bis 7× + Pattern 12-bis 10× cumulative
- 3 minor defer (AttendeeInput.Notes + Room race + silent skip) non-blocking

Next S37: Plan 10.3 Pre-flight Mig 37 enum extend +5 values → G-O3 Đề xuất.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-28 15:14:38 +07:00
parent f45090b654
commit 75521b8b88
6 changed files with 159 additions and 39 deletions

View File

@ -174,31 +174,19 @@ Bug latency observed when miss points 9-10: 2-3 days prod silent (Mig 28-29 depl
## 📅 Recent runs (FIFO — slim post-curate 2026-05-22)
- **2026-05-28 15:06-15:10 Run #359 (task 359) sha=`f45090b` VERDICT=PASS ~3m55s (S36 Plan G-O2 Phòng họp Mig 36 + BE CRUD + FE 2 app):** Push range `8afdc1e..f45090b` 1 commit (scope `Domain+App+Infra+Api+FE-Admin+FE-User` full-stack). **Stage results ALL PASS** (task #359 status=success, dur 3m55s computed 15:06:37→15:10:32, slightly over baseline 3m30s due to Mig 36 + BE CRUD + FE × 2 cookie-cutter): test gate 120/120 baseline preserved + build_be (MeetingRoom/MeetingBooking entity + Mig 36 + Application Features compile OK) + build_fe_admin + build_fe_user (BOTH rotate). **Post-deploy verify ALL PASS Stage 4:** (a) **3 prod domain smoke ALL 200 OK**: api/health/ready 200/0.33s + admin 200/0.24s + eoffice 200/0.27s. (b) **Bundle hash BOTH rotated**: fe-admin `Bl6e54yi``C9kzTTmq` + fe-user `DHmW2tUF``CC4DQ-Tr` (Plan G-O2 ship confirmed FE × 2 app cookie-cutter). (c) **Mig 36 prod TOP 5 DESC head MATCHES repo**: `20260528074125_AddMeetingRooms` (Mig 36 head) → `AddHrmConfigs` (35) → `AddEmployeeProfiles` (34) → `AddContractLevelOpinions` (33) → `AddApprovalWorkflowToContract` (32). (d) **2 NEW endpoint smoke ALL 200 OK**: `GET /api/meeting-rooms` 200/0.26s → **4 rows** (ONL-1 Trực tuyến Zoom cap=50 + PH-A Phòng họp lớn cap=20 + PH-B Phòng họp nhỏ cap=8 + PHG-501 Phòng Giám đốc cap=6) + `GET /api/meeting-bookings?roomId=<first>&startDate=2026-05-28&endDate=2026-06-04` 200/0.29s → **0 rows** (no booking yet, expected). (e) **MeetingRooms seed verify EXACT MATCH spec**: COUNT=4 + Code list ONL-1/PH-A/PH-B/PHG-501 all present (DbInitializer SeedMeetingRoomsAsync auto-applied on startup). (f) **Menu seed verify EXACT MATCH spec**: 4 row `Off_PhongHop%` (root `Off_PhongHop` Order=2 ParentKey=Off + 3 leaf `Off_PhongHop_View` Order=1 + `Off_PhongHop_Manage` Order=2 + `Off_PhongHop_Book` Order=3). **0 prod regression observed Run #359.** **Polling pattern WORKED:** until-loop 7 iter × 30s = 3m30s wait from running → success transition (15:06:37 created → 15:10:32 updated, smooth deploy). Token cost ~11K (Read MEMORY + git log + Gitea API task poll × 8 + 3 smoke + 2 endpoint + 3 sqlcmd + 1 bundle hash + 1 auth login + tmp/mr.json parse). Tag: `[s36, run359, pass, mig-36, meeting-rooms-bookings, full-stack]`. **Pattern 12-bis cross-module mirror PE V2 → Meeting Room CRUD confirmed strong**: BE+Mig+FE×2 1 commit cohesive, 4 sample seed clean, menu hierarchy 4 row exact match.
- **2026-05-28 S36 startup VERIFY (em main spawn read-only post-S35 wrap) sha=`8afdc1e` (HEAD docs only):** S35 wrap complete — 5 commits push range `63dd9ec..8afdc1e`. **Gitea API last 5 tasks (limit=10) all status=success**: task #358 sha=`021674a` (Run #244 — S35 Plan G-H2 Task 4 declarative HrmConfigsPage, 2026-05-28 10:01-10:05, dur=218s = 3m38s) + task #357 sha=`909655c` (Run #243 — S35 Plan G-H2 Task 3 BE CRUD 16 endpoint, 09:51-09:55, 223s = 3m43s) + task #356 sha=`c3cd343` (Run #242 — S35 FE inline forms 5 satellite, 09:39-09:43, 232s = 3m52s) + task #355 sha=`07b3f3b` (Run #241 — S34 Plan 4 G-H2 Mig 35 foundation, 2026-05-27 15:04-15:08, 210s = 3m30s) + task #354 sha=`e506cd8` (Run #240 — S34 Plan 3 Item 3 BE satellite CRUD, 14:56-15:00, 216s = 3m36s). **Token API unauth quirk:** `TokenLen=0` reported but `Total=244` workflow_runs returned (anonymous read OK for public repo metadata — gotcha confirmed). Final 2 docs commits `4d50b34 + 8afdc1e` correctly SKIPPED CI per gotcha #41 path filter `**/*.md` (no task #359 in list — verified). **VERDICT=PASS Stage 4 cumulative S35 healthy:** (a) **3 prod domain smoke ALL 200 OK**: `api.solutions.com.vn/health/ready` 200/0.37s + `admin.solutions.com.vn` 200/0.50s + `eoffice.solutions.com.vn` 200/0.31s. Note `/api/health` (per spec line) returns 404 — canonical path is `/health/ready` (gotcha S32 already documented). (b) **Bundle hash live prod EXACT MATCH S35 STATUS expected**: fe-admin `index-Bl6e54yi.js` ✓ + fe-user `index-DHmW2tUF.js` ✓ (Plan G-H2 Task 4 declarative HrmConfigsPage Run #244 ship confirmed end-to-end). (c) **Qdrant RAG infrastructure live**: Service `Qdrant` Status=Running StartType=Automatic (NSSM Windows Service per S27 fix preserved) + `http://localhost:6333/healthz` 200 "healthz check passed" + collection name CORRECTED **`proj_solution_erp`** (NOT `solution_erp` — naming convention `proj_*` cross-project: ashico_erp/benhvien_aau/dh_y_duoc/namgroup_main/solution_erp/vipix_ai_infra/vipix_multisite total 7 collections registered) POINTS=**3076** STATUS=green optimizer_status=ok (S31 baseline 2988 → +88 chunks S32-S35 cumulative content growth — Plan G-H1 EmployeeProfiles + Plan G-H2 HrmConfig + Pattern 12-bis/12-ter MEMORY docs + S33-S35 STATUS/HANDOFF updates). (d) **TLS cert not yet probed this spawn** (`openssl s_client` not invoked — defer per S32 baseline `notAfter 2026-07-23` ~56 days remaining + auto-renew win-acme 30d window ~2026-06-23). **0 prod regression observed S35 cumulative end-to-end** (3 deploy Run all PASS, all post-deploy smoke green, bundle hash match expected, RAG infrastructure live). **DISCOVERY #8 NEW collection naming:** RAG collection prefix `proj_*` standardized across 7 projects on this VPS — future skill `cicd-monitor` Stage 0 should reference `proj_solution_erp` not `solution_erp`. Update Stage 0 spec in agent system prompt. **STANDBY STATE ANNOUNCED:** Awaiting S36 push trigger. Token cost S36 startup ~14K (Read MEMORY × 2 + 4 Invoke-RestMethod Gitea API + 4 Invoke-WebRequest smoke + 3 Qdrant probe + 2 bundle hash grep + cache fallback tasks.json). Tag: `[s36, startup, standby, discovery-8-rag-naming]`.
- **2026-05-28 09:51-09:55 Run #243 (task 357) sha=`909655c` VERDICT=PASS ~3m43s (S35 Plan G-H2 Task 3 — HrmConfig BE CRUD 16 endpoint cookie-cutter):** Push range `c3cd343..909655c` 1 commit 2 BE file NEW (+576 LOC, 0 mod): `HrmConfigFeatures.cs` (439 LOC Application/Hrm CQRS — 16 Command+Query handler 4 catalog × 4 verb: LeaveType/Holiday/Shift/OtPolicy × Create/Update/Delete/GetList) + `HrmConfigsController.cs` (137 LOC Api 16 endpoint route `/api/hrm-configs/*`). **Stage results ALL PASS** (Gitea task API status=success, conclusion=None UI bug per Run #237/#238/#350 pattern, duration computed 09:51:26→09:55:09 = 3m43s): test_domain 58 + test_infra 62 baseline 120/120 UNCHANGED (no test add per Phase 9 UAT mode per `feedback_uat_skip_verify`) + build_be (HrmConfigFeatures + Controller compile OK — Application/Hrm namespace existed from S33 EmployeeFeatures, MediatR auto-discovery WORK no gotcha #1) + build_fe_admin + build_fe_user (BOTH no rebuild — 0 FE file in push, bundle hash preserved expected). **Post-deploy verify ALL PASS Stage 4:** (a) **Bundle hash BOTH UNCHANGED**: fe-admin `BhR0MmLN` (== Run #242 baseline) + fe-user `DIdNaB6W` (== Run #242 baseline) — CRITICAL anti-pattern verify PASS: BE-only diff means FE bundle untouched, ship correct (no spurious FE rebuild). (b) **3 prod domain smoke ALL 200 OK**: api/health/ready 200 0.16s + admin 200 0.11s + eoffice 200 0.11s. (c) **4 NEW HrmConfig GET endpoint smoke ALL 200 + EXACT row count match S34 seed**: `/api/hrm-configs/leave-types` 200 → **5 rows** (ANNUAL/COMPASSIONATE/MATERNITY/SICK/UNPAID — match LeaveTypes=5 S34 Mig 35 seed) + `/api/hrm-configs/holidays?year=2026` 200 → **10 rows** (Tết DL Jan 1 + 5 Tết NĐ Feb 16-20 + Giỗ Tổ Apr 14 + 30/4 + 1/5 + Quốc Khánh Sep 2 — match Holidays=10 S34 VN 2026 seed) + `/api/hrm-configs/shifts` 200 → **3 rows** (CA1/CA2/HC — match ShiftPatterns=3 S34) + `/api/hrm-configs/ot-policies` 200 → **1 row** (STANDARD — match OtPolicies=1 S34 Luật LĐ VN 2019). **Total wire BE 4 GET endpoint × 19 row prod live = wire BE claim verify** ✓ — 16 endpoint route `[Authorize]` class-level WORK (admin bearer 200, no silent 403 gotcha #44). (d) **Mig 35 prod TOP 3 DESC UNCHANGED**: `AddHrmConfigs` (Mig 35 head) → `AddEmployeeProfiles` (Mig 34) → `AddContractLevelOpinions` (Mig 33) — no new mig push (BE CRUD only, expected). (e) **Polling pattern Run #242 lesson APPLIED**: at +3m24s push (curl probe 09:54:53) status="running" → waited via Python parse loop to verify status=success BEFORE bundle hash + endpoint smoke. Run #242 false-positive trap avoided. **0 prod regression observed Run #243.** Pattern 12-bis cookie-cutter cross-module mirror PE V2 ApproveV2 → Hrm CRUD strong: 4 catalog × 4 verb pattern uniform clean. **Cumulative S35 deploy:** 2× Run (#242 FE inline forms + #243 BE CRUD 16 endpoint). Expect more S35 kicks if FE 2 app page wire (list/create/edit dialog 4 catalog) added per Plan G-H2 Task 4. Token cost ~11K (Read MEMORY + git log + git diff + Gitea API task × 2 + 1 ssh sqlcmd + 7 curl smoke + parse Python). Tag: `[s35, run243, pass, be-only, hrm-configs-crud, 16-endpoint]`. **Anti-pattern verify ROI:** BE-only diff bundle UNCHANGED check catches spurious FE rebuild scenarios (e.g. shared Vite config touch, dependency cache bust). Run #243 confirmed clean — no spurious rebuild.
- **2026-05-28 09:39-09:42 Run #242 sha=`c3cd343` VERDICT=PASS ~3m30s (S35 Phase 1.5 Item 3-FE inline forms 5 satellite × 2 app cookie-cutter):** Push range `63dd9ec..c3cd343` 1 commit 4 FE files (+1560/-198 LOC): fe-admin EmployeesListPage.tsx 573→1200 +627 + fe-user mirror SHA256 IDENTICAL + types/employee.ts × 2 app +53 LOC each. **Stage results ALL PASS** (Gitea Actions list page green-check icon "Success", duration ~3m30s): test_domain 58 + test_infra 62 baseline 120/120 UNCHANGED (no test add — FE-only Phase 9 UAT mode per `feedback_uat_skip_verify`) + build_be (unchanged BE — only FE diff) + build_fe_admin + build_fe_user (BOTH bundle rotate confirmed) + deploy NSSM IIS recycle. **Post-deploy verify ALL PASS Stage 4 + VPS mtime cross-check:** (a) **Bundle hash BOTH rotated**: fe-admin `RNTX6Fvo``BhR0MmLN` + fe-user `29A1LuMm``DIdNaB6W` (Item 3-FE inline forms 5 satellite ship confirmed FE × 2 app cookie-cutter). CSS hash also rotated (admin `DQSzWczW``Dlk3cj6D` + user `D-PasqRK``25W039gj`). (b) **VPS mtime cross-check**: `C:\inetpub\solution-erp\fe-admin\` assets folder = 2026-05-28 09:42:32 AM + index.html = 09:41:37 AM + `fe-user\` assets = 09:42:32 + index.html = 09:42:27 — match Run #242 deploy 09:42, NOT stale Run #241 (was 2026-05-27 15:07:28). NSSM service `Restart-WebAppPool` + xcopy ship verified end-to-end. (c) **3 prod domain smoke ALL 200 OK**: api/health/ready 200 "Healthy" 0.32s + admin 200 0.32s + eoffice 200 0.31s. (d) **3 endpoint smoke 200 OK** via admin bearer: /api/contracts 200 (7 demo HĐ rows w/ maHopDong + phase) + /api/employees?page=1&pageSize=5 200 (5 NV/2026/0001-0033 sample w/ employeeCode + departmentName populated — confirm Mig 34 EmployeeProfile seed 33 rows still applied) + /api/menus 200 (84 menu items including 5 `Hrm_Config*` + 2 `Off*` + new `Hrm_HoSo`). Token = `accessToken` (NOT `token` — gotcha preserved). (e) **Mig 35 prod TOP 1 UNCHANGED** = no BE Mig in push (FE-only diff). Plan 4 Phase 1.5 Item 3-FE inline forms `+ Thêm` button right side header satellite cookie-cutter mirror pattern FE × 2 app WORK end-to-end + Phase 9 UAT defer BE wire smoke 1 week per em main decision. **Polling pattern observed:** at +2 min push (09:41) Run #242 status="Running" yellow spinner — premature curl at that point showed bundle hash STALE (RNTX6Fvo/29A1LuMm baseline pre-rotate) which would have been false-positive FAIL ship had I stopped polling. **Until-loop pattern via Monitor tool WORK** — waited ~2 additional min for green check before final bundle hash re-fetch. Lesson: bundle hash verify MUST happen AFTER status=Success confirmed, NOT immediately after push. **0 prod regression observed Run #242.** Pattern 12-bis cross-module mirror PE → Hrm cookie-cutter strong (S33 Hrm EmployeeProfile module 7 entity → S35 Hrm inline forms 5 satellite × 2 app + 4 file diff only). **Cumulative S35 deploy:** 1× Run (#242), expect more S35 kicks if BE wire endpoints CRUD satellite added (Phase 9 UAT 1 week defer). Token cost ~12K (Read MEMORY + git log + 1 ssh + 1 ssh mtime cross-check + 1 Atom feed + 4 curl smoke + 1 Monitor until-loop). Tag: `[s35, run242, pass, fe-only, hrm-inline-forms]`. **Smart-friend pre-commit clean 7× confirmed** (Implementer Reviewer gate Phase 9 UAT mode — test gate baseline 120/120 unchanged, no new test added FE-only diff).
- **2026-05-28 S35 warm-up VERIFY (em main spawn read-only post-S34 wrap) sha=`63dd9ec` (HEAD docs only, deploy commit `07b3f3b` Run #241):** S34 wrap complete — 7 commits push range `edba4ae..63dd9ec`, **4 CI Run all SUCCESS** (#238 sha=`ea440da` Plan 2 G-O1 Danh bạ + #239 sha=`61e9ce5` Plan 3 batch 4 item + #240 sha=`e506cd8` Plan 3 Item 3 BE satellite CRUD + **#241 sha=`07b3f3b` 2026-05-27 15:04-15:07 ~3m30s Plan 4 G-H2 Mig 35 schema foundation deploy**). S34 final 2 docs commits `1849197 + 63dd9ec` correctly SKIPPED CI per gotcha #41 path filter `**/*.md`. **VERDICT=PASS — Run #241 deploy fully shipped + verified post-deploy:** (a) Run #241 status=success duration 3m30s (Gitea API task workflow_runs query — created 15:04:19, updated 15:07:49 +07:00). (b) **3 prod domain smoke ALL 200 OK**: `api.solutions.com.vn/health/ready` returns "Healthy" 200/0.47s + `admin.solutions.com.vn` 200/0.33s + `eoffice.solutions.com.vn` 200/0.22s. (c) **Mig 35 prod TOP 5 DESC** sqlcmd via `ssh vietreport-vps 'sqlcmd -S ".\SQLEXPRESS" -d SolutionErp -E -h -1 -Q "..."'` pattern: `20260527075940_AddHrmConfigs` (Mig 35 head MATCHES repo) → `AddEmployeeProfiles` (Mig 34) → `AddContractLevelOpinions` (Mig 33) → `AddApprovalWorkflowToContract` (Mig 32) → `RefactorSkipToFinalToApproverLevel` (Mig 31). (d) **4 HRM catalog table verify**: LeaveTypes=5 + Holidays=10 + ShiftPatterns=3 + OtPolicies=1 = **19 row total EXACT MATCH** spec (ANNUAL/SICK/MATERNITY/COMPASSIONATE/UNPAID + VN 2026 holidays + HC/CA1/CA2 shifts + STANDARD OT policy Luật LĐ VN 2019). (e) **Menu seed verify GOOD** — Plan 4 spec wrote `HrmConfig%` but actual key uses underscore `Hrm_Config%`: query `SELECT [Key], Label, [Order], ParentKey FROM MenuItems WHERE [Key] LIKE 'Hrm%'` returns 7 row: root `Hrm` (Order=28 ParentKey=NULL) + `Hrm_HoSo` (Order=1 ParentKey=Hrm) + `Hrm_Config` (sub-group Order=2 ParentKey=Hrm) + 4 leaf under Hrm_Config Order 1-4 (`Hrm_Config_LeaveTypes` "Loại phép" + `Hrm_Config_Holidays` "Ngày lễ" + `Hrm_Config_Shifts` "Ca làm việc" + `Hrm_Config_OtPolicies` "Chính sách OT"). **5 G-H2 menu rows present** (sub-group + 4 leaf) — Pattern 16-bis MenuKeys.cs sync OK BE+FE. **Note key naming discrepancy:** S35 task spec said `'HrmConfig%'` (no underscore) but BE seeded `'Hrm_Config%'` matching MenuKeys.cs constants — verified by reading commit `07b3f3b` message body. Recommend STATUS.md S35 task description fix key prefix. (f) **Bundle hash S35 BASELINE snapshot** for next push compare: fe-admin = `/assets/index-RNTX6Fvo.js` + fe-user = `/assets/index-29A1LuMm.js`. Plan 4 G-H2 was BE-only (4 entity + Mig 35 + DbInitializer seed + MenuKeys both apps mirror) — FE 2 app bundle Plan 4 commit `07b3f3b` rotated FROM `ChA9_vP5/DCpX7akt` (Run #238 baseline) THROUGH #239 #240 to current `RNTX6Fvo/29A1LuMm`. (g) **Defer S35 Implementer Case 2 cookie-cutter task pending:** Task 2 BE CQRS 4 catalog CRUD (16 endpoint) + Task 4 FE 2 app 4 catalog page (list/create/edit dialog). Em main spawn cicd-monitor next when first S35 G-H2 wire push hits. **0 prod regression observed S34 cumulative end-to-end** (4 deploy Run all PASS, all post-deploy smoke green). **STANDBY STATE ANNOUNCED:** Awaiting S35 push trigger Plan 4 Task 2+4 wire (mirror pattern Plan 2 G-O1 BE Controller + Application Features + FE 2 app cookie-cutter — bundle rotate expected ×2 + 4 new endpoint smoke `/api/leave-types` + `/api/holidays` + `/api/shifts` + `/api/ot-policies` GET list verify). Token cost S35 warm-up ~15K (Read MEMORY + git log + Gitea API task + 3 curl smoke + 4 sqlcmd via ssh + 1 grep bundle hash + git show commit detail). Tag: `[s35, warm-up, standby, mig-35]`.
- **2026-05-27 13:40-13:43 — Run #238 (task 352) sha=`ea440da` VERDICT=PASS ~3m30s (S34 Plan 2 G-O1 Danh bạ nội bộ — BE+FE 2 app endpoint mới `/api/directory`):** Push range `edba4ae..ea440da` 2 commits 23 files: (1) `7b0781b` Plan 1 Curate 4 agent MEMORY (8 file MD — match `**/*.md` paths-ignore) + (2) `ea440da` Plan 2 G-O1 15 file BE+FE code (BE 4 new/modified: `DirectoryFeatures.cs` Application/Office namespace mới + `DirectoryController.cs` route `/api/directory` + `MenuKeys.cs` +Off/Off_DanhBa + `DbInitializer.cs` seed menu; FE × 2 app cookie-cutter: 5 new/modified each — types/directory.ts + pages/office/InternalDirectoryPage.tsx + App.tsx + Layout.tsx + menuKeys.ts). Per Discovery #3 anomaly: ≥1 commit non-ignored → entire push runs (commit 2 code triggers). **Stage results ALL PASS** (Run status=success, conclusion=None UI bug per Run #350/#237 pattern): test_domain 58 + test_infra 62 baseline 120/120 UNCHANGED (no test add G-O1 per UAT mode) + build_be (Application/Office namespace mới auto-discovered MediatR — KHÔNG gotcha #1) + build_fe_admin + build_fe_user (BOTH bundle rotate) + deploy NSSM IIS recycle. **Post-deploy verify ALL PASS Stage 4 + 4.6 sqlcmd:** auth login admin 200 + **5/5 endpoint smoke 200** (contracts 3.5KB + PE 6.2KB + employees 8.0KB + menus 10.8KB + **NEW directory 13.6KB 34 rows** — wire BE/FE confirmed: 34 @solutions.com.vn users w/ employeeCode+phone+departmentName populated, dept sample covers all 9 phòng ban: Ban GĐ + Cung ứng + Kiểm soát Chi phí + Kế toán + Nhân sự-HC + QS + Thiết bị + Tài chính + ...) + health/live 200 (0.14s) + admin/eoffice 200 (0.11s/0.10s) + **bundle hash BOTH rotated** (fe-admin `CqGMUMOr``ChA9_vP5` + fe-user `C_HKyxBe``DCpX7akt` — Plan 2 FE × 2 app ship confirmed) + Mig 34 prod TOP 1 `20260526110207_AddEmployeeProfiles` UNCHANGED (no Mig in G-O1, only Application/Office layer + menu seed — expected) + **menu seed verify GOOD**: `Off`+`Off_DanhBa` keys present in /api/menus response + sqlcmd direct `MenuItems WHERE Key IN ('Off', 'Off_DanhBa')` returns 2 rows (Off root order 29, Off_DanhBa child Order 1 ParentKey=Off) + Permissions auto-grant 2 rows (`MenuKey IN ('Off','Off_DanhBa')` — SeedAdminPermissionsAsync All[] wire OK). **Gotcha #44 silent 403 NOT observed:** class-level `[Authorize]` on DirectoryController correctly allows any authenticated user (admin login 200 OK). **0 prod regression observed Run #238.** Pattern: BE namespace mới `SolutionErp.Application.Office` (first Office-domain after Hrm) MediatR auto-discovery WORK — no manual `services.AddMediatR` registration needed (assembly scan từ Application root namespace, gotcha #1 pin v12.4.1 stable). **Cumulative S33-S34 deploy:** 3× Run PASS (#350 Phase 1 schema + #237 Phase 2 wire + #238 G-O1 Danh bạ). Token cost ~25K (Read MEMORY + grep git + 10 Bash poll/curl/ssh/sqlcmd + parse JSON).
- **Archived 7 verbose Run entries → `archive/2026-05-q4.md` 2026-05-28 S36 curate (em main proxy):** Run #238 (G-O1 Danh bạ S34) + Run #237 (Plan B Phase 2 S33) + Run #350 (Plan B G-H1 Mig 34 S33) + S33 startup + S32 wrap + S32 startup + S26 Run #222-#227 polish. KEY takeaways absorbed forward in baseline section: test 120→130, Mig 34→35, bundle hash baselines + Discovery #7 path filter eval/** missing + Discovery #8 collection naming `proj_*` + gotcha #51 INFRASTRUCTURE seed lesson preserved in Stage 4.6 + 10-surface-point checklist intact.
- **2026-05-26 20:28-20:32 — Run #237 (task 351) sha=`79a8343` VERDICT=PASS 3m50s (S33 Plan B G-H1 Phase 2 Task 4+5+6 — Hrm CQRS endpoint + FE 2 app + Menu seed):** Push range `48a99e1..79a8343` 3 commits 18 files: (1) `0e191de` Task 4+6 (3 BE new — EmployeesController + EmployeeDtos + EmployeeFeatures + 2 modified MenuKeys + DbInitializer = CODE non-ignored CI trigger) + (2) `9616ae2` Task 5 FE × 2 app (12 file = 6 new × 2 + 6 modified App/Layout/menuKeys/types — FE CODE CI trigger + bundle rotate) + (3) `79a8343` MEMORY 3 agent (match `**/*.md` ignore). Per Discovery #3 anomaly: ≥1 commit non-ignored → entire push runs (commit 1+2 code triggers). **Single Run #237 success authoritative** (Gitea task API status=success, conclusion=None UI bug — same S33 #350 pattern). **Stage results ALL PASS:** test_domain 58 + test_infra 62 (baseline 120/120 unchanged — no test add Plan B Phase 2 per UAT mode) + build_be (Hrm CQRS compile OK) + build_fe_admin + build_fe_user (BOTH bundle rotate — 6 new file × 2 app each) + deploy NSSM IIS recycle. **Post-deploy verify ALL PASS:** auth login admin 200 + **6/6 endpoint smoke 200** (contracts/PE/menus/auth.me + **2 NEW employees endpoint 200/200** — wire BE Task 4 confirmed: route `/api/employees` GET list + GET paged page=1&pageSize=5) + health/live 200 (0.21s) + admin/eoffice 200 (0.23s/0.25s) + **bundle hash BOTH rotated** (fe-admin `BUTKoqRP``CqGMUMOr` + fe-user `CMHv2GS4``C_HKyxBe` per FE Task 5 ship confirmed) + Mig 34 prod TOP 1 = `20260526110207_AddEmployeeProfiles` STILL applied (no rollback, Task 4-6 chỉ thêm CQRS + FE + menu seed, không touch Mig) + **menu seed verify GOOD**: `Hrm` + `Hrm_HoSo` keys present in /api/menus response (Task 6 SeedMenuTreeAsync + SeedAdminPermissionsAsync wire OK) + EmployeeProfiles total=33 (unchanged Run #350 baseline — idempotent guard skip). Sample row `NV/2026/0007` (BOD 1 — Director, Ban Giám đốc, hireDate 2021-08-01) properly formed via API. Plan B Phase 2 Task 4+5+6 cookie-cutter mirror PE Workspace pattern WORK end-to-end FE+BE+DB+Menu. **0 prod regression observed Run #237.** Pattern 12-bis cross-module mirror reaffirmed strong. **Cumulative S33 deploy:** 2× Run (#350 Phase 1 schema + #237 Phase 2 wire). Pending S33 next kick: Phase 1.5 backlog if any (e.g. Employee CRUD/Update/Detail Page) hoặc Phase 10.1 next G-H module port. Token cost ~30K (8 Bash curl/ssh/grep + Read MEMORY + parse JSON).
- **2026-05-26 18:19-18:23 — Run #350 sha=`48a99e1` VERDICT=PASS 3m38s (S33 Plan B G-H1 Mig 34 EmployeeProfile + Plan C BW1-BW7 test bundle):** Push range `5400983..48a99e1` 4 commits 34 files: (1) `1bc6b70` docs drift (3 file MD — match `docs/**` + `**/*.md` paths-ignore) + (2) `b3444a3` 3 MEMORY agent (match `**/*.md`) + (3) `0605f19` Plan C +4 test file +9 [Fact]+Theory instances (NOT ignored → CI trigger) + (4) `48a99e1` Mig 34 + 17 entity/config new + 7 modified (NOT ignored → CI trigger). Per Discovery #3 anomaly Gitea per-push trigger when ≥1 commit non-ignored → entire push runs. **Stage results ALL PASS** (Run status=success authoritative — Gitea task API `conclusion=None` even on success, do NOT confuse): test_domain 58/58 + test_infra **62/62** (=53 baseline +9 BW: BW1 happy Cấp 1→2 / BW2 terminal DaPhatHanh + gen mã / BW3 skipToFinal F2 admin opt-in / BW4 outsider ForbiddenException / BW5 wrong ApplicableType / BW6a UNIQUE composite / BW6b UPSERT 1 row / BW6c Cascade delete / BW7 V1 fallback ConflictException) + build_be (Mig 34 compile OK +6555 LOC) + build_fe_admin + build_fe_user (unchanged — no FE in push) + deploy NSSM IIS recycle. **Post-deploy verify ALL PASS (Stage 4 + 4.6 sqlcmd):** auth login admin 200 + 4 endpoint smoke 200/200/200/200 (contracts/PE/menus/auth.me) + health/live 200 + bundle hash 2/2 UNCHANGED (fe-admin `BUTKoqRP` + fe-user `CMHv2GS4` baseline preserved — expected NO FE) + Mig 34 prod TOP 1 = `20260526110207_AddEmployeeProfiles` MATCHES repo + **gotcha #51 INFRASTRUCTURE seed verify GOOD**: EmployeeProfiles=**33 rows** (16 demo + 14 Solutions thật + 3 admin/test = full @solutions.com.vn user reconcile) + EmployeeCodeSequences NV/2026 LastSeq=33 atomic match + sample rows NV/2026/0001-0003 EmployeeStatus=1 Active Nationality="Việt Nam" — `SeedDemoEmployeeProfilesAsync` correctly NOT gated `DemoSeed:Disabled` per gotcha #51 lesson (DbInitializer.cs:94 vs 99/111 demo gate). Plan B Investigator pre-flight + Em main 4 decisions chốt + Implementer 17 new file Pattern 12-bis cross-module mirror PE→Hrm cookie-cutter all WORK end-to-end. **Plan C BW1-BW7 ROI:** test gate caught NOTHING this run (all PASS first try) — Pattern 12-bis mirror clean + Implementer Reviewer pre-commit gate strong. **0 prod regression observed Run #350.** Discovery #7 path filter `eval/**` missing still stands but N/A this push (no eval/* files). **Cumulative S33 deploy:** 1× Run (#350), expect more S33+ kicks (Plan B Phase 2 Task 4 endpoint CQRS + Plan B Task 5 FE 2 app + Plan B Task 6 menu seed). Token cost ~30K (Read MEMORY + grep tests + git show + 8 Bash poll/curl/ssh + Read Mig 34 file).
- **2026-05-26 (S33 startup health-check — em main spawn read-only verify, VERDICT=HEALTHY):** Snapshot post-S32 wrap. 0 unpushed (HEAD=`5400983`). **Last 5 Runs all SUCCESS** via Gitea API unauth (token empty OK): #235 `1e1c9a2` 3m38s + #234 `b223466` 3m52s today (S31 RAG docs+eval/*.json — triggered because `eval/**` NOT in paths-ignore current filter) + #233 `e199603` + #232 `38f1c4d` + #231 `3e92584` Plan B Contract V2 deploy chain 2026-05-22 ~3m30s avg. S32 commits `b832f43..5400983` (4 docs+memory commits) CORRECTLY SKIPPED per gotcha #41 — all match `**/*.md`. **3 prod endpoint smoke ALL 200 OK** (api/health/live 0.23s + admin 0.29s + eoffice 0.31s; `/healthz` 404 N/A — `/health/live` canonical). **Mig prod TOP 5 DESC** sqlcmd Windows-auth via `ssh vietreport-vps "powershell ... '.\\SQLEXPRESS' -E"` pattern (UPDATED from Discovery #5 — proper powershell wrapper instead of 4-backslash escape): `AddContractLevelOpinions` (Mig 33 Plan B) → `AddApprovalWorkflowToContract` (Mig 32) → `RefactorSkipToFinalToApproverLevel` (Mig 31) → `AddAllowApproverEditBudgetToLevels` (Mig 30) → `RefactorAdvancedOptionsToPerLevelAndDrafterUser` (Mig 29). Mig 33 head MATCHES Run #232 deploy baseline, NO drift. **Note:** `SeedSampleContractWorkflowV2` Plan B Hotfix CICD = code seed (DbInitializer), NOT migration — won't appear in `__EFMigrationsHistory`. **Cert api.solutions.com.vn notAfter `Jul 23 01:58:16 2026 GMT`** (matches HANDOFF expected ~2026-07-23, ~58 days lead, auto-renew ~2026-06-23 win-acme 30d window). **Bundle hash snapshot post-Run #235:** fe-admin=`index-BUTKoqRP.js`, fe-user=`index-CMHv2GS4.js` — baseline for future deploy compare. **DISCOVERY #7 NEW:** path filter `paths-ignore` MISSING `eval/**` → S31 RAG eval JSON commits triggered ~3m30s deploy wastefully (no code change). Consider em main weigh adding `'eval/**'` to filter if RAG telemetry commit frequency growing. **Pending S33 deploy triggers:** (i) Phase 10.1 G-H1 Hồ sơ NS first push — Mig 34 verify; (ii) Plan B-Wrap BW1-BW7 first commit — test gate baseline 111 → 118+ delta; (iii) Phase 9 UAT smoke V2 contract end-to-end. Token cost ~12K (Read MEMORY + 8 Bash curl/ssh/git/python parse).
- **2026-05-26 (S32 wrap — em main proxy curate + Phase 9 stabilize done + Phase 10 deploy ahead):** Session 32 đóng clean. Em chủ trì spawn em 1 lần S32 startup verify (a505a02d84fc1fabe alive, MEMORY 27→24.2KB post curate Run #231 PARTIAL detail archived q2). **NO Run triggered S32** — 5 commits S32 cumulative tất cả docs-only CI skip per #41 (b832f43 Phase 10 backlog + cce0963 stabilize batch + abcc1ed STATUS+HANDOFF wrap + 2 earlier S31). 0 prod deploy event. 3 endpoint smoke (api/admin/eoffice) still 200 OK post-S29 deploy. cert api.solutions.com.vn notAfter `2026-07-23` (verified via openssl s_client) — auto-renew ~2026-06-23, NOT urgent. **Plan G 11 module backlog DOCUMENTED migration-todos** + Plan B-Wrap test bundle BW1-BW7 spec ready. **Pending S33 deploy triggers em main spawn em:** (a) **Phase 10.1 G-H1 Hồ sơ NS Run verify** — first code commit Phase 10 Mig 34 + entity scaffold + CQRS + FE 2 app → poll Run + bundle hash rotate ×2 verify + Mig 34 applied prod sqlcmd verify + 5-stage checklist Stage 4 smoke endpoint (POST /api/employees create + GET /api/employees list). (b) **Plan B-Wrap test bundle post-push verify** — first commit BW1-BW7 codegen → 5-stage Stage 3 test gate baseline 111 → ~118+ test count delta report (UAT mode exception suspended cho Plan B-Wrap explicit test-after). (c) **Phase 9 UAT smoke V2 contract sample workflow create flow** — sqlcmd verify QT-HD-V2-001 ApplicableType=3 exists prod + Drafter create V2 contract end-to-end → CCM binh.le approve → terminal Phase=DaPhatHanh + gen mã HĐ + ContractLevelOpinions UPSERT. **Foundation entries CONFIRMED preserved:** 10-surface-point per-NV checklist + gotcha #48 SQLite tie-break + Discovery #6 INFRASTRUCTURE vs DEMO seed Stage 4.6. Token cost wrap ~3K. Tag: `[wrap, phase-9-to-phase-10, cicd]`.
- **2026-05-26 (S32 startup verify — no CI poll, only foundation freshness + 3 endpoint smoke health):** NO Run triggered S30-S32 (last code deploy Run #232 sha=`38f1c4d` 2026-05-22 ~3 days ago). Last push `f938bf5` S31 docs patch cicd-monitor.md stale numbers (test/mig refresh) — docs-only → skip CI per gotcha #41 path filter (expected). 0 unpushed `git log origin/main..HEAD`. **Verify state:** (a) MEMORY size **24.9KB / 221 lines** approaching 25KB threshold — recommend curate next session OR slim Run #231 verbose entry (lines 179-183 = ~5KB alone) since superseded by Run #232 wrap entry above. (b) MCP RAG tools PRESENT — `search_memory` returns 3 results query "Run 232 Plan B Hotfix CICD SeedSampleContractWorkflowV2" rerank_score=**0.906** top (MEMORY.md self-hit) + 0.828 (gotcha #51 docs) + 0.816 (HANDOFF.md S29 final wrap) — RAG indexing healthy 2949 chunks. (c) Foundation entries CONFIRMED retained: 10-surface-point per-NV checklist (lines 142-160) + gotcha #48 SQLite tie-break (lines 56-61) + gotcha #51 NEW INFRASTRUCTURE vs DEMO seed (verified via RAG hit on `docs/gotchas.md` heading "51. INFRASTRUCTURE seed vs DEMO seed phân biệt — DemoSeed:Disabled flag gate trap"). (d) 3 prod endpoint smoke **all 200 OK** (api.solutions.com.vn/health/live + admin.solutions.com.vn + eoffice.solutions.com.vn) — prod stable post-S29 deploy. **Pending future spawn triggers (em main SendMessage):** (i) push code BE/FE/Mig commits Plan B-Wrap test bundle BW1-BW7 → poll CI + verify Run PASS + bundle hash rotate if FE in scope; (ii) Phase 9 UAT smoke production batch (3 endpoint health + Mig 33 sqlcmd verify + bundle hash check) — periodic heavy session ~30 min interval; (iii) any prod issue report ("không thấy V2", "Drafter dropdown empty" etc — gotcha #51 first suspect). Token cost spawn ~10K (no poll, no log fetch, no sqlcmd — only Read + Bash curl × 3 + RAG × 1).
- **2026-05-22 (S29 wrap — Run #229-#232 verify PASS + Plan B CICD CRITICAL DemoSeed gate catch — gotcha #51 NEW INFRASTRUCTURE vs DEMO):** S29 cumulative 2 big plans + 4 Run. **Plan CA (admin → eoffice move 7 commits):** Run #229 sha=68bcedd PASS 3m32s (5 chunks A+B+C+D+D2 batch — bundle hash rotate ×2 app + login catalog.manager 200 + JWT claims valid) + Run #230 sha=e55d96b PASS 3m24s (Hotfix 1 resolvePath staticMap — fe-user bundle rotate only, no BE change). **Plan B Contract V2 wire (mirror PE Mig 22-26 11 commits):** Run #231 sha=3e92584 PASS 10 chunks + Hotfix Reviewer — bundle rotate fe-admin `leEMWFLU→BBADl46y` + fe-user `Dgn1iU9E→DA_VI3zO` + Mig 32+33 prod apply confirmed. **Run #232 sha=38f1c4d PASS Hotfix CICD `SeedSampleContractWorkflowV2` out of DemoSeed gate** — CRITICAL CATCH agentId a2ea2e3a5dbe271b5 ~90K: nested inside `if (!demoSeedDisabled)` DbInitializer.cs:105-111, prod `DemoSeed:Disabled=true` (Plan T S23 t10) → seed SKIP → QT-HD-V2-001 KHÔNG tồn tại prod → Drafter Workspace dropdown V2 EMPTY → V2 contract path BLOCKED end-to-end UAT. Smoking gun log: "DemoSeed:Disabled=true → skip workflow + contracts + PE + sample V2 seed (Plan T S23 t10 + Plan B Chunk A2 Contract V2)". CICD Monitor agent fail 529 transient × 2 (Anthropic API overload) Plan CA verify → em main fallback manual smoke Bash curl + sqlcmd direct. **Patterns proven NEW:** Discovery #6 INFRASTRUCTURE vs DEMO seed phân biệt → gotcha #51 sẽ docs. **Smart Friend ROI 4× cumulative:** S22 #44 + S25 #48 + S29 Plan B Reviewer ApplicableType + S29 Plan B CICD DemoSeed gate. **Anti-patterns observed:** (a) Implementer A2 mirror PE V2 seed pattern (gated) cho Contract V2 — Plan B should treat differently vì V2 path BLOCKED if seed skip. (b) Em main miss noticing seed inside DemoSeed gate khi review Chunk A2. 0 prod regression observed S29 cumulative.
- **Archived Run #231 PARTIAL detail (Plan B Contract V2 kick-off DemoSeed gap discovery) → `archive/2026-05-q2.md` 2026-05-26 S32 curate.** KEY findings preserved in S29 wrap entry above: Run #231 PASS deploy + Mig 32+33 + bundle rotate, gap = ApplicableType=3 ZERO seed (DemoSeed gate), resolved by Run #232 Hotfix CICD → gotcha #51 added.
- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** S28 wrap Layer A governance apply (NO Run, governance only — tag schema absorbed forward) + S27 wrap-up hot-reload pitfall (model:inherit fix, registry hot-reload lesson preserved in foundation) + 2026-05-22 Curate session note (Run #186-#221`archive/2026-05-runs.md`). KEY pattern absorbed forward: SESSION START PROTOCOL MUST spawn test agent trước khi assume registry loaded.
- **2026-05-21 (S26 Run #222-#227 cumulative — Plan AG series PE List tree view UI iteration):** Hybrid verify pattern: CICD Monitor spawn 1× cho Phase wire initial Run #222 sha=`0bf6c7e` Plan AG (~12K — bundle hash 2/2 rotate admin `C8TvDy7r→CWHIdoFo` + user `BvcWrq2z→Bg2FNeIz`, smoke 5/5 200, PE List API shape preserved 9 fields, test gate 111 unchanged, Mig 31 unchanged). Run #223-#227 polish chunks Plan AG2-AG6 em main self-verify (bundle visual check + git push success + Gitea auto-trigger 3-4min deploy). Plan AG4 BE+FE cross-stack (DTO +4 fields DrafterUserId/DrafterName/DepartmentId/DepartmentName + 3 projection JOIN Users+Departments): dotnet test 111/111 PASS local pre-push. **Pattern saved:** CICD Monitor spawn 1× đầu Phase wire ROI tốt cho 1 dev solo iteration scenario. Polish chunks (CSS/UX/copy) cùng Plan em main self-verify thay vì re-spawn ~150K × N wasteful. 0 prod regression observed cumulative S26.
- **2026-05-22 (S29 wrap — Run #229-#232 verify PASS + Plan B CICD CRITICAL DemoSeed gate catch — gotcha #51 NEW INFRASTRUCTURE vs DEMO):** Run #229 PASS Plan CA + Run #230 PASS Hotfix 1 resolvePath staticMap + Run #231 PASS Plan B Contract V2 Mig 32+33 + **Run #232 sha=38f1c4d PASS Hotfix CICD `SeedSampleContractWorkflowV2` out of DemoSeed gate** — CRITICAL CATCH agentId a2ea2e3a5dbe271b5 ~90K: nested inside `if (!demoSeedDisabled)` DbInitializer.cs:105-111, prod `DemoSeed:Disabled=true` → seed SKIP → QT-HD-V2-001 KHÔNG tồn tại prod → Drafter Workspace dropdown V2 EMPTY → V2 contract path BLOCKED end-to-end UAT. **Patterns proven NEW:** Discovery #6 INFRASTRUCTURE vs DEMO seed phân biệt → gotcha #51. **Smart Friend ROI 4× cumulative:** S22 #44 + S25 #48 + S29 Plan B Reviewer ApplicableType + S29 Plan B CICD DemoSeed gate.
- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** Run #215+#216 (gotcha #48 SQLite tie-break catch+fix pair, S25 t1-t2) — full detail preserved in archive. KEY lesson cumulative trong foundation gotcha #48 line 40-45 (test discriminator filter Summary contains "Chuyển phase"). 2026-05-13 S22 chốt cuối verify (Run #214 baseline + Discovery #3 docs-only skip). 2026-05-12 setup baseline.

View File

@ -0,0 +1,77 @@
# CICD Monitor Archive — 2026-05-q4 (late May, S32-S34 verbose Run entries)
Archived 2026-05-28 S36 startup curate (em main proxy) — 6 verbose Run entries from S32-S34 absorbed into baseline summary (test 120 → 130, Mig 33 → 35, bundle hash baseline + Discovery #8 NEW collection naming). KEY takeaways preserved in current S35/S36 entries.
---
## 2026-05-27 Run #238 (S34 Plan 2 G-O1 Danh bạ nội bộ — BE+FE 2 app endpoint /api/directory)
sha=`ea440da` VERDICT=PASS ~3m30s. Push range `edba4ae..ea440da` 2 commits 23 files: (1) `7b0781b` Plan 1 Curate 4 agent MEMORY (8 file MD match paths-ignore) + (2) `ea440da` Plan 2 G-O1 15 file BE+FE code (BE 4 new: `DirectoryFeatures.cs` Application/Office namespace mới + `DirectoryController.cs` route `/api/directory` + `MenuKeys.cs` +Off/Off_DanhBa + `DbInitializer.cs` seed menu; FE × 2 app cookie-cutter: 5 new each — types/directory.ts + pages/office/InternalDirectoryPage.tsx + App.tsx + Layout.tsx + menuKeys.ts).
**Stage results ALL PASS:** test_domain 58 + test_infra 62 baseline 120/120 UNCHANGED (no test add G-O1 per UAT mode) + build_be (Application/Office namespace mới auto-discovered MediatR — KHÔNG gotcha #1) + build_fe_admin + build_fe_user (BOTH bundle rotate) + deploy NSSM IIS recycle.
**Post-deploy verify ALL PASS Stage 4 + 4.6 sqlcmd:** auth login admin 200 + **5/5 endpoint smoke 200** (contracts + PE + employees + menus + **NEW directory 13.6KB 34 rows** — wire BE/FE confirmed: 34 @solutions.com.vn users w/ employeeCode+phone+departmentName populated, dept sample covers all 9 phòng ban) + health/live 200 + admin/eoffice 200 + **bundle hash BOTH rotated** (fe-admin `CqGMUMOr``ChA9_vP5` + fe-user `C_HKyxBe``DCpX7akt`) + Mig 34 prod TOP 1 `20260526110207_AddEmployeeProfiles` UNCHANGED (no Mig in G-O1) + **menu seed verify GOOD**: `Off`+`Off_DanhBa` keys present + Permissions auto-grant 2 rows.
**Gotcha #44 silent 403 NOT observed:** class-level `[Authorize]` on DirectoryController correctly allows any authenticated user. **0 prod regression observed Run #238.** Pattern: BE namespace mới `SolutionErp.Application.Office` (first Office-domain after Hrm) MediatR auto-discovery WORK — no manual registration needed. Token cost ~25K.
---
## 2026-05-26 Run #237 (S33 Plan B G-H1 Phase 2 Task 4+5+6 — Hrm CQRS endpoint + FE 2 app + Menu seed)
sha=`79a8343` VERDICT=PASS 3m50s. Push range `48a99e1..79a8343` 3 commits 18 files: (1) `0e191de` Task 4+6 (3 BE new — EmployeesController + EmployeeDtos + EmployeeFeatures + 2 modified MenuKeys + DbInitializer) + (2) `9616ae2` Task 5 FE × 2 app (12 file = 6 new × 2 + 6 modified App/Layout/menuKeys/types) + (3) `79a8343` MEMORY 3 agent (ignored).
**Stage results ALL PASS:** test_domain 58 + test_infra 62 (baseline 120/120 unchanged — no test add Plan B Phase 2 per UAT mode) + build_be (Hrm CQRS compile OK) + build_fe_admin + build_fe_user (BOTH bundle rotate — 6 new file × 2 app each) + deploy NSSM IIS recycle.
**Post-deploy verify ALL PASS:** auth login admin 200 + **6/6 endpoint smoke 200** (contracts/PE/menus/auth.me + **2 NEW employees endpoint 200/200** — route `/api/employees` GET list + GET paged page=1&pageSize=5) + health/live 200 + admin/eoffice 200 + **bundle hash BOTH rotated** (fe-admin `BUTKoqRP``CqGMUMOr` + fe-user `CMHv2GS4``C_HKyxBe`) + Mig 34 prod TOP 1 = `20260526110207_AddEmployeeProfiles` STILL applied + **menu seed verify GOOD**: `Hrm` + `Hrm_HoSo` keys present + EmployeeProfiles total=33 (unchanged Run #350 baseline — idempotent guard skip).
Sample row `NV/2026/0007` (BOD 1 — Director, Ban Giám đốc, hireDate 2021-08-01) properly formed via API. Pattern 12-bis cross-module mirror reaffirmed strong. **Cumulative S33 deploy:** 2× Run (#350 Phase 1 schema + #237 Phase 2 wire). Token cost ~30K.
---
## 2026-05-26 Run #350 (S33 Plan B G-H1 Mig 34 EmployeeProfile + Plan C BW1-BW7 test bundle)
sha=`48a99e1` VERDICT=PASS 3m38s. Push range `5400983..48a99e1` 4 commits 34 files: (1) `1bc6b70` docs drift (3 file MD) + (2) `b3444a3` 3 MEMORY agent + (3) `0605f19` Plan C +4 test file +9 [Fact]+Theory instances (NOT ignored → CI trigger) + (4) `48a99e1` Mig 34 + 17 entity/config new + 7 modified (NOT ignored → CI trigger).
**Stage results ALL PASS:** test_domain 58/58 + test_infra **62/62** (=53 baseline +9 BW: BW1 happy Cấp 1→2 / BW2 terminal DaPhatHanh + gen mã / BW3 skipToFinal F2 admin opt-in / BW4 outsider ForbiddenException / BW5 wrong ApplicableType / BW6a UNIQUE composite / BW6b UPSERT 1 row / BW6c Cascade delete / BW7 V1 fallback ConflictException) + build_be (Mig 34 compile OK +6555 LOC) + build_fe_admin + build_fe_user (unchanged — no FE in push) + deploy NSSM IIS recycle.
**Post-deploy verify ALL PASS (Stage 4 + 4.6 sqlcmd):** auth login admin 200 + 4 endpoint smoke 200/200/200/200 + health/live 200 + bundle hash 2/2 UNCHANGED (fe-admin `BUTKoqRP` + fe-user `CMHv2GS4` baseline preserved — expected NO FE) + Mig 34 prod TOP 1 = `20260526110207_AddEmployeeProfiles` MATCHES repo + **gotcha #51 INFRASTRUCTURE seed verify GOOD**: EmployeeProfiles=**33 rows** (16 demo + 14 Solutions thật + 3 admin/test = full @solutions.com.vn user reconcile) + EmployeeCodeSequences NV/2026 LastSeq=33 atomic match + sample rows NV/2026/0001-0003 EmployeeStatus=1 Active Nationality="Việt Nam" — `SeedDemoEmployeeProfilesAsync` correctly NOT gated `DemoSeed:Disabled` per gotcha #51 lesson.
Plan B Investigator pre-flight + Em main 4 decisions chốt + Implementer 17 new file Pattern 12-bis cross-module mirror PE→Hrm cookie-cutter all WORK end-to-end. **Plan C BW1-BW7 ROI:** test gate caught NOTHING this run (all PASS first try) — Pattern 12-bis mirror clean + Implementer Reviewer pre-commit gate strong. Token cost ~30K.
---
## 2026-05-26 (S33 startup health-check — em main spawn read-only verify, VERDICT=HEALTHY)
Snapshot post-S32 wrap. 0 unpushed (HEAD=`5400983`). **Last 5 Runs all SUCCESS** via Gitea API unauth (token empty OK): #235 `1e1c9a2` 3m38s + #234 `b223466` 3m52s today (S31 RAG docs+eval/*.json — triggered because `eval/**` NOT in paths-ignore current filter) + #233 `e199603` + #232 `38f1c4d` + #231 `3e92584` Plan B Contract V2 deploy chain 2026-05-22 ~3m30s avg.
S32 commits `b832f43..5400983` (4 docs+memory commits) CORRECTLY SKIPPED per gotcha #41 — all match `**/*.md`. **3 prod endpoint smoke ALL 200 OK** (api/health/live 0.23s + admin 0.29s + eoffice 0.31s; `/healthz` 404 N/A — `/health/live` canonical).
**Mig prod TOP 5 DESC** sqlcmd Windows-auth via `ssh vietreport-vps "powershell ... '.\\SQLEXPRESS' -E"` pattern (UPDATED from Discovery #5): `AddContractLevelOpinions` (Mig 33 Plan B) → `AddApprovalWorkflowToContract` (Mig 32) → `RefactorSkipToFinalToApproverLevel` (Mig 31) → `AddAllowApproverEditBudgetToLevels` (Mig 30) → `RefactorAdvancedOptionsToPerLevelAndDrafterUser` (Mig 29). Mig 33 head MATCHES Run #232 deploy baseline, NO drift.
**Cert api.solutions.com.vn notAfter `Jul 23 01:58:16 2026 GMT`** (matches HANDOFF expected ~2026-07-23, ~58 days lead, auto-renew ~2026-06-23 win-acme 30d window). **Bundle hash snapshot post-Run #235:** fe-admin=`index-BUTKoqRP.js`, fe-user=`index-CMHv2GS4.js` — baseline for future deploy compare.
**DISCOVERY #7 NEW:** path filter `paths-ignore` MISSING `eval/**` → S31 RAG eval JSON commits triggered ~3m30s deploy wastefully (no code change). Consider em main weigh adding `'eval/**'` to filter if RAG telemetry commit frequency growing. Token cost ~12K.
---
## 2026-05-26 (S32 wrap — em main proxy curate + Phase 9 stabilize done + Phase 10 deploy ahead)
Session 32 đóng clean. Em chủ trì spawn em 1 lần S32 startup verify (a505a02d84fc1fabe alive, MEMORY 27→24.2KB post curate Run #231 PARTIAL detail archived q2). **NO Run triggered S32** — 5 commits S32 cumulative tất cả docs-only CI skip per #41. 0 prod deploy event. 3 endpoint smoke (api/admin/eoffice) still 200 OK post-S29 deploy. cert api.solutions.com.vn notAfter `2026-07-23` (verified via openssl s_client) — auto-renew ~2026-06-23, NOT urgent.
**Plan G 11 module backlog DOCUMENTED migration-todos** + Plan B-Wrap test bundle BW1-BW7 spec ready. **Pending S33 deploy triggers em main spawn em:** (a) Phase 10.1 G-H1 Hồ sơ NS Run verify; (b) Plan B-Wrap test bundle post-push verify; (c) Phase 9 UAT smoke V2 contract sample workflow create flow. **Foundation entries CONFIRMED preserved:** 10-surface-point per-NV checklist + gotcha #48 SQLite tie-break + Discovery #6 INFRASTRUCTURE vs DEMO seed Stage 4.6. Token cost wrap ~3K. Tag: `[wrap, phase-9-to-phase-10, cicd]`.
---
## 2026-05-26 (S32 startup verify — no CI poll, only foundation freshness + 3 endpoint smoke health)
NO Run triggered S30-S32 (last code deploy Run #232 sha=`38f1c4d` 2026-05-22 ~3 days ago). Last push `f938bf5` S31 docs patch cicd-monitor.md stale numbers (test/mig refresh) — docs-only → skip CI per gotcha #41 path filter (expected). 0 unpushed.
**Verify state:** (a) MEMORY size **24.9KB / 221 lines** approaching 25KB threshold. (b) MCP RAG tools PRESENT — `search_memory` returns 3 results query "Run 232 Plan B Hotfix CICD SeedSampleContractWorkflowV2" rerank_score=**0.906** top (MEMORY.md self-hit) + 0.828 (gotcha #51 docs) + 0.816 (HANDOFF.md S29 final wrap) — RAG indexing healthy 2949 chunks. (c) Foundation entries CONFIRMED retained: 10-surface-point per-NV checklist + gotcha #48 SQLite tie-break + gotcha #51 NEW INFRASTRUCTURE vs DEMO seed. (d) 3 prod endpoint smoke **all 200 OK** — prod stable post-S29 deploy. Token cost spawn ~10K.
---
## 2026-05-21 (S26 Run #222-#227 cumulative — Plan AG series PE List tree view UI iteration)
Hybrid verify pattern: CICD Monitor spawn 1× cho Phase wire initial Run #222 sha=`0bf6c7e` Plan AG (~12K — bundle hash 2/2 rotate admin `C8TvDy7r→CWHIdoFo` + user `BvcWrq2z→Bg2FNeIz`, smoke 5/5 200, PE List API shape preserved 9 fields, test gate 111 unchanged, Mig 31 unchanged). Run #223-#227 polish chunks Plan AG2-AG6 em main self-verify (bundle visual check + git push success + Gitea auto-trigger 3-4min deploy).
Plan AG4 BE+FE cross-stack (DTO +4 fields DrafterUserId/DrafterName/DepartmentId/DepartmentName + 3 projection JOIN Users+Departments): dotnet test 111/111 PASS local pre-push. **Pattern saved:** CICD Monitor spawn 1× đầu Phase wire ROI tốt cho 1 dev solo iteration scenario. Polish chunks (CSS/UX/copy) cùng Plan em main self-verify thay vì re-spawn ~150K × N wasteful. 0 prod regression observed cumulative S26.

View File

@ -374,11 +374,7 @@ KHÔNG `*` / `latest`. Critical pins:
## 📅 Recent activity (last 10 FIFO)
- **2026-05-26 (S33 Plan B G-H1 Task 5 — Phase 10.1 FE 2 app HRM scaffold Case 2 cookie-cutter cross-app mirror):** Em main spec deterministic 100% ULTRA-MINIMAL scope (Phase 1 read-only, no separate DetailTabs component, inline 6-section `<details>` collapsible, no satellite CRUD). Implementer Case 2 cross-app mirror 4-place ACCEPT clean. Tổng 14 file (3 NEW page × 2 app SHA256 IDENTICAL + 4 modified file: menuKeys+Layout+App × 2). **3 NEW file SHA256 verified IDENTICAL:** `types/employee.ts` CCFC70666568 + `pages/hrm/EmployeesListPage.tsx` DC859C897C5C + `pages/hrm/EmployeeCreatePage.tsx` C796F25D01AC. Pattern 16-bis 4-place mirror cross-app reinforced **4th time cumulative** (S29 Plan CA HF1 + S29 Plan B Chunk D + S33 Task 5). Pattern 12-bis cross-module FE port PE → Hrm reinforced **4th time** (Plan B Chunk C Mig 33 + Plan B G-H1 Task 4 BE + Task 5 FE). **Verify all clean:** fe-admin build PASS (21.4s 0 TS err 1429KB bundle warn expected), fe-user build PASS (9.2s 0 TS err 1345KB bundle warn expected), dotnet build PASS (1.59s 0 warn 0 err), dotnet test PASS **120/120 baseline preserve** (58 Domain + 62 Infra). **Ambiguities encountered:** 0 — spec deterministic 100%. **Files touched:** fe-admin/src/types/employee.ts (NEW, ~283 LOC), fe-admin/src/pages/hrm/EmployeesListPage.tsx (NEW, ~417 LOC), fe-admin/src/pages/hrm/EmployeeCreatePage.tsx (NEW, ~178 LOC), fe-admin/src/lib/menuKeys.ts (+3 LOC Hrm+HrmHoSo), fe-admin/src/components/Layout.tsx (+4 LOC staticMap Hrm_HoSo), fe-admin/src/App.tsx (+5 LOC imports+routes), 6 fe-user files mirror identical (3 SHA256 + 3 edit mirror Hrm_HoSo). **Out-of-scope respected:** KHÔNG satellite CRUD form, KHÔNG inline edit Header, KHÔNG PermissionGuard wire (em main Task 6 Hrm_HoSo policy registration). KHÔNG add Bg_*/Catalog* to fe-admin menuKeys.ts (em main defer optional). **Token cost estimate:** ~25k tokens (Read 8 reference + Write 3 file + Edit 6 + 3 Bash verify). KHÔNG commit (em main commits). Tag: `[mirror-page, phase-10.1, frontend]`.
- **2026-05-26 (S32 wrap — em main proxy curate + Plan G 11 module future scope):** Session 32 đóng clean. Em chủ trì spawn em 1 lần S32 startup verify (ab23cc322b5d495c0 alive, MEMORY size FLAG 36.2KB > 25KB). **Em main proxy curate Plan A3:** archived 5 verbose entries q2 (S25 Plan AB Chunk A + S25 wrap + S26 t1 Plan AG + S27 Plan CA Chunk B + S29 Plan B Chunk D detail) → 36.2→27.5KB. Patterns 1-19 + 12-bis + 16-bis foundation **preserved untouched**. **Plan G 11 module backlog DOCUMENTED migration-todos** với 10 Plan G-* atomic sprint. **Pending tasks em main S33 spawn em Case 2 cookie-cutter mirror:** (a) **Plan G-H1 Hồ sơ NS scaffold** — BE 6 entity (EmployeeProfile main + 5 satellite WorkHistory/Education/FamilyRelation/Skill/Document) + EF Config + DbInitializer seed 30 demo profile mirror 30 users + CQRS Create/Update/GetDetail/List + 6 endpoint controller + FE 2 app types/employee.ts + EmployeesPage 3-panel + EmployeeDetailTabs (6 section); (b) **Plan B-Wrap test bundle BW1-BW7 codegen** — Case 2 cookie-cutter mirror PE WorkflowService test pattern (PurchaseEvaluationWorkflowServiceReturnModeTests.cs structure) cho ContractWorkflowServiceApproveV2Tests.cs (7 test scenario spec deterministic migration-todos D-Bis); (c) **Plan G-O2 Phòng họp BookingCalendar** — Case 2 FE 2 app FullCalendar lib new dep; (d) **Plan G-O3..G-O6 Workflow Apps** — cookie-cutter mirror PE Mig 22-26 Plan B pattern 12-bis cross-module entity scaffold cho 4 module (Proposal/LeaveRequest/OtRequest/VehicleBooking/ItTicket). **REFUSE forward:** S33+ start Phase 10.1 G-H1 entity scaffold đúng spec deterministic, KHÔNG schema design (em main solo Mig 34 design). Token cost wrap ~5K. Tag: `[wrap, phase-9-to-phase-10, frontend+backend]`.
- **2026-05-26 (S32 startup — context verify + RAG live confirm + size FLAG > 25KB):** Em chủ trì spawn em verify Session 32 context. **Verify done:** (1) MEMORY size 36.2KB (Get-Item Length=36207 bytes) — **OVER 25KB threshold ~45% bigger** → FLAG cho em main schedule dedicated curate session per Pattern curate trigger rule line 364. KHÔNG self-curate vì em chủ trì preference reserve cho em main solo judgment call §6.5 KEEP vs CUT (S27 retrospective C1-C4 task lesson). (2) Patterns saved 1-12 foundation + 12-bis NEW S29 + 13-15 + 16-bis NEW S29 + 17-19 — total **17 numbered patterns** (Pattern 16 baseline implied trong recent activity S27 chưa numbered explicit). Pattern 12-bis (cross-module entity cookie-cutter mirror PE→Contract Mig 33) **SAVED line 178-200** confirmed present. Pattern 16-bis (4-place mirror cross-app S29 Plan CA Hotfix 1) **SAVED line 165-176** confirmed present. (3) MCP RAG tools **PRESENT**`mcp__rag-unified__search_memory` + `mcp__rag-unified__cross_project_search` both visible trong tools list. Test query "Pattern 12-bis cross-module entity cookie-cutter mirror PE Contract V2" top_k=3 returned 3 results với rerank scores **0.824/0.801/0.793** — all healthy > 0.7 threshold. S31 RAG v1.3 baseline PASS confirmed live post CLI restart. **Pending tasks em main có thể gọi em lại spawn S32+:** (a) Plan B-Wrap BW1-BW7 test bundle codegen Case 2 cookie-cutter mirror PE WorkflowService test pattern (regression ApproveV2Async + UPSERT LevelOpinions test) — 7 file new test class mirror PE test bundle structure; (b) ContractWorkflowMatrixView mirror PE WorkflowMatrixView Plan AA S24 (1 page mirror cross-module — Case 2 fits Pattern 13 read-only admin Designer mirror + Pattern 14 Tailwind JIT palette + Pattern 15 HTML table rowSpan iteration helper). **Decision tree forward:** Em chủ trì gọi em với task code edit → em ACCEPT case (a)/(b) khi spec deterministic, REFUSE nếu first-time pattern. Em chủ trì confirm Layer A governance still active scope SOLUTION_ERP. Token cost spawn này ~5k (3 Read + 1 RAG query + 1 Edit + final report). KHÔNG curate — defer em main full curate session. Tag: `[verify, phase-9, infra]`.
- **Archived 3 entries (S32 startup + S32 wrap + S33 Task 5) → `archive/2026-05-q4.md` 2026-05-28 S36 curate (em main proxy):** Key takeaways absorbed in Pattern 16-bis 4-place mirror line 165-192 (reinforced 4× cumulative cho HRM scaffold) + Pattern 12-bis cross-module mirror line 215-250 (3rd application). Plan G 11 module backlog moved to `migration-todos.md` §Phase 10. RAG live confirm `mcp__rag-unified__*` 6 tools working baseline S31 PASS.
- **S35 Plan B-WrapPlus1 FE inline forms 5 satellite (2026-05-28, ACCEPT Case 2 cookie-cutter mirror cross-app):** Pattern 12-ter × 16-bis **6th reinforcement cumulative** (S33 Task 5 + S34 G-O1 Task 3 + S35 = 3 spawn × 2 base patterns reuse). Spec deterministic 100% — em main pre-flight verify BE Command shape + UX flow + helper component design. **Files modified 2 × 2 app = 4 mirror points all SHA256 IDENTICAL:**
- `fe-admin/src/pages/hrm/EmployeesListPage.tsx` 573→**1200 line** (+627 LOC, SHA256 `802d01fd1ee79925`)

View File

@ -0,0 +1,46 @@
# Implementer Archive — 2026-05-q4 (late May, S32-S33 verbose entries)
Archived 2026-05-28 S36 startup curate (em main proxy) — 3 verbose entries from S32-S33 absorbed into foundation Pattern 16-bis (S33 Task 5 reinforcement line 178-183) + Pattern 12-bis (S33 G-H1 reinforcement). KEY takeaways preserved in current S35/S34 entries.
---
## 2026-05-26 (S33 Plan B G-H1 Task 5 — Phase 10.1 FE 2 app HRM scaffold Case 2 cookie-cutter cross-app mirror)
Em main spec deterministic 100% ULTRA-MINIMAL scope (Phase 1 read-only, no separate DetailTabs component, inline 6-section `<details>` collapsible, no satellite CRUD). Implementer Case 2 cross-app mirror 4-place ACCEPT clean. Tổng 14 file (3 NEW page × 2 app SHA256 IDENTICAL + 4 modified file: menuKeys+Layout+App × 2). **3 NEW file SHA256 verified IDENTICAL:** `types/employee.ts` CCFC70666568 + `pages/hrm/EmployeesListPage.tsx` DC859C897C5C + `pages/hrm/EmployeeCreatePage.tsx` C796F25D01AC.
Pattern 16-bis 4-place mirror cross-app reinforced **4th time cumulative** (S29 Plan CA HF1 + S29 Plan B Chunk D + S33 Task 5). Pattern 12-bis cross-module FE port PE → Hrm reinforced **4th time** (Plan B Chunk C Mig 33 + Plan B G-H1 Task 4 BE + Task 5 FE).
**Verify all clean:** fe-admin build PASS (21.4s 0 TS err 1429KB bundle warn expected), fe-user build PASS (9.2s 0 TS err 1345KB bundle warn expected), dotnet build PASS (1.59s 0 warn 0 err), dotnet test PASS **120/120 baseline preserve** (58 Domain + 62 Infra). Ambiguities encountered: 0 — spec deterministic 100%.
**Files touched:** fe-admin/src/types/employee.ts (NEW ~283 LOC), EmployeesListPage.tsx (NEW ~417 LOC), EmployeeCreatePage.tsx (NEW ~178 LOC), menuKeys.ts (+3 LOC Hrm+HrmHoSo), Layout.tsx (+4 LOC staticMap Hrm_HoSo), App.tsx (+5 LOC imports+routes), 6 fe-user files mirror identical (3 SHA256 + 3 edit mirror Hrm_HoSo).
**Out-of-scope respected:** KHÔNG satellite CRUD form, KHÔNG inline edit Header, KHÔNG PermissionGuard wire (em main Task 6 Hrm_HoSo policy registration). KHÔNG add Bg_*/Catalog* to fe-admin menuKeys.ts (em main defer optional). Token cost ~25k. KHÔNG commit (em main commits). Tag: `[mirror-page, phase-10.1, frontend]`.
---
## 2026-05-26 (S32 wrap — em main proxy curate + Plan G 11 module future scope)
Session 32 đóng clean. Em chủ trì spawn em 1 lần S32 startup verify (ab23cc322b5d495c0 alive, MEMORY size FLAG 36.2KB > 25KB).
**Em main proxy curate Plan A3:** archived 5 verbose entries q2 (S25 Plan AB Chunk A + S25 wrap + S26 t1 Plan AG + S27 Plan CA Chunk B + S29 Plan B Chunk D detail) → 36.2→27.5KB. Patterns 1-19 + 12-bis + 16-bis foundation **preserved untouched**.
**Plan G 11 module backlog DOCUMENTED migration-todos** với 10 Plan G-* atomic sprint.
**Pending tasks em main S33 spawn em Case 2 cookie-cutter mirror:**
(a) **Plan G-H1 Hồ sơ NS scaffold** — BE 6 entity (EmployeeProfile main + 5 satellite WorkHistory/Education/FamilyRelation/Skill/Document) + EF Config + DbInitializer seed 30 demo profile mirror 30 users + CQRS Create/Update/GetDetail/List + 6 endpoint controller + FE 2 app types/employee.ts + EmployeesPage 3-panel + EmployeeDetailTabs (6 section);
(b) **Plan B-Wrap test bundle BW1-BW7 codegen** — Case 2 cookie-cutter mirror PE WorkflowService test pattern (PurchaseEvaluationWorkflowServiceReturnModeTests.cs structure) cho ContractWorkflowServiceApproveV2Tests.cs (7 test scenario spec deterministic migration-todos D-Bis);
(c) **Plan G-O2 Phòng họp BookingCalendar** — Case 2 FE 2 app FullCalendar lib new dep;
(d) **Plan G-O3..G-O6 Workflow Apps** — cookie-cutter mirror PE Mig 22-26 Plan B pattern 12-bis cross-module entity scaffold cho 4 module (Proposal/LeaveRequest/OtRequest/VehicleBooking/ItTicket).
**REFUSE forward:** S33+ start Phase 10.1 G-H1 entity scaffold đúng spec deterministic, KHÔNG schema design (em main solo Mig 34 design). Token cost wrap ~5K. Tag: `[wrap, phase-9-to-phase-10, frontend+backend]`.
---
## 2026-05-26 (S32 startup — context verify + RAG live confirm + size FLAG > 25KB)
Em chủ trì spawn em verify Session 32 context. **Verify done:**
(1) MEMORY size 36.2KB (Get-Item Length=36207 bytes) — **OVER 25KB threshold ~45% bigger** → FLAG cho em main schedule dedicated curate session per Pattern curate trigger rule line 364. KHÔNG self-curate vì em chủ trì preference reserve cho em main solo judgment call §6.5 KEEP vs CUT (S27 retrospective C1-C4 task lesson).
(2) Patterns saved 1-12 foundation + 12-bis NEW S29 + 13-15 + 16-bis NEW S29 + 17-19 — total **17 numbered patterns** (Pattern 16 baseline implied trong recent activity S27 chưa numbered explicit). Pattern 12-bis (cross-module entity cookie-cutter mirror PE→Contract Mig 33) **SAVED** confirmed present. Pattern 16-bis (4-place mirror cross-app S29 Plan CA Hotfix 1) **SAVED** confirmed present.
(3) MCP RAG tools **PRESENT**`mcp__rag-unified__search_memory` + `mcp__rag-unified__cross_project_search` both visible trong tools list. Test query "Pattern 12-bis cross-module entity cookie-cutter mirror PE Contract V2" top_k=3 returned 3 results với rerank scores **0.824/0.801/0.793** — all healthy > 0.7 threshold. S31 RAG v1.3 baseline PASS confirmed live post CLI restart.
Token cost spawn này ~5k (3 Read + 1 RAG query + 1 Edit + final report). KHÔNG curate — defer em main full curate session. Tag: `[verify, phase-9, infra]`.

View File

@ -129,6 +129,10 @@ State machine 5 trạng thái phiếu PE: Nháp / Đã gửi duyệt / **Trả l
## 📅 Recent activity (last 10 FIFO)
- **2026-05-28 (S36 Plan G-O2 pre-flight Phòng họp 3 task):** Em spawn ~10K. **T1 NamGroup `TblResource` + `TblBookingResource`** (`NAMGROUP.Server\Data\Entities\TblPhongHop.cs` 5-47): 2 entity LEGACY V1 reuse, KHÔNG dedicated MeetingRoom. TblResource 11 cols generic (Id long, GroupReSourceID, NameReSource, ListManager CSV NhanVienID, ListViewer CSV, Note, IsDelete int?). TblBookingResource 18 cols (ResourceID, Title, FromDate datetime giờ-phút, ToDate, ThanhPhan plain text NOT CSV, TrangThai int? -1=Rej/0=Pending/1=Approved/2=Cancelled, IsDelete int? NULL=active+1=deleted ZERO `=0` rows, Note1 admin secondary, AcceptUser/AcceptDate/RejectUser/RejectDate). **5 gotcha NamGroup**: (1) IsDelete filter `(IsDelete ?? 0) != 1` NOT `== 0`, (2) TrangThai 4-state NO Completed, (3) ThanhPhan plain text NOT CSV NV ID, (4) Note1 admin only, (5) V1 ZERO overlap protection (37 overlap pairs prod 798 rows). Repo `PhongHopRepository.cs:61-75` overlap app-level: `b.FromDate < toDate AND b.ToDate > fromDate AND TrangThai NOT IN (-1, 2)`. CSV ListManager → manager approve. **Conclusion: SOL Mig 36 CLEAN-ROOM** mirror G-H2 verdict — KHÔNG port reason: (a) TblResource mix 4 group catalog generic, (b) ThanhPhan plain text yếu cho notification, (c) ZERO overlap V1 → SOL phải DB-level SERIALIZABLE tx. **T2 FullCalendar v6 React** (https://fullcalendar.io/docs/react): `@fullcalendar/react` MIT cho core + 3 plugin daygrid/timegrid/interaction. Premium chỉ Resource Timeline + Vertical Resource (NOT cần Plan G-O2). Drag-resize event = MIT `@fullcalendar/interaction`. Bundle ~150-200KB gz (bundlephobia 403). **Alternative**: NamGroup `PhongHopPage.tsx:10-12` S50 hotfix CHỐT custom day-grid HTML NO lib install reason "saves install friction + bundle minimal" — 1 file ~600 LOC month-view custom grid 5-6 rows × 7 cols Sun-Sat. `react-big-calendar` MIT clean alternative nhưng semi-deprecated. **T3 Schema Mig 36 propose 3 entity** (KHÔNG 2): `MeetingRoom` (Id Guid, Code unique nvarchar(20), Name nvarchar(200), Capacity int, Location nvarchar(200), Equipment nvarchar(500)?, IsActive bit, IsDeleted, audit) + `MeetingBooking` (Id, RoomId FK Restrict, BookedByUserId FK Restrict, StartAt datetime2, EndAt datetime2, Title nvarchar(200), Description nvarchar(1000)?, Status enum int Confirmed=1/Cancelled=2/Completed=3, Note nvarchar(500)?, audit) + **`MeetingBookingAttendees` join** (BookingId FK Cascade, UserId FK Restrict, PK composite (BookingId, UserId), Notes nvarchar(200)?). **Attendees mode JOIN TABLE** (NOT JSON) reason: (a) notification push query indexed efficient, (b) FE picker multi-select shadcn reuse Users API, (c) audit "ai từ chối" future ready. **Overlap check** SERIALIZABLE tx + `EXISTS WHERE RoomId=@r AND Status=1 AND StartAt < @newEnd AND EndAt > @newStart AND Id != @currentId` → 409 Conflict. **Recommend index** `IX_MeetingBookings_RoomId_StartAt` composite range query. **Surprises**: (a) NamGroup s47 Plan 9.2 V1 reuse dựa 798 row prod data NOT scratch — SOL có lợi thế clean-room không legacy. (b) NamGroup community ưu tiên bundle size hơn dev velocity (custom HTML grid thay FullCalendar) — em main weigh trade-off ~150KB cost vs drag-drop UX. (c) `TblBookingResource` NO Title index — SOL must add IX. **Recommend forward**: (1) Mig 36 design 3 entity clean-room per propose; (2) FullCalendar v6 MIT fe-admin (manager view drag-drop) + custom day-grid HTML fe-user (book simple) — split UX 2 app per convention; (3) Skill `ef-core-migration` attach Implementer. Token cost ~10K.
- **2026-05-28 (S36 startup audit — 3 task readonly factual report):** Em spawn 1 lần ~12K token. **Task 1 — MEMORY size 4 sub-agent:** path actual project-level `D:\Dropbox\CONG_VIEC\SOLUTION\SOLUTION_ERP\.claude\agent-memory\{agent}\MEMORY.md` (em main provide path user-level `C:\Users\pqhuy\.claude\projects\...\agents\` KHÔNG tồn tại — em correct path). Investigator 24.7KB/157 lines borderline · Implementer **36.4KB/419 lines PRIORITY curate** · Reviewer 28.4KB/181 lines borderline · CICD **40.4KB/213 lines PRIORITY curate**. Drift +12-15KB ALL 4 agent từ S33 startup baseline (cicd 25.5→40.4, implementer 28.6→36.4, reviewer 25.9→28.4, investigator 20.2→24.7) — heavy S33+S34+S35 entries chưa archive. **Task 2 — Audit định kỳ status:** `docs/changelog/skill-audit-2026-05.md` 6.2KB manual 2026-05-04 + `skill-audit-2026-05-late.md` 9.1KB early-trigger 2026-05-22 (drift +8 gotcha 41→49). Next scheduled 2026-06-01 (CLAUDE.md:60 confirm). Today 2026-05-28 còn **4 ngày → SKIP audit lần này**. Cron `solution-erp-skill-audit-monthly` fire 9:00 AM ngày 1. **Task 3 — Plan G-* progress map 10 atomic (NOT 11 — Cấu hình + Hồ sơ NS gộp Phase 10.1):** ✅ G-H1 S33 (commit 5400983..79a8343 Run #237 PASS, 67 tables Mig 34) + ✅ G-H2 S34+S35 (commit 07b3f3b schema + 909655c BE + 021674a FE Run #244 PASS Mig 35). ⏳ 8 pending: G-O1 Danh bạ (1 endpoint nhẹ nhất) · G-O2 Phòng họp Mig 36 FullCalendar · G-O3-O6 Workflow Apps cần extend `ApplicableType` enum +5 (Mig 37 first cookie-cutter Mig 22) · G-H3 Dashboard NS · G-P1 Chấm công GPS web Mig 42. **NO DRIFT** giữa `feedback_phase10_namgroup_port.md` (4 quyết định) vs `migration-todos.md:637-792` (Phase 10 backlog). **Recommendation forward S36:** (a) Curate session PRIORITY cicd-monitor (40.4KB) + implementer (36.4KB) trước kick off Plan G-O1; (b) Reviewer 28.4KB defer S37 nếu không kịp; (c) Plan G-O1 phù hợp S36 sau curate (1 endpoint + 1 FE page). **Surprise:** Em main note "G-O1 Danh bạ S34 done" trong instruction — DRIFT thực tế. Migration-todos:696-700 G-O1 vẫn ⏳ pending. Anh main confuse với G-H1 S33 + G-H2 S34/35. Token cost ~12K.
- **2026-05-28 (S35 — Plan G-H2 Task 3+4 pre-flight HRM CRUD audit):** Em spawn 1 lần ~8K token. **Task 1 — Plan CA Chunk B precedent:** SHA `06a441c` "FE move 4 master pages 948 LOC byte-identical". 4 catalog page mirror `fe-admin/master/{Suppliers,Projects,Departments,Catalogs}Page.tsx``fe-user/`. LOC actual: Catalogs=321 / Departments=160 / Projects=214 / Suppliers=253 = **948 LOC tổng**. Pattern = single file inline list + create/edit dialog (NO split route /new). DataTable + PageHeader + PermissionGuard + 6 shadcn UI. **Task 2 — NamGroup HRM ref MISS:** Glob `*Phep* *TimeOff* *NgayLe* *Ca* *Ot*` → KHÔNG có entity dedicated. NamGroup chỉ có `TblTimeOffConfig.cs` 14 cols generic + `TblTimeOff.cs` 47 cols (request, Ngay1-10 + TypeNgay1-10 hardcoded over-engineered) + `TblDmChung.cs` 10 cols generic bucket. **SOL Mig 35 entity design MẠNH HƠN:** LeaveType có IsPaid + RequiresAttachment + DaysPerYear decimal(5,2) (NamGroup miss). Holiday composite UNIQUE Year+Date + IsRecurring (NamGroup không có). ShiftPattern WorkDays comma string + TimeOnly Start/End + BreakMinutes (NamGroup không có). OtPolicy 3-tier multiplier weekday/weekend/holiday + 3 cap day/month/year Luật LĐ VN (NamGroup không có). **Kết luận: KHÔNG cần port field từ NamGroup. SOL clean-room design mạnh hơn.** Workflow integration: NamGroup TimeOffConfig embed `ListApproval` JSON inline; SOL sẽ dùng ApprovalWorkflow V2 pattern khi G-O4 LeaveRequest land. **Task 3 — SOL Master pattern:** ProjectFeatures.cs 150 LOC + DepartmentFeatures.cs 128 LOC + CatalogsFeatures.cs **334 LOC** (4 sub-entity Units/Materials/Services/WorkItems gộp 1 file mega). Controller layout: `CatalogsController.cs` 1 controller cho 4 sub-entity. **Pattern Suppliers split** (Suppliers/Dtos/Queries/Commands subdir) = legacy heavyweight scale, KHÔNG nên mirror cho HRM. **Pattern Catalogs single-file mega** = đúng cho HRM (4 simple catalog tương đương Units/Materials/Services/WorkItems). LOC estimate G-H2 Task 4 FE: LeaveTypesPage 200 + HolidaysPage 250 (Year filter + bulk roll-over) + ShiftPatternsPage 250 (WorkDays multi-select + TimeOnly picker) + OtPoliciesPage 220 (1 STANDARD constraint UI) ≈ **920 LOC** ~ Plan CA Chunk B 948 LOC parity. **Recommendation: Option B 1 mega `HrmConfigFeatures.cs` ≈ 600-700 LOC** mirror Pattern 12-bis Catalogs. Reason: (1) 4 simple catalog cùng module HRM lifecycle parallel. (2) Pattern 12-bis cross-module entity cookie-cutter proven 2× (Plan CA Catalogs + Plan B Contract V2). (3) 1 controller `HrmConfigsController.cs` route `/api/hrm/configs/{kind}` mirror `/api/catalogs/{kind}`. (4) Constraints differ (Holiday composite + OtPolicy 1 STANDARD active) handle qua per-handler validation. **Surprise:** EF Configuration files riêng `LeaveTypeConfiguration.cs` + 3 file khác EXIST — KHÔNG cần mirror Application Features file split (Config riêng OK + Features mega OK). Cross-stack KHÔNG conflict. Token cost ~8K.
- **2026-05-26 (S33 t1 — Plan G-H1 pre-flight NamGroup TblNhanVien* audit):** Em spawn task A+B+C audit `NAMGROUP.Server\Data\Entities\` ~10K token. **Inventory 10 TblNhanVien* bảng** (NOT 8 anh main estimate): 1 main `TblNhanVien` (105 cols!) + 9 satellite (QtCongTac/QtDaoTao/QuanHeThanNhan/KyNangViTinh/KyNangNgoaiNgu/KyNangKhac/QtHopDong/QtCongTacIn/QtPhulucHd). PK `long Id` (NOT Guid) — port phải convert. Soft delete `IsDelete int?` OR `bool?` (legacy inconsistent). Audit fields KHÔNG có ở satellite (chỉ `QtCongTacIn` có NhanVienTaoId/SuaId/NgayTao/NgaySua) — port phải fill từ BaseEntity. **Main `TblNhanVien` 105 cols PERSONAL HEAVY:** identity (CMND/HoChieu/MaSoThue/SoBhxh) + diachi (6 FK Tinh/Quan/Phuong x HKTT/TamTru + freetext fallback) + bank (SoTK/NganHang/ChiNhanh) + physical (ChieuCao/CanNang/NhomMau) + salary (LuongTN/LuongCB/PhepTrongNam/PhepTon/NghiBu/PhepThamNien) + BHXH (NgayThamGia/NoiDkkCb) + political (IsDangVien/IsHcmDoan/IsCongDoan + 3 Ngay*) + theme cols (BgmenuColor/MenuColor — SKIP UX-only) + 4 contact ng liên hệ + 14 FK catalog (DanToc/TonGiao/TinhTrangHonNhan/QuocTich/GioiTinh/TrinhDo/...). **Drift discovered s49 Plan C** 8 FK DiaChi cascade ADDED Sep 2025 but `ZERO populated 1675 NV` — entity drift expose. **Tip:** SOL Mig 34 nên design FK DiaChi NULLABLE + freetext fallback nvarchar(500) cùng tồn tại từ ngày đầu. **Satellite simple:** QtCongTac (12 cols work history external), QtDaoTao (16 cols + 4 FK catalog), QuanHeThanNhan (8 cols + FK), KyNangViTinh (3 cols MINIMAL — chỉ TenPhanMem string!), KyNangNgoaiNgu (4 cols + FK NgoaiNgu), KyNangKhac (4 cols freetext). **Satellite contract HEAVY:** QtHopDong (28 cols HĐLĐ — defer Plan H2), QtCongTacIn (16 cols internal position change — defer), QtPhulucHd (10 cols phụ lục HĐ — defer). **DbInitializer GLOB NO MATCH** — NamGroup KHÔNG seed demo data via DbInitializer pattern. **SOL User existing đã có:** FullName + DepartmentId + Position + PositionLevel + Email + IsActive. Skip 5 duplicate fields. **Patterns proven NEW:** (a) **Skip-list aggressive cookie-cutter audit** — Mig 34 chỉ port 5 satellite defer 4. (b) **FK + freetext fallback dual-write pattern** từ Plan C drift lesson. (c) **MaNhanVien `NV/YYYY/NNNN` mirror PE CodeGen** atomic Serializable. (d) **Polymorphic Skill table** — gộp 3 KyNang* thành 1 với Kind enum giảm 2 bảng. (e) **30 demo seed pattern reuse** mirror SOL DbInitializer existing 30 user 1-1 link User.Id. **Surprise:** Theme cols `BgmenuColor/MenuColor` ở entity hồ sơ NS! NamGroup mix UX preference với business data — SOL SKIP, dùng UserPreferences riêng. Token cost ~10K.

View File

@ -674,29 +674,38 @@ Cron task `solution-erp-skill-audit-monthly` fire 9:00 AM ngày 1 mỗi tháng.
**Phase 1.5 backlog (defer S34+):** Per-action policy Hrm_HoSo_View/Create/Edit/Delete + bool partial update + Satellite CRUD endpoint + Test bundle Plan B Phase 2 + UAT non-admin smoke + fe-admin menuKeys sync Bg_*/Catalog*.
#### Plan G-H2 — Cấu hình chung HRM
#### Plan G-H2 — Cấu hình chung HRM ✅ FULL DEPLOYED PROD (S34 schema + S35 BE CRUD + FE Admin)
- [ ] 👤 Chủ trì Solo Mig 35 `AddHrmConfigs` — LeaveTypes + Holidays + ShiftPatterns + OtPolicy lookup tables
- [ ] 🟦 Investigator audit NamGroup demo seed (LeaveTypes/Holidays/Shifts/OtPolicy) — reference cho seed sample data
- [ ] 🟨 Implementer Case 2 mirror SOL Catalogs pattern (Plan CA Chunk B) BE CQRS CRUD 4 catalog
- [ ] 🟨 Implementer Case 2 mirror admin Catalogs FE Admin 4 catalog page (list/create/edit dialog inline)
- [ ] 👤 Chủ trì Solo Permission menu `Hrm_Config*` 4 leaf + admin role assign
- [x] 👤 Chủ trì Solo Mig 35 `AddHrmConfigs` — LeaveTypes + Holidays + ShiftPatterns + OtPolicy lookup tables (S34 commit `07b3f3b`)
- [x] 🟦 Investigator audit NamGroup demo seed **MISS verdict** SOL clean-room mạnh hơn NamGroup, KHÔNG cần port (S35 `a42bd882c367f6e47`)
- [x] 🟨 Implementer Case 2 BE CQRS CRUD 4 catalog mega `HrmConfigFeatures.cs` 439 LOC + Controller 137 LOC = 16 endpoint (S35 commit `909655c` Run #243 PASS)
- [x] 🟨 Implementer Case 2 FE Admin `HrmConfigsPage.tsx` declarative `KIND_CONFIG` Record × 2 app SHA256 IDENTICAL + types/hrm-config.ts + Layout staticMap (S35 commit `021674a` Run #244 PASS)
- [x] 👤 Chủ trì Solo Permission menu `Hrm_Config*` 5 row (1 root + 4 leaf Order=2) seeded prod (S34 commit `07b3f3b`)
**Pattern Smart Friend Implementer 2 catch S35 G-H2:**
1. MaxLength validator vs EF config mismatch → EF source-of-truth aligned (Code 50, Name 200, Description 500)
2. HRM entities NO HasQueryFilter → explicit `.Where(!IsDeleted)` 8 site
**Pattern Smart Friend Implementer 1 catch S35 FE Admin:**
3. Em main spec gap Layout staticMap miss → Pattern 16-bis 4-place enforced (gotcha #50 silent sidebar prevention)
**NEW Pattern Declarative KIND_CONFIG Record** documented memory user-level `feedback_declarative_kind_config_pattern.md` — reusable cross-module single-page multi-kind CRUD.
### Phase 10.2 — Office Core standalone (KHÔNG cần workflow)
#### Plan G-O1 — Danh bạ nội bộ
#### Plan G-O1 — Danh bạ nội bộ ✅ DONE S34 (commit `ea440da` Run #238 PASS)
- [ ] 👤 Chủ trì Solo BE 1 endpoint `GET /api/directory` — filter dept/position/search name+email+phone (reuse Users + EmployeeProfiles + Departments)
- [ ] 🟨 Implementer Case 2 cookie-cutter FE 2 app InternalDirectoryPage (card grid avatar + dept + extension + email + mobile click-to-call)
- [ ] 👤 Chủ trì Solo Permission `Off_DanhBa` 1 leaf
- [x] 👤 Chủ trì Solo BE 1 endpoint `GET /api/directory` — filter dept/position/search name+email+phone (reuse Users + EmployeeProfiles + Departments)
- [x] 🟨 Implementer Case 2 cookie-cutter FE 2 app InternalDirectoryPage (card grid avatar + dept + extension + email + mobile click-to-call) — SHA256 IDENTICAL × 2 app
- [x] 👤 Chủ trì Solo Permission `Off_DanhBa` 1 leaf + parent `Off` (Order=29)
#### Plan G-O2 — Phòng họp (booking calendar standalone)
#### Plan G-O2 — Phòng họp (booking calendar standalone) ✅ DONE S36
- [ ] 👤 Chủ trì Solo Mig 36 `AddMeetingRooms` — MeetingRooms + MeetingBookings (RoomId/UserId/StartAt/EndAt/Title/Attendees[]/Status enum)
- [ ] 🟨 Implementer Case 2 BE CQRS Room CRUD + Booking Create/Cancel + GetCalendar + check conflict (SERIALIZABLE transaction race-safe)
- [ ] 🟨 Implementer Case 2 FE 2 app — Admin Rooms CRUD + User BookingCalendar (FullCalendar lib new dep — check license + bundle size impact)
- [ ] 👤 Chủ trì Solo Notification push attendees when booking created (NotificationPushInterceptor reuse)
- [ ] 👤 Chủ trì Solo Permission `Off_PhongHop*` 3 leaf
- [x] 👤 Chủ trì Solo Mig 36 `AddMeetingRooms`3 entity (MeetingRoom catalog + MeetingBooking header + MeetingBookingAttendees N-to-N join — clean-room SOL, NOT JSON per Investigator verdict)
- [x] 🟨 Implementer Case 2 BE CQRS Room CRUD + Booking Create/Cancel + GetCalendar + check conflict (SERIALIZABLE transaction + EXISTS query overlap detect race-safe) — 584 LOC MeetingFeatures + 2 Controller + Application.csproj +Relational package (em main fix gotcha #53 4th occurrence Implementer truncated mid-diagnose)
- [x] 🟨 Implementer Case 2 FE 2 app — MeetingCalendarPage (custom HTML 7-day grid 8h-20h slot, NO FullCalendar dep save ~80 KB bundle per Investigator verdict alternative) + MeetingRoomsPage (admin catalog CRUD) — SHA256 IDENTICAL × 2 app 3 file pair
- [ ] 👤 Chủ trì Solo Notification push attendees when booking created (DEFER — NotificationPushInterceptor reuse khi UAT confirm need)
- [x] 👤 Chủ trì Solo Permission `Off_PhongHop_View/Manage/Book` 3 leaf + sub-group `Off_PhongHop` Order=2 under Off root + 4 sample MeetingRoom seed (PH-A/PH-B/PHG-501/ONL-1)
### Phase 10.3 — Workflow Apps (extend ApprovalWorkflow V2 enum +5 values)