[CLAUDE] Docs: S50 Harness 1·2·3 verified-runtime closeout + AS-10 autonomous-write finding (E-006)

- Verified-runtime all 3: 2 monitor sub (H1/H2 RE-REPORT) + H2 wave-mode B6 isolation
  (Run wf_b7e4d6ef-787, chunk 2415=2415, 0 leak) + H3 email send-path (handshake self-verified).
- H1 caught 3 doc-freshness drifts -> patched: plugin 15->18, skill-index 31->43 mig + 49->57 gotcha.
- gotcha #57 exact coords confirmed: LeaveTypeConfiguration.cs:19 + ShiftPatternConfiguration.cs:19.
- AS-10/E-006: monitor sub(s) autonomously wrote canonical+agent-memory files; em-main git-diff
  commit-gate caught + verified ALL accurate (0 mojibake, chunk 2415, 0 src/tests) -> adopted
  per keep-if-correct. Process gap flagged for monitor tool-grant review.
- Test 181 PASS unchanged (0 .cs). CI-skip (all .md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-08 00:25:00 +07:00
parent 31629a196c
commit f8179c5fbd
15 changed files with 115 additions and 22 deletions

View File

@ -58,6 +58,7 @@ Test theo CODE (single source truth), document mismatch header comment + report.
- **2026-05-30 (S42 P11-A Wave4):** +11 test `tests/.../Application/WorkflowAppApproveV2Tests.cs` **141 PASS** (Infra 7283). LeaveRequest 8 case full (Submit happy/guard×2, Approve advance/terminal/UPSERT-invariant/forbidden/empty-comment-placeholder, RejectTuChoi, ReturnTraLai+RejectedFromStatus) + OtRequest smoke (submitapprove single-levelDaDuyet). **No prod bug** LeaveOt ApproveV2 wire correct, all PASS first run. **NEW Pattern:** WorkflowApps handlers = CQRS MediatR (KHÔNG service) instantiate handler trực tiếp `new ApproveLeaveRequestHandler(db, AsUser(u), clock).Handle(cmd,ct)`, chỉ 3 dep (IApplicationDbContext + TestCurrentUser + FixedDateTime) nhẹ hơn 6-dep Contract service. MaDonTu format "DT/LR/2026/001". Gap #4 (Workflow Apps) PARTIAL done Travel/Vehicle mirror pending. Lesson: CWD drift (fe-user) ghi MEMORY nhầm path, em main relocate. Verify CWD root trước Write memory.
- **2026-05-30 (S43 P11-B Wave3 LeaveBalance):** +8 test `tests/.../Application/LeaveBalanceTests.cs` **152 PASS** (Infra 8694). Deduction hook (ApproveLeaveRequestHandler terminal) full: deduct single-level (create row from DaysPerYear), only-at-terminal multi-level (advance no-deduct + 1× terminal), accumulate UPSERT (5+2=7 no new row), negative allowed (Used20>Entitled12 → Remaining8 no throw), Reject+Return no-deduct (split 5a/5b), GetMyLeaveBalances lazy synth (2 active type filter inactive), AdjustLeaveBalance upsert. **⚠️ FOUND + FIXED 2 pre-existing RED** in S42 template (`Approve_LastLevel_TransitionsToDaDuyet` + `Approve_EmptyComment_StoresPlaceholder`): Wave 1 deduction hook (uncommitted, prod) làm terminal insert LeaveBalance FK→LeaveTypes Restrict FAIL vì BuildLeave dùng `LeaveTypeId=Guid.NewGuid()`. **NOT prod bug** (prod đơn luôn pin LeaveType thật) — fix tại test: BuildLeave +optional leaveTypeId, seed LeaveType ở 2 test đó. Baseline thật trước S43 = 142-pass/2-RED (KHÔNG phải 144-green). REPORTED em main.
- **2026-06-01 (S45 HRM coverage gaps + Holiday drift) [em main proxy]:** +27 test → **181 PASS** (Infra 96→123). 3 file: HrmConfigHolidayTests (7 — composite UNIQUE Create/Update, ⭐self-update giữ key đổi Name no-false-positive, soft-delete exclusion) + EmployeeSatelliteTests (10 — 5× FK-invariant parent `AnyAsync(!IsDeleted)` guard + soft-delete + cascade-non-behavior Case5 + EF model `DeleteBehavior.Cascade` config assertion) + AuthorizePolicyRegressionTests extend (10 — HrmConfigs bare-`[Authorize]`+writes `Roles=Admin`; Employees class-`Policy=Hrm_HoSo.Read`+per-action). **FOUND drift** (test theo CODE = single source): Holiday DB UNIQUE (Year,Date) unfiltered vs handler `!IsDeleted` → recreate-on-soft-deleted-slot `DbUpdateException(500)`. REPORTED → em main fixed Mig 43 `.HasFilter("[IsDeleted]=0")` (Case 7 flipped assert SUCCESS). New pattern: EF model-metadata assertion `db.Model.FindEntityType(typeof(X)).GetForeignKeys()...DeleteBehavior` lock schema intent. ⚠️ gotcha #57 backlog: LeaveType.Code + ShiftPattern.Code vẫn unfiltered.
- **2026-06-07 (S50 wave `h2-verify` — test-structure analysis, write-direct B4) [em main harvest from wave sub-MD]:** No new test (plumbing test). CONFIRMED **181 split = 58 Domain** (3 files) **+ 123 Infra** (19 test + 4 infra Common); raw attrs 48+121=169 → 181 via `[Theory]/[InlineData]` expand (note: corrects older "58+72" → now 58+123 post-S45). **gotcha #57 exact coords (test-before when fixed):** bug OPEN @ `LeaveTypeConfiguration.cs:19` + `ShiftPatternConfiguration.cs:19` (bare `.IsUnique()`, no filter) vs fixed `HolidayConfiguration.cs:18 .HasFilter("[IsDeleted] = 0")`. **Template = `HrmConfigHolidayTests.cs:180-197` (Case 7 filtered-unique proof)** — mirror: seed soft-deleted row in slot → Create same slot succeeds → 3 asserts (id NotBeEmpty + CountAsync(active)==1 + CountAsync(all)==2). SQLite honors filtered-unique. Test home = `tests/.../Application/`. Tag [wave-h2, gotcha-57-coords, plumbing].
---