Codex Reports Live Refresh Factory — Production Complete
Codex Reports Live Refresh Factory — Hoàn tất production
Ngày nghiệm thu: 2026-07-11
Production commit: 07caed3b8cacd958066e578a68bc4d60cfa136b8
PR: #671, #672, #673, #674
Phạm vi: Chỉ sửa code/khuôn/deploy/verifier hiện có; không tạo bảng thử, không ghi DB, không sửa 4 trang Balo snapshot.
Kết luận Owner
ĐÃ ĐẠT: bấm Làm mới phát request thật, đọc lại nguồn sống, cập nhật số và “Cập nhật lúc”. Khuôn tương lai dùng chung cho Directus base-table và PG view_sql; publisher gọi verifier ghép cặp.
Vòng 1 — Bệnh đã trị
Route sống + chống cache
Hai lần gọi production:
A generated_at=2026-07-11T02:51:27.529Z table=385 refreshed_at=2026-07-11T02:51:27.508Z
B generated_at=2026-07-11T02:51:29.390Z table=385 refreshed_at=2026-07-11T02:51:29.363Z
Cache-Control: no-store, max-age=0
page_url bị từ chối: HTTP 400. Route chỉ nhận table_id.
Nút Làm mới
Playwright chạy trực tiếp production:
Running 3 tests using 3 workers
✓ Home refresh re-reads its live rows and all displayed totals
✓ computed PG report refresh gets a newer generated dataset
✓ base-table report refresh stays on the Directus live-table path
3 passed (11.9s)
Test computed report chờ đúng network response /api/reports/live?table_id=tbl_report_pg, kiểm tra generated_at mới hơn, refreshed_at mới và UI nhận timestamp đó.
Verifier API ↔ PG ↔ SSR
Chạy verifier đã deploy trên VPS, PG transaction chỉ-đọc:
PASS source=live_view_sql table_id=tbl_report_pg api_count=12 pg_count=12 generated_at=2026-07-11T02:51:22.130Z ssr_refreshed_at=2026-07-11T02:51:22.949Z
Verifier fail-closed khi thiếu no-store, generated_at/refreshed_at không tiến, timestamp quá 120 giây, API rows khác PG-live, hoặc SSR thiếu total/timestamp mới. Cả dot-list-publish và dot-report-publish đều gọi verifier.
Deploy an toàn
- Guard Reports factory PASS toàn bộ.
- Deploy run cuối: GitHub Actions
29136925192SUCCESS. - SQL migrations: SKIPPED.
- Post-deploy DB-writing integrity: SKIPPED.
- PostgreSQL reconciliation: SKIPPED.
- Backup + rollback bao phủ Nuxt output, compose và nginx.
- Nuxt bắt buộc
--force-recreatesau rsync và khi rollback, tránh server bundle cũ trong RAM lệch client artifact mới. - Nginx whitelist được đặt đúng server scope;
nginx -tcuối: successful.
Vòng 2 — Không hỏng gì
200 /
200 /reports
200 /reports/report-pg
200 /reports/report-balo-table
200 /reports/report-loai
200 /knowledge/registries
200 /knowledge/workflows
200 /api/registries-pivot/summary
200 /api/mcp
Nginx vẫn đủ Reports, registries-pivot và MCP. Không sửa dữ liệu/trang Balo snapshot.
Guard tương lai
Guard CI chặn nếu:
- route/khuôn/publisher/verifier không tracked hoặc bị ignore;
- thiếu
/api/reports/, registries-pivot hoặc MCP trong nginx; - route nhận
page_url/sql/view_sqltừ client hoặc thiếuno-store; - hai publisher không gọi verifier;
- Nuxt deploy còn ghi DB trong nhánh Nuxt-only;
- backup/rollback thiếu;
- deploy/rollback không force-recreate Nuxt;
- whitelist
locationbị đặt sai http scope.
Ghi chú ngoài phạm vi
Counting Contract độc lập hiện báo drift live: CAT-ALL=2519752 khác SUM(atom active)=2130153. Đã rerun và vẫn đỏ. Không sửa vì Owner yêu cầu DB read-only và đây không thuộc Reports refresh; tất cả guard/build/E2E/smoke liên quan bản sửa đều xanh.