All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m25s
Documentation deliverables:
- docs/STATUS.md Recently Done newest entry S24 t1 (gop 3 commit + multi-agent ROI table + pattern reinforced 4 lessons)
- docs/HANDOFF.md "Last updated S24 t1" prepend on top (cumulative carry S23 chốt cuối)
- docs/changelog/sessions/2026-05-15-s24-turn1-plan-aa-workflow-matrix.md NEW ~9KB
- Q&A 2 lượt chốt spec (Permission strategy + Matrix layout)
- Pre-A Investigator findings 5Q + 3 surprises critical
- Chunk A BE+Layout breakdown (MenuKeys + DbInitializer INSERT-OR-UPDATE-Order
+ Handler filter + Controller pass-through + sidebar widen + revert Plan U truncate)
- Chunk B FE matrix page + types + App.tsx route
- Chunk C Reviewer cumulative verdict (PASS 0 blocker)
- Stats trước-sau + Multi-agent ROI table (~150K total ~25% solo equiv)
- 4 pattern reinforced cross-project reusable
- Pending S24+ checklist (7 items)
Agent MEMORY drift (auto-updated by agents + Investigator manual touch):
- .claude/agent-memory/investigator/MEMORY.md +1 FIFO entry S24 Pre-A audit
- .claude/agent-memory/implementer/MEMORY.md +1 FIFO entry S24 Chunk B PASS
- .claude/agent-memory/reviewer/MEMORY.md +1 FIFO entry S24 cumulative verify PASS
Stats S24 t1 chốt:
- 31 mig (no Mig mới)
- 59 tables
- ~146 endpoints (+1 GET filter param)
- 35 FE pages (+1 WorkflowMatrixViewPage)
- 111 test (unchanged UAT mode)
- 47 gotcha
- 21 memory user-level
- 6 skills
- 4 sub-agents (3 spawn S24 t1)
- 3 commits Plan AA push remote: ee776d5 (A) + c667802 (B) + this (C)
Pending: Bro UAT verify deploy + CICD Monitor spawn Run #210+ post-deploy.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 KiB
24 KiB
Reviewer Agent — Persistent Memory
Persistent diary cross-session. Auto-injected first 200 lines / 25KB at spawn. Update BEFORE every stop. Curate when > 25KB.
🎯 Role baseline
Adversarial pre-commit reviewer for SOLUTION_ERP. Read-only verification + live curl on prod UAT environment (*.solutions.com.vn). Tools: Read, Grep, Glob, Bash (curl + git diff + sqlcmd read). Output: PASS/FAIL verdict + concrete issues file:line.
🚨 Recurring SOLUTION_ERP bug patterns (catch with priority)
Gotcha #44 — Silent 403 class-level Authorize quá strict (S18 lesson)
- Symptom: Drafter dropdown V2 workflow empty silent (no error toast)
- Root:
[Authorize(Policy = "Workflows.Read")]class-level → non-admin 403, TanStack Query catch silent → UI empty - Verify: grep
\[Authorize\(Policy = .*\)\]class-level vs action-level + curl với non-admin token expect 200 - Fix pattern: class-level
[Authorize]only (any authenticated). POST/PUT/DELETE giữ[Authorize(Policy = "X.Create")]admin-only
Gotcha #43 — Step.Order ≠ index 0-based
- Symptom: EF query
Where(s => s.Order == i)returns wrong row - Verify: grep
step.Orderarithmetic — array index 0-based vs Order field 1-based - Fix pattern: precompute candidates EF query → in-memory
OrderBy(s => s.Order).ToList()→ array index access
Gotcha #42 — Dual schema workflow V1 vs V2 — Service phải branch
- Symptom: PE submit failed do Service không biết V1 hay V2 schema
- Verify: grep
evaluation.ApprovalWorkflowId is Guid awId— phải branch theo pin field - Fix pattern:
if (evaluation.ApprovalWorkflowId is Guid awId) ApproveV2Async(...) else ApproveV1LegacyAsync(...)
Wire BE claim recurring bug pattern
- Symptom: claim wire CRUD nhưng grep diff finds
// Mock/alert(...)/ no POST/PUT/DELETE call - Verify: grep diff mock markers + live curl POST/PUT/DELETE expect 2XX
- Severity: CRITICAL — block commit
Gotcha #17 — EF migration 3-file rule
- Symptom: commit migration nhưng thiếu
.Designer.cshoặcApplicationDbContextModelSnapshot.cs→ next migration fail - Verify:
git diff --name-only | grep Migrations/expect 3 files (target.cs + target.Designer.cs + Snapshot.cs)
Gotcha #47 — .claude/agent-memory/** NOT in paths-ignore filter (S22 discovery, PENDING bro decide)
- Symptom: MEMORY.md drift patch commit (end-of-session flush) triggers full CI deploy ~3.5min waste
- Verify: check
.gitea/workflows/deploy.ymlpaths-ignore— currently['docs/**', '**/*.md', '.claude/skills/**']MISSING.claude/agent-memory/** - Discovery: S21 CICD Monitor Run #188 verify chốt initial — confirmed via path filter audit
- Fix recommended: add
.claude/agent-memory/**vào paths-ignore (em main KHÔNG tự edit — flag bro decide; pending add todocs/gotchas.md47th entry) - Severity: minor (CI waste only, no functional impact)
📋 5-category checklist (apply EVERY review)
Category 1: Wire BE / feature claim verify
- Grep mock markers in diff (
// Mock,alert(,setEditing(null) // close UI,TODO.*wire) - Grep actual API call:
await api\.(post|put|delete|patch)\(trong FE diff - Live curl POST/PUT/DELETE/PATCH if deploy claim (
https://api.solutions.com.vn/...) - Status code matrix expected vs actual
Category 2: Schema integrity (44 active gotchas)
- Reference
docs/gotchas.md+ skilldependency-audit-erp - Check 3-file rule Mig
- Check column types vs entity definition (Mig 27 lesson:
IsVisible bit NOT NULL DEFAULT 1+DisplayLabel nvarchar(200) NULL)
Category 3: Security
[Authorize]class-level on ALL new controllers- Per-action
[Authorize(Policy = "...")]cho admin-scoped (gotcha #44 lesson) - Permission guard wrap new admin pages (FE)
- Route permission map populate (
menuKeys.tsmirror BEMenuKeys.cs+All[]) - Input validation FluentValidation Validator class
- SQL parameterized (EF Core default OK) + XSS escape
Category 4: Code quality
dotnet build SolutionErp.slnxclean 0 errnpm run build× fe-admin + fe-user clean (TS6 strict)- Tests baseline 81 PASS (Phase 9 UAT exception OK)
- No
--no-verifybypass (forbidden absolute) - Anti-fiddle audit (scope drift > 20% LOC outside spec = FAIL)
- Mirror 2 FE app khi feature FE (rule §3.9)
Category 5: Test coverage
- New helper static → unit test (xUnit)
- New Repository method → repo test
- New endpoint API → integration test (WebApplicationFactory)
- Bug recurring → regression test TDD-style (test BEFORE fix)
- Phase 9 UAT exception: test-after default OK theo memory
feedback_uat_skip_verify - Test count baseline 81 → tăng khi feature added theo §7
⚠️ Anti-patterns observed (DO NOT)
- ❌ Recommend code edits — only describe issue + acceptance criteria
- ❌ Skip live curl verify if deploy claim — recurring risk
- ❌ Accept "wire" claim without grep proof
- ❌ Defer to em main authority — escalate disagreement explicitly
- ❌ Skip MEMORY.md update với anti-patterns observed
- ❌ Lower bar to match em main quality — Smart Friend anti-pattern Cognition
🛡️ Smart Friend anti-pattern guard
Per Cognition documented research:
- NEVER lower bar to match em main's apparent quality
- If em main code fine → say PASS
- If em main code has issues → FAIL with specifics regardless social pressure
- "Quality ceiling was set by the primary, not the escalation." — Your value = raise quality through catch
🧠 SOLUTION_ERP review essentials
- Tests baseline: 104/104 PASS (58 Domain + 46 Infra — +20 từ 84 S21: 5 regression gotcha #44 Authorize class-level + 7 ReturnMode + 7 Guard EnsureCanRejectV2Async + 1 V2 actor scope reject). Must increase nếu feature added per §7; UAT iteration exception per memory
feedback_uat_skip_verify(Plan C test-after bundle defer) - Gotchas: 46 active (
docs/gotchas.mdreference) — +#45 PE button TraLai payload mismatch + +#46 Gitea API path/cache stale (S21 t3-t4). +#47 paths-ignore agent-memory gap (S22 PENDING bro confirm add to docs) - Migrations: 30 latest
AddAllowApproverEditBudgetToLevels(S22+5 — per-slot F4 flag admin opt-in cho Approver scope edit budget ChoDuyet branch). Mig 29 prevRefactorAdvancedOptionsToPerLevelAndDrafterUser(S21 t5 per-NV split) - Per-NV Allow scope split* (Mig 29 + Mig 30) — F1+F3 5 flag + F4
AllowApproverEditBudget(S22) onApprovalWorkflowLevels(per Approver slot), F2 1 flag onUsers.AllowDrafterSkipToFinal(per Drafter). DTO:currentLevelOptions+drafterAllowSkipToFinalthay vìworkflowOptions - Endpoints: ~146 (+3 S22: allow-skip-final / budget-adjust / attachments/view)
- Identity password policy ≥12 chars (S22+2 enforced by ASP.NET Identity stack — reject
User@12345611 chars). Existing HANDOFF mention "User@123456" pattern S4 outdated, current test creds Admin@123456 + TestUser@123456 OK - Live deploys (Prod UAT): https://api.solutions.com.vn · https://admin.solutions.com.vn · https://eoffice.solutions.com.vn
- Bearer token test:
- Admin:
admin@solutions.com.vn / Admin@123456(full quyền) - UAT user:
nv.test@solutions.com.vn / TestUser@123456(Drafter Phòng CCM — verify non-admin access patterns)
- Admin:
- Users active: 33 (rename role-based pattern act.nv / act.pp / act.tp etc.)
- Conventions:
docs/rules.md(§3.9 mirror 2 FE, §5.2 commit format, §6.5 docs KEEP narrative, §7 test timing, §2.8 package pinning) - 6 skills:
contract-workflow·permission-matrix·form-engine·ef-core-migration·dependency-audit-erp·iis-deploy-runbook
🔑 Critical pin verify (gotcha #1-4)
- MediatR
12.4.1(14 fail DI) - Swashbuckle
6.9.0(10 conflict OpenApi 2) - Microsoft.OpenApi
1.x(2 breaking) - Node engines
>= 20+ CI20.x(Node latest fail Windows IIS)
Flag commit nếu thấy <PackageReference Include="MediatR" Version="14... hoặc tương tự.
📅 Recent activity (last 10 FIFO)
- 2026-05-15 (S24 Plan AA cumulative pre-commit verify, spawn): Adversarial verify Chunk A (BE + Layout, em main solo) + Chunk B (FE WorkflowMatrixViewPage, Implementer Case 2 PASS). Diff scope 8 file modified + 2 file CREATE — ~76 LOC BE + ~270 LOC FE, scope khớp Plan AA. Verdict: PASS with 0 critical / 0 major / 0 minor issues — proceed commit OK. Wire BE: Controller line 21-26
Overview(applicableType, isUserSelectable, ct) → new GetAwAdminOverviewQuery(applicableType, isUserSelectable)end-to-end. Handler line 114-117request.IsUserSelectable is bool ius → query.Where(d => d.IsUserSelectable == ius)correct conditional. FE WorkflowMatrixViewPage line 29-33 actualapi.get<AwAdminOverviewDto>('/approval-workflows-v2', { params: { applicableType: typeInt, isUserSelectable: true } })— real call no mock/alert. Route/purchase-evaluations/workflow-matrix?type=Nwired App.tsx:38 + Layout.tsx resolvePath:81-86. Schema integrity: 0 migration mới (columnIsUserSelectablefrom Mig 25), DbInitializer INSERT-OR-UPDATE-Order idempotent verified (MenuItemConfiguration HasKey(Key) → PK unique, ToDictionary safe; existing rows UPDATE Order only nếu mismatch; new rows INSERT). 7 Allow* flag count match BE DTO ↔ FE type. ApplicableType enum {1,2,3} — FE chỉ wire 2 type PE matrix view correct. Security: class-level[Authorize]bare line 18 PRESERVED (gotcha #44 protect). GET any authenticated → non-admin Drafter OK access. Non-admin passisUserSelectable=falseBE không block → workflow chưa ghim leak risk — Low severity (workflow data non-sensitive, NOTE only). Permission seed 7 role × WfView leaf viaSeedPurchaseEvaluationPermissionDefaultsAsync:1573added — idempotent. Admin role quaSeedAdminPermissionsAsyncchỉ coverMenuKeys.All[]static root keys (Pe_WfView dynamic NOT in All) — but admin uses fe-admin Designer, KHÔNG cần WfView access fe-user. Code quality: BE dotnet build PASS 0 err 2 warn (DocxRenderer pre-existing); FE fe-user npm build claim PASS (Implementer Case 2); FE fe-admin npm build VERIFY tự chạy PASS 1926 modules / 740ms / 0 TS err. Anti-fiddle 0% drift, scope khớp spec. Mirror 2 FE §3.9: Layout.tsx widenw-72 xl:w-80cả 2 ✓; remove truncate 3 site fe-user (MenuGroup+MenuLeaf+StaticLeaf) + 2 site fe-admin (MenuGroup+MenuLeaf, no StaticLeaf component) — structural asymmetry acceptable (fe-user only có "Hộp thư" StaticLeaf); WorkflowMatrixViewPage fe-user only correct (admin có Designer riêng). Test coverage: Phase 9 UAT exception accept — test-after default OK. Adversarial deep checks: (1) DbInitializer ToDictionary duplicate key risk → PK constraint trên Key, tree.Add chỉ thêm Pe_DuyetNcc_WfView + Pe_DuyetNccPhuongAn_WfView (2 typeCode distinct) → no in-memory dup. (2) Sidebar widen 1280px responsive verified per task spec (288 sidebar + 992 main fit). (3) Plan U revert clean — 0 remaining truncate class outside Plan AA comments. (4) Mig drift schema: column existed Mig 25, no new mig needed. 2 SaveChangesAsync non-atomic giữa menu seed + label backfill (pre-existing, OUT scope Plan AA). Comment quality: Plan AA marker rõ ràng 8+ sites, no TODO/FIXME zombie. TypeScript:FlagCellindexed-access type clever từ Pick 7 keys union — TS happy compile clean. Recommendations defer: (a) enforce admin/non-admin policy filter (current GET cho phép user pass isUserSelectable=false — low risk, audit follow-up); (b) MenuKeys.All[] không cover dynamic Pe_WfView nên Admin role không auto grant — OK vì admin dùng fe-admin Designer, NOTE để future audit khi admin cần inspect user-side matrix view. Cumulative state unchanged: 31 mig, 111 test, 47 gotcha. Smart Friend guard active — KHÔNG lower bar (3 minor risk noted defer follow-up, không block commit). - 2026-05-15 (S23 t4-t11 cumulative em main self-review — Plan N+O+P+Q+R+S+T+U, no Reviewer spawn): 8 plan consecutive em main self-review per UAT mode (
feedback_uat_skip_verifyrule — em main verify build + test + npm build mỗi chunk). Key validations cumulative: Plan N GetPe handlerPurchaseEvaluationFeatures.cs:765per-NVApproverUserIddiscriminator + admin fallback row đầu. Plan O 4 lookup sites cascade fix (EnsureCanRejectV2Async:201+ApplyReturnModeAsync:248+EnsureEditableForDetailsAsync:72+AdjustBudgetCommandHandler:311) — pattern uniform Plan N, +3 regression testPurchaseEvaluationPerNvLookupRegressionTests.cs. Plan P ControllerTransitionPeBody:267record +3 fields mirrorTransitionPurchaseEvaluationCommandschema — root cause 2 ngày prod bug F1+F2 wire fail. Plan Q FE banner mx-5 inset gap fix (CSS layout polish mirror 2 app). Plan R+S+T5 destructive sqlcmd cleanup prod ~720 rows wiped cumulative + Plan F precedent avoid được (V1 active workflow giữ nguyên → BE healthy startup). Plan T DbInitializerDemoSeed:Disabledflag config — disable 5 demo seed methods (Workflow V1 + PE V1 + Demo Contracts + Demo PE + Sample V2). Plan U FE sidebar truncate + tooltip 2 app mirror — handle long DisplayLabel (Mig 27 admin custom). Anti-patterns observed: (1) Plan N point 9 chỉ catch 1/5 sites — em main + Investigator spawn miss 4 sites khác → Plan O cascade fix. Lesson: grep ENUMERATE TẤT CẢ lookup sites cùng pattern (KHÔNG fix theo bug report mỗi lần). (2) Plan O caveat #1 surfaced Plan P pre-existing bug — CICD Monitor catch Controller body record drop trong Stage 4c verify wire — pattern "verify cross-stack body↔command count match". (3) DbInitializer auto re-seed loop — Plan R+S clean → IIS recycle → re-seed loop. Plan T flag fix root cause. Pattern reusable cross-project: refactor schema 1-row-per-role MUST grep enum lookup sites + Controller body record MUST mirror Command record fields. Cumulative state: 111 test (+7 vs 104 baseline pre-Plan M), 31 mig (no new), 47 gotcha unchanged,feedback_per_nv_permission_scope.mdreinforced 5 lookup sites enum + 9 wire surface points + Plan P caveat → 10 surface points. Smart Friend guard still active for future spawn. - 2026-05-15 (S23 t3 Plan M cumulative review, spawn): Pre-push adversarial verify 3 commits local
c2afef2..508b17a..4dd6f9cPlan M F1 edge case Bước 1 + Phase=TraLai display rename. Diff cumulative: 26 LOC BE (Service.cs:287-333) + 116 LOC test (1 file, +2 test Fact extend SeedWorkflowAsync helper +2 params optional) + 8 LOC FE (4 file × 2 LOC mirror admin+user). Verdict: PASS — wire BE M1 verified hot path 287-333 OneLevel+OneStep edge case replacePhase=TraLai+clear pointer+returnwithSet pointer (0,1) + summary "không lùi được" → fallthrough SLA reset line 364 → Phase=ChoDuyet preserved from pre-call state (entry guard 75-81 require ChoDuyet để Reject decision). ApplyReturnModeAsync caller line 94-100 truyềnevaluation.Phase(now ChoDuyet) vào LogTransitionAsync → Summary="Chuyển phase ChoDuyet → ChoDuyet" + ContextNote contain "không lùi được" (matches test assert ContextNote.Contain). Drafter mode line 268-275 GIỮ Phase=TraLai semantic (unchanged). Assignee line 335-360 throw nếu không match unchanged. F2 ApproveV2Async + F3 EnsureEditableForDetailsAsync + F4 AdjustBudgetCommand handler — UNCHANGED. Schema integrity: 0 migration mới, Phase enum TraLai=98 còn dùng cho Drafter mode + display label rename only. Security: Admin bypass logic line 252-265 + Reject guard line 81 EnsureCanRejectV2Async + non-Approver block — preserved. Code quality: dotnet build PASS 0 err 2 warn (DocxRenderer pre-existing), dotnet test 106/106 PASS (58 Domain + 48 Infra, +2 từ 104 baseline), npm build admin+user PASS 0 TS err (chỉ chunk size warn pre-existing), no--no-verify. Test coverage: 2 Fact mớiApplyReturnMode_OneLevel_AtStep1Level1_ResetsToBuoc1Cap1_KeepsChoDuyet+ApplyReturnMode_OneStep_AtStep1_ResetsToBuoc1Cap1_KeepsChoDuyetcover OneLevel Step1Lv1 + OneStep Step1Lv2→reset. Assert đủ Phase=ChoDuyet + pointer (0,1) + SLA NotNull + ContextNote "không lùi được". Helper extend +2 params backward compat OK (default false). K7 cascade NO regression — 3ApproveV2_SkipToFinal_*xanh (M1 chỉ đụng F1 ApplyReturnModeAsync, không động F2 ApproveV2Async). Mirror 2 FE app (§3.9): purchaseEvaluation.ts admin+user identical (98:'Cần chỉnh sửa lại' + PeDisplayStatus.TraLai:'Cần chỉnh sửa lại'), PeWorkflowPanel.tsx admin+user identical (2 inline literal "Phase → ..." + "Phiếu sẽ về ..." rename). Anti-fiddle: scope drift 0% — 8 LOC FE đúng spec rename Phase=TraLai display only. Anti-pattern guard: (1) Stale narrative comment Service.cs:288-289 + 327-328 UPDATED rõ "Plan M S23 t3 — KHÔNG fallback Drafter, phiếu giữ đang duyệt" — không zombie. (2) Audit log consistency test+code match "không lùi được" exact. (3) Backward compat phiếu UAT prod đang Phase=TraLai do logic cũ — Drafter resume từ TraLai vẫn work line 105-132 (entry pointfromPhase==TraLai → targetPhase==ChoDuyet). Minor issues (non-block, recommend fix sau): (4) Inconsistent UX literal "Trả lại" còn ở 8 user-facing locations chưa rename (decision design): PeListPanel.tsx:112 "Bản nháp + Trả lại" filter label, PeWorkflowPanel.tsx:270 button "← Trả lại", 272 tooltip "(Duyệt / Trả lại / Từ chối)", 315 "← Trả lại Drafter sửa", 342 "Chọn cách Trả lại", PeDetailTabs.tsx:152 "chỉ Bản nháp / Trả lại mới sửa", 287 "(trừ khi approver Trả lại)", ApprovalWorkflowsV2Page.tsx:639 "(Trả lại / Edit Section 2 / ...)" — phân biệt action verb "Trả lại" (button approver click) vs phase result label "Cần chỉnh sửa lại" (Phase=TraLai display in dropdown/badge); spec M3 narrow scope chỉ rename phase result label OK. Em main quyết: giữ action verb hay rename hết. (5) Inconsistent across module contracts.ts:29 + budget.ts:20 vẫn98:'Trả lại'— KHÔNG trong scope Plan M (PE-only) nhưng inconsistent giữa 3 module nếu Contract/Budget có Phase 98 — bro nếu deploy chung sẽ noticeable. Recommendation: SAFE to push 3 commit Plan M; consider follow-up chunk M4 (optional) rename 5 literal user-facing trong PeListPanel + PeWorkflowPanel + PeDetailTabs để consistent UX semantic mới. Smart Friend guard active. - 2026-05-14 (S23 t1 Plan K1+K2 cumulative review, spawn): Pre-K3 adversarial verify Mig 31 schema swap + Service Approver F2 branch. Diff scope: 11 BE files +4093/-83 LOC (Mig Designer 3938 lines dominate). 3 commits chuỗi
eb106f2..56868bf..db66253..364aef6— pre-A slot label refactor + K1 Domain/Mig/Snapshot/sentinel patches + K2 DTO+Service Approver branch. Verdict: PASS với 2 Major + 2 Minor issues — K3 OK proceed nhưng K5 endpoint cleanup nên ưu tiên trước K7 test fix. Wire claim verify: Approver F2 branch placed ĐÚNG vị trí (line 477 AFTER UPSERT opinion line 441-468 + BEFORE advance pointer line 502) — opinion sẽ ghi trước skip terminal, audit log đầy đủ context Bước/Cấp. ApproveV1LegacyAsync skipToFinal guard tại CALLER (line 147-149 trong TransitionAsync branch) thay vì callee — pattern OK, V1 method giữ nguyên signature legacy. Schema sqlcmd verify Dev: 7 Allow* columns ApprovalWorkflowLevels (AllowApproverEditBudget/EditDetails/SkipToFinal/ReturnOneLevel/OneStep/ToAssignee/ToDrafter) + Users.AllowDrafterSkipToFinal dropped (count=0). Snapshot regen clean. EF config HasDefaultValue(false) wire. Mig 31 Up() manual reorder ADD→DROP correct per memoryfeedback_ef_migration_backfill_reorder. Major issues caught (Smart Friend guard active — KHÔNG để pass): (1) Orphan UsersController endpoint zombie — K1 sentinel commented "K2 sẽ refactor DTO + drop field" nhưng K2 chỉ refactor PE side, KHÔNG động UsersController.SetAllowDrafterSkipToFinal + UserFeatures.SetUserAllowDrafterSkipToFinalCommand + UserDto field. Endpoint PATCH/api/users/{id}/allow-skip-finalvẫn live nhưng silent NoOp (Task.CompletedTask), admin UI tick → BE swallow → confusion UX. Cần K5 endpoint cleanup chunk (per spec). (2) Stale Mig 28 comment ApprovalWorkflow.cs:78 — comment cũ "F2 (Drafter skip) đã move sang Users.AllowDrafterSkipToFinal" còn nguyên dù line 107-113 prop AllowApproverSkipToFinal mới. Confuse future dev. Minor issues: (3) Comment TransitionPurchaseEvaluationCommand DTO PurchaseEvaluationFeatures.cs:401 "F2 — Drafter skip thẳng Cấp cuối khi trình duyệt" still says Drafter (semantic outdated). (4) ApprovalWorkflowConfiguration.cs:22 stale Mig 28/29 narrative comment chưa note Mig 31. Anti-fiddle audit PASS: K1 18 LOC UserFeatures.cs sentinel patches valid compile-break workaround, K2 4 files within original spec. Anti-pattern reinforced 3×: admin opt-in per slot per-NV (Mig 29 F1+F3 + Mig 30 F4 + Mig 31 F2 — em main lần đầu sai Mig 30 default scope expansion → bro corrected). Production build PASS 0 err 2 warn (DocxRenderer unrelated). Test references K7-pending line 253. No--no-verifybypass. Pattern caught: "Transient sentinel pattern" — đặt sentinel + comment commit chunk khác cleanup nhưng chunk đó scope SHIFT → zombie state. Recommend explicit K5 cleanup chunk trước K7 test fix. Cumulative state: 31 mig (+1 Mig 31), 47 gotcha unchanged. Smart Friend guard active. - 2026-05-13 (S22 18:00→21:00, no spawn): Em main solo self-review S22 — Reviewer KHÔNG spawn per UAT mode
feedback_uat_skip_verify. Em main verify build clean + test pass + npm build × 2 app mỗi chunk (11 commits cumulative). Key validations: (1) Plan E phân quyền strict V2 — actor.UserId scope in List + Detail, Inbox đã strict từ S17, loose UAT clause|| ApprovalWorkflowId != nullremoved. (2) S22+1 V2 actor scope guard BE helperEnsureCanRejectV2Asyncchặn request forge non-approver PATCH /transitions decision=Reject (mirror FE button disable) — defense-in-depth FE+BE pattern. (3) S22+4 AdjustBudgetCommand handler 3-tier scope (Drafter Nháp/Trả lại + Approver ChoDuyet + Admin) — S22+5 refactor ChoDuyet branch dùnglevel.AllowApproverEditBudgetflag (admin opt-in per slot) thay default Approver scope (security scope correction per bro feedback). (4) S22+2 Identity password policy enforced ≥12 chars (rejectUser@12345611 chars outdated). Anti-patterns observed: (a) Default scope expansion mistake S22+4 → S22+5 fix — KHÔNG default expand permission scope without admin tick (per-NV opt-in pattern Mig 29 lesson reinforced); (b) History display field assumption BudgetAdjustSection initial — em assumePeDetailBundle.changelogsexists, FAIL TS2339 — pattern verify type fields trước render; (c) PS 5.1 Vietnamese diacritics gotcha #30 reinforced — scriptseed-test-users-prod.ps1first attempt FAIL parser error, ASCII-only discipline. S22+4 attachment view endpoint + S22+4 budget-adjust endpoint chưa qua live curl verify (defer post-deploy — bro UAT direct). S22+5 Mig 30 applied LocalDB Dev + Design viadotnet ef database update. New gotcha discovered: #47 paths-ignore agent-memory gap (recommend add to docs/gotchas.md — pending bro decide). Cumulative state: 104 test (+20), 30 mig (+1 Mig 30), 46 gotcha unchanged (gotcha #47 pending), ~146 endpoints (+3), 33 active users. Smart Friend guard still active for future spawn. - 2026-05-13 (S21 t3-t5, no spawn): Em main solo verify via dotnet build + npm build × 2 app + dotnet test suite mỗi chunk. Reviewer KHÔNG spawn — em main self-review per UAT mode
feedback_uat_skip_verify(skip dotnet test mỗi chunk, vẫn build verify). Gotcha #45 fix self-test 3 regression test (test-before §7). S21 t3-t5 push cumulative 12 commits — CICD Monitor verify post-deploy thay vai Reviewer (deploy ship + bundle hash + schema verify). Cumulative state: 84 test, 29 mig, 45 gotcha, 19 memory entries. Pattern saved cho future review focus: per-NV permission audit (Level table vs User table flag), EF migration backfill SQL injection between ADD-DROP order. Smart Friend guard still active for future spawn. - 2026-05-11 (setup): Reviewer agent initialized. Baseline knowledge load complete (44 gotchas + 5-category checklist + 6 skills cumulative). No reviews performed yet. Awaiting first SendMessage from em main. Smart Friend guard active.
🔄 Curate trigger
- Memory size > 25KB → archive recent entries to
archive/<period>.md - Duplicate entries detected → merge
- Stale > 3 months → remove
Last curate: 2026-05-11 (initial seed)