[CLAUDE] Docs: S48 adap-* verify closure post-restart + Gov-v2 error-ledger + §L.b

- store_memory strip VERIFIED-runtime (registry 0/8 subs) — adap-report updated
- frontend-designer FD2 loop VERIFIED-RAN (first spawn) — adap-report updated
- Gov-v2 delta CLOSED: NEW docs/governance/error-ledger.md (blameless RCA + Active-Guards
  index + AS-1..AS-9 deterministic-detect + 3-ledger triad) + session-end.md Phase 1.5 §L.b 6-step
- STATUS/HANDOFF S48 + session log + frontend-designer MEMORY flush (FD2 rig + Tailwind-v4 fact)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-03 00:05:39 +07:00
parent 72bbfa56a5
commit 009dd94f22
9 changed files with 229 additions and 22 deletions

View File

@ -7,16 +7,32 @@
- **NOT MINE:** BE/DB/business-logic (implementer-backend) · cookie-cutter mechanical mirror theo spec (implementer-frontend — **KHÔNG double-touch cùng file UI**) · test (test-specialist).
- **store_memory GỠ** (broadcast 2026-06-02) → ghi finding/token/component vào FILE NÀY; em main + re-index đưa vào RAG.
## SE design-system (FD1 — DÙNG, KHÔNG reinvent)
- Brand primary **`#1F7DC1`** · font **Be Vietnam Pro** (Vietnamese diacritics) · **shadcn/ui** + Tailwind tokens · ERP shell (TopBar + Bell + UserMenu).
- Token source: `fe-admin/tailwind.config.*` + `fe-admin/src/index.css` (+ mirror fe-user). Read TRƯỚC khi build.
## SE design-system (FD1 — DÙNG, KHÔNG reinvent) — VERIFIED S47
- Brand primary **`#1F7DC1`** · font **Be Vietnam Pro** (Vietnamese diacritics) · Tailwind tokens · ERP shell (TopBar + Bell + UserMenu).
- ⚠️ **Token source = Tailwind v4 CSS-first** (NO `tailwind.config.js` file — template path stale). Tokens live in `fe-user/src/index.css` `@theme{}` block (mirror `fe-admin/src/index.css`). Read TRƯỚC khi build.
- Brand scale `--color-brand-50..900`; **`--color-brand-600 = #1f7dc1`** (exact logo). Accent red `--color-accent-500/600` (from ® mark). Be Vietnam Pro + JetBrains Mono via Google Fonts `@import` in index.css. body 14px / lh 1.55 / letter-spacing -0.003em.
- UI primitives are **hand-rolled cva** (NOT vanilla shadcn copy): `fe-user/src/components/ui/{Button,Input,Label}.tsx`. Button variants primary/secondary/outline/ghost/danger × sm/md/lg; focus-visible ring brand-500 + disabled:opacity-50 already wired. Input has focus-visible border-brand-500 + ring. REUSE these, don't reinvent.
- Stack: React 19 + Vite 8 + TS 6 + TanStack Query + lucide-react + sonner. Node v22 local (engines `>=20`).
- UI 100% tiếng Việt · Named export (trừ App) · TS6 `const X = {...} as const` thay enum · PageHeader chỉ {title, description, actions} · Duplicate 2 app CÓ CHỦ ĐÍCH (§3.9).
## FD2 visual-verification rig (SE-specific)
## FD2 visual-verification rig (SE-specific) — ✅ VERIFIED RAN end-to-end S47
- Dev: `cd fe-admin && npm run dev` → :8082 (proxy /api→:5443) · `cd fe-user && npm run dev` → :8080.
- Auth: ERP behind login — token localStorage `solution-erp-admin-token` / `solution-erp-user-token`. Authed page screenshot cần API+SQL chạy + login fixture (seed JWT). Public `/login` chụp trực tiếp.
- Tool: skill `webapp-testing` (Playwright) → PNG ≥2 viewport (375 + 1440) → Read PNG → rubric FD4 → fix → lặp.
- **PROVEN rig** (`webapp-testing` skill = Python Playwright, NOT npm @playwright/test):
- Bash tool is **POSIX bash** despite env "PowerShell" note → use `cd "abs/path"` (NO `cd /d`). Forward-slash Windows paths work.
- Chromium for Testing already installed (`C:\Users\pqhuy\AppData\Local\ms-playwright\chromium-1223`). Python 3.11 + `playwright` binding present & drives headless OK. NO install needed.
- Run pattern: `python <skill>/scripts/with_server.py --server "npm run dev" --port 8080 --timeout 90 -- python my_shot.py` (helper starts/stops dev). Write my_shot.py in fe-user dir, **delete after** (throwaway, not app code).
- Screenshot: `browser.new_page(viewport={w,h}, device_scale_factor=2)``page.screenshot(full_page=True)`**Read PNG** to NHÌN.
- 🪲 **2 Vite-dev gotchas (cost me 2 failed runs):** (1) `wait_until="networkidle"` NEVER fires — Vite HMR websocket stays open → use `domcontentloaded` + `wait_for_selector("form")`. (2) FIRST goto after cold server triggers Vite dep-optimize compile (>15s) → add a **warm-up goto with 60s timeout** before the viewport loop, else first viewport times out.
- Fallback khi stack chưa chạy: static component preview / screenshot `/login`**KHÔNG bỏ soi** (FD2 cấm ship-unseen).
## Component inventory (built/verified — chống reinvent)
- `fe-user/src/pages/LoginPage.tsx` — login (public, no auth). Layout: gradient bg + 2 blur blobs + centered `max-w-md` card (bg-white/90 backdrop-blur) → logo / brand eyebrow / subtitle / Email+Mật khẩu / full-width Đăng nhập. Uses ui/{Button,Input,Label}. Solid baseline; nearly identical in fe-admin (mirror candidate).
## Anti-slop catches + rubric verdicts
- **LoginPage (S47): rubric PASS.** Anti-generic ✓ (brand #1F7DC1 NOT default-blue, no emoji, lucide-ready, purposeful palette). Fix applied: subtitle "Đăng nhập để tiếp tục" `text-slate-500``text-slate-600` (borderline ~4.6:1 over translucent card → solid ~7.5:1, FD5 contrast floor). 1-line, no layout shift, on-scale (FD1). Screenshots: `/tmp/fd2-login-shots/login-{before,after}-{mobile-375,desktop-1440}.png`.
- ⚠️ **fe-admin parity follow-up:** same subtitle likely `text-slate-500` in fe-admin LoginPage — apply same bump next fe-admin touch (did NOT touch fe-admin this run; scope-disciplined).
- Minor noted (NOT fixed, out of bounded scope): 2 `blur-3xl` blobs barely visible at 1440 = render cost ~0 payoff; eyebrow `tracking-[0.2em]` heavy. Candidates if login redesign requested.
## Activity log
- **S47 (2026-06-02) created** — chưa spawn-test (agent .md no hot-reload → cần restart). First spawn post-restart: (1) verify FD2 Playwright loop chạy THẬT, (2) confirm token source path `tailwind.config`/`index.css`, (3) confirm `webapp-testing` skill available. Đến lúc đó nấc = file-created, FD2-loop verified-pending.
- **S47 (2026-06-02) FD2 RIG VERIFIED ✅** — first real spawn. Ran full FD2 loop end-to-end on fe-user `/login`: read DS (Tailwind v4 CSS-first, corrected stale config-path assumption) → started Vite via `with_server.py` → Playwright screenshot 375+1440 → Read PNGs → FD4 critique → 1-line contrast fix → re-screenshot confirmed → `npm run build` 0 TS error. Closes adap-report `2026-06-02-Agent-frontend-designer-floor` FD2 runtime proof. 2 Vite gotchas captured above. Loop is REAL, not theoretical.

View File

@ -34,6 +34,20 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
- `docs/rules.md`, `docs/architecture.md`, `docs/gotchas.md`, `docs/database/`, `docs/flows/`
- rules, architecture, gotcha, skill, daily, hand-off (`docs/HANDOFF.md`), DB, luồng DB, session log (`docs/changelog/sessions/`)
## Phase 1.5 — §L AUTO-MAINTAIN (Gov-v2 keystone — deterministic, KHÔNG daemon)
> Artifact home = [`docs/governance/error-ledger.md`](../../docs/governance/error-ledger.md) (RCA + Active-Guards index + 3-ledger triad mapping). **G-015:** đây là **step lead chạy ở session-end**, KHÔNG phải daemon tự-động-vô-điều-kiện.
**§L.a — Deterministic detect (scan action-signature, KHÔNG để AI tự-phán):** quét session theo bảng **AS-1..AS-9** trong error-ledger. Mỗi hit → 1 RCA entry blameless (5-why + fix + guard). **Bug-production = lỗi KÉP → 2 fix** (vá code **VÀ** vá guard/eval-case). List AS mở — gặp class mới thì thêm.
**§L.b — 6-step auto-maintain (đủ 6, KHÔNG skip — thiếu = ledger thối):**
- **(a) summary-index** += 1 dòng/session vào `STATUS.md` Recently Done (pointer, KHÔNG full-log).
- **(b) Active-Guards** (error-ledger): promote guard **2-strike** (episodic→procedural) · mark `verified` nếu held qua session · retire theo **net-effect** (hại>lợi → gỡ).
- **(c) chore-flag:** agent L1 >~30KB → archive L2 · error-ledger open-entry quá ngưỡng · **0-byte memory check (AS-8)**.
- **(d) flush agent-memory** mỗi sub đã spawn session này — **spawn-record 4-field** `{agent · task · nấc(agreed/executed/verified) · evidence}`. (0 sub spawn → "n-a".)
- **(e) pending-request audit:** request anh CHƯA-thực-thi đã log SPECIFICS chưa (KHÔNG placeholder).
- **(f) harvest-integrity double-check:** verify spawn-record (d) đủ + đúng mọi sub (moved-not-cut).
## Phase 2 — WRITE (update MD/RAG)
### 2.1 UPDATE/Re-rank MD/RAG đã thay đổi