update: 编辑整理文档 maintenance

MemRelay-Operation: curated-update:13ffa178-e9cf-4735-8da4-e1d4cf683a52:2
MemRelay-Resource: 13ffa178-e9cf-4735-8da4-e1d4cf683a52
This commit is contained in:
2026-10-08 15:05:04 +08:00
parent 118352074a
commit f55fcc4f0c
2 changed files with 65 additions and 114 deletions
@@ -1,114 +0,0 @@
---
title: Metrix Maintenance & Open Issues (Shared Workspace)
type: curated
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/curated/development/metrix-maintenance-open-issues-shared-workspace
stable_id: 13ffa178-e9cf-4735-8da4-e1d4cf683a52
scope: project
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
workspace_type: development
usage_profile_id: null
preference_context: development
document_type: maintenance
revision: 1
source_memory_ids: []
source_checkpoint_ids: []
source_file_ids: []
source_git_commit: e660bc7bb4fc5ccda47decb4d514874a148ed9b2
source_git_commits:
- e660bc7bb4fc5ccda47decb4d514874a148ed9b2
source_agent_sync_ids: []
model_connection: Sub2API
model_name: git-restore
source_count: 29
source_revisions:
memory:6c4cbc6d-a59b-4128-9d6a-cb9652cff00e: '1'
memory:a3896ad9-d30c-4963-9232-a7d1ab571d19: '2'
memory:bc21af00-1127-44f8-93b7-aa484a7041c2: '1'
memory:5924806e-b234-49f7-b971-3c844fd07cf3: '3'
source_dispositions:
processed: 29
unchanged: 0
unsupported: 0
skipped: 0
cited_source_ids:
- memory:6c4cbc6d-a59b-4128-9d6a-cb9652cff00e
- memory:a3896ad9-d30c-4963-9232-a7d1ab571d19
- memory:bc21af00-1127-44f8-93b7-aa484a7041c2
- memory:5924806e-b234-49f7-b971-3c844fd07cf3
job_cited_source_ids: []
conflicts: []
supersedes: []
preferences: []
source_cursor: 162
source_hash: e2fcea7c8a9e0df7a91925fb2a9beabd922058868310effc908f95df2d78b218
prompt_version: 2026-08-12.3
schema_version: '3'
curation_job_id: null
created_at: '2026-08-19T02:32:37.159033+00:00'
updated_at: '2026-09-23T15:09:21.197870+00:00'
tags:
- maintenance
- troubleshooting
- tasks
- preferences
- sql
- docker
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
---
## High‑Priority Open Work Items (as of 2026‑08‑26)
| ID | Description | Root Cause | Source |
|----|-------------|------------|--------|
| **SQL‑Index‑Missing** | Add missing index for large `UPDATE JOIN` on ~5 M‑row text column (query > 2 h) | C‑05 (large query) | `memory:6c4cbc6d‑a59b‑...` |
| **FastAPI `/health` Freeze** | Convert async blocking handler to regular `def` | C‑03 | `memory:6c4cbc6d‑a59b‑...` |
| **Docker Exec Timeout** | Remove default 3 s socket timeout that disconnects terminals | C‑04 | `memory:6c4cbc6d‑a59b‑...` |
| **Container‑Host Networking** | Ensure containers reliably reach host services | Identified need | – |
| **API‑Token Permission Granularity** | Extend token model for fine‑grained actions (`container:start`) | Current policy blocks mutating ops | – |
| **Full‑Text Audit‑Log Search** | Add MySQL `FULLTEXT` indexes & UI toggle | Keyword‑only search today | – |
| **InterferenceETL Schedule UI** | Visual cron‑editor for `schedule` field | Text‑only schedule currently | `memory:a3896ad9‑d30c‑...` |
| **CapacityReport CI/CD** | Automate tests & Docker image builds per release | Manual sync currently | – |
| **Shiki Theme Sync** | Keep Shiki highlighting in sync with UI dark/light theme | Pending implementation | – |
| **Internal PyPI Cache Eviction** | Background job to purge old wheels when size/TTL limits hit | No eviction policy | – |
| **Terminal Copy‑Paste on Windows** | Add error handling & UI notification for pipe failures | Sporadic failures observed | – |
| **Column‑Width Persistence** | Store layout metadata via user‑preferences API (instead of only `localStorage`) | Current per‑page only | – |
| **Duplicate‑CGI Merge Strategy** | Configurable (`highest|latest|average`) merge for duplicate rows | Fixed to “highest DBM” | – |
## Resolved Tasks (Verified at 2026‑08‑26 checkpoint)
- **FastAPI `/health` async → def conversion** – ✅ (`memory:fb67062d‑89fa‑...`).
- **Docker exec timeout removal** – ✅ (`memory:6c4cbc6d‑a59b‑...`).
- **Shiki theme sync implementation** – ✅ (`memory:fb67062d‑89fa‑...`).
- **InterferenceETL cron‑editor UI** – ✅ (`memory:6d022bb5‑053d‑...`).
- **CapacityReport second instance deployment** – ✅ (`memory:2a61dd7b‑d069‑...`).
## Troubleshooting Summary
| # | Symptom | Cause | Solution |
|---|---------|-------|----------|
| 1 | Windows directory rename locked | IDE holds handle on `.git` | Stop IDE, rename, `git submodule sync` |
| 2 | `/health` endpoint never returns | Async handler performed blocking I/O | Convert to regular `def` |
| 3 | Docker `exec` sessions disconnect after ~3 s | Default socket timeout | Call `socket.settimeout(None)` after `exec_start` |
| 4 | Missing `api_enabled` flag → `forbidden` error | Config lacks flag | Add `api_enabled: bool = True` in `core/config.py` |
| 5 | Hard‑coded credentials in `pypi_mirror.py` | Placeholder left in code | Use env vars or Vaultwarden |
| 6 | `create-module.mjs` typo (`___SNAKE___snapshot`) | Template typo | Fix placeholder |
| 7 | Empty `pytest.ini` | No test files | Add tests or update config |
| 8 | Generic `except Exception: pass` in container exec WS | Swallows errors | Log exception & close WebSocket |
| 9 | Permission expansion not applied (`resource:*` → read) | Expansion logic missing | Ensure `expand_permissions` runs during seeding |
|10| Shiki theme not syncing on UI theme change | Shiki instance not updated | Watch `appStore.dark`, call `shiki.setTheme` |
|11| Terminal copy‑paste fails on Windows named pipes | Missing error handling | Add UI toast & fallback to TCP |
|12| Column‑width reset on reload | Width stored only in `localStorage` | Persist via `/api/user/preferences` |
|13| Duplicate CGI merge strategy undefined | No config option | Add `duplicate_cgi_merge` setting |
|14| Internal PyPI cache grows unbounded | No eviction policy | Background job to delete oldest wheels when limits exceeded |
## Ongoing Development Preferences (scenario level)
1. **Workflow Order** – Implement → Clean → Memory → Docs → Commit (Chinese‑first, KISS/YAGNI). (source: `global_guidance_memory:5924806e-...`, `global_guidance_document:e4fc35f2-...`)
2. **Git Commit Convention** – `type: 中文一句话描述` (e.g., `feat: 添加用户登录`). (source: `global_guidance_document:d3a20d44-...`)
3. **Environment** – Development on Windows + WSL2 + Docker Desktop; all commands must be Windows‑compatible. (source: `global_guidance_document:6973450e-...`, `global_guidance_document:8a861a5f-...`)
These preferences are recorded at the **scenario** level for the *development* workspace and do not create global settings.
## Tags
`[maintenance]` `[troubleshooting]` `[tasks]` `[preferences]` `[sql]` `[docker]`
@@ -0,0 +1,65 @@
---
title: Metrix 实际部署资产与运行边界
type: curated
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/curated/development/metrix-实际部署资产与运行边界
stable_id: bb1539bd-c7f2-4d57-9257-8e4b2b4672cb
scope: project
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
workspace_type: development
usage_profile_id: null
preference_context: development
document_type: deployment
revision: 2
source_memory_ids: []
source_checkpoint_ids: []
source_file_ids: []
source_git_commit: e660bc7bb4fc5ccda47decb4d514874a148ed9b2
source_git_commits:
- e660bc7bb4fc5ccda47decb4d514874a148ed9b2
source_agent_sync_ids: []
model_connection: Sub2API
model_name: manual
source_count: 29
source_revisions:
memory:6c4cbc6d-a59b-4128-9d6a-cb9652cff00e: '1'
memory:a3896ad9-d30c-4963-9232-a7d1ab571d19: '2'
memory:bc21af00-1127-44f8-93b7-aa484a7041c2: '1'
memory:5924806e-b234-49f7-b971-3c844fd07cf3: '3'
source_dispositions:
processed: 29
unchanged: 0
unsupported: 0
skipped: 0
cited_source_ids:
- memory:6c4cbc6d-a59b-4128-9d6a-cb9652cff00e
- memory:a3896ad9-d30c-4963-9232-a7d1ab571d19
- memory:bc21af00-1127-44f8-93b7-aa484a7041c2
- memory:5924806e-b234-49f7-b971-3c844fd07cf3
job_cited_source_ids: []
conflicts: []
supersedes: []
preferences: []
source_cursor: 162
source_hash: e2fcea7c8a9e0df7a91925fb2a9beabd922058868310effc908f95df2d78b218
prompt_version: 2026-08-12.3
schema_version: '3'
curation_job_id: null
created_at: '2026-09-23T15:09:27.507263+00:00'
updated_at: '2026-10-08T07:05:00.757965+00:00'
tags:
- curated
- manual
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
---
# Metrix 部署与运行约定
当前源码:FastAPI可在web/dist存在时同端口8000托管SPA/API;生产不启用reload。前端所有资源随构建提供,Swagger使用本地bundle。安装页选SQLite/MySQL并创建管理员,无硬编码默认管理员。
scripts/build_docker.py构建metrix-app并生成dist/docker/metrix-app-latest.tar和compose说明;--include-mysql额外导出独立mysql镜像tar。应用tar不包含另一个MySQL镜像,脚本也不默认打包CapacityReport或PyPI。packaging/docker-compose.yml为Metrix应用,mysql覆盖文件提供可选数据库;CapacityReport有自己的Docker/编排资产。PyPI镜像见packaging/pypiserver/Dockerfile。
脚本容器依赖宿主已有镜像,平台不自动pull。挂载Docker socket可管理宿主Docker;脚本工作区的bind source必须是daemon宿主可见路径,后端容器部署需正确配置同路径运行目录。容器访问宿主用host.docker.internal或实际检查的网关。
本地dev.py默认Metrix API8000/Web5173及可选CapacityReport API9081/Web5174;与生产独立部署区分。开发环境准备、选项和验证入口以当前README/DEVELOPMENT_GUIDE为准。
本轮未连接生产服务器。此前capacityrepost-web镜像、卷、健康与sector数据结果属于历史部署记录,不代表当前线上版本。后续部署仍需明确授权、备份与实际连通性验证。