From 51a7842229c5445e1a343c8a2a634d3d717b4ae7 Mon Sep 17 00:00:00 2001 From: MemRelay Date: Thu, 8 Oct 2026 15:06:43 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E7=BC=96=E8=BE=91=E6=95=B4=E7=90=86?= =?UTF-8?q?=E6=96=87=E6=A1=A3=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: curated-update:e4fc35f2-1606-4b79-9c1e-367edeea97d0:2 MemRelay-Resource: e4fc35f2-1606-4b79-9c1e-367edeea97d0 --- ...开发工作流(MemRelay与提交推送一致版).md | 81 ++++++++ .../Global Development Workflows.md | 90 --------- .../contexts/Development Context Overview.md | 191 ------------------ 3 files changed, 81 insertions(+), 281 deletions(-) create mode 100644 global/curated/0c9feb46-d06e-43cd-9ef0-c5813c84a998/全局开发工作流(MemRelay与提交推送一致版).md delete mode 100644 global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/Global Development Workflows.md delete mode 100644 global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/contexts/Development Context Overview.md diff --git a/global/curated/0c9feb46-d06e-43cd-9ef0-c5813c84a998/全局开发工作流(MemRelay与提交推送一致版).md b/global/curated/0c9feb46-d06e-43cd-9ef0-c5813c84a998/全局开发工作流(MemRelay与提交推送一致版).md new file mode 100644 index 0000000..0009596 --- /dev/null +++ b/global/curated/0c9feb46-d06e-43cd-9ef0-c5813c84a998/全局开发工作流(MemRelay与提交推送一致版).md @@ -0,0 +1,81 @@ +--- +title: 全局开发工作流(MemRelay与提交推送一致版) +type: curated +permalink: main/global/curated/0c9feb46-d06e-43cd-9ef0-c5813c84a998/全局开发工作流-mem-relay-与提交推送一致版 +stable_id: e4fc35f2-1606-4b79-9c1e-367edeea97d0 +scope: global +project_id: null +workspace_type: global +usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 +preference_context: global +document_type: workflows +revision: 2 +source_memory_ids: +- d8161df6-3159-46c9-9402-c5ab30d1436e +source_checkpoint_ids: [] +source_file_ids: [] +source_git_commit: null +source_git_commits: [] +source_agent_sync_ids: [] +model_connection: Sub2API +model_name: manual +source_count: 90 +source_revisions: + memory:5ed86f53-b53e-4534-8e51-d3a010069d5e: '2' + memory:105b328f-4bda-4641-90a7-7282ef156316: '2' + memory:3f91189b-11a1-45bb-8357-4f413dc1609d: '1' +source_dispositions: + processed: 90 + unchanged: 0 + unsupported: 0 + skipped: 0 +cited_source_ids: +- curated_baseline:e4fc35f2-1606-4b79-9c1e-367edeea97d0 +- cross_workspace_memory:df065dbf-85de-4f2b-bbb1-5d8b115de08c +- cross_workspace_memory:9f00df57-ec45-4d63-9da6-9b2fb16c2d6b +- cross_workspace_memory:0f19c98d-0d69-4702-af18-e75edae6370a +- cross_workspace_memory:1dfbc803-3390-4cc7-9a17-6bf86c9bb165 +- cross_workspace_memory:6e63a053-fea4-4785-984c-b61fab08810a +- cross_workspace_memory:dd093dd7-71be-46a2-bcb1-4a87c3d4b9ab +- cross_workspace_memory:dc70f54c-8e29-4834-a5c1-a63bc9ac9e68 +- cross_workspace_memory:e1b8d25d-f638-4fbe-8a8d-0eda8f2d7d46 +- cross_workspace_memory:6b129c78-a412-41e9-af9f-63ab071e03d9 +- cross_workspace_memory:5924806e-b234-49f7-b971-3c844fd07cf3 +- cross_workspace_memory:2bff13bb-b5cc-40fd-8b2f-774f5c6b9dba +- cross_workspace_memory:61e30ee3-0e26-4d64-b00e-f77bc3a3fd60 +- memory:5ed86f53-b53e-4534-8e51-d3a010069d5e +- memory:105b328f-4bda-4641-90a7-7282ef156316 +- memory:3f91189b-11a1-45bb-8357-4f413dc1609d +job_cited_source_ids: +- curated_baseline:e4fc35f2-1606-4b79-9c1e-367edeea97d0 +conflicts: [] +supersedes: [] +preferences: [] +source_cursor: 571 +source_hash: b84354eb37ab531c5be3076d5c3f130399f235bc33c8cf9453cbfcecae042e49 +prompt_version: 2026-08-12.3 +schema_version: '3' +curation_job_id: null +created_at: '2026-09-23T14:50:03.841179+00:00' +updated_at: '2026-10-08T07:06:39.554639+00:00' +tags: +- curated +- manual +restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2 +--- + +# 全局开发工作流 + +依据现行AGENTS和全局规则修正: + +1. 先读取MemRelay能力、项目上下文和检查点,理解当前代码/配置/Git状态。只处理用户授权目标及必要依赖。 +2. 实现→清理临时内容→相称测试/实际验证→MemRelay事实与交接检查点→必要文档→检查暂存差异→提交。记忆仅在MemRelay不可用时离线暂存aidocs,恢复后同步;不双边维护。 +3. 每个可独立验证功能立即提交type: 中文描述;有远端时fetch后安全推送。保护分支/PR/CI按门禁处理,不擅自强推、发布或部署。 +4. 登录/SSH/数据库/API操作先查MemRelay密码库能力与条目;唯一匹配直接使用,多项/无项再询问。新改凭据立即保存,普通记忆只记条目名称用途,不输出密文。 +5. 临时文件、缓存、测试数据库、日志仅当前项目Temp或PI scratch;不写桌面/下载/系统临时目录。保护实际业务配置和数据。 +6. FastAPI避免async阻塞I/O;JSON中的真实datetime/UUID/Pydantic先jsonable_encoder;PowerShell复杂JSON用临时UTF8文件发送。长SQL/上传统一实际链路超时,Docker长exec确认底层socket超时。 +7. 使用已有有效测试;验证结果区分已运行、未运行和环境阻塞,不以历史结果替代当前检查。 + +设备固件操作的历史专项约束只在相应项目适用:OTA需匹配ABI与发布版本,禁止随意刷通用RK3568镜像,先核对项目U-Boot/DTB/硬件配置。它们不构成普通Web项目任务。 + +旧“默认仅commit”和“aidocs唯一记忆”规则已被现行规则替代。 \ No newline at end of file diff --git a/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/Global Development Workflows.md b/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/Global Development Workflows.md deleted file mode 100644 index 15fd082..0000000 --- a/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/Global Development Workflows.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Global Development Workflows -type: curated -permalink: main/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/global-development-workflows -stable_id: e4fc35f2-1606-4b79-9c1e-367edeea97d0 -scope: global -project_id: null -workspace_type: global -usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 -preference_context: global -document_type: workflows -revision: 1 -source_memory_ids: -- d8161df6-3159-46c9-9402-c5ab30d1436e -source_checkpoint_ids: [] -source_file_ids: [] -source_git_commit: null -source_git_commits: [] -source_agent_sync_ids: [] -model_connection: Sub2API -model_name: git-restore -source_count: 90 -source_revisions: - memory:5ed86f53-b53e-4534-8e51-d3a010069d5e: '2' - memory:105b328f-4bda-4641-90a7-7282ef156316: '2' - memory:3f91189b-11a1-45bb-8357-4f413dc1609d: '1' -source_dispositions: - processed: 90 - unchanged: 0 - unsupported: 0 - skipped: 0 -cited_source_ids: -- curated_baseline:e4fc35f2-1606-4b79-9c1e-367edeea97d0 -- cross_workspace_memory:df065dbf-85de-4f2b-bbb1-5d8b115de08c -- cross_workspace_memory:9f00df57-ec45-4d63-9da6-9b2fb16c2d6b -- cross_workspace_memory:0f19c98d-0d69-4702-af18-e75edae6370a -- cross_workspace_memory:1dfbc803-3390-4cc7-9a17-6bf86c9bb165 -- cross_workspace_memory:6e63a053-fea4-4785-984c-b61fab08810a -- cross_workspace_memory:dd093dd7-71be-46a2-bcb1-4a87c3d4b9ab -- cross_workspace_memory:dc70f54c-8e29-4834-a5c1-a63bc9ac9e68 -- cross_workspace_memory:e1b8d25d-f638-4fbe-8a8d-0eda8f2d7d46 -- cross_workspace_memory:6b129c78-a412-41e9-af9f-63ab071e03d9 -- cross_workspace_memory:5924806e-b234-49f7-b971-3c844fd07cf3 -- cross_workspace_memory:2bff13bb-b5cc-40fd-8b2f-774f5c6b9dba -- cross_workspace_memory:61e30ee3-0e26-4d64-b00e-f77bc3a3fd60 -- memory:5ed86f53-b53e-4534-8e51-d3a010069d5e -- memory:105b328f-4bda-4641-90a7-7282ef156316 -- memory:3f91189b-11a1-45bb-8357-4f413dc1609d -job_cited_source_ids: -- curated_baseline:e4fc35f2-1606-4b79-9c1e-367edeea97d0 -conflicts: [] -supersedes: [] -preferences: [] -source_cursor: 571 -source_hash: b84354eb37ab531c5be3076d5c3f130399f235bc33c8cf9453cbfcecae042e49 -prompt_version: 2026-08-12.3 -schema_version: '3' -curation_job_id: null -created_at: '2026-08-08T07:55:35.371609+00:00' -updated_at: '2026-09-23T14:50:02.231152+00:00' -tags: -- workflows -- global -restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2 ---- - -# Global Development Workflow - -1. **Project memory & Git process** - - All notes are kept in `aidocs/project_context.md`. `aidocs/` is in `.gitignore` and never committed. - - After completing a task, perform: delete temporary files, debug logs, unused code → update memory (what/why/validation/issues/next steps) → check `.gitignore` → commit with `type: 中文一句话描述`. Default is *commit only*; push only when explicitly requested. - -2. **Credential Retrieval Workflow** - - Before any login, SSH, database or API call, query Vaultwarden. If exactly one match, use it directly. If multiple or none, prompt for selection or manual input. - - When adding or updating credentials, immediately write them to the password vault; memory records only the entry name, purpose, and usage method. - -3. **Technical Notes** - - **FastAPI async** – Never perform blocking I/O inside `async def`; change to normal `def` so FastAPI handles it in a thread‑pool. - - **PowerShell JSON** – Write JSON to a temporary file and send with `curl.exe --data-binary @file` to preserve quotes. - - **Large‑table SQL** – Add indexes on frequently queried text columns, raise DB `read/write_timeout` along with client `upload_timeout`/`run_timeout`. - - **Docker exec timeout** – Obtain raw socket and call `socket.settimeout(None)` to disable default 3 s timeout. - - **Docker Hub proxy** – Configure Docker Desktop to **Manual** with HTTP/HTTPS pointing to `http://127.0.0.1:7897` and restart Docker. - -4. **Version & Deployment Rules** - - For OTA, always use the official release version matching the device's ABI and keep the device’s firmware tightly coupled to the release channel. - - Do not flash generic RK3568 images; use the project‑provided U‑Boot, DTB and RTL8367S/DSA configurations. - -5. **Testing & Validation** - - Regression tests should use real timestamps and ensure that the JSON output from `memrelay://capabilities` rendered via `jsonable_encoder` matches the raw resource structure. - - FastAPI handlers that perform blocking I/O should be switched to synchronous functions. \ No newline at end of file diff --git a/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/contexts/Development Context Overview.md b/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/contexts/Development Context Overview.md deleted file mode 100644 index 53b66d2..0000000 --- a/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/contexts/Development Context Overview.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -title: Development Context Overview -type: curated -permalink: main/global/curated/7aee455b-24cc-4008-bdaf-443721e6f939/contexts/development-context-overview -stable_id: d3a20d44-6001-4c88-8772-65dbfac75e6e -scope: global -project_id: null -workspace_type: global -usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 -preference_context: global -document_type: context_development -revision: 1 -source_memory_ids: -- d8161df6-3159-46c9-9402-c5ab30d1436e -source_checkpoint_ids: [] -source_file_ids: [] -source_git_commit: null -source_git_commits: [] -source_agent_sync_ids: [] -model_connection: Sub2API -model_name: git-restore -source_count: 90 -source_revisions: - memory:bf88c265-4749-4c50-85bc-4bae25298cd5: '4' - memory:5ed86f53-b53e-4534-8e51-d3a010069d5e: '2' - memory:105b328f-4bda-4641-90a7-7282ef156316: '2' - memory:3f91189b-11a1-45bb-8357-4f413dc1609d: '1' -source_dispositions: - processed: 90 - unchanged: 0 - unsupported: 0 - skipped: 0 -cited_source_ids: -- curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e -- cross_workspace_memory:dd093dd7-71be-46a2-bcb1-4a87c3d4b9ab -- cross_workspace_memory:b476b307-7224-4128-8499-4c43a2ad1cb5 -- cross_workspace_memory:67a86e88-a750-4cd8-9650-c1b7cfbf22b9 -- cross_workspace_memory:2939ce96-a6f6-418a-9a70-568980dbdc2a -- cross_workspace_memory:7737eaaf-441e-476e-aea0-42a4d13ae245 -- cross_workspace_memory:92e5c8d9-c4ef-4ab7-99ac-1b81f3228b59 -- cross_workspace_memory:dc70f54c-8e29-4834-a5c1-a63bc9ac9e68 -- cross_workspace_memory:e1b8d25d-f638-4fbe-8a8d-0eda8f2d7d46 -- cross_workspace_memory:6b129c78-a412-41e9-af9f-63ab071e03d9 -- cross_workspace_memory:df7b18f9-490f-415f-a388-2332d1b7df87 -- cross_workspace_memory:f42fc721-886f-4d6d-85a4-1611d7bc2cf1 -- cross_workspace_memory:a9739d28-4318-492e-bad3-53e9ea2769a8 -- cross_workspace_memory:814d437d-2c21-4f02-b17b-97fd3ec03f7e -- cross_workspace_memory:650349fe-0a22-4d62-b3ab-329523cb1960 -- cross_workspace_memory:180c6231-32a2-4513-980b-613afff09cbe -- cross_workspace_memory:f8c5300e-3068-4003-a816-b20f997d9715 -- cross_workspace_memory:4f58f272-ba63-4f40-a617-c35cfa4cad6e -- cross_workspace_memory:cb5d1924-eb5d-4e63-9696-4033f7d0b943 -- cross_workspace_memory:27678f65-69be-4d2d-84f9-fc4ed515819c -- cross_workspace_memory:74160f67-38fe-487e-a2d3-8f739c31a09b -- cross_workspace_memory:84879e0b-c836-496e-a6cd-d607d6445689 -- cross_workspace_memory:2f6e65b2-e6f2-4970-b570-1895590207dd -- cross_workspace_memory:9d00d45d-e524-4fbd-8b40-bd9b8d89e7f7 -- cross_workspace_memory:97c12ace-42c3-40ad-a7e6-18b5f765bd72 -- cross_workspace_memory:8d83fdf5-683a-41ce-94ed-da186cf32c71 -- cross_workspace_memory:67499b3a-97a6-4982-9c16-4afaa59d45f3 -- cross_workspace_memory:aa56cfd5-4cbf-4bbd-b589-03aaed17acb2 -- cross_workspace_memory:df065dbf-85de-4f2b-bbb1-5d8b115de08c -- cross_workspace_memory:9f00df57-ec45-4d63-9da6-9b2fb16c2d6b -- cross_workspace_memory:0f19c98d-0d69-4702-af18-e75edae6370a -- cross_workspace_memory:1dfbc803-3390-4cc7-9a17-6bf86c9bb165 -- cross_workspace_memory:6e63a053-fea4-4785-984c-b61fab08810a -- curated_baseline:2b47472d-3ac2-4394-8646-c6bf1c0fc270 -- cross_workspace_memory:61e30ee3-0e26-4d64-b00e-f77bc3a3fd60 -- cross_workspace_memory:2bff13bb-b5cc-40fd-8b2f-774f5c6b9dba -- cross_workspace_memory:5924806e-b234-49f7-b971-3c844fd07cf3 -- cross_workspace_memory:0ca7e07e-97b7-496c-96c8-dc712498fc8e -- cross_workspace_memory:09d9ff03-0cbd-4551-9b74-f5953855e4a3 -- cross_workspace_memory:ce9006a3-2313-411f-b577-10bbb9b9c3bb -- cross_workspace_memory:b3fc5d7e-f1d7-4a63-860b-37f9f35cb136 -- cross_workspace_memory:41e5bdb5-a67b-49bc-b8a6-ab20b4c66fca -- cross_workspace_memory:23bcc4c0-4992-41d6-b70e-210937a76a0f -- cross_workspace_memory:db92ba17-fcee-4f1d-9593-6b325105e482 -- cross_workspace_memory:340af5e9-b3e5-423a-9971-b370992738ce -- cross_workspace_memory:b70c1a22-6834-4e59-936c-1945b04273b7 -- memory:bf88c265-4749-4c50-85bc-4bae25298cd5 -- memory:5ed86f53-b53e-4534-8e51-d3a010069d5e -- memory:105b328f-4bda-4641-90a7-7282ef156316 -- memory:3f91189b-11a1-45bb-8357-4f413dc1609d -job_cited_source_ids: -- curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e -conflicts: [] -supersedes: [] -preferences: -- statement: Use the simplest correct implementation (KISS & YAGNI). - level: global - workspace_types: [] - workspace_ids: [] - source_ids: - - curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e - counterexample_source_ids: [] - occurrence_count: 1 - explicit: true - confidence: 1.0 - status: current -- statement: Default commit only; push only on explicit request. - level: global - workspace_types: [] - workspace_ids: [] - source_ids: - - curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e - counterexample_source_ids: [] - occurrence_count: 1 - explicit: true - confidence: 1.0 - status: current -- statement: Run on Windows + WSL2 + Docker Desktop; containers use host.docker.internal - and listen on 0.0.0.0. - level: global - workspace_types: [] - workspace_ids: [] - source_ids: - - curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e - counterexample_source_ids: [] - occurrence_count: 1 - explicit: true - confidence: 1.0 - status: current -- statement: Configure Docker Desktop proxy to Manual with HTTP/HTTPS at http://127.0.0.1:7897. - level: global - workspace_types: [] - workspace_ids: [] - source_ids: - - curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e - counterexample_source_ids: [] - occurrence_count: 1 - explicit: true - confidence: 1.0 - status: current -- statement: Never perform blocking I/O inside async def; use def in FastAPI. - level: global - workspace_types: [] - workspace_ids: [] - source_ids: - - curated_baseline:d3a20d44-6001-4c88-8772-65dbfac75e6e - counterexample_source_ids: [] - occurrence_count: 1 - explicit: true - confidence: 1.0 - status: current -source_cursor: 571 -source_hash: b84354eb37ab531c5be3076d5c3f130399f235bc33c8cf9453cbfcecae042e49 -prompt_version: 2026-08-12.3 -schema_version: '3' -curation_job_id: null -created_at: '2026-08-08T07:55:39.614383+00:00' -updated_at: '2026-09-23T14:50:10.142099+00:00' -tags: -- development -- global -- context -restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2 ---- - -# Current Development Context (Global) - -## Core Principles -- Use the simplest correct implementation (KISS & YAGNI) and re‑use existing project frameworks, services, tools, and conventions. Avoid speculative dependencies or abstractions. - -## Memory Workflow -- All project notes are kept exclusively in `aidocs/project_context.md`. The file has a fixed header and is never committed to the repository (`.gitignore`). Entries are added newest‑first with a second‑level timestamp. - -## Git Commit Convention -- Default is to **commit only**; a push occurs only on explicit request. -- Commit messages follow the form `type: 中文一句话描述` where `type` ∈ `feat`, `fix`, `refactor`, `style`, `docs`, `chore`, `revert`. - -## Development Platform -- Windows + WSL2 + Docker Desktop (Linux containers). -- Containers access host services via `host.docker.internal`. The host must listen on `0.0.0.0`. -- Bridge‑network access to host‑mapped ports uses the gateway address `172.17.0.1`. - -## Docker Hub Proxy -- Docker Desktop must be set to **Manual** with both HTTP and HTTPS pointing to `http://127.0.0.1:7897`. Restart Docker and verify `docker pull` successful before any build. - -## Common Technical Pitfalls and Mitigations -- **FastAPI async** – Never perform blocking I/O inside `async def` (pymysql, requests, file I/O, etc.). Use `def` so FastAPI moves it to a thread‑pool. -- **PowerShell JSON** – Write JSON to a temporary file then send with `curl.exe --data-binary @file` to preserve quotes. -- **Large‑table SQL** – Add indexes on commonly queried text columns; unify DB `read/write_timeout=3600s` and client upload/run timeouts `1800s/7200s`. -- **Docker Exec timeout** – Obtain raw socket and call `socket.settimeout(None)` to disable the default 3 s timeout. -- **Wheel & sdist download** – Use `--platform manylinux2014_x86_64` for manylinux wheels; for sdist‑only packages download tar.gz via PyPI JSON API. -- **Docker Hub proxy** – Configure Docker Desktop to use Manual proxy with HTTP/HTTPS at `http://127.0.0.1:7897` and restart. - -## Git Rules -- See curated rule `cross_workspace_memory:aa56cfd5-4cbf-4bbd-b589-03aaed17acb2` for commit style and default local‑only commits. - -## Project Memory Management -- All notes kept in `aidocs/project_context.md`. The `aidocs/` directory is in `.gitignore` and never committed. \ No newline at end of file