docs: ADR-016 daily_sales cache fingerprint + 4/28-29 history log + CLAUDE.md ADR 索引補 015/016
- 新增 docs/adr/ADR-016:daily_sales cache TTL → TTL+DB fingerprint,棄用 N-POST broadcast hack(命中率 9.4%),引述 debugger/web-researcher/migration-engineer 三方共識;殘留 HIGH-2(app.py 43 處 _SALES_PROCESSED_CACHE)列管 - docs/memory/history_logs.md 新增 4/28-29 條目:app.py -10.8%、4 個改進版死碼揭發、 cache 機制重構、hook 9 PoC 強化、12 Agent 並行作戰實踐 - CLAUDE.md 補上 ADR-015/016 索引項 Memory(個人 auto-memory,未入 repo)同步: - feedback_flask_blueprint_shadow.md(first-registered wins) - feedback_cache_invalidation_pattern.md(DB fingerprint vs N-POST) - feedback_agent_dispatch_order.md(critic 必須先於 fullstack) - feedback_cloud_vs_local_automation.md(LAN 專案禁雲端 routine) - project_phase3e_refactor_progress.md(11 commits 戰果)
This commit is contained in:
@@ -10,6 +10,16 @@
|
||||
|
||||
## 📅 詳細更新日誌 (考古存檔)
|
||||
|
||||
### 2026-04-28~29:Phase 3e 重構大戰 + daily_sales cache 隱形 bug 根除
|
||||
- **app.py 縮減 -10.8%**: 7,386 → 6,590 行,11 commits 全綠零 502。
|
||||
- **抽 Blueprint**: `/api/categories` → `category_routes.py` (8fce73b);`/api/test_url` + `/brand_assets` → `misc_routes.py` (e676840)。
|
||||
- **揭發 4 個改進版死碼**: refactor-specialist 28 條雙重 URL 等價性矩陣指出 `/growth_analysis`、`/daily_sales`、`/api/export/excel/abc`、`/api/run_task` 在 routes/*.py 已重構但因 Flask first-registered-wins 規則被 app.py 同 URL `@app.route` shadow 從未生效。本輪先啟用 daily_sales (8fefea0),餘三條待後續。
|
||||
- **daily_sales cache 機制重構** (ADR-016): 「匯入 15323 筆但業績頁面看不到」隱形 bug 根因 = gunicorn 4 worker 各持獨立 module-level dict。先嘗試 N-POST broadcast hack 命中率僅 9.4%(debugger + web-researcher + migration-engineer 三方共識);改用 DB fingerprint (`MAX(snapshot_date), COUNT(*)`) 雙閘失效 (3971fd4),強一致無浪費。
|
||||
- **clear_cache endpoint 加 `@login_required`**: 修 critic HIGH-3,外部 POST 無 auth 回 400(CSRF + login 雙重攔截)。
|
||||
- **hook 9 PoC 強化** (136e65b): vuln-verifier 對 `.claude/hooks/momo-prod-guard.js` 跑 9 條 PoC 8 條繞過 → 補強 heredoc / writable CTE / multi-statement / pg_read_file / COPY FROM PROGRAM / `/run/secrets` / `/proc/*/environ` 全擋。
|
||||
- **12 Agent 並行作戰實踐**: 8 完成 + 4 rate-limited;學到 critic 必須先於 fullstack-engineer 完成(feedback_agent_dispatch_order.md)。
|
||||
- **殘留 HIGH-2 技術債**: app.py 仍 43 處 `_SALES_PROCESSED_CACHE`(sales_analysis 等獨立 cache)待後續抽 `services/cache_manager.py`。
|
||||
|
||||
### 2026-04-28:AI 引擎穩定性與 CI/CD 幽靈容器大規模修復
|
||||
- **幽靈容器排除**: 發現 `docker-compose.yml` 漏掛載 `routes` 目錄,導致 Telegram Bot 長期執行舊代碼。
|
||||
- **埠位衝突修復**: 移除 `depends_on: postgres` 以解決與 orphan `momo-db` 的 5432 埠位競爭問題。
|
||||
|
||||
Reference in New Issue
Block a user