[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F7RKV9THJT3TFYHH2MXZK7":3,"skill-same:01M7F7RKV9THJT3TFYHH2MXZK7":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":14,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M7F7RKV9THJT3TFYHH2MXZK7","lancedb-memory-plugin-development",null,"Develop, verify, and log-diagnose the hermes-lancedb-memory \u002F minir-memory plugin repo.","chaorenex1\u002Fhermes-home-content","chaorenex1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F23194925?v=4","01M7F5NA1D1D02R2MEMYQN2NZT","chan chan","01M7F5NA20KTHMTY2015CYM1TZ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\r\nname: lancedb-memory-plugin-development\r\ndescription: \"Develop, verify, and log-diagnose the hermes-lancedb-memory \u002F minir-memory plugin repo.\"\r\nversion: 1.0.0\r\nauthor: Hermes Agent\r\nlicense: MIT\r\nplatforms: [windows]\r\nmetadata:\r\n  hermes:\r\n    tags: [hermes, lancedb, memory-provider, plugin, kanban, acceptance]\r\n---\r\n\r\n# LanceDB Memory Plugin Development\r\n\r\nUse when implementing, fixing, or verifying the user's file-authoritative memory provider\r\n(`hermes-lancedb-memory`). The repo is developed over many rounds driven by spec documents and\r\nshort user rulings; this skill is the stable workflow across those rounds.\r\nSee `references\u002Farchitecture-anchors.md` for the domain map (paths, DBs, pipeline contracts,\r\nenv vars) — re-verify anchors against live code before relying on them. For a live\r\n\"检查Hermes日志\u002F报错\" request follow `references\u002Flog-triage.md` (pass order, signature table,\r\nbenign-noise list, report shape).\r\n\r\n## 1. Decide which tree you are editing (do this FIRST)\r\n\r\n- Resolve the live names first: the provider may live in the successor repo\r\n  `\u003CUSER_HOME>\\projects\\minir-memory` as package `plugin\u002Fminir`, installed at\r\n  `$HERMES_HOME\\plugins\\minir`, instead of `hermes-lancedb-memory`\u002F`plugins\u002Flancedb`. List the\r\n  repo root and `$HERMES_HOME\\plugins`, then substitute the actual repo\u002Fpackage\u002Fdeployed names\r\n  in every command below; never patch the installed copy in place of the repo.\r\n- \"当前仓库\" \u002F implementation requests mean the **dev repo** `\u003CUSER_HOME>\\projects\\hermes-lancedb-memory` (git master). Implement there.\r\n- `%LOCALAPPDATA%\\hermes\\plugins\\lancedb` (or `plugins\u002Fminir` in the minir generation) is the **deployed copy** the running Hermes imports. It lags the repo and can mix code generations — do not patch it in place of the repo, and do not treat its files as the source of truth.\r\n- `%LOCALAPPDATA%\\hermes\\hermes-agent` carries the **host** contract (sync_turn, turn finalizer, session env) — largely locally-modified\u002Funtracked WIP. Plugin agents receive Host toolsets ONLY via the facade `bind(toolsets=...)` channel (private tool names go through `tools=`); a green repo suite does not prove this seam — fixtures fake the facade (repo fakes supply `_plugin_id=\"memory\u002Flancedb\"` while the real `PluginAgentFacade` holds only `_identity`, so plugin-agent kb_* calls refuse with `plugin Agent context belongs to another plugin`; probe the real classes with `scripts\u002Fhost_facade_probe.py` before touching plugin code). Keep host edits minimal and record them under `$HERMES_HOME\\patches\\hermes-agent\\` as a `\u003Cdate>-\u003Ctopic>.md` note (diff + evidence + tests + replay hint) plus a full-file `\u003Cname>.py.patched-\u003Cdate>` copy; run the affected host test files (`hermes-agent\u002Fvenv\u002FScripts\u002Fpython -m pytest \u003Cpaths> -q`) before\u002Fafter and include the raw counts in the note; see `references\u002Freal-host-integration.md`.\r\n- Deployment (only on an explicit request) = `python scripts\u002Finstall_dev_plugin.py --target-hermes-home \u003CHERMES_HOME> --replace` → verify deployed tree == repo tree (sha256 manifest, caches excluded; run this skill's `scripts\u002Ftree_parity_check.py \u003Csrc> \u003Cdst…>` for the walk — it also accepts profile copies as targets) → mirror to named profiles (`$HERMES_HOME\u002Fscripts\u002Fsync_default_profile_extensions.py`; the gateway-down cron never fires) → `hermes gateway restart` → one-shot smoke (`hermes chat -q \"Reply with exactly: PROBE_OK\" --oneshot`) then read `$HERMES_HOME\u002Flogs\u002F{agent,errors}.log`. A skills-side `post-mirror verification failed` on some profiles is usually the live `.usage.json`\u002F`.bundled_manifest` mtime race — content sha decides, do not chase it. Full chain, verification probes, and failure signatures: `references\u002Freal-host-integration.md`.\r\n- minir 代际部署（`plugin\u002Fminir`，无 install_dev_plugin.py 时）：同步 `plugin\u002Fminir` 源文件到\r\n  `$HERMES_HOME\\plugins\\minir`、删目标 `__pycache__`、逐文件 sha256 对齐；`hermes plugins validate`\r\n  与 `doctor` 通过后 `hermes gateway restart`，再确认新 PID 占用 API 端口（restart 会短暂提示旧端口\r\n  仍在监听，不要据此重跑）；`scripts\u002Fverify_against_host.py` 必须显式传 `--host-python` 与\r\n  `--workspace`，自动探测在宿主外会失败。\r\n- After a deploy, long-running host processes (TUI host, Desktop backends, gateways) keep executing the\r\n  PREVIOUS generation from memory — Python never reloads. Symptoms in `logs\u002Fagent.log`\u002F`errors.log`:\r\n  the `...lancedb__source_\u003Cdigest>.lifecycle_hooks: lancedb lifecycle store unavailable` flood +\r\n  `SchemaVerificationError: database schema is newer than this provider` (DB migrated by the new\r\n  generation while the old one runs), and `Hook 'post_tool_call' callback callback skipped after\r\n  previous timeout...` (old generation registers hooks via a nested `def callback`; the current one\r\n  registers bound methods) — a skip line naming a REAL callback (e.g. `post_tool_call`) is NOT this\r\n  class: it is a live stuck\u002Fslow callback; attribute it by registrant (`references\u002Flog-triage.md`).\r\n  `\u003Cdigest>` = sha256(resolved `$HERMES_HOME\u002Fplugins\u002Flancedb`)[:16] — proves\r\n  the load path. Attribute the emitter by walking your shell's parent chain to the hosting python.exe\r\n  and compare its start time against the deploy times. A restart of the stale host is the fix; verify\r\n  the deployed tree == repo tree (`diff -rq`, __pycache__ excluded) before blaming current code.\r\n\r\n## 2. Read the spec stack before implementing\r\n\r\n- `Documents\\记忆最新需求2.md` — current requirements (semantics authority).\r\n- `Documents\\记忆最新需求2-执行计划.md` — WP execution plan + progress table; **its progress column lags reality** (written before rounds land, not kept current) — treat it as leads\u002Fhistory and verify status against the workspace and commits.\r\n- Repo `.omx\u002Fplans\u002Flancedb-memory-session-context-engine-plan.md` — meta-plan; its audit tables mix two code generations — re-verify every claim against live code before trusting a row.\r\n- Short, terse user messages (\"X 所有权：Y\") are rulings: implement exactly on the dev repo, add regression tests around the changed contract, and note any doc\u002Fruling conflict in the final report instead of silently picking a side.\r\n\r\n## 3. Test harness\r\n\r\n- `cd \u003Crepo> && python -m pytest tests -q -p no:cacheprovider` — use whichever interpreter actually has pytest: the system Python (3.14) on the old repo, the host Hermes venv python on minir-memory (verified there as `python -m pytest tests -q`). Confirm with `python -c \"import pytest\"` instead of assuming from `.venv`. Add `--continue-on-collection-errors` when a collection error may exist.\r\n- Full suite size and runtime grow each round; read the collected count from the run instead of trusting a fixed number. 2 symlink skips are environmental and normal. Focused files first, full suite last — never claim acceptance without the full run.\r\n- CI-free repo: the suite IS the acceptance gate.\r\n\r\n## 4. Contract-change sweep (the failure this repo punishes)\r\n\r\nWhen renaming a contract, moving ownership, or changing an API\u002FDB\u002Ffile shape:\r\n\r\n1. BEFORE edits: `rg -n --no-ignore \"\u003Cold term>\" \u003Crepo>` WITHOUT `-g '*.py'`. Contract text lives in Python, prompt-template strings, `skills\u002F*\u002FSKILL.md`, tests, and README.\r\n2. **`skills\u002F*\u002FSKILL.md` are runtime-registered instructions** (registered via `ctx.register_skill`, injected into background provider agents) — stale wording there is a live defect, not a doc nit. Prompt-template strings are the same class of artifact.\r\n3. Change every layer: module code → prompt templates → skills\u002F*\u002FSKILL.md → README → tests.\r\n4. AFTER edits: grep the TEST TREE for every changed symbol (`commit_generation`, `prepare_files`, `refresh(`, `dynamic_target_paths`, …) — hand-rolled fixtures\u002Fmocks reimplement the old shape and fail only on shards you did not run. Exact-shape assertions (`assert result == {...}`, `assert_called_once_with(...)`, \"\u003Cterm> not in hint\" checks) also encode the old contract — grow them in the same change whenever a payload key, signature, or hint string is added.\r\n5. Finish with focused tests, then the full suite, plus residual-wording greps; expect an independent verifier to check wording too.\r\n\r\n## 4c. PluginAgent 接缝（context-run gate）修复配方（2026-09-13 实证）\r\n\r\n- `resolve_context_run` 的拒绝对可叠加出现，必须用**真实宿主对象**逐项验证，不能只看第一条错误：\r\n  `plugin_id`（宿主门面须暴露 `_plugin_id = identity.plugin_id`）→ `purpose`（envelope purpose 必须等于注册 purpose；\r\n  插件 adapter 的 `handle.run` 必须透传 `purpose=`，宿主 `PluginAgentHandle.run\u002Farun` 有该形参并回退 bind purpose）→\r\n  `host_session_id`（注册 workflow bundle 必须携带 `session_id`，且运行 envelope 传入同一值）→\r\n  `attempt_id`（同上）。修复一层会暴露下一层，按此顺序一次排查完。\r\n- 参照实现＝flows（`agent_context_runtime` 的 flow runner）：`runtime_bundle[\"session_id\"]=host_session_id`、\r\n  `runtime_bundle[\"attempt_id\"]=attempt_id` 后才 `register_context_run`；`agent_pipeline`\u002F`profile_review` 等\r\n  落后应向其对齐（bundle 补键，而非改 guard）。\r\n- 宿主机验证：宿主 venv 直接构造 `PluginRuntimeServices(PluginIdentity(...)).agent` 检查门面属性；\r\n  repo 侧 fakes 自带 `_plugin_id` 会掩盖真实门面缺口（\"绿套件不证明宿主接缝\"的又一实例）。\r\n- end-to-end 复证：one-shot 宿主机保活跑 job——`hermes chat -q 'Use the terminal tool to run exactly: python -c \"import time; time.sleep(150)\"...' --oneshot`\r\n  可在进程存活期捕捉 job 会话的 kb 工具成败；新代码信号＝`provider.tool_metric tool=kb_* success=True`\r\n  （旧代码=invalid_arguments 拒绝），写完盘信号＝`lancedb-memory\u002F\u003Ctype>\u002Fsummary.md` 等文件 mtime 更新。\r\n- workflow 文件边界 guard（`_enforce_workflow_file_boundary`）必须同时解析 **现代 `operation=` 形态与 legacy\r\n  `mode=` 形态**；否则 summary\u002Fextraction agent 的现代调用被误判 permission_denied（\"write path is invalid\"）。\r\n- 每条修复配 regression：adapter purpose 透传（fake handle 断言）、pipeline bundle 键、guard 双形态；\r\n  精确形状断言（`assert workflow_runtime == {...}`、handle 签名集合）要在同一变更里扩展，否则全量套件报红。\r\n- kb 工具集 runner 对齐清单（seam 修复\u002F审计轮后必扫）：`grep -n KB_AGENT_TOOLSETS plugin\u002Flancedb\u002F*.py`\r\n  列出的每个 `agent.run(` 点必须同时有 `register_context_run(...) as run_id` + `tool_context={\"context_run_id\": run_id}`\r\n  + workflow bundle 与 run 的 `host_session_id`\u002F`attempt_id` 一致；漏掉的 runner（实证：`quality_agent.py`、\r\n  `reasoning.py` 的 kb_reasoning）让该 agent 的**全部** kb_* 调用以\r\n  `invalid_arguments: \"plugin Agent context payload is invalid\"` 被拒（tool_context=None 落在 `resolve_context_run`\r\n  第 2 层 payload 校验）——症状像宿主 bug，其实是 runner 漏注册。job 型 runner 的 run_id 取\r\n  `attempt[\"context_run_id\"]`（call site job dict 补键，与 `bind_job_operation_store` 的 run_id 对齐）；\r\n  kb_reasoning 经 `KnowledgeReasoner(..., session_id, profile_name)` 携带会话\u002F档案。注册后语义：context 读\r\n  （kb_summary_search\u002Fkb_context）按 `bound_profile_name` 做 self-scope；文件工具在未授权 purpose 下报\r\n  `this Context Agent phase has no file-memory authority`（按设计，非 bug）。死代码 `ProfileReviewPipeline`\r\n  （profile_review.py，无实例化点）可忽略。\r\n\r\n## 4d. 宿主 durable boundary outbox 契约（deferred 边界投递）\r\n\r\n- 宿主 run_agent 把 session 边界（shutdown\u002Fcompression\u002Fnew_session）写入 state.db `memory_boundary_outbox`，先内联投递，\r\n  失败由后台 worker 以 ≤60s 退避重投（`agent\u002Fmemory_boundary_outbox.py`）；投递携带**事件自身的** `parent_session_id`，\r\n  跨进程\u002F跨会话重放是设计内行为（延迟投递必然发生在旧会话不再是 live binding 之后）。\r\n- 插件侧 on_session_end\u002Fon_session_switch 不得用 live binding 校验（`_bound_session`）拒绝事件会话，否则事件永久搁浅：\r\n  实证 14 条事件 attempts 868–1893、每 ~60s 一次 ValueError 堆栈（`_bound_session` raise \"does not match the active Provider session\"）。\r\n  正确语义＝事件会话为权威：expire 该会话 working set、stop 该会话计数、按该会话 counters 行的 scope\u002Fmode 触发辩证推理\r\n  （`_boundary_session` \u002F `_boundary_turn_number` \u002F `_enqueue_dialectic_reasoning(counters=...)`）。\r\n- deferred on_session_switch 只做旧 scope 过期＋事件 id 记录，**不得重绑** live session；内联路径（parent==bound）保持原重绑行为。\r\n- 自检：`rg -n \"_bound_session\" plugin\u002Flancedb\u002F__init__.py` 只应命中 live 表面（working_scope\u002Fset_session_mode\u002Fon_turn_start\u002Fcompress_context）。\r\n- 回归：`tests\u002Ftest_boundary_deferred_delivery.py`（deferred end\u002Fswitch、unknown session no-op、inline 重绑回归）。\r\n- 宿主接缝探针：`scripts\u002Fboundary_outbox_probe.py`（用宿主真实 `_build_session_end_kwargs`\u002F`deliver_memory_boundary_event`\r\n  驱动修复后的插件——延迟 end 必须停计数+产 1 条触发、延迟 switch 不得重绑、重放必须被接受；FAILURES 为空才算过）。\r\n- 探针\u002F测试的 Windows 陷阱：provider 会一直持有 `memory.db` 句柄，`tempfile.TemporaryDirectory` 清理必报\r\n  WinError 32 —— 用 `mkdtemp` + `shutil.rmtree(ignore_errors=True)`，并在 finally 里 best-effort `provider.shutdown()`。\r\n- 部署前修复不生效：部署副本仍为旧代际，搁浅事件继续 ≤60s 重投刷 DEBUG 堆栈；部署后积压被消费一次\r\n  （无 counters 行的旧会话 `stop_session` 返回 None → 干净 no-op，不会凭空造数）。\r\n\r\n## 5. Repo editing pitfalls\r\n\r\n- `plugin\u002Flancedb\u002F__init__.py` is ~130 KB \u002F ~3000 lines: patch surgical regions only; re-read the file (or the region) before patching after any other actor may have touched it.\r\n- Files are CRLF; the patch tool normalizes endings. After an edit confirm with `git diff --stat` that the change is the intended line delta, not a whole-file rewrite.\r\n- Never edit `build\u002F` (stale package copies) and exclude it from greps.\r\n- Do not commit unless asked; large uncommitted working trees are normal here. Keep each actor on a mutually exclusive file set when several run in parallel.\r\n\r\n## 6c. Repair rounds (checklist-driven waves, proven)\r\n\r\n- Build waves by mutually exclusive FILE whitelists; every card carries the same global rules\r\n  (requirements doc = acceptance baseline, only-whitelist, no commit\u002Fstash, focused tests only).\r\n- Chain: workers -> verifier (qa1 must emit metadata.gate) -> synthesizer (cto). With the gateway\r\n  down, run a bounded background dispatch loop (`hermes kanban dispatch` every 120s; exit on\r\n  terminal synthesizer) — nothing auto-promotes without it.\r\n- Fleet reroute when every worker blocks instantly: read $HERMES_HOME\u002Fkanban\u002Flogs\u002F\u003Ctask>.log — an\r\n  HTTP 403\u002Fquota error is a provider fault. Probe the replacement lane with the exact worker argv\r\n  (`hermes -p dev1 --cli -m \u003Cmodel> --provider \u003Cprovider> chat -q \"Reply with exactly: PROBE_OK\"`),\r\n  then `hermes kanban set-model \u003Cid> \u003Cmodel> --provider \u003Cprovider>` on EVERY card of the graph,\r\n  `hermes kanban unblock \u003Cid> \u003Creason>` on blocked ones, and one dispatch pass.\r\n- gate=fail handling: contain the running synthesizer immediately (`hermes kanban block \u003Cid>\r\n  \u003Creason>`; `block` takes a positional reason), then create the bounded chain\r\n  rework -> replacement QA -> fresh synthesizer and record recovery on the root blackboard. The\r\n  rework card may span multiple whitelists (it is the only active writer then).\r\n- Cross-worker handoff pitfall: a worker that finishes earlier never sees a later sibling's root\r\n  comment (this round: the template-consumption note arrived 90s after W2 completed -> follow-up\r\n  dev+QA chain). After every wave, audit ALL root comments for unhandled cross-whitelist notes.\r\n- Orchestrator closes with its own full-suite rerun plus a git-status\u002FHEAD check before reporting,\r\n  and reports the raw counts from its own run (expected magnitude ~490 passed, 0 failed, 2 env symlink skips).\r\n\r\n## 7. Acceptance pattern (user's established standard)\r\n\r\n- Deliverable = dev-repo change + full suite 0 failed + targeted probes per changed contract; report evidence (commands + raw results), not claims.\r\n- Work is tracked as Kanban cards with `--workspace dir:\u003Crepo>` and a no-commit rule; verifier profiles qa1\u002Fqa2, synthesizer cto. See the `kanban-orchestrator` skill for swarm mechanics (provider reroute on worker crashes, manual dispatch when the gateway is down, replacement-QA rework).\r\n- Swarm wiring for this repo: workspace `dir:\u003Crepo>` + no-commit on every card. `hermes kanban swarm` auto-attaches `requesting-code-review` (verifier) and `humanizer` (synthesizer) — verify they load for qa1\u002Fcto's real skills tree first (`.archive\u002F` copies don't count), otherwise build the graph via the board Python API: root(`initial_status=\"blocked\"`) → workers(`parents=[root]`, `goal_mode=True`, full brief in body) → verifier(`parents=\u003Call workers>`) → synthesizer(`parents=[verifier]`); activate with `complete_task(root)`; post `[swarm:blackboard]` topology\u002Fcontract notes; read every card back before dispatching.\r\n- Gateway-down chains need a bounded dispatch loop: nothing auto-promotes the verifier\u002Fsynthesizer after workers finish. Run `hermes kanban dispatch` every ~120s in a background loop with a per-card status script; exit when the terminal card is done\u002Fblocked and nothing is running; restart the loop after any reroute. From bash, give Windows `python.exe` `C:\u002F...`-style paths (MSYS `\u002Fc\u002F...` gets mangled to `C:\\c\\...`); after starting the loop confirm its first status line landed in the log — a broken logger leaves the dispatcher cycling alone and the exit condition never fires.\r\n- Worker-provider reroute: probe by replicating the worker argv (`hermes -p \u003Cprofile> --cli -m \u003Cmodel> --provider \u003Cprovider> chat -q \"Reply with exactly: PROBE_OK\"`) — that proves profile-scoped resolution end-to-end. Goal-mode workers mask quota faults as `Goal-mode worker exhausted its turn budget ... judge error: PermissionDeniedError`; read `$HERMES_HOME\u002Fkanban\u002Flogs\u002F\u003Ctask>.log` for the real 403, then `set-model` every card (workers+verifier+synthesizer) + `unblock` + one dispatch pass.\r\n- Verifier briefs must explicitly require the verifier's `kanban_complete` to carry a JSON `metadata.gate` (`pass`\u002F`fail`) plus `evidence`\u002F`failed_criteria` — verifiers default to prose-only summaries otherwise.\r\n- A narrow gate=fail limited to wording\u002Fdocs: fix inline, then create one replacement QA card scoped to the rework + full regression; reserve full rework chains for code\u002Fsemantic failures.\r\n- gate=fail 先冻结在跑的 synthesizer：`hermes kanban block \u003Cid> \u003Creason words…>`（reason 是位置参数；`--reason` 会报错；unblock 才用 `--reason`）——native 依赖调度只读任务 status、不读 gate metadata，不冻结就会对失败轮次照常产出“成功”合成。随后按失败项归属建链：返工卡（含失败判据原文+复现步骤）→ 替换 QA 子卡（先复现原缺陷再验修复 + 全量回归）→ 新 synthesizer 子卡；旧卡留档，root 黑板记 recovery（fail 卡\u002F判据\u002F新链 ID）。\r\n- Worker briefs must require completion metadata `{changed_files, tests_run, items_fixed, residuals}`——QA 与合成读它，白话摘要不够。\r\n- 并行轮收尾纪律：采信任何 gate 之前先逐条盘点 root 黑板全部注释，确认每条跨边界交接（worker 请求到他人白名单文件里的后续修复）已被消费——完工早于注释的 worker 看不到它（时序差可低至数十秒），verifier 探针可能不覆盖该缺口；未消费即建有界补齐链（目标文件 owner → 独立 QA + 全量回归），不重开整轮。\r\n- 编排者终验（交付前）：亲自复跑全量套件 + 对每个修复点做默认\u002F显式两态直探，数字与 QA\u002F合成报告三方对齐后才交付。\r\n- Report open items plainly at the end (uncommitted, undeployed, pending host wiring, unrun audits) — the user decides the next round.\r\n\r\n## 9. Deep Interview \u002F Ultrawork host contract (integrate branch)\r\n\r\n- Host surface (`\u002Fdeep-interview`): objective | status | show | resume \u003Cdeep-interview-id> | cancel | subgoal. `pause\u002Fstop\u002Fdone\u002Fclear` are deleted by ruling; `resume` rebinds the interview's session to the current one. start\u002Fresume set `HERMES_SESSION_MODE=deep-interview` + `HERMES_DEEP_INTERVIEW_ID`; cancel returns mode to `session`. The session-env machinery is IN the integration line (ported from the memory-program WIP + two additions): `gateway.session_context.set_current_session_mode` \u002F `set_current_deep_interview_id` (ContextVar + env mirror, delegated-child suppression) and `scoped_session_env_vars`; `run_agent._resolved_workflow_task_env` (includes `HERMES_SESSION_MODE` beyond the WIP's four names) is rebound task-locally per turn by `agent\u002Fturn_facade` — the setting is effective in-process, not a no-op.\r\n- Projection design B (host tables, provider direct read): the host writes `deep_interview_for_memory` rows **inside its kanban write transactions** (`hermes_cli\u002Fworkflow_memory_tables.py::upsert_deep_interview_for_memory_on`; `projected_goal_state_version` is stamped with the write, `_sync_memory_tables` in `deep_interview_store`). The lancedb plugin's `workflow_projection.load_workflow_projection` reads the tables directly, keyed by `HERMES_DEEP_INTERVIEW_ID`. The provider `publish_deep_interview_projection` channel is optional\u002Fbest-effort and must never fail-close a turn.\r\n- Tools lane: `interview_state`, `interview_search`, `deep_interview_execute`, `deep_interview_import_plan` (registered on the core list + a `workflow` toolset); `planning_tool_guard` is enforced both at the dispatcher boundary (`model_tools.handle_function_call`) and in `agent\u002Ftool_executor._dispatch_authorized_once`.\r\n- `hermes deep-interview` subcommand: start (goal) | status (no goal) | `--resume \u003Cdeep-interview-id>` --session ...; `cmd_deep_interview` in `hermes_cli\u002Fmain.py`.\r\n- State: this line is landed on live `main`; the live working tree carries the feature plus the memory-program WIP as unstaged changes (converged via a pre-activation worktree; WIP snapshot \u002F resolved activation patch \u002F backup branch under `$HERMES_HOME\\backups\\pre-di-activation-*`). The running CLI and Desktop still need a restart to load it.\r\n- Ultrawork 实现面（与 DI 相反：完整体未落 main）：完整实现 = hermes-agent 分支\r\n  `codex\u002Fdeep-interview-hard-cut-recovery` tip `d40424f256`（用 `git log --all -- \u003C路径>` 复核）——\r\n  `hermes_cli\u002Fultrawork_{commands,planner,source,context,execute,kanban,policy,pr}.py`、\r\n  `hermes_cli\u002Fsubcommands\u002Fultrawork.py`（main.py `cmd_ultrawork` 接线）、\r\n  `tools\u002Fultrawork_{search,execute,archive}_tool.py`、`plugins\u002Fultrawork-observation-gate\u002F`\r\n  （2-Action Rule 门禁：计数 qualifying 工具调用、第三个前阻塞）、17 个 `tests\u002F**\u002Ftest_ultrawork*`、\r\n  契约 skill `software-development\u002Fultrawork` + website 文档（skill\u002F文档在 main 上也有）；\r\n  main 仅调用点\u002FCommandDef\u002Fenv\u002F表定义，模块缺失（`\u002Fultrawork` import 即失败）。\r\n- Ultrawork 数据面：planner 写 `HERMES_HOME\u002Flancedb-memory\u002Fresource\u002Fplan\u002F`（`\u003Ctitle>-\u003Cplan_id前8>.md`）\r\n  + kanban.db `ultrawork_plans`；policy 表 `ultrawork_iteration_loops\u002Fultrawork_iterations\u002F\r\n  ultrawork_file_baselines`（mode ∈ fixed|max|adaptive）；lancedb 插件是读侧消费者：\r\n  `workflow_projection.py` 读 `ultrawork_for_memory`\u002F`ultrawork_kanban_runs`\u002F`ultrawork_kanban_routes`\r\n  渲染 `\u003Cultrawork>` 块，`paths.py::ultrawork_phase_document_path` 算相位文档路径。\r\n- 勿混淆旧代际：`~\u002Fprojects\u002Fultrawork-swarm-kanban{,-plugin}`（Ralph\u002FOps 控制器）与被 hard-cut 的\r\n  `backups\\*\\removed\\*\\ultrawork-swarm-kanban` 都是旧线，不是现行实现。\r\n\r\n## 8. Requirements audits (需求 vs 代码 — the repo's recurring round type)\r\n\r\n- 需求文档是唯一验收基线：“需求是基线，不要质疑我的需求”——不提问、不推回裁定、不以“注释声称设计\r\n  演进”把需求排除在判定之外。代码与文档分歧 = 缺陷（partial\u002Fviolates）+ 修复方向；判定对象是工作区\r\n  (`plugin\u002Flancedb\u002F`、`tests\u002F`，含未提交改动)，不是 git HEAD 或计划进度表。\r\n- 零命中即缺陷：需求要求的构造物在代码中搜不到 = 该条 violates（进修复清单）——不得以“现行代际已换\r\n  模板\u002F被新设计取代”为由放行；`references\u002Farchitecture-anchors.md` 的旧代际指纹只用于排除死代码名，\r\n  不构成需求豁免。行为若确以他名存在于最终执行路径（hook\u002Fprovider\u002F工具任一层），按该层判\r\n  conforms\u002Fpartial 并记录 naming 锚点。\r\n- 判“最终行为”而非“钩子名”：generic `on_session_end`\u002F`on_session_finalize` 钩子为 no-op 属既定\r\n  分工（host 每 `run_conversation` 触发；真实边界=`MemoryProvider.on_session_end`），`prefetch()`\r\n  返回 \"\"（注入仅 `pre_llm_call`）、compression 不写 `session_summary.md` 均为正确设计；\r\n  `system_prompt_block`\u002F`on_pre_compress` 是 provider 方法而非 7 个注册钩子之一。但需求要求的\r\n  最终行为（停计数\u002F触发辩证推理\u002F范围窗口\u002F落库）在哪层发生就在哪层判：provider 方法里发生=符合；\r\n  哪层都不发生=缺陷——不得用 no-op 注释为其开脱，修复可落在 hook 或 provider 任一处。\r\n- Compare NAMES, not just presence: kb_file's live enum is `delete_path` (+ `insert\u002Fupdate\u002F\r\n  update_lines\u002Fdelete_lines`, legacy `mode=create|update|delete`) while the requirements say\r\n  `delete` with line ops nested under `patch_file` — report naming\u002Fmanner drift as partial with\r\n  anchors on both sides.\r\n- 粒度=原子条目：每条 hook \u002F 每个工具模式 \u002F 每个注入元素各一条（~100+ 条）逐条判定——簇级汇总会被\r\n  判“太粗糙”。Verdict per item: conforms | partial | violates（或等价 implemented|partial|\r\n  missing|contradicted）+ `file:line` 证据原文 + covering test + 缺口（需求要求X\u002F代码实际Y）+ 修复\r\n  方向；`missing`\u002F`violates` 必须附实际执行的零命中 grep。Partition the doc by requirement cluster\r\n  for parallel streams; delegated audit streams are self-reports — spot-check their anchors with\r\n  your own greps before synthesis.\r\n- Long grep output is truncated by the terminal to\r\n  `...\\hermes\\cache\\terminal-output\\out-*.log` — read that file with read_file instead of\r\n  re-running the command, and batch related greps into one call so a single log read covers\r\n  several checks.\r\n- 审计轮执行配方（编排者会话 + 4 条并行 delegate_task 流；审计本体不进 Kanban——Kanban 是修复轮的载体）：\r\n  1) 框架复用：`%LOCALAPPDATA%\\Temp\\memory_audit\\audit_items_v2.md`（127 条 R 编号 + 需求行号 + H1–H4\r\n  分簇）——复用前核对需求文档未变（mtime）且框架覆盖全文行段（未覆盖行=追加 X 条目）；产物目录被清理则\r\n  按同簇逻辑从文档重derive。\r\n  2) 分簇：H1 钩子\u002F计数触发\u002F压缩\u002F注入结构（R01-R25,R105-R113,R126）｜H2 agent 装配\u002F模式\u002F观察\u002F投影\r\n  （R26-R46,R99-R101,R114-R116,R120）｜H3 路径\u002Fimprovement\u002F提取检索\u002F记忆类型（R47-R58,R81-R90,\r\n  R121-R125,R127）｜H4 kb 工具\u002Fskills\u002Freceipt\u002F清理（R59-R80,R91-R95,R96-R98,R102-R104,R117-R119）。\r\n  3) 每簇一条流：内联条目清单（行号+验证提示）+ 判定规则 + 输出路径 `memory_audit\\round\u003CN>\\h\u003Ck>_out.json`；\r\n  条目 JSON={id,requirement,verdict,evidence[],tests[],gap,fix}，收尾用 json.load 验证条目数==分配数（分配数按“独立判定项”口径在框架文件里写死：父项与子项是否分开计数逐条列出，防流按不同口径自检失败）；\r\n  流内硬约束：只读仓库、不跑全量套件（≤3 个焦点测试）、不建 Kanban、不动 %LOCALAPPDATA%\\hermes。需求\r\n  文档把 `_` 转义写作 `\\_`——在流提示里注明搜索时还原为 `_`。\r\n  4) 同步后台起全量套件（`… | tee \u003Clog>`）作全局证据——与流并行，勿串行干等。\r\n  5) 流返回后：每簇 ≥2 条锚点自行 grep 抽查；上轮声明的残余项显式重验（root comments、QA metadata、\r\n  `hermes kanban show \u003Cid>`），报告含“上轮声明 X \u002F 本轮判定 Y”对照。\r\n- 并行流“已完成≠已交付”：交付层可能把某条流标为 failed \u002F `Subagent did not produce a response`，而其\r\n  JSON 产物已在磁盘完整落盘并自检通过（最终消息丢失才触发该状态）。收到该类失败先查产物文件与 live\r\n  transcript 尾部：产物存在且可解析（json.load + 条目数==分配数）即视为完成、直接进入抽查\u002F合成，不重派；\r\n  仅产物缺失\u002F不完整\u002F不可解析才重派——重派会重跑整簇，白烧一轮完整审计。流 brief 的完成契约固定三件套：\r\n  写 JSON 产物 → python 读回断言 → 打印一行摘要（把“已完成”与“已交付”解耦，交付层故障不吞产物）。\r\n- Kanban 只读侦查：默认板 DB=`%LOCALAPPDATA%\\hermes\\kanban.db`（其他板在 `kanban\\boards\\\u003Cslug>\\kanban.db`）；\r\n  用 Python sqlite3 只读 URI（`file:…?mode=ro`）查询，`tasks.created_at`=epoch 秒，按 tenant\r\n  `hermes-lancedb-memory` 过滤；`hermes kanban show \u003Cid>` 打印 body\u002Fcomments\u002Fsummary\u002Fruns——卡 body\r\n  即当时的 worker 合同。\r\n- 交付物 = 逐条报告 + 修复清单：每项含需求行号、缺口、修复方向、逐 worker 的文件+测试白名单；修复轮\r\n  直接把清单当 worker 合同（Kanban 卡 body 引用它）。\r\n- 修复轮编排：按互斥文件白名单分 worker；共享热文件（`plugin\u002Flancedb\u002F__init__.py`、\r\n  `prompt_templates.py`）每波只给一个 worker，依赖它的条目降下一波；worker 必须清零“反向断言”\r\n  （断言旧\u002Fno-op 行为的测试改为需求行为）并携带覆盖测试交付。\r\n- 需求条款内部张力（如固定路径 vs 按模式切换）按最具体\u002F专门条款实现、对另一条款最大兼容；不得以\r\n  “需求冲突”为由停摆或推回用户。\r\n- 每轮重查、勿凭记忆：全量套件先跑作全局证据（本机 2 个 symlink 环境性 skip 属正常）；`kb_file`\r\n  通用 operations 与 `kb_feedback` 不受 profile 约束（仅权威根边界）——声称写入隔离前先实测。\r\n- 审计对象可以不在工作区：需求实现面可能在 hermes-agent 分支或其他树（例：ultrawork 完整实现只在分支、\r\n  main 仅残片）。用户一句话给出“审计 X”时，先按侦察路径定位实现面、再建条目框架（别先写框架再找代码）。\r\n  分支快照按只读物化：`git archive \u003Cref> | tar -x -C %TEMP%\\\u003Cfeat>_audit\\src`（不 checkout、不加\r\n  worktree、不动用户工作区）；编排者与流都在快照上审计并跑聚焦套件（host venv python + `HERMES_HOME`\r\n  指向 Temp 目录 + `-p no:cacheprovider`）；快照套件先逐文件 `--collect-only -q` 计数再整体运行——通过数\r\n  偏小先怀疑收集范围；陈旧快照的 fixture 参数超出实现签名（setup TypeError）照实记为快照缺陷证据。\r\n- landing 意识（分支 vs main）：报告须含 landing 表，逐构造标注 branch\u002Fmain——`git merge-base\r\n  --is-ancestor \u003Cimpl-commit> main`、`git diff --stat main \u003Cbranch> -- \u003C共享文件>`（量级=收敛工作量）、\r\n  `python -B -c \"import hermes_cli.\u003Cmod>\"`（`-B` 防在树里写 __pycache__；ModuleNotFoundError 就是\r\n  landing 缺口证据）。main 有调用点但 import 目标缺失 = 该 `\u002F命令` 调用即失败（已知缺口类）。\r\n- 功能面侦察路径（“X 在哪实现”逐层证伪，别在第一层收工）：main 调用点 grep → `git log --all\r\n  --format=\"%h %ad %s\" --date=short | grep -i \u003Cfeat>` 与 `--diff-filter=A\u002FD` \u002F `-S \"\u003Csymbol>\"`\r\n  定位引入与删除 → `git branch -a --contains \u003Ccommit>` → `git worktree list` 逐 worktree\r\n  `git ls-tree -r \u003Cref> | grep -i \u003Cfeat>` → `%LOCALAPPDATA%\\hermes\\backups\\*`（`*-hard-cut-*` 的\r\n  `removed\u002F` = 被砍旧实现，`pre-*-hard-cut-*` = 砍前数据库快照）→ `~\u002Fprojects\u002F*` 独立仓库（多为旧代际）。\r\n- ultrawork.md 轮框架：`%TEMP%\\uw_audit\\uw_items.md`（80 条 R01–R80：H1 规划\u002F计划格式 29｜H2 上下文\r\n  11｜H3 迭代 17｜H4 清理\u002F规模\u002F红旗 23；含 landing 表与共享规则）；被清理时按同簇逻辑从\r\n  `Documents\\ultrawork.md` 重 derive。\r\n","# LanceDB Memory Plugin Development\r\n\r\nUse when implementing, fixing, or verifying the user's file-authoritative memory provider\r\n(`hermes-lancedb-memory`). The repo is developed over many rounds driven by spec documents and\r\nshort user rulings; this skill is the stable workflow across those rounds.\r\nSee `references\u002Farchitecture-anchors.md` for the domain map (paths, DBs, pipeline contracts,\r\nenv vars) — re-verify anchors against live code before relying on them. For a live\r\n\"检查Hermes日志\u002F报错\" request follow `references\u002Flog-triage.md` (pass order, signature table,\r\nbenign-noise list, report shape).\r\n\r\n## 1. Decide which tree you are editing (do this FIRST)\r\n\r\n- Resolve the live names first: the provider may live in the successor repo\r\n  `\u003CUSER_HOME>\\projects\\minir-memory` as package `plugin\u002Fminir`, installed at\r\n  `$HERMES_HOME\\plugins\\minir`, instead of `hermes-lancedb-memory`\u002F`plugins\u002Flancedb`. List the\r\n  repo root and `$HERMES_HOME\\plugins`, then substitute the actual repo\u002Fpackage\u002Fdeployed names\r\n  in every command below; never patch the installed copy in place of the repo.\r\n- \"当前仓库\" \u002F implementation requests mean the **dev repo** `\u003CUSER_HOME>\\projects\\hermes-lancedb-memory` (git master). Implement there.\r\n- `%LOCALAPPDATA%\\hermes\\plugins\\lancedb` (or `plugins\u002Fminir` in the minir generation) is the **deployed copy** the running Hermes imports. It lags the repo and can mix code generations — do not patch it in place of the repo, and do not treat its files as the source of truth.\r\n- `%LOCALAPPDATA%\\hermes\\hermes-agent` carries the **host** contract (sync_turn, turn finalizer, session env) — largely locally-modified\u002Funtracked WIP. Plugin agents receive Host toolsets ONLY via the facade `bind(toolsets=...)` channel (private tool names go through `tools=`); a green repo suite does not prove this seam — fixtures fake the facade (repo fakes supply `_plugin_id=\"memory\u002Flancedb\"` while the real `PluginAgentFacade` holds only `_identity`, so plugin-agent kb_* calls refuse with `plugin Agent context belongs to another plugin`; probe the real classes with `scripts\u002Fhost_facade_probe.py` before touching plugin code). Keep host edits minimal and record them under `$HERMES_HOME\\patches\\hermes-agent\\` as a `\u003Cdate>-\u003Ctopic>.md` note (diff + evidence + tests + replay hint) plus a full-file `\u003Cname>.py.patched-\u003Cdate>` copy; run the affected host test files (`hermes-agent\u002Fvenv\u002FScripts\u002Fpython -m pytest \u003Cpaths> -q`) before\u002Fafter and include the raw counts in the note; see `references\u002Freal-host-integration.md`.\r\n- Deployment (only on an explicit request) = `python scripts\u002Finstall_dev_plugin.py --target-hermes-home \u003CHERMES_HOME> --replace` → verify deployed tree == repo tree (sha256 manifest, caches excluded; run this skill's `scripts\u002Ftree_parity_check.py \u003Csrc> \u003Cdst…>` for the walk — it also accepts profile copies as targets) → mirror to named profiles (`$HERMES_HOME\u002Fscripts\u002Fsync_default_profile_extensions.py`; the gateway-down cron never fires) → `hermes gateway restart` → one-shot smoke (`hermes chat -q \"Reply with exactly: PROBE_OK\" --oneshot`) then read `$HERMES_HOME\u002Flogs\u002F{agent,errors}.log`. A skills-side `post-mirror verification failed` on some profiles is usually the live `.usage.json`\u002F`.bundled_manifest` mtime race — content sha decides, do not chase it. Full chain, verification probes, and failure signatures: `references\u002Freal-host-integration.md`.\r\n- minir 代际部署（`plugin\u002Fminir`，无 install_dev_plugin.py 时）：同步 `plugin\u002Fminir` 源文件到\r\n  `$HERMES_HOME\\plugins\\minir`、删目标 `__pycache__`、逐文件 sha256 对齐；`hermes plugins validate`\r\n  与 `doctor` 通过后 `hermes gateway restart`，再确认新 PID 占用 API 端口（restart 会短暂提示旧端口\r\n  仍在监听，不要据此重跑）；`scripts\u002Fverify_against_host.py` 必须显式传 `--host-python` 与\r\n  `--workspace`，自动探测在宿主外会失败。\r\n- After a deploy, long-running host processes (TUI host, Desktop backends, gateways) keep executing the\r\n  PREVIOUS generation from memory — Python never reloads. Symptoms in `logs\u002Fagent.log`\u002F`errors.log`:\r\n  the `...lancedb__source_\u003Cdigest>.lifecycle_hooks: lancedb lifecycle store unavailable` flood +\r\n  `SchemaVerificationError: database schema is newer than this provider` (DB migrated by the new\r\n  generation while the old one runs), and `Hook 'post_tool_call' callback callback skipped after\r\n  previous timeout...` (old generation registers hooks via a nested `def callback`; the current one\r\n  registers bound methods) — a skip line naming a REAL callback (e.g. `post_tool_call`) is NOT this\r\n  class: it is a live stuck\u002Fslow callback; attribute it by registrant (`references\u002Flog-triage.md`).\r\n  `\u003Cdigest>` = sha256(resolved `$HERMES_HOME\u002Fplugins\u002Flancedb`)[:16] — proves\r\n  the load path. Attribute the emitter by walking your shell's parent chain to the hosting python.exe\r\n  and compare its start time against the deploy times. A restart of the stale host is the fix; verify\r\n  the deployed tree == repo tree (`diff -rq`, __pycache__ excluded) before blaming current code.\r\n\r\n## 2. Read the spec stack before implementing\r\n\r\n- `Documents\\记忆最新需求2.md` — current requirements (semantics authority).\r\n- `Documents\\记忆最新需求2-执行计划.md` — WP execution plan + progress table; **its progress column lags reality** (written before rounds land, not kept current) — treat it as leads\u002Fhistory and verify status against the workspace and commits.\r\n- Repo `.omx\u002Fplans\u002Flancedb-memory-session-context-engine-plan.md` — meta-plan; its audit tables mix two code generations — re-verify every claim against live code before trusting a row.\r\n- Short, terse user messages (\"X 所有权：Y\") are rulings: implement exactly on the dev repo, add regression tests around the changed contract, and note any doc\u002Fruling conflict in the final report instead of silently picking a side.\r\n\r\n## 3. Test harness\r\n\r\n- `cd \u003Crepo> && python -m pytest tests -q -p no:cacheprovider` — use whichever interpreter actually has pytest: the system Python (3.14) on the old repo, the host Hermes venv python on minir-memory (verified there as `python -m pytest tests -q`). Confirm with `python -c \"import pytest\"` instead of assuming from `.venv`. Add `--continue-on-collection-errors` when a collection error may exist.\r\n- Full suite size and runtime grow each round; read the collected count from the run instead of trusting a fixed number. 2 symlink skips are environmental and normal. Focused files first, full suite last — never claim acceptance without the full run.\r\n- CI-free repo: the suite IS the acceptance gate.\r\n\r\n## 4. Contract-change sweep (the failure this repo punishes)\r\n\r\nWhen renaming a contract, moving ownership, or changing an API\u002FDB\u002Ffile shape:\r\n\r\n1. BEFORE edits: `rg -n --no-ignore \"\u003Cold term>\" \u003Crepo>` WITHOUT `-g '*.py'`. Contract text lives in Python, prompt-template strings, `skills\u002F*\u002FSKILL.md`, tests, and README.\r\n2. **`skills\u002F*\u002FSKILL.md` are runtime-registered instructions** (registered via `ctx.register_skill`, injected into background provider agents) — stale wording there is a live defect, not a doc nit. Prompt-template strings are the same class of artifact.\r\n3. Change every layer: module code → prompt templates → skills\u002F*\u002FSKILL.md → README → tests.\r\n4. AFTER edits: grep the TEST TREE for every changed symbol (`commit_generation`, `prepare_files`, `refresh(`, `dynamic_target_paths`, …) — hand-rolled fixtures\u002Fmocks reimplement the old shape and fail only on shards you did not run. Exact-shape assertions (`assert result == {...}`, `assert_called_once_with(...)`, \"\u003Cterm> not in hint\" checks) also encode the old contract — grow them in the same change whenever a payload key, signature, or hint string is added.\r\n5. Finish with focused tests, then the full suite, plus residual-wording greps; expect an independent verifier to check wording too.\r\n\r\n## 4c. PluginAgent 接缝（context-run gate）修复配方（2026-09-13 实证）\r\n\r\n- `resolve_context_run` 的拒绝对可叠加出现，必须用**真实宿主对象**逐项验证，不能只看第一条错误：\r\n  `plugin_id`（宿主门面须暴露 `_plugin_id = identity.plugin_id`）→ `purpose`（envelope purpose 必须等于注册 purpose；\r\n  插件 adapter 的 `handle.run` 必须透传 `purpose=`，宿主 `PluginAgentHandle.run\u002Farun` 有该形参并回退 bind purpose）→\r\n  `host_session_id`（注册 workflow bundle 必须携带 `session_id`，且运行 envelope 传入同一值）→\r\n  `attempt_id`（同上）。修复一层会暴露下一层，按此顺序一次排查完。\r\n- 参照实现＝flows（`agent_context_runtime` 的 flow runner）：`runtime_bundle[\"session_id\"]=host_session_id`、\r\n  `runtime_bundle[\"attempt_id\"]=attempt_id` 后才 `register_context_run`；`agent_pipeline`\u002F`profile_review` 等\r\n  落后应向其对齐（bundle 补键，而非改 guard）。\r\n- 宿主机验证：宿主 venv 直接构造 `PluginRuntimeServices(PluginIdentity(...)).agent` 检查门面属性；\r\n  repo 侧 fakes 自带 `_plugin_id` 会掩盖真实门面缺口（\"绿套件不证明宿主接缝\"的又一实例）。\r\n- end-to-end 复证：one-shot 宿主机保活跑 job——`hermes chat -q 'Use the terminal tool to run exactly: python -c \"import time; time.sleep(150)\"...' --oneshot`\r\n  可在进程存活期捕捉 job 会话的 kb 工具成败；新代码信号＝`provider.tool_metric tool=kb_* success=True`\r\n  （旧代码=invalid_arguments 拒绝），写完盘信号＝`lancedb-memory\u002F\u003Ctype>\u002Fsummary.md` 等文件 mtime 更新。\r\n- workflow 文件边界 guard（`_enforce_workflow_file_boundary`）必须同时解析 **现代 `operation=` 形态与 legacy\r\n  `mode=` 形态**；否则 summary\u002Fextraction agent 的现代调用被误判 permission_denied（\"write path is invalid\"）。\r\n- 每条修复配 regression：adapter purpose 透传（fake handle 断言）、pipeline bundle 键、guard 双形态；\r\n  精确形状断言（`assert workflow_runtime == {...}`、handle 签名集合）要在同一变更里扩展，否则全量套件报红。\r\n- kb 工具集 runner 对齐清单（seam 修复\u002F审计轮后必扫）：`grep -n KB_AGENT_TOOLSETS plugin\u002Flancedb\u002F*.py`\r\n  列出的每个 `agent.run(` 点必须同时有 `register_context_run(...) as run_id` + `tool_context={\"context_run_id\": run_id}`\r\n  + workflow bundle 与 run 的 `host_session_id`\u002F`attempt_id` 一致；漏掉的 runner（实证：`quality_agent.py`、\r\n  `reasoning.py` 的 kb_reasoning）让该 agent 的**全部** kb_* 调用以\r\n  `invalid_arguments: \"plugin Agent context payload is invalid\"` 被拒（tool_context=None 落在 `resolve_context_run`\r\n  第 2 层 payload 校验）——症状像宿主 bug，其实是 runner 漏注册。job 型 runner 的 run_id 取\r\n  `attempt[\"context_run_id\"]`（call site job dict 补键，与 `bind_job_operation_store` 的 run_id 对齐）；\r\n  kb_reasoning 经 `KnowledgeReasoner(..., session_id, profile_name)` 携带会话\u002F档案。注册后语义：context 读\r\n  （kb_summary_search\u002Fkb_context）按 `bound_profile_name` 做 self-scope；文件工具在未授权 purpose 下报\r\n  `this Context Agent phase has no file-memory authority`（按设计，非 bug）。死代码 `ProfileReviewPipeline`\r\n  （profile_review.py，无实例化点）可忽略。\r\n\r\n## 4d. 宿主 durable boundary outbox 契约（deferred 边界投递）\r\n\r\n- 宿主 run_agent 把 session 边界（shutdown\u002Fcompression\u002Fnew_session）写入 state.db `memory_boundary_outbox`，先内联投递，\r\n  失败由后台 worker 以 ≤60s 退避重投（`agent\u002Fmemory_boundary_outbox.py`）；投递携带**事件自身的** `parent_session_id`，\r\n  跨进程\u002F跨会话重放是设计内行为（延迟投递必然发生在旧会话不再是 live binding 之后）。\r\n- 插件侧 on_session_end\u002Fon_session_switch 不得用 live binding 校验（`_bound_session`）拒绝事件会话，否则事件永久搁浅：\r\n  实证 14 条事件 attempts 868–1893、每 ~60s 一次 ValueError 堆栈（`_bound_session` raise \"does not match the active Provider session\"）。\r\n  正确语义＝事件会话为权威：expire 该会话 working set、stop 该会话计数、按该会话 counters 行的 scope\u002Fmode 触发辩证推理\r\n  （`_boundary_session` \u002F `_boundary_turn_number` \u002F `_enqueue_dialectic_reasoning(counters=...)`）。\r\n- deferred on_session_switch 只做旧 scope 过期＋事件 id 记录，**不得重绑** live session；内联路径（parent==bound）保持原重绑行为。\r\n- 自检：`rg -n \"_bound_session\" plugin\u002Flancedb\u002F__init__.py` 只应命中 live 表面（working_scope\u002Fset_session_mode\u002Fon_turn_start\u002Fcompress_context）。\r\n- 回归：`tests\u002Ftest_boundary_deferred_delivery.py`（deferred end\u002Fswitch、unknown session no-op、inline 重绑回归）。\r\n- 宿主接缝探针：`scripts\u002Fboundary_outbox_probe.py`（用宿主真实 `_build_session_end_kwargs`\u002F`deliver_memory_boundary_event`\r\n  驱动修复后的插件——延迟 end 必须停计数+产 1 条触发、延迟 switch 不得重绑、重放必须被接受；FAILURES 为空才算过）。\r\n- 探针\u002F测试的 Windows 陷阱：provider 会一直持有 `memory.db` 句柄，`tempfile.TemporaryDirectory` 清理必报\r\n  WinError 32 —— 用 `mkdtemp` + `shutil.rmtree(ignore_errors=True)`，并在 finally 里 best-effort `provider.shutdown()`。\r\n- 部署前修复不生效：部署副本仍为旧代际，搁浅事件继续 ≤60s 重投刷 DEBUG 堆栈；部署后积压被消费一次\r\n  （无 counters 行的旧会话 `stop_session` 返回 None → 干净 no-op，不会凭空造数）。\r\n\r\n## 5. Repo editing pitfalls\r\n\r\n- `plugin\u002Flancedb\u002F__init__.py` is ~130 KB \u002F ~3000 lines: patch surgical regions only; re-read the file (or the region) before patching after any other actor may have touched it.\r\n- Files are CRLF; the patch tool normalizes endings. After an edit confirm with `git diff --stat` that the change is the intended line delta, not a whole-file rewrite.\r\n- Never edit `build\u002F` (stale package copies) and exclude it from greps.\r\n- Do not commit unless asked; large uncommitted working trees are normal here. Keep each actor on a mutually exclusive file set when several run in parallel.\r\n\r\n## 6c. Repair rounds (checklist-driven waves, proven)\r\n\r\n- Build waves by mutually exclusive FILE whitelists; every card carries the same global rules\r\n  (requirements doc = acceptance baseline, only-whitelist, no commit\u002Fstash, focused tests only).\r\n- Chain: workers -> verifier (qa1 must emit metadata.gate) -> synthesizer (cto). With the gateway\r\n  down, run a bounded background dispatch loop (`hermes kanban dispatch` every 120s; exit on\r\n  terminal synthesizer) — nothing auto-promotes without it.\r\n- Fleet reroute when every worker blocks instantly: read $HERMES_HOME\u002Fkanban\u002Flogs\u002F\u003Ctask>.log — an\r\n  HTTP 403\u002Fquota error is a provider fault. Probe the replacement lane with the exact worker argv\r\n  (`hermes -p dev1 --cli -m \u003Cmodel> --provider \u003Cprovider> chat -q \"Reply with exactly: PROBE_OK\"`),\r\n  then `hermes kanban set-model \u003Cid> \u003Cmodel> --provider \u003Cprovider>` on EVERY card of the graph,\r\n  `hermes kanban unblock \u003Cid> \u003Creason>` on blocked ones, and one dispatch pass.\r\n- gate=fail handling: contain the running synthesizer immediately (`hermes kanban block \u003Cid>\r\n  \u003Creason>`; `block` takes a positional reason), then create the bounded chain\r\n  rework -> replacement QA -> fresh synthesizer and record recovery on the root blackboard. The\r\n  rework card may span multiple whitelists (it is the only active writer then).\r\n- Cross-worker handoff pitfall: a worker that finishes earlier never sees a later sibling's root\r\n  comment (this round: the template-consumption note arrived 90s after W2 completed -> follow-up\r\n  dev+QA chain). After every wave, audit ALL root comments for unhandled cross-whitelist notes.\r\n- Orchestrator closes with its own full-suite rerun plus a git-status\u002FHEAD check before reporting,\r\n  and reports the raw counts from its own run (expected magnitude ~490 passed, 0 failed, 2 env symlink skips).\r\n\r\n## 7. Acceptance pattern (user's established standard)\r\n\r\n- Deliverable = dev-repo change + full suite 0 failed + targeted probes per changed contract; report evidence (commands + raw results), not claims.\r\n- Work is tracked as Kanban cards with `--workspace dir:\u003Crepo>` and a no-commit rule; verifier profiles qa1\u002Fqa2, synthesizer cto. See the `kanban-orchestrator` skill for swarm mechanics (provider reroute on worker crashes, manual dispatch when the gateway is down, replacement-QA rework).\r\n- Swarm wiring for this repo: workspace `dir:\u003Crepo>` + no-commit on every card. `hermes kanban swarm` auto-attaches `requesting-code-review` (verifier) and `humanizer` (synthesizer) — verify they load for qa1\u002Fcto's real skills tree first (`.archive\u002F` copies don't count), otherwise build the graph via the board Python API: root(`initial_status=\"blocked\"`) → workers(`parents=[root]`, `goal_mode=True`, full brief in body) → verifier(`parents=\u003Call workers>`) → synthesizer(`parents=[verifier]`); activate with `complete_task(root)`; post `[swarm:blackboard]` topology\u002Fcontract notes; read every card back before dispatching.\r\n- Gateway-down chains need a bounded dispatch loop: nothing auto-promotes the verifier\u002Fsynthesizer after workers finish. Run `hermes kanban dispatch` every ~120s in a background loop with a per-card status script; exit when the terminal card is done\u002Fblocked and nothing is running; restart the loop after any reroute. From bash, give Windows `python.exe` `C:\u002F...`-style paths (MSYS `\u002Fc\u002F...` gets mangled to `C:\\c\\...`); after starting the loop confirm its first status line landed in the log — a broken logger leaves the dispatcher cycling alone and the exit condition never fires.\r\n- Worker-provider reroute: probe by replicating the worker argv (`hermes -p \u003Cprofile> --cli -m \u003Cmodel> --provider \u003Cprovider> chat -q \"Reply with exactly: PROBE_OK\"`) — that proves profile-scoped resolution end-to-end. Goal-mode workers mask quota faults as `Goal-mode worker exhausted its turn budget ... judge error: PermissionDeniedError`; read `$HERMES_HOME\u002Fkanban\u002Flogs\u002F\u003Ctask>.log` for the real 403, then `set-model` every card (workers+verifier+synthesizer) + `unblock` + one dispatch pass.\r\n- Verifier briefs must explicitly require the verifier's `kanban_complete` to carry a JSON `metadata.gate` (`pass`\u002F`fail`) plus `evidence`\u002F`failed_criteria` — verifiers default to prose-only summaries otherwise.\r\n- A narrow gate=fail limited to wording\u002Fdocs: fix inline, then create one replacement QA card scoped to the rework + full regression; reserve full rework chains for code\u002Fsemantic failures.\r\n- gate=fail 先冻结在跑的 synthesizer：`hermes kanban block \u003Cid> \u003Creason words…>`（reason 是位置参数；`--reason` 会报错；unblock 才用 `--reason`）——native 依赖调度只读任务 status、不读 gate metadata，不冻结就会对失败轮次照常产出“成功”合成。随后按失败项归属建链：返工卡（含失败判据原文+复现步骤）→ 替换 QA 子卡（先复现原缺陷再验修复 + 全量回归）→ 新 synthesizer 子卡；旧卡留档，root 黑板记 recovery（fail 卡\u002F判据\u002F新链 ID）。\r\n- Worker briefs must require completion metadata `{changed_files, tests_run, items_fixed, residuals}`——QA 与合成读它，白话摘要不够。\r\n- 并行轮收尾纪律：采信任何 gate 之前先逐条盘点 root 黑板全部注释，确认每条跨边界交接（worker 请求到他人白名单文件里的后续修复）已被消费——完工早于注释的 worker 看不到它（时序差可低至数十秒），verifier 探针可能不覆盖该缺口；未消费即建有界补齐链（目标文件 owner → 独立 QA + 全量回归），不重开整轮。\r\n- 编排者终验（交付前）：亲自复跑全量套件 + 对每个修复点做默认\u002F显式两态直探，数字与 QA\u002F合成报告三方对齐后才交付。\r\n- Report open items plainly at the end (uncommitted, undeployed, pending host wiring, unrun audits) — the user decides the next round.\r\n\r\n## 9. Deep Interview \u002F Ultrawork host contract (integrate branch)\r\n\r\n- Host surface (`\u002Fdeep-interview`): objective | status | show | resume \u003Cdeep-interview-id> | cancel | subgoal. `pause\u002Fstop\u002Fdone\u002Fclear` are deleted by ruling; `resume` rebinds the interview's session to the current one. start\u002Fresume set `HERMES_SESSION_MODE=deep-interview` + `HERMES_DEEP_INTERVIEW_ID`; cancel returns mode to `session`. The session-env machinery is IN the integration line (ported from the memory-program WIP + two additions): `gateway.session_context.set_current_session_mode` \u002F `set_current_deep_interview_id` (ContextVar + env mirror, delegated-child suppression) and `scoped_session_env_vars`; `run_agent._resolved_workflow_task_env` (includes `HERMES_SESSION_MODE` beyond the WIP's four names) is rebound task-locally per turn by `agent\u002Fturn_facade` — the setting is effective in-process, not a no-op.\r\n- Projection design B (host tables, provider direct read): the host writes `deep_interview_for_memory` rows **inside its kanban write transactions** (`hermes_cli\u002Fworkflow_memory_tables.py::upsert_deep_interview_for_memory_on`; `projected_goal_state_version` is stamped with the write, `_sync_memory_tables` in `deep_interview_store`). The lancedb plugin's `workflow_projection.load_workflow_projection` reads the tables directly, keyed by `HERMES_DEEP_INTERVIEW_ID`. The provider `publish_deep_interview_projection` channel is optional\u002Fbest-effort and must never fail-close a turn.\r\n- Tools lane: `interview_state`, `interview_search`, `deep_interview_execute`, `deep_interview_import_plan` (registered on the core list + a `workflow` toolset); `planning_tool_guard` is enforced both at the dispatcher boundary (`model_tools.handle_function_call`) and in `agent\u002Ftool_executor._dispatch_authorized_once`.\r\n- `hermes deep-interview` subcommand: start (goal) | status (no goal) | `--resume \u003Cdeep-interview-id>` --session ...; `cmd_deep_interview` in `hermes_cli\u002Fmain.py`.\r\n- State: this line is landed on live `main`; the live working tree carries the feature plus the memory-program WIP as unstaged changes (converged via a pre-activation worktree; WIP snapshot \u002F resolved activation patch \u002F backup branch under `$HERMES_HOME\\backups\\pre-di-activation-*`). The running CLI and Desktop still need a restart to load it.\r\n- Ultrawork 实现面（与 DI 相反：完整体未落 main）：完整实现 = hermes-agent 分支\r\n  `codex\u002Fdeep-interview-hard-cut-recovery` tip `d40424f256`（用 `git log --all -- \u003C路径>` 复核）——\r\n  `hermes_cli\u002Fultrawork_{commands,planner,source,context,execute,kanban,policy,pr}.py`、\r\n  `hermes_cli\u002Fsubcommands\u002Fultrawork.py`（main.py `cmd_ultrawork` 接线）、\r\n  `tools\u002Fultrawork_{search,execute,archive}_tool.py`、`plugins\u002Fultrawork-observation-gate\u002F`\r\n  （2-Action Rule 门禁：计数 qualifying 工具调用、第三个前阻塞）、17 个 `tests\u002F**\u002Ftest_ultrawork*`、\r\n  契约 skill `software-development\u002Fultrawork` + website 文档（skill\u002F文档在 main 上也有）；\r\n  main 仅调用点\u002FCommandDef\u002Fenv\u002F表定义，模块缺失（`\u002Fultrawork` import 即失败）。\r\n- Ultrawork 数据面：planner 写 `HERMES_HOME\u002Flancedb-memory\u002Fresource\u002Fplan\u002F`（`\u003Ctitle>-\u003Cplan_id前8>.md`）\r\n  + kanban.db `ultrawork_plans`；policy 表 `ultrawork_iteration_loops\u002Fultrawork_iterations\u002F\r\n  ultrawork_file_baselines`（mode ∈ fixed|max|adaptive）；lancedb 插件是读侧消费者：\r\n  `workflow_projection.py` 读 `ultrawork_for_memory`\u002F`ultrawork_kanban_runs`\u002F`ultrawork_kanban_routes`\r\n  渲染 `\u003Cultrawork>` 块，`paths.py::ultrawork_phase_document_path` 算相位文档路径。\r\n- 勿混淆旧代际：`~\u002Fprojects\u002Fultrawork-swarm-kanban{,-plugin}`（Ralph\u002FOps 控制器）与被 hard-cut 的\r\n  `backups\\*\\removed\\*\\ultrawork-swarm-kanban` 都是旧线，不是现行实现。\r\n\r\n## 8. Requirements audits (需求 vs 代码 — the repo's recurring round type)\r\n\r\n- 需求文档是唯一验收基线：“需求是基线，不要质疑我的需求”——不提问、不推回裁定、不以“注释声称设计\r\n  演进”把需求排除在判定之外。代码与文档分歧 = 缺陷（partial\u002Fviolates）+ 修复方向；判定对象是工作区\r\n  (`plugin\u002Flancedb\u002F`、`tests\u002F`，含未提交改动)，不是 git HEAD 或计划进度表。\r\n- 零命中即缺陷：需求要求的构造物在代码中搜不到 = 该条 violates（进修复清单）——不得以“现行代际已换\r\n  模板\u002F被新设计取代”为由放行；`references\u002Farchitecture-anchors.md` 的旧代际指纹只用于排除死代码名，\r\n  不构成需求豁免。行为若确以他名存在于最终执行路径（hook\u002Fprovider\u002F工具任一层），按该层判\r\n  conforms\u002Fpartial 并记录 naming 锚点。\r\n- 判“最终行为”而非“钩子名”：generic `on_session_end`\u002F`on_session_finalize` 钩子为 no-op 属既定\r\n  分工（host 每 `run_conversation` 触发；真实边界=`MemoryProvider.on_session_end`），`prefetch()`\r\n  返回 \"\"（注入仅 `pre_llm_call`）、compression 不写 `session_summary.md` 均为正确设计；\r\n  `system_prompt_block`\u002F`on_pre_compress` 是 provider 方法而非 7 个注册钩子之一。但需求要求的\r\n  最终行为（停计数\u002F触发辩证推理\u002F范围窗口\u002F落库）在哪层发生就在哪层判：provider 方法里发生=符合；\r\n  哪层都不发生=缺陷——不得用 no-op 注释为其开脱，修复可落在 hook 或 provider 任一处。\r\n- Compare NAMES, not just presence: kb_file's live enum is `delete_path` (+ `insert\u002Fupdate\u002F\r\n  update_lines\u002Fdelete_lines`, legacy `mode=create|update|delete`) while the requirements say\r\n  `delete` with line ops nested under `patch_file` — report naming\u002Fmanner drift as partial with\r\n  anchors on both sides.\r\n- 粒度=原子条目：每条 hook \u002F 每个工具模式 \u002F 每个注入元素各一条（~100+ 条）逐条判定——簇级汇总会被\r\n  判“太粗糙”。Verdict per item: conforms | partial | violates（或等价 implemented|partial|\r\n  missing|contradicted）+ `file:line` 证据原文 + covering test + 缺口（需求要求X\u002F代码实际Y）+ 修复\r\n  方向；`missing`\u002F`violates` 必须附实际执行的零命中 grep。Partition the doc by requirement cluster\r\n  for parallel streams; delegated audit streams are self-reports — spot-check their anchors with\r\n  your own greps before synthesis.\r\n- Long grep output is truncated by the terminal to\r\n  `...\\hermes\\cache\\terminal-output\\out-*.log` — read that file with read_file instead of\r\n  re-running the command, and batch related greps into one call so a single log read covers\r\n  several checks.\r\n- 审计轮执行配方（编排者会话 + 4 条并行 delegate_task 流；审计本体不进 Kanban——Kanban 是修复轮的载体）：\r\n  1) 框架复用：`%LOCALAPPDATA%\\Temp\\memory_audit\\audit_items_v2.md`（127 条 R 编号 + 需求行号 + H1–H4\r\n  分簇）——复用前核对需求文档未变（mtime）且框架覆盖全文行段（未覆盖行=追加 X 条目）；产物目录被清理则\r\n  按同簇逻辑从文档重derive。\r\n  2) 分簇：H1 钩子\u002F计数触发\u002F压缩\u002F注入结构（R01-R25,R105-R113,R126）｜H2 agent 装配\u002F模式\u002F观察\u002F投影\r\n  （R26-R46,R99-R101,R114-R116,R120）｜H3 路径\u002Fimprovement\u002F提取检索\u002F记忆类型（R47-R58,R81-R90,\r\n  R121-R125,R127）｜H4 kb 工具\u002Fskills\u002Freceipt\u002F清理（R59-R80,R91-R95,R96-R98,R102-R104,R117-R119）。\r\n  3) 每簇一条流：内联条目清单（行号+验证提示）+ 判定规则 + 输出路径 `memory_audit\\round\u003CN>\\h\u003Ck>_out.json`；\r\n  条目 JSON={id,requirement,verdict,evidence[],tests[],gap,fix}，收尾用 json.load 验证条目数==分配数（分配数按“独立判定项”口径在框架文件里写死：父项与子项是否分开计数逐条列出，防流按不同口径自检失败）；\r\n  流内硬约束：只读仓库、不跑全量套件（≤3 个焦点测试）、不建 Kanban、不动 %LOCALAPPDATA%\\hermes。需求\r\n  文档把 `_` 转义写作 `\\_`——在流提示里注明搜索时还原为 `_`。\r\n  4) 同步后台起全量套件（`… | tee \u003Clog>`）作全局证据——与流并行，勿串行干等。\r\n  5) 流返回后：每簇 ≥2 条锚点自行 grep 抽查；上轮声明的残余项显式重验（root comments、QA metadata、\r\n  `hermes kanban show \u003Cid>`），报告含“上轮声明 X \u002F 本轮判定 Y”对照。\r\n- 并行流“已完成≠已交付”：交付层可能把某条流标为 failed \u002F `Subagent did not produce a response`，而其\r\n  JSON 产物已在磁盘完整落盘并自检通过（最终消息丢失才触发该状态）。收到该类失败先查产物文件与 live\r\n  transcript 尾部：产物存在且可解析（json.load + 条目数==分配数）即视为完成、直接进入抽查\u002F合成，不重派；\r\n  仅产物缺失\u002F不完整\u002F不可解析才重派——重派会重跑整簇，白烧一轮完整审计。流 brief 的完成契约固定三件套：\r\n  写 JSON 产物 → python 读回断言 → 打印一行摘要（把“已完成”与“已交付”解耦，交付层故障不吞产物）。\r\n- Kanban 只读侦查：默认板 DB=`%LOCALAPPDATA%\\hermes\\kanban.db`（其他板在 `kanban\\boards\\\u003Cslug>\\kanban.db`）；\r\n  用 Python sqlite3 只读 URI（`file:…?mode=ro`）查询，`tasks.created_at`=epoch 秒，按 tenant\r\n  `hermes-lancedb-memory` 过滤；`hermes kanban show \u003Cid>` 打印 body\u002Fcomments\u002Fsummary\u002Fruns——卡 body\r\n  即当时的 worker 合同。\r\n- 交付物 = 逐条报告 + 修复清单：每项含需求行号、缺口、修复方向、逐 worker 的文件+测试白名单；修复轮\r\n  直接把清单当 worker 合同（Kanban 卡 body 引用它）。\r\n- 修复轮编排：按互斥文件白名单分 worker；共享热文件（`plugin\u002Flancedb\u002F__init__.py`、\r\n  `prompt_templates.py`）每波只给一个 worker，依赖它的条目降下一波；worker 必须清零“反向断言”\r\n  （断言旧\u002Fno-op 行为的测试改为需求行为）并携带覆盖测试交付。\r\n- 需求条款内部张力（如固定路径 vs 按模式切换）按最具体\u002F专门条款实现、对另一条款最大兼容；不得以\r\n  “需求冲突”为由停摆或推回用户。\r\n- 每轮重查、勿凭记忆：全量套件先跑作全局证据（本机 2 个 symlink 环境性 skip 属正常）；`kb_file`\r\n  通用 operations 与 `kb_feedback` 不受 profile 约束（仅权威根边界）——声称写入隔离前先实测。\r\n- 审计对象可以不在工作区：需求实现面可能在 hermes-agent 分支或其他树（例：ultrawork 完整实现只在分支、\r\n  main 仅残片）。用户一句话给出“审计 X”时，先按侦察路径定位实现面、再建条目框架（别先写框架再找代码）。\r\n  分支快照按只读物化：`git archive \u003Cref> | tar -x -C %TEMP%\\\u003Cfeat>_audit\\src`（不 checkout、不加\r\n  worktree、不动用户工作区）；编排者与流都在快照上审计并跑聚焦套件（host venv python + `HERMES_HOME`\r\n  指向 Temp 目录 + `-p no:cacheprovider`）；快照套件先逐文件 `--collect-only -q` 计数再整体运行——通过数\r\n  偏小先怀疑收集范围；陈旧快照的 fixture 参数超出实现签名（setup TypeError）照实记为快照缺陷证据。\r\n- landing 意识（分支 vs main）：报告须含 landing 表，逐构造标注 branch\u002Fmain——`git merge-base\r\n  --is-ancestor \u003Cimpl-commit> main`、`git diff --stat main \u003Cbranch> -- \u003C共享文件>`（量级=收敛工作量）、\r\n  `python -B -c \"import hermes_cli.\u003Cmod>\"`（`-B` 防在树里写 __pycache__；ModuleNotFoundError 就是\r\n  landing 缺口证据）。main 有调用点但 import 目标缺失 = 该 `\u002F命令` 调用即失败（已知缺口类）。\r\n- 功能面侦察路径（“X 在哪实现”逐层证伪，别在第一层收工）：main 调用点 grep → `git log --all\r\n  --format=\"%h %ad %s\" --date=short | grep -i \u003Cfeat>` 与 `--diff-filter=A\u002FD` \u002F `-S \"\u003Csymbol>\"`\r\n  定位引入与删除 → `git branch -a --contains \u003Ccommit>` → `git worktree list` 逐 worktree\r\n  `git ls-tree -r \u003Cref> | grep -i \u003Cfeat>` → `%LOCALAPPDATA%\\hermes\\backups\\*`（`*-hard-cut-*` 的\r\n  `removed\u002F` = 被砍旧实现，`pre-*-hard-cut-*` = 砍前数据库快照）→ `~\u002Fprojects\u002F*` 独立仓库（多为旧代际）。\r\n- ultrawork.md 轮框架：`%TEMP%\\uw_audit\\uw_items.md`（80 条 R01–R80：H1 规划\u002F计划格式 29｜H2 上下文\r\n  11｜H3 迭代 17｜H4 清理\u002F规模\u002F红旗 23；含 landing 表与共享规则）；被清理时按同簇逻辑从\r\n  `Documents\\ultrawork.md` 重 derive。\r\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"platforms":35,"description":7},"Hermes Agent","1.0.0",{"hermes":27},{"tags":28},[29,30,31,32,33,34],"hermes","lancedb","memory-provider","plugin","kanban","acceptance",[36],"windows","main","a3f3199bb87ec3c91248f68a39d88527e1847ae9","skills\u002Fsoftware-development\u002Flancedb-memory-plugin-development","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content","https:\u002F\u002Fgithub.com\u002Fchaorenex1","https:\u002F\u002Fblog.aduib.com","A programmer whose only hobby in life is coding","2026-10-20 00:34:32",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add chaorenex1\u002Fhermes-home-content --skill lancedb-memory-plugin-development",{"tool":51,"command":52},"bunx","bunx skills add chaorenex1\u002Fhermes-home-content --skill lancedb-memory-plugin-development",{"tool":54,"command":55},"pnpm","pnpm dlx skills add chaorenex1\u002Fhermes-home-content --skill lancedb-memory-plugin-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002FSKILL.md",true,[59,65,69,73,79,83],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Farchitecture-anchors.md","REFERENCE","参考文档",7119,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Freferences\u002Farchitecture-anchors.md",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Flog-triage.md",5190,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Freferences\u002Flog-triage.md",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Freal-host-integration.md",17889,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Freferences\u002Freal-host-integration.md",{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"scripts\u002Fboundary_outbox_probe.py","SCRIPT","脚本",6930,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Fscripts\u002Fboundary_outbox_probe.py",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fhost_facade_probe.py",2185,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Fscripts\u002Fhost_facade_probe.py",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"scripts\u002Ftree_parity_check.py",3142,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Flancedb-memory-plugin-development\u002Fscripts\u002Ftree_parity_check.py",[88,95,102,109,116,123],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7F8GF32YD5MBQW2TGSRH1YP","web-retrieval-resilience","Web tools fail or search rules break: repair or fall back.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-retrieval-resilience\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7F8FP46QESQMCZ1KBT3TW3R","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7F8ER6VXHBNVRQBZS7X08SE","verification-loop","Run a six-phase verification of a Claude Code session's work — build, type check, lint, tests with coverage, security grep, and diff review — then produce a PASS\u002FFAIL verification report. Use when verifying work after completing a feature or refactor, before creating a PR, or when quality gates must pass.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7F8E4BQJ38KVQVM3MT20PYV","unreal-world-builder","开放世界与环境专家——精通 UE5 World Partition、Landscape、程序化植被、HLOD 和大规模关卡流式加载，打造无缝开放世界体验","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-world-builder\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":19},"01M7F8D747SQW2FTP7GBSX38BR","unreal-technical-artist","Unreal Engine 视觉管线专家——精通材质编辑器、Niagara 特效、程序化内容生成和 UE5 项目的美术到引擎管线","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-technical-artist\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":19},"01M7F8CKHYJVZVBTN0321J88T2","unreal-systems-engineer","性能与混合架构专家——精通 C++\u002FBlueprint 边界、Nanite 几何体、Lumen GI 和 Gameplay Ability System，面向 AAA 级 Unreal Engine 项目","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-systems-engineer\u002FSKILL.md",[],[]]