- Session log MOI 2026-06-11-S59-wipe-tree-pmh-uat-batch.md (wipe testing data + tree 4 tang + 71 ma PMH + 6 vong UAT realtime, bundle FINAL B1DtNT9C/D6uF3Mln Run #282). - STATUS/HANDOFF flush S59 (header + table + In Progress + Recently Done + bundle line). - gotchas.md +2: #61 sqlcmd -f 65001 (console mojibake vs data-hong-that) + #62 rename natural-key DB-truoc-code-sau (seed per-code idempotent). CLAUDE.md root cite 62. - Agent-memory 5 file: cicd x9 run entries + UTC-annotate #275 + bundle status-line final, inv-codebase recon S59 + curate S51->archive, H1 x2 + H2 x2 closeout entries. - H2 GATE PASS 5/5 (0 miss, 0 on-behalf can append) + H1 ALL-4-FRESH (cross-count verified: gotcha 62 x3 nguon, bundle 4-source). RAG: 2 chunk S59 stored, rerank 0.875. - Chore monthly 07-01: curate cicd L1 ~56KB + inv 32.9KB + STATUS/HANDOFF re-tier (uu tien).
5.8 KiB
Archive 2026-06 — investigator-codebase FIFO overflow
Moved from MEMORY.md L1 (S57bis curate 2026-06-11). Verbatim.
-
2026-06-08 (S50 P11-C Vehicle+Driver — HrmConfigs add-kind pattern VERIFIED on-disk, RAG down): ⭐ HrmConfigs KHÔNG có "kind enum/registry" backend — 4 entity RIÊNG (LeaveType/Holiday/ShiftPattern/OtPolicy), NOT discriminated table. "kind" chỉ FE:
HrmConfigKindunionfe-admin/src/types/hrm-config.ts:4+ route param. Add 1 kind = mirror FULL entity stack 11 chỗ: BE (1) DomainHrm/{X}.csAuditableEntity soft-delete (2)Configurations/{X}Configuration.cs.ToTable+.HasIndex(Code).IsUnique()(3)ApplicationDbContext.cs:95-98DbSet (4)IApplicationDbContext.cs:102-105DbSet (5)HrmConfigFeatures.cs+Region N (DTO+List/Create/Update/Delete handler+validator, mega 4-region :30/125/222/328) (6)HrmConfigsController.cs+4 route hardcode[HttpGet/Post/Put/Delete("{kind}")](Post/Put/Del[Authorize(Roles="Admin")], Get chỉ[Authorize]) (7)DbInitializer.cs:2329 SeedHrmConfigsAsync+if-block + skip-guard :2331 phải +&& OtPoliciesNew.AnyAsync()(8)MenuKeys.cs:88-92+const +:149 All[](Admin auto-grantSeedAdminPermissionsAsyncloop idempotent). FE (9)HrmConfigsPage.tsx:45 KIND_CONFIG+entry +:114 KINDS[]+:379 renderCellsbranch +:166 smart-defaults+ types/hrm-config.ts DTO (10)App.tsx:90route/hrm/configs/:kindSẴN catch-all → KHÔNG cần sửa, chỉ +menuKeys (11)menuKeys.ts:38-42+Layout.tsx:60-63 staticMap. gotcha #57 CONFIRMED còn trần:LeaveTypeConfiguration.cs:19+ShiftPatternConfiguration.cs:19+OtPolicyConfiguration.cs:22.IsUnique()CHƯA.HasFilter("[IsDeleted]=0")(chỉHolidayConfiguration.cs:18đã fix Mig 43). → Vehicle/Driver Code UNIQUE PHẢI add filter ngay từ đầu. Mig 44 BẮT BUỘC CREATE TABLE (mỗi kind = bảng riêng, NOT discriminated → +2 bảng Vehicles+Drivers, không phải seed-only). VehicleBooking (Office/VehicleBooking.cs:13-19) pure free-textVehicleLicense/VehicleName/DriverNamestring, NOVehicleId/DriverIdFK (grep empty) → P11-C catalog-only, FK link defer Mig sau. Latest Mig=43FilterHolidayUniqueIndexByIsDeleted(20260601064128), next=44. Tag[p11-c, hrmconfig-add-kind, gotcha57, on-disk-verify]. -
2026-06-07 (S50 wave
h2-verify— B6 guardrail audit, read-only) [em main scribe from findings + H2 harvest]: Verified B6 wave-isolation 3/3 PASS. B6 = TWO complementary rules: (a) transientwave-*/+agent-teams/gitignored (.gitignore:93-94) → audit-noise=0; (b) canonicalagent-memory/**/MEMORY.mdTRACKED → rogue sub-write surfaces ingit status.git check-ignore -v= ground-truth verifier BOTH directions (matched rule:line for ignored; empty for tracked). ⚠️ Ordering gotcha: wave/team patterns MUST sit AFTER!.claude/**(.gitignore:82-83) to win via last-match (:91documents intent) — else!.claude/**un-ignores everything. All 10 MEMORY.md tracked (roster 8→10). Surprise (cross-cutting, both wave subs): Bash tool =/usr/bin/bashNOT PowerShell despite env=PowerShell →Get-ChildItem/Select-String/Test-Pathfail (exit 2/127); read-only Bash-only subs MUST use POSIX (git ls-files/grep/ls). Tag [wave-h2, b6-isolation, posix-not-pwsh]. -
2026-06-08 (S51 gotcha #57 EXTENSION reachability audit — 6 candidate, RAG down, on-disk only): ⭐ Bug class = soft-delete + bare
.IsUnique()on Code → recreate-after-delete throws DbUpdateException 500. Verdict 6 cand: FIX 3 (Master) Department/Supplier/Project (Department/Supplier/ProjectConfiguration.cs:18/24/19bare unique). ALL = AuditableEntity + GLOBALHasQueryFilter(!IsDeleted)+ Delete via.Remove()→AuditingInterceptor.cs(State Deleted→Modified, IsDeleted=true) + CreateAnyAsync(x=>x.Code==req.Code)NO!IsDeletedBUT global filter auto-hides soft-deleted → check passes → unfiltered index 500. CONFIRMED-reachable (DepartmentFeatures.cs:76+125,ProjectFeatures.cs:87+147,CreateSupplierCommand.cs:45+DeleteSupplierCommand.cs:20). SKIP 3: (a) ContractClause (ContractClauseConfiguration.cs:18) — NO Create/Update/Delete handler ANYWHERE (onlyIApplicationDbContext.cs:32DbSet; FormsController = templates only) → not CRUD-reachable. (b) MeetingRoom (MeetingRoomConfiguration.cs:20) — Delete setsIsActive=falseNOT IsDeleted (MeetingFeatures.cs:178, comment :175 "FK Restrict → NOT soft delete") → index never gets soft-deleted row; Create also checks&& !IsDeleted:113. (c) EmployeeProfile (EmployeeProfileConfiguration.cs:24/26EmployeeCode+UserId) — Delete soft (EmployeeFeatures.cs:437) BUT Create BLOCKS reuse by design: UserId checkAsNoTracking().FirstOrDefault(UserId==)(no HRM global filter) sees soft-deleted → throws ConflictException "Cần khôi phục" :160-163; EmployeeCode auto-gen atomic (never user-supplied/reused) → no collision. Completeness (grep ALL.IsUnique()): beyond 3 Master + 6 HRM-fixed (LeaveType/Holiday/Shift/OtPolicy/Vehicle/Driver all.HasFilter([IsDeleted]=0)), every OTHER bare-unique is either composite junction (Permission RoleId+MenuKey, *LevelOpinion, MeetingBookingAttendee, LeaveBalance, Attendance UserId+Date), nullable-code already filtered ([Ma*] IS NOT NULL: Contract/PE/Proposal/Budget/WorkflowApps), or no-soft-delete (WorkflowDefinition/ApprovalWorkflow Code+Version, ContractTemplate FormCode, WorkflowTypeAssignment, DepartmentApprovals). Mig 46 = exactly 3 indexes (Departments/Suppliers/Projects Code). Surprise: Master GLOBAL query filter MAKES the bug (auto-hides soft-deleted from check) — opposite of HRM where bug needs manual!IsDeleted; either way unfiltered index = 500. Tag[gotcha57-ext, reachability-audit, master-global-filter, s51].